[vlc-commits] Simple: implement 4.0 to 1.0
Jean-Baptiste Kempf
git at videolan.org
Fri Apr 12 16:51:19 CEST 2013
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 12 16:42:44 2013 +0200| [3c46fdb63f8ae528ca415c6a962e875b267808b5] | committer: Jean-Baptiste Kempf
Simple: implement 4.0 to 1.0
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c46fdb63f8ae528ca415c6a962e875b267808b5
---
modules/audio_filter/channel_mixer/simple.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/modules/audio_filter/channel_mixer/simple.c b/modules/audio_filter/channel_mixer/simple.c
index 4cabb90..e78505b 100644
--- a/modules/audio_filter/channel_mixer/simple.c
+++ b/modules/audio_filter/channel_mixer/simple.c
@@ -140,6 +140,17 @@ static void DoWork_5_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
+static void DoWork_4_0_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+ VLC_UNUSED(p_filter);
+ float *p_dest = (float *)p_out_buf->p_buffer;
+ 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[2] + p_src[3] + p_src[0] / 4 + p_src[1] / 4;
+ p_src += 4;
+ }
+}
+
static void DoWork_3_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
@@ -248,6 +259,8 @@ static int OpenFilter( vlc_object_t *p_this )
p_filter->p_sys->pf_dowork = DoWork_7_x_to_1_0;
else if( b_input_5_0 )
p_filter->p_sys->pf_dowork = DoWork_5_x_to_1_0;
+ else if( b_input_4_center_rear )
+ p_filter->p_sys->pf_dowork = DoWork_4_0_to_1_0;
else if( b_input_3_0 )
p_filter->p_sys->pf_dowork = DoWork_3_x_to_1_0;
else
More information about the vlc-commits
mailing list