]> git.sesse.net Git - vlc/commitdiff
Simple: slightly different matrixes for 7.x and 6.1 stereo downmix
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 18 Apr 2013 14:09:48 +0000 (16:09 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 18 Apr 2013 14:09:48 +0000 (16:09 +0200)
modules/audio_filter/channel_mixer/simple.c

index 3e6b013585bbb865483d6c8dfd822566facb81d5..f1ec88410552ededb189b673f49765beff0d7212 100644 (file)
@@ -116,8 +116,8 @@ static void DoWork_7_x_to_2_0( filter_t * p_filter,  block_t * p_in_buf, block_t
     const float *p_src = (const float *)p_in_buf->p_buffer;
     for( int i = p_in_buf->i_nb_samples; i--; )
     {
-        *p_dest++ = p_src[6] + 0.5 * p_src[0] + p_src[2] / 4 + p_src[4] / 4;
-        *p_dest++ = p_src[6] + 0.5 * p_src[1] + p_src[3] / 4 + p_src[5] / 4;
+        *p_dest++ = p_src[6] * 0.7071 + p_src[0] + p_src[2] / 4 + p_src[4] / 4;
+        *p_dest++ = p_src[6] * 0.7071 + p_src[1] + p_src[3] / 4 + p_src[5] / 4;
 
         p_src += 7;
 
@@ -131,8 +131,8 @@ static void DoWork_6_1_to_2_0( filter_t * p_filter,  block_t * p_in_buf, block_t
     const float *p_src = (const float *)p_in_buf->p_buffer;
     for( int i = p_in_buf->i_nb_samples; i--; )
     {
-        *p_dest++ = p_src[0] + 0.7071 * (p_src[3] + (p_src[2] + p_src[5]) / 2);
-        *p_dest++ = p_src[1] + 0.7071 * (p_src[4] + (p_src[2] + p_src[5]) / 2);
+        *p_dest++ = p_src[0] + p_src[3] + 0.7071 * (p_src[2] + p_src[5]);
+        *p_dest++ = p_src[1] + p_src[4] + 0.7071 * (p_src[2] + p_src[5]);
 
         p_src += 6;