mirror of
https://github.com/xiph/opus.git
synced 2025-06-01 08:07:41 +00:00
VBR code simplification
This commit is contained in:
parent
dae16fb94b
commit
28ef277db4
1 changed files with 3 additions and 6 deletions
|
@ -1555,8 +1555,7 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
|
|||
max_frac = DIV32_16(MULT16_16(QCONST16(0.8f, 15), coded_stereo_dof), coded_bins);
|
||||
/*printf("%d %d %d ", coded_stereo_dof, coded_bins, tot_boost);*/
|
||||
target -= MIN32(MULT16_32_Q15(max_frac,target),
|
||||
SHR16(MULT16_16(st->stereo_saving,(coded_stereo_dof<<BITRES)),8));
|
||||
target += MULT16_16_Q15(QCONST16(0.1f,15),coded_stereo_dof<<BITRES);
|
||||
SHR16(MULT16_16(st->stereo_saving-QCONST16(0.1f,8),(coded_stereo_dof<<BITRES)),8));
|
||||
}
|
||||
/* Boost the rate according to dynalloc (minus the dynalloc average for calibration). */
|
||||
target += tot_boost-(16<<LM);
|
||||
|
@ -1569,10 +1568,8 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
|
|||
int tonal_target;
|
||||
float tonal;
|
||||
|
||||
/* Compensates for the average tonality boost */
|
||||
target -= MULT16_16_Q15(QCONST16(0.11f,15),coded_bins<<BITRES);
|
||||
|
||||
tonal = MAX16(0,st->analysis.tonality-.15);
|
||||
/* Tonality boost (compensating for the average). */
|
||||
tonal = MAX16(0,st->analysis.tonality-.15)-0.09;
|
||||
tonal_target = target + (coded_bins<<BITRES)*1.2f*tonal;
|
||||
if (pitch_change)
|
||||
tonal_target += (coded_bins<<BITRES)*.8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue