ffmpeg/libavcodec/opus
Daniil Cherednik 816d74e0bb avcodec/opus/enc: fix CELT psy analysis and packet sizing
The CELT psychoacoustic path was effectively broken: analysis could use
the wrong queued audio and stale scratch samples, and raw band scores were
folded into the frame bit budget, where they could overflow instead of
only driving alloc_boost.

On top of that, c3aea7628c changed avctx->frame_size from fixed
120-sample steps to a configuration-derived value, while the CELT input
and psy paths still treated queue entries as 120-sample steps. That could
misalign psy analysis, read before a short overlap frame, stall silent
flushes, poison rate control with zero-bit silent frames, and overrun the
range coder on EOF or short tails.

This commit fixes these cases by using avctx->frame_size for psy step
accounting, aligning bufqueue analysis with actual audio, padding short
overlaps, and avoiding invalid bit-budget updates for silent or EOF
packets. This lets CELT produce valid packets again.
2026-05-23 10:38:28 +00:00
..
celt.c
celt.h
dec.c
dec_celt.c opus/dec_celt: avoid emph_coeff becoming a subnormal 2026-03-16 11:51:49 +01:00
dsp.c
dsp.h
enc.c avcodec/opus/enc: fix CELT psy analysis and packet sizing 2026-05-23 10:38:28 +00:00
enc.h
enc_psy.c avcodec/opus/enc: fix CELT psy analysis and packet sizing 2026-05-23 10:38:28 +00:00
enc_psy.h
enc_utils.h
frame_duration_tab.c
Makefile
opus.h
parse.c
parse.h
parser.c
pvq.c
pvq.h
rc.c
rc.h
silk.c avcodec/opus: use precomputed NLSF weights for Silk decoder 2026-04-17 14:39:20 +00:00
silk.h
tab.c avcodec/opus: use precomputed NLSF weights for Silk decoder 2026-04-17 14:39:20 +00:00
tab.h avcodec/opus: use precomputed NLSF weights for Silk decoder 2026-04-17 14:39:20 +00:00