Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
3cfcd059
Commit
3cfcd059
authored
Jan 18, 2008
by
Jean-Marc Valin
Browse files
Big mode cleanup. Keeping only one mono and one stereo mode
parent
a76a0b23
Changes
4
Hide whitespace changes
Inline
Side-by-side
libcelt/celt.h
View file @
3cfcd059
...
...
@@ -43,11 +43,8 @@ typedef struct CELTDecoder CELTDecoder;
typedef
struct
CELTMode
CELTMode
;
extern
const
CELTMode
const
*
celt_mode0
;
extern
const
CELTMode
const
*
celt_mode1
;
extern
const
CELTMode
const
*
celt_mode2
;
extern
const
CELTMode
const
*
celt_mode3
;
extern
const
CELTMode
const
*
celt_mode4
;
extern
const
CELTMode
const
*
celt_mono
;
extern
const
CELTMode
const
*
celt_stereo
;
/* Encoder stuff */
...
...
libcelt/modes.c
View file @
3cfcd059
...
...
@@ -97,7 +97,7 @@ const int qbank3[NBANDS256+2] = {0, 4, 8, 12, 16, 24, 32, 40, 48, 56, 72, 88, 10
//const int pbank3[PBANDS256+2] = {0, 8, 16, 24, 40, PITCH_END256, 256};
const
int
pbank3
[
PBANDS256
+
2
]
=
{
0
,
4
,
8
,
12
,
16
,
24
,
40
,
56
,
PITCH_END256
,
256
};
const
CELTMode
mode
0
=
{
static
const
CELTMode
mono_
mode
=
{
128
,
/**< overlap */
256
,
/**< mdctSize */
1
,
/**< nbMdctBlocks */
...
...
@@ -115,109 +115,33 @@ const CELTMode mode0 = {
means18
,
/**< eMeans */
decay18
,
/**< eDecay */
32
,
/**< defaultRate */
7
,
/**< nbAllocVectors */
NALLOCS
,
/**< nbAllocVectors */
bitalloc0
,
/**< allocVectors */
};
/* Approx 38 kbps @ 44.1 kHz */
const
CELTMode
mode1
=
{
128
,
/**< overlap */
128
,
/**< mdctSize */
2
,
/**< nbMdctBlocks */
1
,
/**< channels */
NBANDS128
,
/**< nbEBands */
PBANDS128
,
/**< nbPBands */
PITCH_END128
,
/**< pitchEnd */
qbank1
,
/**< eBands */
pbank1
,
/**< pBands*/
qpulses1
,
/**< nbPulses */
0
.
7
,
/**< ePredCoef */
means
,
/**< eMeans */
decay
,
/**< eDecay */
32
,
/**< defaultRate */
7
,
/**< nbAllocVectors */
bitalloc0
,
/**< allocVectors */
};
/* Approx 58 kbps @ 44.1 kHz */
const
CELTMode
mode2
=
{
256
,
/**< overlap */
256
,
/**< mdctSize */
1
,
/**< nbMdctBlocks */
1
,
/**< channels */
NBANDS
,
/**< nbEBands */
PBANDS
,
/**< nbPBands */
PITCH_END
,
/**< pitchEnd */
qbank0
,
/**< eBands */
pbank0
,
/**< pBands*/
qpulses2
,
/**< nbPulses */
0
.
8
,
/**< ePredCoef */
means18
,
/**< eMeans */
decay18
,
/**< eDecay */
48
,
/**< defaultRate */
7
,
/**< nbAllocVectors */
bitalloc0
,
/**< allocVectors */
};
const
CELTMode
mode3
=
{
128
,
/**< overlap */
256
,
/**< mdctSize */
1
,
/**< nbMdctBlocks */
1
,
/**< channels */
NBANDS256
,
/**< nbEBands */
PBANDS256
,
/**< nbPBands */
PITCH_END256
,
/**< pitchEnd */
qbank3
,
/**< eBands */
pbank3
,
/**< pBands*/
qpulses1
,
/**< nbPulses */
0
.
7
,
/**< ePredCoef */
means
,
/**< eMeans */
decay
,
/**< eDecay */
32
,
/**< defaultRate */
7
,
/**< nbAllocVectors */
bitalloc0
,
/**< allocVectors */
};
/* Stereo mode around 120 kbps */
const
CELTMode
mode
4
=
{
256
,
/**< overlap */
static
const
CELTMode
stereo_
mode
=
{
128
,
/**< overlap */
256
,
/**< mdctSize */
1
,
/**< nbMdctBlocks */
2
,
/**< channels */
NBANDS
,
/**< nbEBands */
PBANDS
,
/**< nbPBands */
PITCH_END
,
/**< pitchEnd */
NBANDS
,
/**< nbEBands */
PBANDS
,
/**< nbPBands */
PITCH_END
,
/**< pitchEnd */
qbank0
,
/**< eBands */
pbank0
,
/**< pBands*/
qpulses4s
,
/**< nbPulses */
0
.
8
,
/**< ePredCoef */
means18
,
/**< eMeans */
decay18
,
/**< eDecay */
means18
,
/**< eMeans */
decay18
,
/**< eDecay */
92
,
/**< defaultRate */
7
,
/**< nbAllocVectors */
NALLOCS
,
/**< nbAllocVectors */
bitalloc0
,
/**< allocVectors */
};
const
CELTMode
const
*
celt_mode0
=
&
mode0
;
const
CELTMode
const
*
celt_mode1
=
&
mode1
;
const
CELTMode
const
*
celt_mode2
=
&
mode2
;
const
CELTMode
const
*
celt_mode3
=
&
mode3
;
const
CELTMode
const
*
celt_mode4
=
&
mode4
;
const
CELTMode
const
*
celt_mono
=
&
mono_mode
;
const
CELTMode
const
*
celt_stereo
=
&
stereo_mode
;
libcelt/modes.h
View file @
3cfcd059
...
...
@@ -52,7 +52,6 @@ struct CELTMode {
const
float
*
eMeans
;
const
int
*
eDecay
;
int
defaultRate
;
int
nbAllocVectors
;
const
int
*
allocVectors
;
};
...
...
libcelt/testcelt.c
View file @
3cfcd059
...
...
@@ -53,8 +53,8 @@ int main(int argc, char *argv[])
fout
=
fopen
(
outFile
,
"wb+"
);
/* Use mode4 for stereo and don't forget to change the value of CHANNEL above */
enc
=
celt_encoder_new
(
celt_mo
de0
);
dec
=
celt_decoder_new
(
celt_mo
de0
);
enc
=
celt_encoder_new
(
celt_mo
no
);
dec
=
celt_decoder_new
(
celt_mo
no
);
while
(
!
feof
(
fin
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment