From patchwork Mon Apr 9 02:12:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingming Fan X-Patchwork-Id: 8360 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp1960199jad; Sun, 8 Apr 2018 19:13:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx490txlgXipTKgmmHpVr5KZGMc0gGSZFpTA7YJVSj9yTnaO3xmIfR4y5Wo19KsKfFPlQKMrV X-Received: by 10.28.22.2 with SMTP id 2mr18101812wmw.159.1523239996275; Sun, 08 Apr 2018 19:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523239996; cv=none; d=google.com; s=arc-20160816; b=AchCcmQMuzgnLSVl9b0KU0RY/f+s5X8RtLSty/jXah8FVVGrScLUo7Meybds+5Oj88 WohKXh3sfdgOqhR2J0YkdPYS/gPGCdI11Kdfu9CbOekNBz1mvVvPsehu+W7iRnIDSKjZ gbJYvWx2tRy0SIl/z50uOm1Q5j7hDHkiFI6+X2Vhqa7bukPSQiaxOIkqbIEWODekqppI OSSH6FXXB5F9h6dnB9aKcx2QDijFaHxVDo8xo7D0QG1PSpcPm04Dm+xkVOe/2Z4/2L0I cUBjx8d2SwmpgGS/6nv8LUx00Kzkq/IMA3NWFJbz0cAdmd8VPFVS5SqOM+199ElKu0yQ GdZA== 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:cc: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=7IQfBRJbf5x7CGXwu1F4uhKD3bdTUjduThQeNxdBB2w=; b=dlvd/lktAksidJTeDVtRB4dAK/zWEHrA03qpEYrxlYbjT91BpCyGkrC80r/UZkVrQ8 dfKReuIjW8FO61lWXYma57ZA1XvzM1ScjOG2zwv1fwSBqhTWn2ANfqFouj6WBJjdTv8N xFYiN/5KlwoBbxhpasn4hkpZ7T5ZdG+NGgupyKwV6GDtDoz6/uRVH6mOBRcbqILyUsjZ zPEgV+DjzV8KfWqaH8rypyxbJ+CdUXfmZ3UPG8bnZCAMrgOikYozgak+BuunkZ2m1w0r bbwJyDVSlulHrveC+kMpZIzy4DpZMeuIxN1TwxI3pHAjQILWPm5E4bejYDVQN3tshYI6 /DqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=db1cLqf0; 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=QUARANTINE 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 f132si9311909wmf.92.2018.04.08.19.13.15; Sun, 08 Apr 2018 19:13:16 -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.s=20161025 header.b=db1cLqf0; 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=QUARANTINE 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 CF42D689EDA; Mon, 9 Apr 2018 05:12:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl0-f53.google.com (mail-pl0-f53.google.com [209.85.160.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45F51689959 for ; Mon, 9 Apr 2018 05:12:44 +0300 (EEST) Received: by mail-pl0-f53.google.com with SMTP id 61-v6so4210423plb.2 for ; Sun, 08 Apr 2018 19:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sM77SwrhJiJfEVTpDtNr6rHoyNUMSFy1R4K9KBDLPQw=; b=db1cLqf09ofB8fOC6MqiKDBX+goB7VaV5Le9pvQnvge8cAuT2ngZAumx9gIoJXW9s6 tYaM52ivNdmbnKyzuyPFHXcQPsafnVsD+fkvnYxFAKD3NDf4UiQLfRsfTAQFK7/b4uzd dcyvTMz74Xn5B3xoG8OT4++Tt45ht5Dz3gtZmjQtymm8MAi4WATNIJ/u1oxX69cdkUDJ l9vklZQi8qysEeg7Q0lakvQ+Vptgb3ZCSrAVAVwcvKRaxB6xBicn//xFXuQe78+f8op6 pYDqPSd/9leXXWBQZqbqZ6c7IFiY22YklN1mNTiOazJH5OXKbHpeS9LXsXHja8nllgKU 7OQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sM77SwrhJiJfEVTpDtNr6rHoyNUMSFy1R4K9KBDLPQw=; b=jQl0BO2h+2MfozWS0zlZJXUmDxVVPVgtsnSBzqDq3pG2eRJnS6FLwtZU0N20fBuTPg 5MxtjIK6Rm0wglYHoa+7BGlyIZURejJzz5+D7zq/yf1aPsILNZ3fFDdQtZQVRMe3Ion4 gkCS3t//1uXlNmuKbqDvP9PB45KN4u01P6nVRp3wQo+zV/gs30MGJ2KsX5lLe4hVxwam GPeIswFtgEPkofgaoELx/lJoJryyyZzKq8aQo9ciI5LsspbzTmoCbajeHqrTigDafNhi 5PlvQzoctV1KE6yQqi3GpPJ9CkgPWiNFcrXRRmrrfFYIIcwynX8p7wM5gt0ZzXbdU4Vo 1ZzQ== X-Gm-Message-State: AElRT7F2gih/twLQlarKqpuWNcm4P+4prtLWgOgThazps3R3OOA8oFyL pXJTAIGHloUdySzCGgGVBe5fyg== X-Received: by 2002:a17:902:8501:: with SMTP id bj1-v6mr37518011plb.239.1523239984048; Sun, 08 Apr 2018 19:13:04 -0700 (PDT) Received: from localhost.localdomain ([103.48.142.82]) by smtp.gmail.com with ESMTPSA id j10sm30393904pfj.1.2018.04.08.19.13.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Apr 2018 19:13:03 -0700 (PDT) From: Yingming Fan X-Google-Original-From: Yingming Fan To: ffmpeg-devel@ffmpeg.org Date: Mon, 9 Apr 2018 10:12:39 +0800 Message-Id: <20180409021239.4235-1-fanyingming@bytedance.com> X-Mailer: git-send-email 2.15.1 (Apple Git-101) Subject: [FFmpeg-devel] [PATCH] checkasm/hevc_mc : add hevc_mc for checkasm 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 Cc: Yingming Fan MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Yingming Fan --- Hi, there. I plane to submit our arm32 neon codes for qpel and epel. While before this i will submit hevc_mc checkasm codes. This hevc_mc checkasm codes check every qpel and epel function, including 8 10 and 12 bit. Passed test by using 'checkasm --test=hevc_mc' under Linux x86_64 MacOS x86_64 and Linux arm64 platform. Also passed FATE test. tests/checkasm/Makefile | 2 +- tests/checkasm/checkasm.c | 1 + tests/checkasm/checkasm.h | 1 + tests/checkasm/hevc_mc.c | 547 ++++++++++++++++++++++++++++++++++++++++++++++ tests/fate/checkasm.mak | 1 + 5 files changed, 551 insertions(+), 1 deletion(-) create mode 100644 tests/checkasm/hevc_mc.c diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index 0233d2f989..e6c94cd676 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -23,7 +23,7 @@ AVCODECOBJS-$(CONFIG_EXR_DECODER) += exrdsp.o AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuvdsp.o AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o AVCODECOBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o -AVCODECOBJS-$(CONFIG_HEVC_DECODER) += hevc_add_res.o hevc_idct.o hevc_sao.o +AVCODECOBJS-$(CONFIG_HEVC_DECODER) += hevc_add_res.o hevc_idct.o hevc_sao.o hevc_mc.o AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodsp.o AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 20ce56932f..b95efc674d 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -117,6 +117,7 @@ static const struct { { "hevc_add_res", checkasm_check_hevc_add_res }, { "hevc_idct", checkasm_check_hevc_idct }, { "hevc_sao", checkasm_check_hevc_sao }, + { "hevc_mc", checkasm_check_hevc_mc }, #endif #if CONFIG_HUFFYUV_DECODER { "huffyuvdsp", checkasm_check_huffyuvdsp }, diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index dcab74de06..5a4a612da7 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -58,6 +58,7 @@ void checkasm_check_h264qpel(void); void checkasm_check_hevc_add_res(void); void checkasm_check_hevc_idct(void); void checkasm_check_hevc_sao(void); +void checkasm_check_hevc_mc(void); void checkasm_check_huffyuvdsp(void); void checkasm_check_jpeg2000dsp(void); void checkasm_check_llviddsp(void); diff --git a/tests/checkasm/hevc_mc.c b/tests/checkasm/hevc_mc.c new file mode 100644 index 0000000000..018f322c11 --- /dev/null +++ b/tests/checkasm/hevc_mc.c @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2018 Yingming Fan + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include + +#include "libavutil/intreadwrite.h" + +#include "libavcodec/avcodec.h" + +#include "libavcodec/hevcdsp.h" + +#include "checkasm.h" + +static const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }; +static const uint32_t idx_width_map[8][2] = {{1, 4}, {3, 8}, {4, 12}, {5, 16}, {6, 24}, {7, 32}, {8, 48}, {9, 64}}; +#define SIZEOF_PIXEL ((bit_depth + 7) / 8) +#define PIXEL_STRIDE (AV_INPUT_BUFFER_PADDING_SIZE + MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) +#define BUF_SIZE ((MAX_PB_SIZE+4+4) * PIXEL_STRIDE * 2) + +#define randomize_buffers(buf0, buf1, size) \ + do { \ + uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ + int k; \ + for (k = 0; k < size; k += 4) { \ + uint32_t r = rnd() & mask; \ + AV_WN32A(buf0 + k, r); \ + AV_WN32A(buf1 + k, r); \ + } \ + } while (0) + +#define randomize_buffers2(buf0, buf1, size) \ + do { \ + uint32_t mask = 0x1fff1fff; \ + int k; \ + for (k = 0; k < size; k += 4) { \ + uint32_t r = rnd() & mask; \ + AV_WN32A(buf0 + k, r); \ + AV_WN32A(buf1 + k, r); \ + } \ + } while (0) + +static int get_random(min, max, mod) +{ + int value = rnd()%mod; + int sign = rnd()&0x1 == 0 ? 1 : -1; + return av_clip(sign*value, min, max); +} + +static void check_put_hevc_qpel(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width); + + randomize_buffers(src0, src1, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_qpel[idx][!!y][!!x], "put_hevc_qpel_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref((int16_t *)dst0, src0 + offset, stride, height, x, y, width); + call_new((int16_t *)dst1, src1 + offset, stride, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new((int16_t *)dst1, src1 + offset, stride, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_epel(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width); + + randomize_buffers(src0, src1, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_epel[idx][!!y][!!x], "put_hevc_epel_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref((int16_t *)dst0, src0 + offset, stride, height, x, y, width); + call_new((int16_t *)dst1, src1 + offset, stride, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new((int16_t *)dst1, src1 + offset, stride, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_qpel_uni(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, + ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); + + randomize_buffers(src0, src1, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_qpel_uni[idx][!!y][!!x], "put_hevc_qpel_uni_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref(dst0, stride, src0 + offset, stride, height, x, y, width); + call_new(dst1, stride, src1 + offset, stride, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new(dst1, stride, src1 + offset, stride, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_epel_uni(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, + ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); + + randomize_buffers(src0, src1, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_epel_uni[idx][!!y][!!x], "put_hevc_epel_uni_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref(dst0, stride, src0 + offset, stride, height, x, y, width); + call_new(dst1, stride, src1 + offset, stride, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new(dst1, stride, src1 + offset, stride, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_qpel_bi(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src00, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src11, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, + ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, + int width); + + randomize_buffers(src0, src1, BUF_SIZE); + randomize_buffers2(src00, src11, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_qpel_bi[idx][!!y][!!x], "put_hevc_qpel_bi_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref(dst0, stride, src0 + offset, stride, (int16_t *)src00, height, x, y, width); + call_new(dst1, stride, src1 + offset, stride, (int16_t *)src11, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new(dst1, stride, src1 + offset, stride, (int16_t *)src11, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_epel_bi(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src00, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src11, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; + int offset = (AV_INPUT_BUFFER_PADDING_SIZE+4*PIXEL_STRIDE)*SIZEOF_PIXEL; + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, + ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, + int width); + + randomize_buffers(src0, src1, BUF_SIZE); + randomize_buffers2(src00, src11, BUF_SIZE); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.put_hevc_epel_bi[idx][!!y][!!x], "put_hevc_epel_bi_%dx%d_%d_%d_%d", width, height, + x, y, bit_depth)) { + call_ref(dst0, stride, src0 + offset, stride, (int16_t *)src00, height, x, y, width); + call_new(dst1, stride, src1 + offset, stride, (int16_t *)src11, height, x, y, width); + if (memcmp(dst0, dst1, BUF_SIZE)) + fail(); + bench_new(dst1, stride, src1 + offset, stride, (int16_t *)src11, height, x, y, width); + } + } + } + } +} + +static void check_put_hevc_qpel_uni_w(HEVCDSPContext h, int bit_depth) +{ + int i, x, y; + LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src0, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src1, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src00, [BUF_SIZE]); + LOCAL_ALIGNED_32(uint8_t, src11, [BUF_SIZE]); + + for (i = 0; i < FF_ARRAY_ELEMS(idx_width_map); i++) { + for (y = 0; y < 4; y++) { + for (x = 0; x < 4; x++) { + int idx = idx_width_map[i][0]; + int width = idx_width_map[i][1]; + int height= width; + int denom = rnd()%8; + int wx = (1<