aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-26 00:41:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-26 00:46:46 +0200
commitb1470d7a60636c7f2a2ea9e3c926ca57f10d0651 (patch)
treefe0b3ab7d34818e7c0a0142281504f6bd6d23888
parent1e40b2c22b24a5758bcfce7620355750313c930d (diff)
downloadffmpeg-b1470d7a60636c7f2a2ea9e3c926ca57f10d0651.tar.gz
rematrix: change type of integers from 16 to 32bit to allow increasing volume with it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswresample/rematrix.c10
-rw-r--r--libswresample/swresample_internal.h2
2 files changed, 6 insertions, 6 deletions
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; i<SWR_CH_MAX; i++)
for(j=0; j<SWR_CH_MAX; j++){
s->matrix[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; i<av_get_channel_layout_nb_channels(s->out_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; j<s->matrix_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