swr: update rematrix coeffs to match AC-3
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Sep 2012 20:32:39 +0000 (22:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Sep 2012 22:29:06 +0000 (00:29 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/rematrix.c

index 26e76a2..7652fd8 100644 (file)
@@ -150,8 +150,13 @@ static int auto_matrix(SwrContext *s)
 
     if(unaccounted & AV_CH_FRONT_CENTER){
         if((s->out_ch_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO){
-            matrix[ FRONT_LEFT][FRONT_CENTER]+= M_SQRT1_2;
-            matrix[FRONT_RIGHT][FRONT_CENTER]+= M_SQRT1_2;
+            if(s->in_ch_layout & AV_CH_LAYOUT_STEREO) {
+                matrix[ FRONT_LEFT][FRONT_CENTER]+= s->clev;
+                matrix[FRONT_RIGHT][FRONT_CENTER]+= s->clev;
+            } else {
+                matrix[ FRONT_LEFT][FRONT_CENTER]+= M_SQRT1_2;
+                matrix[FRONT_RIGHT][FRONT_CENTER]+= M_SQRT1_2;
+            }
         }else
             av_assert0(0);
     }