[FFmpeg-cvslog] aacdec_usac: skip coeff decoding if the number to be decoded is 0
Lynne
git at videolan.org
Sat Jun 8 01:23:16 EEST 2024
ffmpeg | branch: master | Lynne <dev at lynne.ee> | Thu Jun 6 04:38:47 2024 +0200| [a18d0659f403cf4b93a3c5a293a42e0ff7348e90] | committer: Lynne
aacdec_usac: skip coeff decoding if the number to be decoded is 0
Yet another thing not mentioned in the spec.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a18d0659f403cf4b93a3c5a293a42e0ff7348e90
---
libavcodec/aac/aacdec_usac.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 97655787ee..5dd489a43b 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -572,9 +572,15 @@ static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024],
int gb_count;
GetBitContext gb2;
- ff_aac_ac_init(&ac, gb);
c = ff_aac_ac_map_process(state, reset, N);
+ if (!len) {
+ ff_aac_ac_finish(state, 0, N);
+ return 0;
+ }
+
+ ff_aac_ac_init(&ac, gb);
+
/* Backup reader for rolling back by 14 bits at the end */
gb2 = *gb;
gb_count = get_bits_count(&gb2);
More information about the ffmpeg-cvslog
mailing list