kml_fft(f/h)_plan_upsampling_2d
Create a plan for the two-dimensional upsampling transform of a single contiguous data sequence.
Interface Definition
C interface:
kml_fft_plan kml_fft_plan_upsampling_2d(int n0, int n1, int n0_result, int n1_result, double s0, double s1, double *in_, double *out_, unsigned flags);
kml_fftf_plan kml_fftf_plan_upsampling_2d(int n0, int n1, int n0_result, int n1_result, float s0, float s1, float *in_, float *out_, unsigned flags);
kml_ffth_plan kml_ffth_plan_upsampling_2d(int n0, int n1, int n0_result, int n1_result, __fp16 s0, __fp16 s1, __fp16 *in_, __fp16 *out_, unsigned flags);
Parameters
Parameter |
Data Type |
Description |
Input/Output |
|---|---|---|---|
n0 |
int |
Number of rows in the input image. |
Input |
n1 |
int |
Number of columns in the input image. |
Input |
n0_result |
int |
Number of rows in the output image. |
Input |
n1_result |
int |
Number of columns in the output image. |
Input |
s0 |
|
X component of the shift operation. |
Input |
s1 |
|
Y component of the shift operation. |
Input |
in |
|
Memory pointer to the input image. |
Input |
out |
|
Memory pointer to the output image. |
Output |
flags |
unsigned |
A planning option, not in use. |
Input |
Dependencies
C: "kfft.h"
Examples
C interface:
int n0 = 3;
int n1 = 3;
int n0_result=7;
int n1_result=7;
double init[9] = {0, 1, 0, 1, 0, 1, 0, 1, 0};
double *in;
in = (double*)kml_fft_malloc(sizeof(double) * n0 * n1);
for (int i = 0; i < n0 * n1; i++) {
in[i] = init[i];
}
double *out;
out = (double*)kml_fft_malloc(sizeof(double) * n0_result * n1_result);
kml_fft_plan plan;
plan = kml_fft_plan_upsampling_2d(n0, n1, n0_result, n1_result, 0, 0, in, out, KML_FFT_ESTIMATE);
kml_fft_execute(plan);
kml_fft_destroy_plan(plan);
kml_fft_free(in);
kml_fft_free(out);
/*
* out = {0.000000, 0.105960, 0.178233, 0.162397, 0.070375, -0.028537, -0.059857,
* 0.105960, 0.089665, 0.078550, 0.080985, 0.095137, 0.110349, 0.115165,
* 0.178233, 0.078550, 0.010558, 0.025457, 0.112027, 0.205080, 0.234545,
* 0.162397, 0.080985, 0.025457, 0.037624, 0.108326, 0.184322, 0.208386,
* 0.070375, 0.095137, 0.112027, 0.108326, 0.086821, 0.063706, 0.056387,
* -0.028537, 0.110349, 0.205080, 0.184322, 0.063706, -0.065941, -0.106993,
* -0.059857, 0.115165, 0.234545, 0.208386, 0.056387, -0.106993, -0.158727}
*/