[FFmpeg-cvslog] tests/checkasm/lpc: randomize buffer length

James Almer git at videolan.org
Fri Sep 23 00:18:07 EEST 2022


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Sep 22 13:54:05 2022 -0300| [a1c6f4b653b6fca51eea40f12a22ab1cb045751d] | committer: James Almer

tests/checkasm/lpc: randomize buffer length

Simplifies the test, while trying more values and preventing pointlessly
running benchmarks in a loop.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1c6f4b653b6fca51eea40f12a22ab1cb045751d
---

 tests/checkasm/lpc.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/tests/checkasm/lpc.c b/tests/checkasm/lpc.c
index da5364def0..8528fd6e20 100644
--- a/tests/checkasm/lpc.c
+++ b/tests/checkasm/lpc.c
@@ -54,31 +54,18 @@ static void test_window(int len)
 void checkasm_check_lpc(void)
 {
     LPCContext ctx;
+    int len = rnd() % 5000;
     ff_lpc_init(&ctx, 32, 16, FF_LPC_TYPE_DEFAULT);
 
     if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_even")) {
-        for (int i = 0; i < 64; i += 2)
-            test_window(i);
+        test_window(len & ~1);
     }
     report("apply_welch_window_even");
 
     if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_odd")) {
-        for (int i = 1; i < 64; i += 2)
-            test_window(i);
+        test_window(len | 1);
     }
     report("apply_welch_window_odd");
 
-    if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_2560"))
-        test_window(2560);
-    report("apply_welch_window_2560");
-
-    if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_4096"))
-        test_window(4096);
-    report("apply_welch_window_4096");
-
-    if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_4097"))
-        test_window(4097);
-    report("apply_welch_window_4097");
-
     ff_lpc_end(&ctx);
 }



More information about the ffmpeg-cvslog mailing list