[FFmpeg-devel] [PATCH] checkasm: aacencdsp: Actually initialize ff_aac_pow34sf_tab

Martin Storsjö martin at martin.st
Wed Jan 29 11:58:54 EET 2025


This table is zero initialized by default, and has to be
explicitly initialized.

Coincidentally, this fixes linking checkasm with Apple's older
linker. (In Xcode 15, Apple switched to a new linker. The one in
older toolchains seems to have a bug where it won't figure out to
load object files from a static library, if the only symbol
referenced in the object file is a "common" symbol, i.e. one for
a zero-initialized variable. This issue can also be reproduced with
newer Apple toolchains by passing -Wl,-ld_classic to the linker.)
---
 tests/checkasm/aacencdsp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/checkasm/aacencdsp.c b/tests/checkasm/aacencdsp.c
index 5308a2ac03..72815bf963 100644
--- a/tests/checkasm/aacencdsp.c
+++ b/tests/checkasm/aacencdsp.c
@@ -67,11 +67,14 @@ static void test_abs_pow34(AACEncDSPContext *s)
 static void test_quant_bands(AACEncDSPContext *s)
 {
     int maxval = randomize_elem(aac_cb_maxval);
-    float q34 = randomize_elem(ff_aac_pow34sf_tab);
+    float q34;
     float rounding = (rnd() & 1) ? ROUND_TO_ZERO : ROUND_STANDARD;
     LOCAL_ALIGNED_16(float, in, [BUF_SIZE]);
     LOCAL_ALIGNED_16(float, scaled, [BUF_SIZE]);
 
+    ff_aac_float_common_init();
+    q34 = randomize_elem(ff_aac_pow34sf_tab);
+
     declare_func(void, int *, const float *, const float *, int, int, int,
                  const float, const float);
 
-- 
2.39.5 (Apple Git-154)



More information about the ffmpeg-devel mailing list