[vlc-devel] commit: Should remove the big white noise that was produced ( Geoffroy Couprie )

git version control git at videolan.org
Wed Sep 17 11:28:24 CEST 2008


vlc | branch: master | Geoffroy Couprie <geo.couprie at gmail.com> | Wed Sep 17 11:29:52 2008 +0200| [e991ef5da735eb35f4be38cc07d17c26bda398c4] | committer: Geoffroy Couprie 

Should remove the big white noise that was produced

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

 modules/audio_filter/spatializer/comb.hpp        |   17 +++++------
 modules/audio_filter/spatializer/revmodel.cpp    |    8 +++++
 modules/audio_filter/spatializer/spatializer.cpp |   34 ++++++++++++++++-----
 3 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/modules/audio_filter/spatializer/comb.hpp b/modules/audio_filter/spatializer/comb.hpp
index 71d4ef0..4017af3 100644
--- a/modules/audio_filter/spatializer/comb.hpp
+++ b/modules/audio_filter/spatializer/comb.hpp
@@ -9,6 +9,10 @@
 
 #include "denormals.h"
 
+/**
+* Combination filter
+*Takes multiple audio channels and mix them for one ear
+*/
 class comb
 {
 public:
@@ -35,25 +39,20 @@ private:
 
 inline float comb::process(float input)
 {
-
-#if 1
-    /* FIXME FIXME FIXME
-     * comb::process is completly broken so ignore it for now */
-    return 0.0;
-
-#else
+/* FIXME
+* comb::process is not really ear-friendly the tunning values must
+* be changed*/
     float output;
 
     output = undenormalise( buffer[bufidx] );
 
-    filterstore = undenormalise( output*damp2 + filterstore*damp1 );
+    filterstore = undenormalise(output*damp2);
 
     buffer[bufidx] = input + filterstore*feedback;
 
     if(++bufidx>=bufsize) bufidx = 0;
 
     return output;
-#endif
 }
 
 #endif //_comb_
diff --git a/modules/audio_filter/spatializer/revmodel.cpp b/modules/audio_filter/spatializer/revmodel.cpp
index 02bf698..312dd43 100644
--- a/modules/audio_filter/spatializer/revmodel.cpp
+++ b/modules/audio_filter/spatializer/revmodel.cpp
@@ -80,6 +80,13 @@ void revmodel::mute()
     }
 }
 
+/*****************************************************************************
+ *  Transforms the audio stream
+ * /param float *inputL     input buffer
+ * /param float *outputL   output buffer
+ * /param long numsamples  number of samples to be processed
+ * /param int skip             number of channels in the audio stream
+ *****************************************************************************/
 void revmodel::processreplace(float *inputL, float *outputL, long numsamples, int skip)
 {
     float outL,outR,input;
@@ -87,6 +94,7 @@ void revmodel::processreplace(float *inputL, float *outputL, long numsamples, in
     int i;
 
     outL = outR = 0;
+        /* TODO this module supports only 2 audio channels, let's improve this */
         if (skip > 1)
            inputR = inputL[1];
         else
diff --git a/modules/audio_filter/spatializer/spatializer.cpp b/modules/audio_filter/spatializer/spatializer.cpp
index b4edc12..200533b 100644
--- a/modules/audio_filter/spatializer/spatializer.cpp
+++ b/modules/audio_filter/spatializer/spatializer.cpp
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * spatializer.cpp:
+ * spatializer.cpp: sound reverberation
  *****************************************************************************
  * Copyright (C) 2004, 2006, 2007 the VideoLAN team
  *
@@ -45,6 +45,22 @@
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
+#define ROOMSIZE_TEXT N_("Room size")
+#define ROOMSIZE_LONGTEXT N_("Defines the virtual surface of the room" \
+                                "emulated by the filter." )
+
+#define WIDTH_TEXT N_("Room width")
+#define WIDTH_LONGTEXT N_("Width of the virtual room")
+
+#define WET_TEXT N_("")
+#define WET_LONGTEXT N_("")
+
+#define DRY_TEXT N_("")
+#define DRY_LONGTEXT N_("")
+
+#define DAMP_TEXT N_("")
+#define DAMP_LONGTEXT N_("")
+
 vlc_module_begin();
     set_description( N_("spatializer") );
     set_shortname( N_("spatializer" ) );
@@ -54,11 +70,11 @@ vlc_module_begin();
 
     set_callbacks( Open, Close );
     add_shortcut( "spatializer" );
-    add_float( "Roomsize", 1.05, NULL, NULL,NULL, true);
-    add_float( "Width", 10.0, NULL, NULL,NULL, true);
-    add_float( "Wet", 3.0, NULL, NULL,NULL, true);
-    add_float( "Dry", 2.0, NULL, NULL,NULL, true);
-    add_float( "Damp", 1.0, NULL, NULL,NULL, true);
+    add_float( "Roomsize", 1.05, NULL, ROOMSIZE_TEXT,ROOMSIZE_LONGTEXT, true);
+    add_float( "Width", 10.0, NULL, WIDTH_TEXT,WIDTH_LONGTEXT, true);
+    add_float( "Wet", 3.0, NULL, WET_TEXT,WET_LONGTEXT, true);
+    add_float( "Dry", 2.0, NULL, DRY_TEXT,DRY_LONGTEXT, true);
+    add_float( "Damp", 1.0, NULL, DAMP_TEXT,DAMP_LONGTEXT, true);
 vlc_module_end();
 
 /*****************************************************************************
@@ -173,8 +189,6 @@ static void Close( vlc_object_t *p_this )
 
 /*****************************************************************************
  * DoWork: process samples buffer
- *****************************************************************************
- *
  *****************************************************************************/
 static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
                     aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
@@ -255,6 +269,10 @@ static void SpatClean( aout_filter_t *p_filter )
     var_DelCallback( p_aout, psz_control_names[4], DampCallback, p_sys );
 }
 
+/*****************************************************************************
+ * Variables callbacks
+ *****************************************************************************/
+
 static int RoomCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {




More information about the vlc-devel mailing list