MythTV master
freesurround_decoder.h
Go to the documentation of this file.
1/*
2Copyright (C) 2007 Christian Kothe
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef FREESURROUND_DECODER_H
20#define FREESURROUND_DECODER_H
21
22// the Free Surround decoder
24public:
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
69private:
70 class Impl;
71 Impl *m_impl; // private implementation (details hidden)
72};
73
74
75#endif
void steering_mode(bool mode)
fsurround_decoder(unsigned blocksize=8192)
void decode(float center_width=1, float dimension=0, float adaption_rate=1)
void separation(float front, float rear)
void surround_coefficients(float a, float b)
void sample_rate(unsigned int samplerate)
void phase_mode(unsigned mode)