Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-07-07 02:47:14 +0300
committerJames Almer <jamrial@gmail.com>2017-07-13 23:03:28 +0300
commit6f205a42d76a080d10e768f66ae2cf5c2c8b9f6d (patch)
tree48b60485a65bdffdad94b41b7a30105ce130f787 /tests
parent823cc7e25f9790005574166ee7c5388527b5bb4a (diff)
checkasm: add hybrid_analysis_ileave and hybrid_synthesis_deint tests to aacpsdsp
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/checkasm/aacpsdsp.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/checkasm/aacpsdsp.c b/tests/checkasm/aacpsdsp.c
index 2b051f65da..ea68b39fa9 100644
--- a/tests/checkasm/aacpsdsp.c
+++ b/tests/checkasm/aacpsdsp.c
@@ -97,6 +97,80 @@ static void test_hybrid_analysis(void)
bench_new(dst1, in, filter, STRIDE, N);
}
+static void test_hybrid_analysis_ileave(void)
+{
+ LOCAL_ALIGNED_16(INTFLOAT, in, [2], [38][64]);
+ LOCAL_ALIGNED_16(INTFLOAT, out0, [91], [32][2]);
+ LOCAL_ALIGNED_16(INTFLOAT, out1, [91], [32][2]);
+
+ declare_func(void, INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
+ int i, int len);
+
+ randomize((INTFLOAT *)out0, 91 * 32 * 2);
+ randomize((INTFLOAT *)in, 2 * 38 * 64);
+ memcpy(out1, out0, 91 * 32 * 2 * sizeof(INTFLOAT));
+
+ /* len is hardcoded to 32 as that's the only value used in
+ libavcodec. asm functions are likely to be optimized
+ hardcoding this value in their loops and could fail with
+ anything else.
+ i is hardcoded to the two values currently used by the
+ aac decoder because the arm neon implementation is
+ micro-optimized for them and will fail for almost every
+ other value. */
+ call_ref(out0, in, 3, 32);
+ call_new(out1, in, 3, 32);
+
+ /* the function just moves data around, so memcmp is enough */
+ if (memcmp(out0, out1, 91 * 32 * 2 * sizeof(INTFLOAT)))
+ fail();
+
+ call_ref(out0, in, 5, 32);
+ call_new(out1, in, 5, 32);
+
+ if (memcmp(out0, out1, 91 * 32 * 2 * sizeof(INTFLOAT)))
+ fail();
+
+ bench_new(out1, in, 3, 32);
+}
+
+static void test_hybrid_synthesis_deint(void)
+{
+ LOCAL_ALIGNED_16(INTFLOAT, out0, [2], [38][64]);
+ LOCAL_ALIGNED_16(INTFLOAT, out1, [2], [38][64]);
+ LOCAL_ALIGNED_16(INTFLOAT, in, [91], [32][2]);
+
+ declare_func(void, INTFLOAT out[2][38][64], INTFLOAT (*in)[32][2],
+ int i, int len);
+
+ randomize((INTFLOAT *)in, 91 * 32 * 2);
+ randomize((INTFLOAT *)out0, 2 * 38 * 64);
+ memcpy(out1, out0, 2 * 38 * 64 * sizeof(INTFLOAT));
+
+ /* len is hardcoded to 32 as that's the only value used in
+ libavcodec. asm functions are likely to be optimized
+ hardcoding this value in their loops and could fail with
+ anything else.
+ i is hardcoded to the two values currently used by the
+ aac decoder because the arm neon implementation is
+ micro-optimized for them and will fail for almost every
+ other value. */
+ call_ref(out0, in, 3, 32);
+ call_new(out1, in, 3, 32);
+
+ /* the function just moves data around, so memcmp is enough */
+ if (memcmp(out0, out1, 2 * 38 * 64 * sizeof(INTFLOAT)))
+ fail();
+
+ call_ref(out0, in, 5, 32);
+ call_new(out1, in, 5, 32);
+
+ if (memcmp(out0, out1, 2 * 38 * 64 * sizeof(INTFLOAT)))
+ fail();
+
+ bench_new(out1, in, 3, 32);
+}
+
static void test_stereo_interpolate(PSDSPContext *psdsp)
{
int i;
@@ -156,6 +230,14 @@ void checkasm_check_aacpsdsp(void)
test_hybrid_analysis();
report("hybrid_analysis");
+ if (check_func(psdsp.hybrid_analysis_ileave, "ps_hybrid_analysis_ileave"))
+ test_hybrid_analysis_ileave();
+ report("hybrid_analysis_ileave");
+
+ if (check_func(psdsp.hybrid_synthesis_deint, "ps_hybrid_synthesis_deint"))
+ test_hybrid_synthesis_deint();
+ report("hybrid_synthesis_deint");
+
test_stereo_interpolate(&psdsp);
report("stereo_interpolate");
}