Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] Miscellaneous aacdec_usac cleanups (PR #20627)
@ 2025-09-29 15:04 Lynne via ffmpeg-devel
  2025-09-29 22:53 ` [FFmpeg-devel] " Kieran Kunhya via ffmpeg-devel
  0 siblings, 1 reply; 2+ messages in thread
From: Lynne via ffmpeg-devel @ 2025-09-29 15:04 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Lynne

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-29 22:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-29 15:04 [FFmpeg-devel] [PATCH] Miscellaneous aacdec_usac cleanups (PR #20627) Lynne via ffmpeg-devel
2025-09-29 22:53 ` [FFmpeg-devel] " Kieran Kunhya via ffmpeg-devel

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