From: Lynne via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Lynne <code@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] Miscellaneous aacdec_usac cleanups (PR #20627) Date: Mon, 29 Sep 2025 15:04:24 -0000 Message-ID: <175915826520.25.4263526844597699342@bf249f23a2c8> (raw) PR #20627 opened by Lynne URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20627 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20627.patch Nothing major. >From 485939f5ba2051d3091bb130f0879d3b1ed83e6a Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Tue, 30 Sep 2025 00:02:19 +0900 Subject: [PATCH 1/2] aacdec_usac: memset uncoded coeffs instead of iterating Microoptimization. --- libavcodec/aac/aacdec_usac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index c4b821bbba..38d5328029 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -670,10 +670,8 @@ static int decode_spectrum_ac(AACDecContext *s, float coef[1024], ff_aac_ac_finish(state, i, N); - for (; i < N/2; i++) { - coef[2*i + 0] = 0; - coef[2*i + 1] = 0; - } + /* Zero out uncoded coeffs */ + memset(coef + 2*i, 0, N*sizeof(*coef))); /* Signs */ for (i = 0; i < len; i++) { -- 2.49.1 >From 5ab2d1762dbfa6d68b6fdc2048b73d9345453a54 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Tue, 30 Sep 2025 00:02:51 +0900 Subject: [PATCH 2/2] aacdec_usac: minor code cleanups --- libavcodec/aac/aacdec_usac.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 38d5328029..9ecbfecb35 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -1152,8 +1152,8 @@ static void complex_stereo_interpolate_imag(float *im, float *re, const float f[ s = f[6]*re[0] + f[5]*re[0] + f[4]*re[1] + f[3]*re[2] + f[2]*re[3] + f[1]*re[4] + f[0]*re[5]; - im[i] += s*factor_even; + for (i = 3; i < len - 4; i += 2) { s = f[6]*re[i-3] + f[5]*re[i-2] + f[4]*re[i-1] + f[3]*re[i] + @@ -1447,11 +1447,10 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac, memset(&sce->coeffs[0], 0, 1024*sizeof(float)); for (int win = 0; win < ics->num_windows; win++) { int lg = ics->swb_offset[ics->max_sfb]; - int N; + + int N = usac->core_frame_len; if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) - N = usac->core_frame_len / 8; - else - N = usac->core_frame_len; + N >>= 3; ret = decode_spectrum_ac(ac, sce->coeffs + win*128, gb, &ue->ac, arith_reset_flag && (win == 0), lg, N); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
next reply other threads:[~2025-09-29 15:04 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-09-29 15:04 Lynne via ffmpeg-devel [this message] 2025-09-29 22:53 ` [FFmpeg-devel] " Kieran Kunhya via ffmpeg-devel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=175915826520.25.4263526844597699342@bf249f23a2c8 \ --to=ffmpeg-devel@ffmpeg.org \ --cc=code@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git