void schro_fft_rev_f32 (float *d_real, float *d_imag, const float *s_real, const float *s_imag, const float *costable, const float *sintable, int shift) { schro_fft_fwd_f32 (d_imag, d_real, s_imag, s_real, costable, sintable, shift); }
int main (int argc, char *argv[]) { SchroEncoder *encoder; SchroParams params; SchroVideoFormat video_format; int filter; SchroFrame *frame; int transform_depth; int i,j; int k; schro_init(); encoder = schro_encoder_new (); frame = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_S16_444, SIZE, SIZE); schro_fft_generate_tables_f32 (costable, sintable, 2*SHIFT); filter = 6; transform_depth = 4; schro_video_format_set_std_video_format (&video_format, 0); video_format.width = SIZE; video_format.height = SIZE; memset (¶ms, 0, sizeof(params)); params.video_format = &video_format; schro_params_init (¶ms, 0); params.wavelet_filter_index = filter; params.transform_depth = transform_depth; schro_params_calculate_iwt_sizes (¶ms); for(i=0;i<SIZE*SIZE;i++) power[i] = 0; for(k=0;k<N_TRIALS;k++){ generate_noise (frame, transform_depth, encoder->subband_weights[filter][transform_depth-1]); schro_frame_inverse_iwt_transform (frame, ¶ms, tmp); for(j=0;j<SIZE;j++){ int16_t *line; line = OFFSET(frame->components[0].data, frame->components[0].stride * j); for(i=0;i<SIZE;i++){ sr[j*SIZE+i] = line[i]; si[j*SIZE+i] = 0; } } schro_fft_fwd_f32 (dr, di, sr, si, costable, sintable, 2*SHIFT); for(i=0;i<SIZE*SIZE;i++) { power[i] += (dr[i]*dr[i]+di[i]*di[i])*(1.0/(SIZE*SIZE)); } } //power[0] *= 4.0/SIZE; //power[0] = 0; for(j=0;j<SIZE/2;j+=CHUNK_SIZE){ for(i=0;i<SIZE/2;i+=CHUNK_SIZE){ int ii,jj; double sum = 0; for(jj=0;jj<CHUNK_SIZE;jj++){ for(ii=0;ii<CHUNK_SIZE;ii++){ sum += power[(j+jj)*SIZE+(i+ii)]; } } sum /= N_TRIALS*CHUNK_SIZE*CHUNK_SIZE; printf("%d %d %g\n", j, i, sqrt(sum)/AMPLITUDE); } printf("\n"); } return fail; }