From patchwork Mon Jan 22 15:25:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 45710 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:120f:b0:199:de12:6fa6 with SMTP id v15csp44434pzf; Mon, 22 Jan 2024 07:26:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmJEO1RLSh9BiTJvaKtHYwbEY+qHIiM4tBK6NGDzPH8ooOLsbmTKqa0GkZDJ+fqwqLafaP X-Received: by 2002:a2e:6e07:0:b0:2cd:1ca5:282c with SMTP id j7-20020a2e6e07000000b002cd1ca5282cmr3930975ljc.5.1705937174262; Mon, 22 Jan 2024 07:26:14 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m16-20020a50ef10000000b0055c47ec2407si857346eds.634.2024.01.22.07.26.13; Mon, 22 Jan 2024 07:26:14 -0800 (PST) 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=@outlook.com header.s=selector1 header.b="tek6Sq/w"; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B35068D04A; Mon, 22 Jan 2024 17:26:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2102.outbound.protection.outlook.com [40.92.99.102]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 282D368CEE5 for ; Mon, 22 Jan 2024 17:25:53 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZwDcSk7/akLkmxYiaH7ciuVfHn5pLesqMTO088wQrMaU6aAzZneE6TyfuzGc+8SVO16igAwP/hUoB3LeQGs9mxMKbMODd+GXtf0JrproX++d1M2cw+BPfzjnq3s6dbuVKbmyYDBIryIW0IGpeXldk6h+9PcLm6lH0uQJuNMD1hTiDx+lEhdByOV5Ohz/PMazfEQ9dh4o4ZbaDLzTu55eDUQVfDOUU7to3vZIblOrLJvrVNBgy4vWUd8H2RpdbETmfmdKBMS4ILZbldEqOm8FGy4JnVVGgrwUUcAWoCpP/orUy+tw6jhvJpkXYs/uV37pd7A8280VZr1EgcMftexXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o9p+JWkf2/gi0FVu/oZcjQ/tbdr260lXxz8jg8iDHco=; b=cCfz9bFIQzh/9K63hzFY7yOOHScy4m9KtaGYHqbA9KbL8Zjft4GnEbF1duw8tNKQoVQmDi8fHMIAW2uDgl3bLMFYGTcKxXBtGPfcGbtTECLhjUQOKvjq06OL49WGwjCRpJYk46dpCHB7WLmwhCeWSsSyX0GHXdj37NBHb3Tnu28kq+7xo4EAlFxKuIKq6jwe9fpdh/ETH+CLAqM/5f9dbumyB4DfuJQAUJnDq+t0Ws4JqH4t3gHSCYwFpF/3Iv8QQFDFGobcyDq+gMPDZsEK6om5nJlb5ganQmi3K5b61aVWirlOfTwQd4p9VnnRbNgOqvtGVHlKMUCWKW47nmQ8Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o9p+JWkf2/gi0FVu/oZcjQ/tbdr260lXxz8jg8iDHco=; b=tek6Sq/wyBUAcyhEIG+rObyM8iems6+ZPrq2l5i11bvAniGwnHaZCgs+VnfVfhLSyQTGytK8+hHo4v1Bsdn5wOCtp43VxltKy8XJPHNSSpz/DfQjgVp7hm4floqXwz79DXwt3i42mTwXU4hT7R++ZlK0DwaGmfIJx4weQA6URMDn/KcxRJa6ZWk/xR7s8idEBOUmG18eQ4VQ7xy4C64yapftnJrRVfj/bDEIh8OrOHZV7Dn+78j+M0r7Dpln7fyOHUbPvIwakTG4Ytc81E/6HwJjvCkBwm1whoxUJm8Ie2CzgAU40qY/LHHcdpr+rAYyZUskO9Bki5/A8PLMd3FN+g== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by TYCP286MB1682.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:184::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.36; Mon, 22 Jan 2024 15:25:44 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::86fc:6255:f4c1:a076]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::86fc:6255:f4c1:a076%3]) with mapi id 15.20.7202.035; Mon, 22 Jan 2024 15:25:44 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Jan 2024 23:25:21 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122152527.601122-1-toqsxw@outlook.com> References: <20240122152527.601122-1-toqsxw@outlook.com> X-TMN: [soqM0lfvAYIRDnYZodArWQ/U0Xl+3z6t] X-ClientProxiedBy: SI1PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:1f4::16) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240122152527.601122-2-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|TYCP286MB1682:EE_ X-MS-Office365-Filtering-Correlation-Id: b63946f1-1aa8-4903-395a-08dc1b5e66a3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1BUDPTlFVcwI2Y/V8EjyfhaRp3vhZ+7/jot/ePOC/Q0UaOvSBmCgzZM82hn4fpBmKMwXSDXHcCjKx16Lo7OEq6gFy3cgRloLj/u8R6AuilFR/Rm52jf5VAN+UrDBkC06P4kxNr2guMnBc4/HgBOC5JqMsr6hvDlPP7Ct/ZJ3u414C7OgKYjNm02ky6f0iAB4TGPb9EEFTSnCaQiYSTBmwy2mihGHtzCPsJkrX77H1epySc9WwJFIlSdwULXL5tc9PvKYRu+7vVVbeddMhVmUO9zWkI6zoNqWqIn5+z3Ya7DBOQ3DBturyUsbBLBM9/Qy5obSyKd+6CtWH34qXFkVZcQrqNKou8IdvvBMWYBgWkxboRCbdBb67sJfD127UnmOzXkK2ICwzdtx2EeIg4WvNfjwBiOIKB4eekTemu4KgXzAKM3o7vbiL8Wf641V7q8d7O83FQXOs9GVd6I3xyCu7ql2Ip+AO+u/maHVTUCi82VcjbCSxeE0Clty8N+Cn4uUUn2TsAukQjaCH8CHMls+qSSvsupLaqwSCnWP3x/3uRSxxL9Sj2+uuNXSnqKruVoHCeV98HSbmqhvfMnoxhKndClhFJbKwBjM3DMLe1vsCyqUV+CEcJONdAf4u8bkBYy7 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KqhfsgzMPAIE34J1y8CVAGxIhYdrCN6jHwUdSiipvu30oR2Q9rfwmS6dUt2PlhOdK1n6sufWJFlNr8fmyTLiBWVvJNVW+XY/p4AnikyYh2IXf5sRYxrsD3SXH42Ot3LibgWshLgvLDsJ4/wvi0wNiaty+8PCJOFK8uRAOEvDz8JOFtSEMcje3z9cKQ80W9FkpoV/Dd5UpsEW4vvXFqOr9DPRPPGHMDxnKnS9H0yHpz10NbBboksMhyoMmZSNK+XJelnqKgvvLlw8t4Y07NDb5vxtjLvjxGfKC1kVzbYo9CpNI8BMwfjK72bXbBd+7sBAmtdYbWK5Cw7M3FkDaHOOxa5ag4OnZpMA8+2RDagPt/DbSKRkiQ4WP75cfG6X2SQMgeGW9Ma/ik4Cx7v/TYheYZ9pSMi9Sf8CW3JbSbhDK3c7KYYJz4iK3zsizGTp0njx8M5kKEHgK0X6ePOiccOplGDSQlVNEoqEPQgjWIkKUznt6SqcqynFaohGsWgWBA0lo41EVmqeqnsbLpZ2tED6Mx3V2kbN6U9fdX487oetBWvXQoA3bLPww5vhavAfzhZJxDx2hxDA/ntN9qZzvv05EJ9V9O7O9CDeMJSapayqytTG9cBVXcPCZdWoYcUdTGCegS7r52Lv0EedU1h92hIRbeyJ/0s6zmUtvJRWCuvCf9eZUymrfd0Bq1k4eN+FuLPIyqjMLHjFgjU9XG6nwb7j2tu4gPhBBLDMpgYhm4heTkJ+IxhcRGRHH9QIFUK8wVz4bVL7/yBbfD+dgeKSUuCu09N7VFC6vlEmK2OdcPZmJZudtNDhpeooZmspa65RNsVWaTn+Oxjq5EYqly31peYpsEnYKdMwvLW6bTUts8nsI2oEgltfNmQogLOSQDGK4f0hUihFyUeUL7mDpdjlYSWXVIzdoK774UzPfuun1ygNcPQYgrBVqS+8upj5EiPptIsZAWuYsjlXVYwpTCh0LQVYhxDrHiRjrkg7VReZVVQ1EOdrm2KBWPRfDCeIuKNc5j3Q5mxsCDifEXqItz1Mnq/cMH9+a1uQb55eimtUVQ85PGX4EN09ZtisRQ/0WL0cy/6nS+e76MSBLWoVoIN2EepKB6ajJ7UvjvEFC7V0Bb0e9kbnQOJLXn6OGTd7ExXRSd/CS1B5H2R15RrBnsGGd3Q4ZMts6GYv0p7u1r6ygUwYlQmLR5Qi2jjBBzrvp4wyKH3wu3AwkZP3VPf5NO54oDs0WnXPnQN2zdHSXxxIGgB6pTg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b63946f1-1aa8-4903-395a-08dc1b5e66a3 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2024 15:25:44.4869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB1682 Subject: [FFmpeg-devel] [PATCH v3 2/8] avcodec/hevcdsp_template: reuse put/put_luma/put_chroma from h2656_inter_template X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xE0t2syzVJwC From: Wu Jianhua Signed-off-by: Wu Jianhua --- libavcodec/hevcdsp_template.c | 594 +++------------------------------- 1 file changed, 46 insertions(+), 548 deletions(-) diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 0de14e9dcf..9b48bdf08e 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -26,6 +26,7 @@ #include "bit_depth_template.c" #include "hevcdsp.h" #include "h26x/h2656_sao_template.c" +#include "h26x/h2656_inter_template.c" static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int width, int height, GetBitContext *gb, int pcm_bit_depth) @@ -299,37 +300,51 @@ IDCT_DC(32) //////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////// -static void FUNC(put_hevc_pel_pixels)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = src[x] << (14 - BIT_DEPTH); - src += srcstride; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - - for (y = 0; y < height; y++) { - memcpy(dst, src, width * sizeof(pixel)); - src += srcstride; - dst += dststride; - } -} +#define ff_hevc_pel_filters ff_hevc_qpel_filters +#define DECL_HV_FILTER(f) \ + const uint8_t *hf = ff_hevc_ ## f ## _filters[mx - 1]; \ + const uint8_t *vf = ff_hevc_ ## f ## _filters[my - 1]; + +#define FW_PUT(p, f, t) \ +static void FUNC(put_hevc_## f)(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, \ + intptr_t mx, intptr_t my, int width) \ +{ \ + DECL_HV_FILTER(p) \ + FUNC(put_ ## t)(dst, src, srcstride, height, hf, vf, width); \ +} + +#define FW_PUT_UNI(p, f, t) \ +static void FUNC(put_hevc_ ## f)(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ + ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width) \ +{ \ + DECL_HV_FILTER(p) \ + FUNC(put_ ## t)(dst, dststride, src, srcstride, height, hf, vf, width); \ +} + +#define FW_PUT_UNI_W(p, f, t) \ +static void FUNC(put_hevc_ ## f)(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ + ptrdiff_t srcstride,int height, int denom, int wx, int ox, \ + intptr_t mx, intptr_t my, int width) \ +{ \ + DECL_HV_FILTER(p) \ + FUNC(put_ ## t)(dst, dststride, src, srcstride, height, denom, wx, ox, hf, vf, width); \ +} + +#define FW_PUT_FUNCS(f, t, dir) \ + FW_PUT(f, f ## _ ## dir, t ## _ ## dir) \ + FW_PUT_UNI(f, f ## _uni_ ## dir, uni_ ## t ## _ ## dir) \ + FW_PUT_UNI_W(f, f ## _uni_w_ ## dir, uni_## t ## _w_ ## dir) + +FW_PUT(pel, pel_pixels, pixels) +FW_PUT_UNI(pel, pel_uni_pixels, uni_pixels) +FW_PUT_UNI_W(pel, pel_uni_w_pixels, uni_w_pixels) + +FW_PUT_FUNCS(qpel, luma, h ) +FW_PUT_FUNCS(qpel, luma, v ) +FW_PUT_FUNCS(qpel, luma, hv ) +FW_PUT_FUNCS(epel, chroma, h ) +FW_PUT_FUNCS(epel, chroma, v ) +FW_PUT_FUNCS(epel, chroma, hv ) static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, @@ -357,30 +372,6 @@ static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, co } } -static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel((((src[x] << (14 - BIT_DEPTH)) * wx + offset) >> shift) + ox); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -420,96 +411,6 @@ static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, filter[6] * src[x + 3 * stride] + \ filter[7] * src[x + 4 * stride]) -static void FUNC(put_hevc_qpel_h)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_qpel_v)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[my - 1]; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8); - src += srcstride; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_qpel_hv)(int16_t *dst, - const uint8_t *_src, - ptrdiff_t _srcstride, - int height, intptr_t mx, - intptr_t my, int width) -{ - int x, y; - const int8_t *filter; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - - src -= QPEL_EXTRA_BEFORE * srcstride; - filter = ff_hevc_qpel_filters[mx - 1]; - for (y = 0; y < height + QPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_qpel_filters[my - 1]; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6; - tmp += MAX_PB_SIZE; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; - int shift = 14 - BIT_DEPTH; - -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -538,33 +439,6 @@ static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const } } -static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[my - 1]; - int shift = 14 - BIT_DEPTH; - -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift); - src += srcstride; - dst += dststride; - } -} - - static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -593,46 +467,6 @@ static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const int8_t *filter; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - int shift = 14 - BIT_DEPTH; - -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - src -= QPEL_EXTRA_BEFORE * srcstride; - filter = ff_hevc_qpel_filters[mx - 1]; - for (y = 0; y < height + QPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_qpel_filters[my - 1]; - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift); - tmp += MAX_PB_SIZE; - dst += dststride; - } -} - static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -673,33 +507,6 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, - intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel((((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -728,33 +535,6 @@ static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, - intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[my - 1]; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel((((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -783,47 +563,6 @@ static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, - intptr_t mx, intptr_t my, int width) -{ - int x, y; - const int8_t *filter; - const pixel *src = (const pixel*)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - src -= QPEL_EXTRA_BEFORE * srcstride; - filter = ff_hevc_qpel_filters[mx - 1]; - for (y = 0; y < height + QPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_qpel_filters[my - 1]; - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel((((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox); - tmp += MAX_PB_SIZE; - dst += dststride; - } -} - static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -873,94 +612,6 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, filter[2] * src[x + stride] + \ filter[3] * src[x + 2 * stride]) -static void FUNC(put_hevc_epel_h)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_epel_v)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[my - 1]; - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8); - src += srcstride; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_epel_hv)(int16_t *dst, - const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - - src -= EPEL_EXTRA_BEFORE * srcstride; - - for (y = 0; y < height + EPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_epel_filters[my - 1]; - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6; - tmp += MAX_PB_SIZE; - dst += MAX_PB_SIZE; - } -} - -static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - int shift = 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) + offset) >> shift); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -988,30 +639,6 @@ static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[my - 1]; - int shift = 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) + offset) >> shift); - src += srcstride; - dst += dststride; - } -} - static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -1038,44 +665,6 @@ static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - int shift = 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - src -= EPEL_EXTRA_BEFORE * srcstride; - - for (y = 0; y < height + EPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_epel_filters[my - 1]; - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) + offset) >> shift); - tmp += MAX_PB_SIZE; - dst += dststride; - } -} - static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) @@ -1116,32 +705,6 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - dst[x] = av_clip_pixel((((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); - } - dst += dststride; - src += srcstride; - } -} - static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -1168,32 +731,6 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[my - 1]; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - dst[x] = av_clip_pixel((((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx + offset) >> shift) + ox); - } - dst += dststride; - src += srcstride; - } -} - static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, @@ -1220,45 +757,6 @@ static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, } } -static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, - int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) -{ - int x, y; - const pixel *src = (const pixel *)_src; - ptrdiff_t srcstride = _srcstride / sizeof(pixel); - pixel *dst = (pixel *)_dst; - ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_epel_filters[mx - 1]; - int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; - int16_t *tmp = tmp_array; - int shift = denom + 14 - BIT_DEPTH; -#if BIT_DEPTH < 14 - int offset = 1 << (shift - 1); -#else - int offset = 0; -#endif - - src -= EPEL_EXTRA_BEFORE * srcstride; - - for (y = 0; y < height + EPEL_EXTRA; y++) { - for (x = 0; x < width; x++) - tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); - src += srcstride; - tmp += MAX_PB_SIZE; - } - - tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_epel_filters[my - 1]; - - ox = ox * (1 << (BIT_DEPTH - 8)); - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[x] = av_clip_pixel((((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx + offset) >> shift) + ox); - tmp += MAX_PB_SIZE; - dst += dststride; - } -} - static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1,