[vlc-commits] Simple: use ITU-R BS.775-2 matrices for 5.x downmixing

Jean-Baptiste Kempf git at videolan.org
Fri Apr 12 17:31:27 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 12 17:27:11 2013 +0200| [29209586dd451f504b92ed6a6eb71ff60a5ad7e3] | committer: Jean-Baptiste Kempf

Simple: use ITU-R BS.775-2 matrices for 5.x downmixing

To 4.0, 2.0 and 1.0

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=29209586dd451f504b92ed6a6eb71ff60a5ad7e3
---

 modules/audio_filter/channel_mixer/simple.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/audio_filter/channel_mixer/simple.c b/modules/audio_filter/channel_mixer/simple.c
index e78505b..bc1157f 100644
--- a/modules/audio_filter/channel_mixer/simple.c
+++ b/modules/audio_filter/channel_mixer/simple.c
@@ -79,8 +79,8 @@ static void DoWork_5_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[4] + 0.5 * p_src[0] + 0.33 * p_src[2];
-        *p_dest++ = p_src[4] + 0.5 * p_src[1] + 0.33 * p_src[3];
+        *p_dest++ = p_src[0] + 0.7071 * (p_src[4] + p_src[2]);
+        *p_dest++ = p_src[1] + 0.7071 * (p_src[4] + p_src[3]);
 
         p_src += 5;
 
@@ -132,7 +132,7 @@ static void DoWork_5_x_to_1_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[4] + p_src[0] / 4 + p_src[1] / 4 + p_src[2] / 6 + p_src[3] / 6;
+        *p_dest++ = 0.7071 * (p_src[0] + p_src[1]) + p_src[4] + 0.5f * (p_src[2] + p_src[3]);
 
         p_src += 5;
 
@@ -197,8 +197,8 @@ static void DoWork_5_x_to_4_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[4] + 0.5 * p_src[0];
-        *p_dest++ = p_src[4] + 0.5 * p_src[1];
+        *p_dest++ = p_src[0] + p_src[4] * 0.7071;
+        *p_dest++ = p_src[1] + p_src[4] * 0.7071;
         *p_dest++ = p_src[2];
         *p_dest++ = p_src[3];
 



More information about the vlc-commits mailing list