00001 /* 00002 Copyright (C) 2007 Christian Kothe 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License 00006 as published by the Free Software Foundation; either version 2 00007 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef EL_PROCESSOR_H 00020 #define EL_PROCESSOR_H 00021 00022 // the Free Surround decoder 00023 class fsurround_decoder { 00024 public: 00025 // create an instance of the decoder 00026 // blocksize is fixed over the lifetime of this object for performance reasons 00027 fsurround_decoder(unsigned blocksize=8192); 00028 // destructor 00029 ~fsurround_decoder(); 00030 00031 float ** getInputBuffers(); 00032 float ** getOutputBuffers(); 00033 00034 // decode a chunk of stereo sound, has to contain exactly blocksize samples 00035 // center_width [0..1] distributes the center information towards the front left/right channels, 1=full distribution, 0=no distribution 00036 // dimension [0..1] moves the soundfield backwards, 0=front, 1=side 00037 // adaption_rate [0..1] determines how fast the steering gets adapted, 1=instantaneous, 0.1 = very slow adaption 00038 //void decode(float *input[2], float *output[6], float center_width=1, float dimension=0, float adaption_rate=1); 00039 void decode(float center_width=1, float dimension=0, float adaption_rate=1); 00040 00041 // flush the internal buffers 00042 void flush(); 00043 00044 // --- advanced configuration --- 00045 00046 // override the surround coefficients 00047 // a is the coefficient of left rear in left total, b is the coefficient of left rear in right total; the same is true for right. 00048 void surround_coefficients(float a, float b); 00049 00050 // set the phase shifting mode for decoding 00051 // 0 = (+0ᄚ,+0ᄚ) - music mode 00052 // 1 = (+0ᄚ,+180ᄚ) - PowerDVD compatibility 00053 // 2 = (+180ᄚ,+0ᄚ) - BeSweet compatibility 00054 // 3 = (-90ᄚ,+90ᄚ) - This seems to work. I just don't know why. 00055 void phase_mode(unsigned mode); 00056 00057 // override the steering mode 00058 // false = simple non-linear steering (old) 00059 // true = advanced linear steering (new) 00060 void steering_mode(bool mode); 00061 00062 // set front/rear stereo separation 00063 // 1.0 is default, 0.0 is mono 00064 void separation(float front,float rear); 00065 00066 // set samplerate for lfe filter 00067 void sample_rate(unsigned int samplerate); 00068 00069 private: 00070 class decoder_impl *impl; // private implementation (details hidden) 00071 }; 00072 00073 00074 #endif
1.6.3