MythTV  master
el_processor.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2007 Christian Kothe
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef EL_PROCESSOR_H
20 #define EL_PROCESSOR_H
21 
22 // the Free Surround decoder
24 public:
25  // create an instance of the decoder
26  // blocksize is fixed over the lifetime of this object for performance reasons
27  explicit fsurround_decoder(unsigned blocksize=8192);
28  // destructor
30 
31  float ** getInputBuffers();
32  float ** getOutputBuffers();
33 
34  // decode a chunk of stereo sound, has to contain exactly blocksize samples
35  // center_width [0..1] distributes the center information towards the front left/right channels, 1=full distribution, 0=no distribution
36  // dimension [0..1] moves the soundfield backwards, 0=front, 1=side
37  // adaption_rate [0..1] determines how fast the steering gets adapted, 1=instantaneous, 0.1 = very slow adaption
38  //void decode(float *input[2], float *output[6], float center_width=1, float dimension=0, float adaption_rate=1);
39  void decode(float center_width=1, float dimension=0, float adaption_rate=1);
40 
41  // flush the internal buffers
42  void flush();
43 
44  // --- advanced configuration ---
45 
46  // override the surround coefficients
47  // 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.
48  void surround_coefficients(float a, float b);
49 
50  // set the phase shifting mode for decoding
51  // 0 = (+0°,+0°) - music mode
52  // 1 = (+0°,+180°) - PowerDVD compatibility
53  // 2 = (+180°,+0°) - BeSweet compatibility
54  // 3 = (-90°,+90°) - This seems to work. I just don't know why.
55  void phase_mode(unsigned mode);
56 
57  // override the steering mode
58  // false = simple non-linear steering (old)
59  // true = advanced linear steering (new)
60  void steering_mode(bool mode);
61 
62  // set front/rear stereo separation
63  // 1.0 is default, 0.0 is mono
64  void separation(float front,float rear);
65 
66  // set samplerate for lfe filter
67  void sample_rate(unsigned int samplerate);
68 
69 private:
70  class Impl;
71  Impl *m_impl; // private implementation (details hidden)
72 };
73 
74 
75 #endif
fsurround_decoder::Impl
Definition: el_processor.cpp:44
fsurround_decoder::sample_rate
void sample_rate(unsigned int samplerate)
Definition: el_processor.cpp:489
fsurround_decoder::~fsurround_decoder
~fsurround_decoder()
Definition: el_processor.cpp:463
fsurround_decoder::m_impl
Impl * m_impl
Definition: el_processor.h:70
fsurround_decoder::flush
void flush()
Definition: el_processor.cpp:469
fsurround_decoder::decode
void decode(float center_width=1, float dimension=0, float adaption_rate=1)
Definition: el_processor.cpp:465
fsurround_decoder::separation
void separation(float front, float rear)
Definition: el_processor.cpp:477
fsurround_decoder::fsurround_decoder
fsurround_decoder(unsigned blocksize=8192)
Definition: el_processor.cpp:461
fsurround_decoder::surround_coefficients
void surround_coefficients(float a, float b)
Definition: el_processor.cpp:471
fsurround_decoder
Definition: el_processor.h:23
fsurround_decoder::steering_mode
void steering_mode(bool mode)
Definition: el_processor.cpp:475
fsurround_decoder::phase_mode
void phase_mode(unsigned mode)
Definition: el_processor.cpp:473
fsurround_decoder::getOutputBuffers
float ** getOutputBuffers()
Definition: el_processor.cpp:484
fsurround_decoder::getInputBuffers
float ** getInputBuffers()
Definition: el_processor.cpp:479