MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PrepareInputBuffer

Function PrepareInputBuffer

tensorflow/lite/kernels/rfft2d.cc:282–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void PrepareInputBuffer(const float* input_data, int input_height,
283 int input_width, int fft_height, int fft_width,
284 double** fft_input_output) {
285 int valid_input_height = std::min(input_height, fft_height);
286 int valid_input_width = std::min(input_width, fft_width);
287 for (int i = 0; i < valid_input_height; ++i) {
288 int in_pos = i * input_width;
289 for (int j = 0; j < valid_input_width; ++j) {
290 fft_input_output[i][j] = input_data[in_pos++];
291 }
292 // Zero-pad the rest of the input buffer
293 for (int j = valid_input_width; j < fft_width + 2; ++j) {
294 fft_input_output[i][j] = 0;
295 }
296 }
297
298 // Zero-pad input buffer, if fft_height is greater than valid_input_height.
299 for (int i = valid_input_height; i < fft_height; ++i) {
300 for (int j = 0; j < fft_width + 2; ++j) {
301 fft_input_output[i][j] = 0;
302 }
303 }
304}
305
306void PrepareOutputBuffer(complex<float>* output_data, int fft_height,
307 int fft_width, double** fft_input_output) {

Callers 1

Rfft2dHelperFunction · 0.85

Calls 1

minFunction · 0.50

Tested by

no test coverage detected