diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index b3e3e4a664..9dcfecbd80 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -197,7 +197,7 @@ int swr_rematrix_init(SwrContext *s){ int ch_in=0; for(j=0; j<64; j++){ s->matrix[out_i][in_i]= matrix[i][j]; - s->matrix16[out_i][in_i]= lrintf(matrix[i][j] * 32768); + s->matrix32[out_i][in_i]= lrintf(matrix[i][j] * 32768); if(matrix[i][j]){ s->matrix_ch[out_i][++ch_in]= in_i; sum += fabs(matrix[i][j]); @@ -215,7 +215,7 @@ int swr_rematrix_init(SwrContext *s){ for(i=0; imatrix[i][j] /= maxcoef; - s->matrix16[i][j]= lrintf(s->matrix[i][j] * 32768); + s->matrix32[i][j]= lrintf(s->matrix[i][j] * 32768); } } for(i=0; iout_ch_layout); i++){ @@ -241,7 +241,7 @@ int swr_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int must if(s->int_sample_fmt == AV_SAMPLE_FMT_FLT){ copy_float((float *)out->ch[out_i], (const float *)in->ch[in_i], s->matrix [out_i][in_i], len); }else - copy_s16 ((int16_t*)out->ch[out_i], (const int16_t*)in->ch[in_i], s->matrix16[out_i][in_i], len); + copy_s16 ((int16_t*)out->ch[out_i], (const int16_t*)in->ch[in_i], s->matrix32[out_i][in_i], len); }else{ out->ch[out_i]= in->ch[in_i]; } @@ -253,7 +253,7 @@ int swr_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int must len); }else{ sum2_s16 ((int16_t*)out->ch[out_i], (const int16_t*)in->ch[ s->matrix_ch[out_i][1] ], (const int16_t*)in->ch[ s->matrix_ch[out_i][2] ], - s->matrix16[out_i][ s->matrix_ch[out_i][1] ], s->matrix16[out_i][ s->matrix_ch[out_i][2] ], + s->matrix32[out_i][ s->matrix_ch[out_i][1] ], s->matrix32[out_i][ s->matrix_ch[out_i][2] ], len); } break; @@ -272,7 +272,7 @@ int swr_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int must int v=0; for(j=0; jmatrix_ch[out_i][0]; j++){ in_i= s->matrix_ch[out_i][1+j]; - v+= ((int16_t*)in->ch[in_i])[i] * s->matrix16[out_i][in_i]; + v+= ((int16_t*)in->ch[in_i])[i] * s->matrix32[out_i][in_i]; } ((int16_t*)out->ch[out_i])[i]= (v + 16384)>>15; } diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index 3137be62da..fc5f25c4a3 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -62,7 +62,7 @@ typedef struct SwrContext { //FIXME find unused fields struct AVResampleContext *resample; float matrix[SWR_CH_MAX][SWR_CH_MAX]; - int16_t matrix16[SWR_CH_MAX][SWR_CH_MAX]; + int32_t matrix32[SWR_CH_MAX][SWR_CH_MAX]; uint8_t matrix_ch[SWR_CH_MAX][SWR_CH_MAX+1]; //TODO callbacks for asm optims