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 Revert "avcodec/opus/parse: export the packet and extradata parsing functions" 2026-02-06 14:09:15 +01:00
dec_celt.c opus/dec_celt: avoid emph_coeff becoming a subnormal 2026-03-16 11:51:49 +01:00
dsp.c avcodec/x86/Makefile: Only compile ASM init files when X86ASM is enabled 2025-11-30 22:20:13 +01:00
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 avcodec/opus/parse: Move frame_duration tab into a file of its own 2026-02-06 14:04:50 +01:00
Makefile Revert "avcodec/opus/parse: export the packet and extradata parsing functions" 2026-02-06 14:09:15 +01:00
opus.h
parse.c avcodec: set skip_samples in generic code 2026-02-12 09:59:54 -03:00
parse.h Revert "avcodec/opus/parse: export the packet and extradata parsing functions" 2026-02-06 14:09:15 +01:00
parser.c Revert "avcodec/opus/parse: export the packet and extradata parsing functions" 2026-02-06 14:09:15 +01:00
pvq.c avcodec/x86/Makefile: Only compile ASM init files when X86ASM is enabled 2025-11-30 22:20:13 +01:00
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