From patchwork Thu Jul 6 23:47:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 4248 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2807654vsb; Thu, 6 Jul 2017 16:48:20 -0700 (PDT) X-Received: by 10.223.174.147 with SMTP id y19mr47792155wrc.155.1499384900531; Thu, 06 Jul 2017 16:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499384900; cv=none; d=google.com; s=arc-20160816; b=UfPRWNESNooxsew6L3jkAOZi3WCy5F2+vtkEXsQ0tMfDrzc3Sje1Aa2+D91DLHU3YY 0TNZIy2rLVEbrcSRPiP8Jt9t5pPSsOT3Hd7Z9PBQ4YtL0BTDBO3ZO7gRfj81ZVI4itBA jc6Y0UFA7pGcowGjPXCAFQFSbgFAHb2xRmKmyCN+yzhrXwe0HAXKcpe4l37PWzj/oXiG RbTs/30w+B8aB0A1OFKcWN0bjpTagLSJ2adkUSIlqUYAghFixMbxOqcNofjYC1lwE3Ll YUNQFgE4172xhAl0PHbGys1DCzdKQ+JVIYDAd+n1EsIVckxVRtPpZ5zeoyfbVYWGci+P 6bpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=BbANlWKsfIdU48b28KIsrvD7eu+4N4PAapJETRoOETA=; b=se39zn+q5HcAZdOgQfFqTGjqMqjYtA4UDmlbAU5UGX5ElJd4bmU3zCpjBVBaAcQeNn EIe1FoE+eoVEQUWGLZvOAmhVQiQ3+bKkdd6O7z2o46lvxWg6o85sGuQbwJOUr0zWF2h7 om6ZcmY6xrMXwOX0Ku4gsSAdkbgmmSoqv6kCZw/yBssqkbmNRMhdOlRlha5HRf1Kh0h3 M0pBgCEkaQz+af+vD/k09hDr2FRJqAPq7qp37nZlDtNZ/PyGU7ClzagzIjjZ0Wv3EM3i fWeuBDLrc1OyGElRVc4eLXSta8jt8QSyAx2TNuMYFwkc97syMRD1s5bQr7tuLKx0wCYF kaGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=MrydchBZ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 46si897422wrm.49.2017.07.06.16.48.20; Thu, 06 Jul 2017 16:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=MrydchBZ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20E38689A9D; Fri, 7 Jul 2017 02:48:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 80B6B689A75 for ; Fri, 7 Jul 2017 02:48:08 +0300 (EEST) Received: by mail-qt0-f195.google.com with SMTP id w12so2375631qta.2 for ; Thu, 06 Jul 2017 16:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=/cd4waTpgUTXjbrxz9VuiAd7RAFnI4xiOkEtvF56/kI=; b=MrydchBZkYWromv5RkJFHW/j2u2iNp3E1547j3WL7hZHmGhMzgSlq6PiHJXyGb7RdH 6bcTqWyDQhG50zwd4AdsOvYdBoDJMTQQl3nmXBq9mRd+FiMAKXcG5KY1SDSMhOf1DRW8 hgv9L85iMvTUDgl6HhNJGxAct9496SP0x92VbC8gZbWBP+fLrSDWlM0j4FH30+f2WK/r uEZKY+H4zEjQp4mefwLDjJARuTWEa2+xQD021b12XR4piCg3WhjO5CoCEmUDxJ/xJtZM zBdBmhhDZOAVLQReQRE4XfMqZQLYoXuAR+/TcWaf7eFuupYTaP8UBEn9MQlp7DsPaAAz gk0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=/cd4waTpgUTXjbrxz9VuiAd7RAFnI4xiOkEtvF56/kI=; b=PHyJnunNZu9BS3WbAyfrs0IxGIgxUQeRuzZRSKCyN2Na2lITHhHugp32dmEI5KrEnU ew6HLy3+UjTTOAKGVPWys5HPOmORK858rnNf0W9N2XdhwRw/77jDQ1QRZ00meN80G+s4 y21xD1lkUi/xTZYa/vg3hDd6LfcLwQEXp2eeW2i4cr2QDYaN/3zXiN4BScYjA4ZtPw6n 3ydZMiks7i1FLOrKCrPpcAY8uAlgT77g/RJofoWdz09zRN8Ty7WtWzDMsgwRcc5WnzZT 158M1cts1+T/WuGL3+NaGjEKlh/eZnqwz53eBX/vaDCkXtvYMPBELbXILDD3is6t1aXF J5OA== X-Gm-Message-State: AKS2vOxLhTquQop6i+xYWO0LqQFVs/7unfhDQGsxBt0W2R0r/ZqONhWI a/emnfHVGb/ePGLn X-Received: by 10.237.57.163 with SMTP id m32mr63313626qte.117.1499384889949; Thu, 06 Jul 2017 16:48:09 -0700 (PDT) Received: from localhost.localdomain ([181.231.116.134]) by smtp.gmail.com with ESMTPSA id j75sm1177397qke.34.2017.07.06.16.48.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 16:48:09 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Jul 2017 20:47:14 -0300 Message-Id: <20170706234714.68-1-jamrial@gmail.com> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] checkasm: add hybrid_analysis_ileave and hybrid_synthesis_deint tests to aacpsdsp X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: James Almer --- tests/checkasm/aacpsdsp.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) 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"); }