Skip to content
GitLab
Menu
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
8dff923a
Commit
8dff923a
authored
Aug 13, 2008
by
Jean-Marc Valin
Browse files
Added hooks for tuning pulses and fine energy quant
parent
5f2a74b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/celt.c
View file @
8dff923a
...
...
@@ -544,11 +544,25 @@ int celt_encode_float(CELTEncoder * restrict st, celt_sig_t * restrict pcm, unsi
P
[
i
]
=
0
;
}
#ifdef STDIN_TUNING2
static
int
fine_quant
[
30
];
static
int
pulses
[
30
];
static
int
init
=
0
;
if
(
!
init
)
{
for
(
i
=
0
;
i
<
st
->
mode
->
nbEBands
;
i
++
)
scanf
(
"%d "
,
&
fine_quant
[
i
]);
for
(
i
=
0
;
i
<
st
->
mode
->
nbEBands
;
i
++
)
scanf
(
"%d "
,
&
pulses
[
i
]);
init
=
1
;
}
#else
ALLOC
(
fine_quant
,
st
->
mode
->
nbEBands
,
int
);
ALLOC
(
pulses
,
st
->
mode
->
nbEBands
,
int
);
#endif
ALLOC
(
error
,
C
*
st
->
mode
->
nbEBands
,
celt_word16_t
);
quant_coarse_energy
(
st
->
mode
,
bandE
,
st
->
oldBandE
,
nbCompressedBytes
*
8
/
3
,
st
->
mode
->
prob
,
error
,
&
st
->
enc
);
ALLOC
(
pulses
,
st
->
mode
->
nbEBands
,
int
);
ALLOC
(
offsets
,
st
->
mode
->
nbEBands
,
int
);
ALLOC
(
stereo_mode
,
st
->
mode
->
nbEBands
,
int
);
stereo_decision
(
st
->
mode
,
X
,
stereo_mode
,
st
->
mode
->
nbEBands
);
...
...
@@ -556,7 +570,9 @@ int celt_encode_float(CELTEncoder * restrict st, celt_sig_t * restrict pcm, unsi
for
(
i
=
0
;
i
<
st
->
mode
->
nbEBands
;
i
++
)
offsets
[
i
]
=
0
;
bits
=
nbCompressedBytes
*
8
-
ec_enc_tell
(
&
st
->
enc
,
0
)
-
1
;
#ifndef STDIN_TUNING
compute_allocation
(
st
->
mode
,
offsets
,
stereo_mode
,
bits
,
pulses
,
fine_quant
);
#endif
/*for (i=0;i<st->mode->nbEBands;i++)
printf("%d ", fine_quant[i]);
for (i=0;i<st->mode->nbEBands;i++)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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