From patchwork Sun Feb 11 08:23:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46175 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp81268pzc; Sun, 11 Feb 2024 00:21:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVCeiU5HwCebw69gY+UED6DkJ6B2X4d9IvJzLoyy1s3Hh/OIaPqbXAH3KW9QrDUMLs7ZnCsv86OCWbjvRJ7cSIFgrjOD4IlxkjNag== X-Google-Smtp-Source: AGHT+IE+ZrrTXYhfuC/N1vN5CriZXCHWLPEIB5e2o9KdbaR0MDbcabOO3C/tK4OjuS07ZUuNQL6v X-Received: by 2002:a2e:81c2:0:b0:2d0:d02e:26d8 with SMTP id s2-20020a2e81c2000000b002d0d02e26d8mr2604613ljg.32.1707639692442; Sun, 11 Feb 2024 00:21:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUMdgftxDDhVPH2VFhxQDNC9loCFLeiKT9fQ3VjCUGfoJsIJoofmthJmU4EmK6xSUhLLoaf2mWFFmqX9fPOh2oA4SjE9z7RRS/fQ3e7Uwhn3gpyRXYB9K2N0YEOcwH2GWE9MvREBsDZPMwqCP19jCh7tLtTQ+1NbBx9lU2vsFKNW1ZPVr7QNJqNtiSXQXsXYTYP1avqf5n45sgaJraTC23i5cdCokLE57VmgkFl7MAIinn0lCKUPVxl36qa7KZJYAWnhYiyEziQlBy9B5YJt3gu6vvlKDMXx4hvW/zI7PDTuVeaeSdtsIeJAG5T4NRqMX9X2ltf28M2EDXZ4CmdxHkj7QWfpTwUCkp+e9Ib+ZhqhHWPUaFL+zSCcgv7m5GaUoxmfYifqPLBSfWUSUN4p2CcvNlmAbVbszUVdHTuRMuDnkevSuoak3YkUHcnSQYLkZzmhPPeVwU6+HFBVj0kNQ9iAhOpR6YbtWsesUFZw8vFqOqV+qBcUlZVnJUCvikv6RhgSLIjmGE+oP1PCUNhL2g5t96bQY5Ht2W3GjOizMsneajvXgTBvObVRotGoCqvCh6NgknML53RoBBhiY1R8C6OOSXWxGQtzvkb66GZ+7hAX5ISvPZEpVeZxUkdWDXvbRLanW29V7S1UDSWPLDwgjHwUbTpNxMTYX/vZ0WsUBosNJDUe2VGFYDIrbOOcsxpb38gQFEambHyAokClu4FHmW/vXjl+hAdPUYN2vsYSUVmtEqlKmtg4FxElap3l0OCaMIxU5yp4AItqxkSysL1KO5c3mM6oxgqSufq2F5/Ag1Lwo2fLL1sSDqV9SK/XcnpZVEeqdZOa4WT7ScG2G6tbqU869i3ram4k6BMXD34h9K2wltDWx4mnrDGY7QqYPcCeW4ExEY97Ne+3XXnbPkALRb8mRA7eSK1mCiLYYjLwMC1dD0b15l7rKUi/S3Lt97zaEkyiw hbO941Rmt4u8gyqc4AzO99O00QzMVYjbZuA0jtenD6oSwzeeUrgmvBnzCgJFnAn417Yt78PoIPjdI2bFH+ksNWeKneKVgxieKD2IDY6ExdaXuA8/FcgdAMAbR7RGC94KrJTJyXEPDaEUEuUNTft5Vg2AQJl6+N84lP3SZTMc6BECqKjozcK9GwZcNZxoDXaLKXg0eo3TviQ0c1mJmEd5ED6Y93XWadsn9VHfhkc33UdZTjxFeAjSB+KL1ek0sEPYToRkF9Kz4ZnlQV7Q36DVAGtuK/nW7EmNKdui4r2XSyDqfh4h7AYR4cTQuCSzAvwq/zDcjokIWE58qQEGkvnbMi+0KAYZBtGGrro1oguFxSZ8dBypTNIaL5UK4WYZHYq4V5ypa9GiAu7VibS6x/S0QNrhQbOObKIPW77Zo0vaXxw090+BhGMYfbCEghJSwLuigrsNTLEl4ChOsBaTbfu8pxdifCrh/EJp51v01IcWHEygqJP5kUD7YccCqyPSKSBejNi4vgYCatGp0rHcAbIKEcAwHK1PuzsxbwSv6gmMA1NAKhWG4Lal5yoSDrPQra0rHKFfkQ/uRA6JqegPaaTCaNEczMyr8X9V3mSQ== Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u30-20020a50951e000000b0056161ec901dsi1497358eda.622.2024.02.11.00.21.31; Sun, 11 Feb 2024 00:21:32 -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=awaOMOSq; 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 6478768CD4B; Sun, 11 Feb 2024 10:21:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2109.outbound.protection.outlook.com [40.92.73.109]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1DDD568CD4B for ; Sun, 11 Feb 2024 10:21:21 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XLJ7Sj0aHueVqCr9PdIhiy5sYPR4BOHNE1dTMsInHD8OZqy8W1tlQCVslpXuYK3tZ64xI5jh5I5mCNnA7rSKyNt6MkHBlaKLhTT33LJDi7ORM+gcOg4GSfxg5twdoTiLrIaWAyoBh98jmltkJR1eDd/oHGbHC6elXLVYTwGYfEWVBgMIvUv6bBaaIn5/kGZiCFLKOd9p51I43P6dWLRO+qv8d9y0XWYE+dtP6ORRgxeOCiSJRH2zjNMlWdNZNXRJtQ+PFMIsav3yGYMM9JNbrHJPxN93FHRDdcVspSmm6uFf21q90hET45Wy7cFJpMPssKMKJ+WFOM3CDpl/xdbrkA== 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=o5tNcbea/5jAaFuJXzcEp5Mdbg4yldSRSMdmkNl71zw=; b=Usd4lfmsQ0DqAL6iDAEE/nUlLaLVvXJAzzjwxUKoC0C2i5VuVOfmKAZOFJ/7+1UPvV2ycn6rkrXCjOnw3jgoBMhtMsuKxhD01wPLHjz3jV7WWNI6Da6xWJPRSaSqkDMfxsungYJ2s0Tqwn46segqfrNEpSElufU3Err0pcLrtsI+VArwPBS7nrXc2496JscPlfdoxOXQllbgMtQqdnjafhXVZPib6Q6IMt6yC+JcOW8EdwFgmCamB/Xjd9DaYBnI88tvw9zY+LDmj7zBReWnIxDDhv6KoBBxXzm4aOCsN+Aq0y43ra5CQdLikCmYlXInBLC7OiZw5s5ew1V/m+lBXQ== 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=o5tNcbea/5jAaFuJXzcEp5Mdbg4yldSRSMdmkNl71zw=; b=awaOMOSqY+XjrB1Bv2fKoLaJ9SwZSI5vSiYfIUBtoLdENkop8SBQCuClhuyL/X4JqcEYAKkTFlOtoh5sWLeqWKJ83FllXmqoKg8KoKifpmmNF7drn2qGz+LPeUUJifJ4U6/7D3ZYJtgfcYpRUfH3Pip8yvhRDW3pWjM0fHXrH+wP7GM8TGegfKj+jnUdDC1C32uaFGSJbixpiDUoV9qEyac2KWeprko7srEhHJH0pVTt0UO3r7HHNGVQEp1HWsQt3m8iNpaQl2NknRK96240AAdN0A9PhSCIZKk2908ZVEJS3dJZ7waRg5a6dwle8DvkZME+D6P9rhlINH1Z07KTJw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0388.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35; Sun, 11 Feb 2024 08:21:17 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.033; Sun, 11 Feb 2024 08:21:17 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Feb 2024 09:23:02 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [O68aU5nJ2Sfazu26dsn4v16yBlcRSGRHJhkCdql0dTw=] X-ClientProxiedBy: FR3P281CA0167.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240211082302.2809408-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0388:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f8294e6-6e33-4b9d-daff-08dc2ada6b5c X-MS-Exchange-SLBlob-MailProps: YfhX3sd/0TUSvyb7a5WmO4587D1qkvE8pyEXSKZ6z6hvlk8aH8KL3L302NMHbUn9g1tbDqCU6lf8VuL/Kxs6ebN38dEQFMc8MjvI947Fi5wD5IGaPmgwosrV7nxPbbIXyYE2W41dgxr5qAjLwf+gBoSvhmYb8z7En/P5i88sdN/KBG0iwOdoBwxzSY/EnfIQ5bDKVeOkgilArwefURaFTc9IZBVe8PMSkgoFK/8NjdyeWR5qi5++jt6/4BMlkaXugKYwYaEOBf0/J8J6yGRaOh4fobrwTeh8p/PXKp2cG/WqEmL/OuP+l3MdWUoTSFDN50I0aOxC2X1vbrchXJQj1DnJlyu0K5CXI2hPvn5HJNuK9+gde24ZsT8J7Yx5xDRc2Oy5lv7GEIEarwj0KN7G0O1StFrpcfLUMTgaCy17v+dUCHqbjRVQD2CbiawnFmZLBSjTTkZzGN1EQm1paubz7Dpkw5/oV5pT8w8B9RqI+cUIx9P7wMa+/LpCKkgd6uFAAVi4HtXo2VyW6GGcTMvB9OKQ/6uIZtlBkpomTRk9RePb/Yo1si3N+ENEUAgMBsUIvaB02Az30X3RNafi/eq5rldVItCF2HBksGaYlcutvV0K3I1z2IFVyc/ufXCuGNCVrVg+kxIko4FY1F0bZgafxBZs+9jZiox2L2dSEnz99n2V0wvphiRUvq3+yWDAwF3hE2GI/sahg8S2DaTrxJHDIxMxwcFpKJbYXiXXfEppGrEyNEBbEKGzSOrB6qYDowoS77W92XL4GZ13f8b1YG1nEoaicVHkfZpF6paa1jvG2fg= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uUU+Cvka/lg5+n716/r636KTZ9bAkUSFB63B9qPLELE99ziqmbI4aMqMcc6GAzUsb2JYiwsT+CffYGTCEbuaf0dWGkS6rPGRk/1XsLUPsAPLyL8pSR1ci4tIwkdIlqqqFVk+8tlGmmQQAvlfWwUOOVzbwa5W7UnzCG38anmD43Hc90gbLd66wCAm0+Ux2uuOl2jI8c94oe0Th0AXRCXVLwo+TyYHpHkOs6X2BTYPnKEr2xG0uQE0iJ+26vQeLZKVbKVTyDEGEepAEATLATATXvsGtIRI/0/IN5M+r9PvkM1LyjCYyBYQSOwerpfuQkid732DZ97BEpESMy4hG+q+/tlO51VF59h5YlkM4VB20uC5UmHrPvYfot12BptKcIQbJMitTWnlcU1YVNOd/pbdxOjNBvyiLhGVdtzy3K2Y1rT2+fIzLtA2BHWtJVWD35EEzzaJ1kh4Ogvc7tNlV8ZHa804INtj6TyHdpo+ZJ8lK/8b5X8zSd3CPnNtXni5SGnIEbDZvesMKDJb7wVTGouY5Czs5PQnmyitM0BINt2j3FyLBWbGaFQVpkXRUHGZ3bX4nQiCmuxyRGKNU2becbiSL7g/VOeFO8FRGwm5Cz835cI= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VBiMohstCC3gxPM6JQqC6Q6/2Ae7OasJaXyK97MQCVGW/XbsijbH0XaoYb5TR/OEMvjm2ezwkOMEsJFaqCyrYyeIyvC/baqvz+dLzN3wvXITOCYkIEzz7Hxqvm2rZ+abZoji+PQhJxnz7BocmTQbIS+bJofaVUQ8SxI4DHPo9jl0yKrp1HrAPwg8Kjffzpw3OQIQmP3ikdKh898rDv7riWGCWbF59f/ROUgnxNusrpIzVkuHU4T/pF+OpT/VkHnG+NJlFnyclvw7LkXm6seiOVV2epSIKGioQEjBb8u/mR/uwzPQRUfrVQ2tGXOvlrgtqqorXhpYC7h9moUbEjJjiFxQuZuNhz9xmzaT2Wbltqj7TAYOV/FMoQrqqvrMuMOJPt5eTN9a0p448WCpFe/UBYtYNgxlHmVjdgHjHqAjujpqPBtPhm7q0oXo4U6OSksD/0SfgeVtHplwrzZ3EQvL7BWd+7Lp+Tny1yKxYIfqrLQ3C+FLOovbCrCjRYOVtkfDxR8/rtIrPKqHp6yVl4SXJDhtgHWxhEjliCBOc5hd8K8I+jh9A+BdyANGeiOvVGdzrEuWGY1a/Z0lGwkyQBI7fHsMqoDRMh800FgbQULRBq+eyFRGicg9L4sTz8UVklVIskwprlNHSJXwpu69grOaUW58HV+Hr3oiHS/zCLQ/fGClTKfio4Icw/FD5fjtpjqGy//gFioxK6zyrz78AbfeR6W4n0VhiOszD5a8tvR5X8IGLS7RTTPiSYElUtB744YfpcWzwdEj89CtgSyzVcUyDRLuHte26P6SWaGpvH+MbqvyAvdYtGEXWY2BrU5rVGT7uTk6pj2R4J/nPzcHAM3/fGilwujuWMZWHeVFXLLcVNmHXjArAuElqFkmJuyysT+I6W2V22vTr/1BDOccfLG9BbVzdisLCLDh8LLphEYzOVVDc06Xqwpiww60SA1ygumjgJ9enl8fPTh+zUqQBbcNps5abTmg9TtiGvmpJe1i6UEBipZfIPOD+RJhXm+jVB6z697uI4pXekLVXI3372HHCimjzM1MObdAi2hQwcQBSQlY9lHExc19lo4kfogwJydmnCw/9sTaZMZldz41mEmKPEv/ki0kCBloMrC9k2lhlQOKQJ2yZpz8Q1c7xyyQB37l/IqumNZlCdq/IY93vZsKRylPcej2LPmGfIh2hXoN+GGrDw/WXP2FIf3vW9bsE/YJFC5GS6JBgFzS9TYBtbg3nzWb8LOSjAJAd1xGE947WbTxqt1QAsTIXGXF+gnY5jUjwJP+SImZuDohBROWJki7vA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f8294e6-6e33-4b9d-daff-08dc2ada6b5c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2024 08:21:17.7034 (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: PR3P250MB0388 Subject: [FFmpeg-devel] [PATCH] avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressing 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CYgdnOaP4jq2 Besides simplifying address computations (it saves 432B of .text in hevcdsp.o alone here) it also fixes undefined behaviour that occurs if mx or my are 0 (happens when the filters are unused) because they lead to an array index of -1 in the old code. This happens in the checkasm-hevc_pel FATE-test. Signed-off-by: Andreas Rheinhardt --- The loongarch and mips parts of this are untested. Luckily we have a loongarch patchwork runner... libavcodec/hevcdsp.c | 6 +- libavcodec/hevcdsp.h | 5 +- libavcodec/hevcdsp_template.c | 38 ++-- libavcodec/loongarch/hevc_mc.S | 224 +++++------------------- libavcodec/loongarch/hevc_mc_bi_lsx.c | 6 +- libavcodec/loongarch/hevc_mc_uni_lsx.c | 6 +- libavcodec/loongarch/hevc_mc_uniw_lsx.c | 4 +- libavcodec/loongarch/hevcdsp_lsx.c | 6 +- libavcodec/mips/hevc_mc_bi_msa.c | 6 +- libavcodec/mips/hevc_mc_biw_msa.c | 6 +- libavcodec/mips/hevc_mc_uni_msa.c | 6 +- libavcodec/mips/hevc_mc_uniw_msa.c | 6 +- libavcodec/mips/hevcdsp_mmi.c | 20 +-- libavcodec/mips/hevcdsp_msa.c | 6 +- libavcodec/x86/hevcdsp_init.c | 4 +- 15 files changed, 112 insertions(+), 237 deletions(-) diff --git a/libavcodec/hevcdsp.c b/libavcodec/hevcdsp.c index 2ca551df1d..630fdc012e 100644 --- a/libavcodec/hevcdsp.c +++ b/libavcodec/hevcdsp.c @@ -91,7 +91,8 @@ static const int8_t transform[32][32] = { 90, -90, 88, -85, 82, -78, 73, -67, 61, -54, 46, -38, 31, -22, 13, -4 }, }; -DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters)[7][4] = { +DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters)[8][4] = { + { 0 }, { -2, 58, 10, -2}, { -4, 54, 16, -2}, { -6, 46, 28, -4}, @@ -101,7 +102,8 @@ DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters)[7][4] = { { -2, 10, 58, -2}, }; -DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters)[3][16] = { +DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters)[4][16] = { + { 0 }, { -1, 4,-10, 58, 17, -5, 1, 0, -1, 4,-10, 58, 17, -5, 1, 0}, { -1, 4,-11, 40, 40,-11, 4, -1, -1, 4,-11, 40, 40,-11, 4, -1}, { 0, 1, -5, 17, 58,-10, 4, -1, 0, 1, -5, 17, 58,-10, 4, -1} diff --git a/libavcodec/hevcdsp.h b/libavcodec/hevcdsp.h index 1b9c5bb6bc..a5933dcac4 100644 --- a/libavcodec/hevcdsp.h +++ b/libavcodec/hevcdsp.h @@ -126,8 +126,9 @@ typedef struct HEVCDSPContext { void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth); -extern const int8_t ff_hevc_epel_filters[7][4]; -extern const int8_t ff_hevc_qpel_filters[3][16]; +/** ff_hevc_.pel_filters[0] are dummies to simplify array addressing */ +extern const int8_t ff_hevc_epel_filters[8][4]; +extern const int8_t ff_hevc_qpel_filters[4][16]; void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth); void ff_hevc_dsp_init_arm(HEVCDSPContext *c, const int bit_depth); diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 9b48bdf08e..121c44c401 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -301,9 +301,9 @@ IDCT_DC(32) // //////////////////////////////////////////////////////////////////////////////// #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 DECL_HV_FILTER(f) \ + const uint8_t *hf = ff_hevc_ ## f ## _filters[mx]; \ + const uint8_t *vf = ff_hevc_ ## f ## _filters[my]; #define FW_PUT(p, f, t) \ static void FUNC(put_hevc_## f)(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, \ @@ -421,7 +421,7 @@ static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; + const int8_t *filter = ff_hevc_qpel_filters[mx]; int shift = 14 + 1 - BIT_DEPTH; #if BIT_DEPTH < 14 @@ -449,7 +449,7 @@ static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[my - 1]; + const int8_t *filter = ff_hevc_qpel_filters[my]; int shift = 14 + 1 - BIT_DEPTH; #if BIT_DEPTH < 14 @@ -487,7 +487,7 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, #endif src -= QPEL_EXTRA_BEFORE * srcstride; - filter = ff_hevc_qpel_filters[mx - 1]; + filter = ff_hevc_qpel_filters[mx]; for (y = 0; y < height + QPEL_EXTRA; y++) { for (x = 0; x < width; x++) tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); @@ -496,7 +496,7 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, } tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_qpel_filters[my - 1]; + filter = ff_hevc_qpel_filters[my]; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) @@ -518,7 +518,7 @@ static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; + const int8_t *filter = ff_hevc_qpel_filters[mx]; int shift = 14 + 1 - BIT_DEPTH; int log2Wd = denom + shift - 1; @@ -546,7 +546,7 @@ static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); - const int8_t *filter = ff_hevc_qpel_filters[my - 1]; + const int8_t *filter = ff_hevc_qpel_filters[my]; int shift = 14 + 1 - BIT_DEPTH; int log2Wd = denom + shift - 1; @@ -580,7 +580,7 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, int log2Wd = denom + shift - 1; src -= QPEL_EXTRA_BEFORE * srcstride; - filter = ff_hevc_qpel_filters[mx - 1]; + filter = ff_hevc_qpel_filters[mx]; for (y = 0; y < height + QPEL_EXTRA; y++) { for (x = 0; x < width; x++) tmp[x] = QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8); @@ -589,7 +589,7 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, } tmp = tmp_array + QPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_qpel_filters[my - 1]; + filter = ff_hevc_qpel_filters[my]; ox0 = ox0 * (1 << (BIT_DEPTH - 8)); ox1 = ox1 * (1 << (BIT_DEPTH - 8)); @@ -621,7 +621,7 @@ static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[mx]; int shift = 14 + 1 - BIT_DEPTH; #if BIT_DEPTH < 14 int offset = 1 << (shift - 1); @@ -646,7 +646,7 @@ static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[my]; pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); int shift = 14 + 1 - BIT_DEPTH; @@ -674,7 +674,7 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[mx]; int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; int16_t *tmp = tmp_array; int shift = 14 + 1 - BIT_DEPTH; @@ -694,7 +694,7 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, } tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_epel_filters[my - 1]; + filter = ff_hevc_epel_filters[my]; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) @@ -715,7 +715,7 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[mx]; int shift = 14 + 1 - BIT_DEPTH; int log2Wd = denom + shift - 1; @@ -739,7 +739,7 @@ static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[my]; pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); int shift = 14 + 1 - BIT_DEPTH; @@ -767,7 +767,7 @@ static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, 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]; + const int8_t *filter = ff_hevc_epel_filters[mx]; int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; int16_t *tmp = tmp_array; int shift = 14 + 1 - BIT_DEPTH; @@ -783,7 +783,7 @@ static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, } tmp = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE; - filter = ff_hevc_epel_filters[my - 1]; + filter = ff_hevc_epel_filters[my]; ox0 = ox0 * (1 << (BIT_DEPTH - 8)); ox1 = ox1 * (1 << (BIT_DEPTH - 8)); diff --git a/libavcodec/loongarch/hevc_mc.S b/libavcodec/loongarch/hevc_mc.S index a0e5938fbd..12d92e32e9 100644 --- a/libavcodec/loongarch/hevc_mc.S +++ b/libavcodec/loongarch/hevc_mc.S @@ -498,7 +498,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v4_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -570,7 +569,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v6_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -699,7 +697,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v8_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -778,7 +775,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v8_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -845,7 +841,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v16_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -940,7 +935,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v16_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -955,7 +949,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v12_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -969,7 +962,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v12_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -984,7 +976,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v24_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1005,7 +996,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v24_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1027,7 +1017,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v32_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1051,7 +1040,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v32_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1076,7 +1064,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v48_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1102,7 +1089,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v48_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1129,7 +1115,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v64_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1155,7 +1140,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_v64_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1275,7 +1259,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h4_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1325,7 +1308,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h4_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1364,7 +1346,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h6_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1385,7 +1366,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h6_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1408,7 +1388,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h8_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1428,7 +1407,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h8_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1450,7 +1428,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h12_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1475,7 +1452,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h12_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1495,7 +1471,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h16_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1518,7 +1493,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h16_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1537,7 +1511,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h24_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1565,7 +1538,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h24_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1590,7 +1562,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h32_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1622,7 +1593,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h32_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1644,7 +1614,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h48_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1684,7 +1653,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h48_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1709,7 +1677,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h64_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1757,7 +1724,6 @@ endfunc function ff_hevc_put_hevc_qpel_uni_w_h64_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter @@ -1841,15 +1807,13 @@ endconst function ff_hevc_put_hevc_epel_uni_w_hv4_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2068,15 +2032,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv6_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2094,15 +2056,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv6_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2120,15 +2080,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv8_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2146,15 +2104,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv8_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2172,15 +2128,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv12_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2205,15 +2159,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv12_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2231,15 +2183,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv16_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2267,15 +2217,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv16_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2293,15 +2241,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv24_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2331,15 +2277,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv24_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2364,15 +2308,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv32_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2402,15 +2344,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv32_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2440,15 +2380,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv48_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2478,15 +2416,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv48_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2516,15 +2452,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv64_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; vreplvei.w vr5, vr5, 0 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 vreplvei.w vr16, vr6, 0 @@ -2554,15 +2488,13 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_hv64_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 // mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters - vldx vr5, t1, t0 // ff_hevc_epel_filters[mx - 1]; + vldx vr5, t1, t0 // ff_hevc_epel_filters[mx]; xvreplve0.w xr5, xr5 ld.d t0, sp, 8 // my - addi.d t0, t0, -1 slli.w t0, t0, 2 - vldx vr6, t1, t0 // ff_hevc_epel_filters[my - 1]; + vldx vr6, t1, t0 // ff_hevc_epel_filters[my]; vsllwil.h.b vr6, vr6, 0 vsllwil.w.h vr6, vr6, 0 xvreplve0.q xr6, xr6 @@ -2596,8 +2528,7 @@ endfunc * int width) */ function ff_hevc_put_hevc_uni_qpel_h4_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr5, t1, t0 //filter addi.d a2, a2, -3 //src -= 3 @@ -2663,8 +2594,7 @@ endfunc .endm function ff_hevc_put_hevc_uni_qpel_h6_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2692,8 +2622,7 @@ function ff_hevc_put_hevc_uni_qpel_h6_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h8_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2720,8 +2649,7 @@ function ff_hevc_put_hevc_uni_qpel_h8_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h12_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2751,8 +2679,7 @@ function ff_hevc_put_hevc_uni_qpel_h12_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h12_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -2784,8 +2711,7 @@ function ff_hevc_put_hevc_uni_qpel_h12_8_lasx endfunc function ff_hevc_put_hevc_uni_qpel_h16_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2814,8 +2740,7 @@ function ff_hevc_put_hevc_uni_qpel_h16_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h16_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -2846,8 +2771,7 @@ function ff_hevc_put_hevc_uni_qpel_h16_8_lasx endfunc function ff_hevc_put_hevc_uni_qpel_h24_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2880,8 +2804,7 @@ function ff_hevc_put_hevc_uni_qpel_h24_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h24_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -2916,8 +2839,7 @@ function ff_hevc_put_hevc_uni_qpel_h24_8_lasx endfunc function ff_hevc_put_hevc_uni_qpel_h32_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -2952,8 +2874,7 @@ function ff_hevc_put_hevc_uni_qpel_h32_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h32_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -2987,8 +2908,7 @@ function ff_hevc_put_hevc_uni_qpel_h32_8_lasx endfunc function ff_hevc_put_hevc_uni_qpel_h48_8_lsx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh vreplvei.h vr1, vr0, 1 //cd... @@ -3029,8 +2949,7 @@ function ff_hevc_put_hevc_uni_qpel_h48_8_lsx endfunc function ff_hevc_put_hevc_uni_qpel_h48_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -3070,8 +2989,7 @@ function ff_hevc_put_hevc_uni_qpel_h48_8_lasx endfunc function ff_hevc_put_hevc_uni_qpel_h64_8_lasx - addi.d t0, a5, -1 - slli.w t0, t0, 4 + slli.w t0, a5, 4 la.local t1, ff_hevc_qpel_filters vldx vr0, t1, t0 //filter abcdefgh xvreplve0.q xr0, xr0 @@ -3122,7 +3040,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v4_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3260,7 +3177,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v6_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3275,7 +3191,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v6_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3289,7 +3204,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v8_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3304,7 +3218,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v8_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3394,7 +3307,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v12_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3409,7 +3321,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v12_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3425,7 +3336,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v16_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3440,7 +3350,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v16_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3456,7 +3365,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v24_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3478,7 +3386,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v24_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3503,7 +3410,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v32_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3525,7 +3431,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v32_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3548,7 +3453,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v48_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3574,7 +3478,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v48_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3601,7 +3504,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v64_8_lsx LOAD_VAR 128 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3631,7 +3533,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_v64_8_lasx LOAD_VAR 256 ld.d t0, sp, 8 //my - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3668,7 +3569,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h4_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3699,7 +3599,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h6_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3730,7 +3629,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h6_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3759,7 +3657,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h8_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3789,7 +3686,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h8_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3853,7 +3749,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h12_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3889,7 +3784,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h12_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3910,7 +3804,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h16_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3934,7 +3827,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h16_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3955,7 +3847,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h24_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -3986,7 +3877,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h24_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4015,7 +3905,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h32_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4040,7 +3929,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h32_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4062,7 +3950,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h48_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4088,7 +3975,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h48_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4111,7 +3997,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h64_8_lsx LOAD_VAR 128 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4138,7 +4023,6 @@ endfunc function ff_hevc_put_hevc_epel_uni_w_h64_8_lasx LOAD_VAR 256 ld.d t0, sp, 0 //mx - addi.d t0, t0, -1 slli.w t0, t0, 2 la.local t1, ff_hevc_epel_filters vldx vr0, t1, t0 //filter @@ -4166,7 +4050,6 @@ endfunc * intptr_t my, int width) */ function ff_hevc_put_hevc_bi_epel_h4_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4209,7 +4092,6 @@ endfunc .endm function ff_hevc_put_hevc_bi_epel_h6_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4234,7 +4116,6 @@ function ff_hevc_put_hevc_bi_epel_h6_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h8_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4258,7 +4139,6 @@ function ff_hevc_put_hevc_bi_epel_h8_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h12_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4286,7 +4166,6 @@ function ff_hevc_put_hevc_bi_epel_h12_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h12_8_lasx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4314,7 +4193,6 @@ function ff_hevc_put_hevc_bi_epel_h12_8_lasx endfunc function ff_hevc_put_hevc_bi_epel_h16_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4341,7 +4219,6 @@ function ff_hevc_put_hevc_bi_epel_h16_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h16_8_lasx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4368,7 +4245,6 @@ function ff_hevc_put_hevc_bi_epel_h16_8_lasx endfunc function ff_hevc_put_hevc_bi_epel_h32_8_lasx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4400,7 +4276,6 @@ function ff_hevc_put_hevc_bi_epel_h32_8_lasx endfunc function ff_hevc_put_hevc_bi_epel_h48_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6// filter @@ -4443,7 +4318,6 @@ function ff_hevc_put_hevc_bi_epel_h48_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h48_8_lasx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter @@ -4481,7 +4355,6 @@ function ff_hevc_put_hevc_bi_epel_h48_8_lasx endfunc function ff_hevc_put_hevc_bi_epel_h64_8_lsx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6// filter @@ -4531,7 +4404,6 @@ function ff_hevc_put_hevc_bi_epel_h64_8_lsx endfunc function ff_hevc_put_hevc_bi_epel_h64_8_lasx - addi.d a6, a6, -1 slli.w a6, a6, 2 la.local t0, ff_hevc_epel_filters vldx vr0, t0, a6 // filter diff --git a/libavcodec/loongarch/hevc_mc_bi_lsx.c b/libavcodec/loongarch/hevc_mc_bi_lsx.c index 48441c107b..d7ddd1c246 100644 --- a/libavcodec/loongarch/hevc_mc_bi_lsx.c +++ b/libavcodec/loongarch/hevc_mc_bi_lsx.c @@ -2224,7 +2224,7 @@ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ hevc_##DIR1##_##TAP##t_##WIDTH##w_lsx(src, src_stride, src_16bit, \ MAX_PB_SIZE, dst, dst_stride, \ @@ -2265,8 +2265,8 @@ void ff_hevc_put_hevc_bi_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_##TAP##t_##WIDTH##w_lsx(src, src_stride, src_16bit, \ MAX_PB_SIZE, dst, dst_stride, \ diff --git a/libavcodec/loongarch/hevc_mc_uni_lsx.c b/libavcodec/loongarch/hevc_mc_uni_lsx.c index 5437dce0e0..6bdc27a824 100644 --- a/libavcodec/loongarch/hevc_mc_uni_lsx.c +++ b/libavcodec/loongarch/hevc_mc_uni_lsx.c @@ -1373,7 +1373,7 @@ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ common_##DIR1##_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, dst_stride, \ filter, height); \ @@ -1401,8 +1401,8 @@ void ff_hevc_put_hevc_uni_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, dst_stride, \ filter_x, filter_y, height); \ diff --git a/libavcodec/loongarch/hevc_mc_uniw_lsx.c b/libavcodec/loongarch/hevc_mc_uniw_lsx.c index c4e79225d3..0ced8d4920 100644 --- a/libavcodec/loongarch/hevc_mc_uniw_lsx.c +++ b/libavcodec/loongarch/hevc_mc_uniw_lsx.c @@ -280,8 +280,8 @@ void ff_hevc_put_hevc_uni_w_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ int shift = denom + 14 - 8; \ \ hevc_hv_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, dst_stride, filter_x,\ diff --git a/libavcodec/loongarch/hevcdsp_lsx.c b/libavcodec/loongarch/hevcdsp_lsx.c index 85843dd111..5747925525 100644 --- a/libavcodec/loongarch/hevcdsp_lsx.c +++ b/libavcodec/loongarch/hevcdsp_lsx.c @@ -3233,7 +3233,7 @@ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_lsx(int16_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ hevc_##DIR1##_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, \ MAX_PB_SIZE, filter, height); \ @@ -3274,8 +3274,8 @@ void ff_hevc_put_hevc_##PEL##_hv##WIDTH##_8_lsx(int16_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, MAX_PB_SIZE, \ filter_x, filter_y, height); \ diff --git a/libavcodec/mips/hevc_mc_bi_msa.c b/libavcodec/mips/hevc_mc_bi_msa.c index dac6a32ab4..309ba5025d 100644 --- a/libavcodec/mips/hevc_mc_bi_msa.c +++ b/libavcodec/mips/hevc_mc_bi_msa.c @@ -5096,7 +5096,7 @@ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ hevc_##DIR1##_bi_##TAP##t_##WIDTH##w_msa(src, src_stride, src_16bit, \ MAX_PB_SIZE, dst, dst_stride, \ @@ -5150,8 +5150,8 @@ void ff_hevc_put_hevc_bi_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_bi_##TAP##t_##WIDTH##w_msa(src, src_stride, src_16bit, \ MAX_PB_SIZE, dst, dst_stride, \ diff --git a/libavcodec/mips/hevc_mc_biw_msa.c b/libavcodec/mips/hevc_mc_biw_msa.c index 260ec84496..34be61c0dc 100644 --- a/libavcodec/mips/hevc_mc_biw_msa.c +++ b/libavcodec/mips/hevc_mc_biw_msa.c @@ -6060,7 +6060,7 @@ void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ int log2Wd = denom + 14 - 8; \ \ hevc_##DIR1##_biwgt_##TAP##t_##WIDTH##w_msa(src, src_stride, src_16bit, \ @@ -6122,8 +6122,8 @@ void ff_hevc_put_hevc_bi_w_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ int log2Wd = denom + 14 - 8; \ \ hevc_hv_biwgt_##TAP##t_##WIDTH##w_msa(src, src_stride, src_16bit, \ diff --git a/libavcodec/mips/hevc_mc_uni_msa.c b/libavcodec/mips/hevc_mc_uni_msa.c index e221df7d53..602b7c614a 100644 --- a/libavcodec/mips/hevc_mc_uni_msa.c +++ b/libavcodec/mips/hevc_mc_uni_msa.c @@ -4155,7 +4155,7 @@ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ common_##DIR1##_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, dst_stride, \ filter, height); \ @@ -4207,8 +4207,8 @@ void ff_hevc_put_hevc_uni_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_uni_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, dst_stride, \ filter_x, filter_y, height); \ diff --git a/libavcodec/mips/hevc_mc_uniw_msa.c b/libavcodec/mips/hevc_mc_uniw_msa.c index caf40c34da..502a502037 100644 --- a/libavcodec/mips/hevc_mc_uniw_msa.c +++ b/libavcodec/mips/hevc_mc_uniw_msa.c @@ -6263,7 +6263,7 @@ void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ int shift = denom + 14 - 8; \ \ hevc_##DIR1##_uniwgt_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, \ @@ -6320,8 +6320,8 @@ void ff_hevc_put_hevc_uni_w_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ int shift = denom + 14 - 8; \ \ hevc_hv_uniwgt_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, dst_stride, \ diff --git a/libavcodec/mips/hevcdsp_mmi.c b/libavcodec/mips/hevcdsp_mmi.c index 1da56d3d87..7ece7b9be0 100644 --- a/libavcodec/mips/hevcdsp_mmi.c +++ b/libavcodec/mips/hevcdsp_mmi.c @@ -34,7 +34,7 @@ void ff_hevc_put_hevc_qpel_h##w##_8_mmi(int16_t *dst, const uint8_t *_src, \ ptrdiff_t srcstride = _srcstride / sizeof(pixel); \ double ftmp[15]; \ uint64_t rtmp[1]; \ - const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; \ + const int8_t *filter = ff_hevc_qpel_filters[mx]; \ DECLARE_VAR_ALL64; \ \ x = x_step; \ @@ -134,7 +134,7 @@ void ff_hevc_put_hevc_qpel_hv##w##_8_mmi(int16_t *dst, const uint8_t *_src,\ DECLARE_VAR_ALL64; \ \ src -= (QPEL_EXTRA_BEFORE * srcstride + 3); \ - filter = ff_hevc_qpel_filters[mx - 1]; \ + filter = ff_hevc_qpel_filters[mx]; \ x = x_step; \ y = height + QPEL_EXTRA; \ __asm__ volatile( \ @@ -206,7 +206,7 @@ void ff_hevc_put_hevc_qpel_hv##w##_8_mmi(int16_t *dst, const uint8_t *_src,\ ); \ \ tmp = tmp_array + QPEL_EXTRA_BEFORE * 4 -12; \ - filter = ff_hevc_qpel_filters[my - 1]; \ + filter = ff_hevc_qpel_filters[my]; \ x = x_step; \ y = height; \ __asm__ volatile( \ @@ -314,7 +314,7 @@ void ff_hevc_put_hevc_qpel_bi_h##w##_8_mmi(uint8_t *_dst, \ 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]; \ + const int8_t *filter = ff_hevc_qpel_filters[mx]; \ double ftmp[20]; \ uint64_t rtmp[1]; \ union av_intfloat64 shift; \ @@ -458,7 +458,7 @@ void ff_hevc_put_hevc_qpel_bi_hv##w##_8_mmi(uint8_t *_dst, \ offset.i = 64; \ \ src -= (QPEL_EXTRA_BEFORE * srcstride + 3); \ - filter = ff_hevc_qpel_filters[mx - 1]; \ + filter = ff_hevc_qpel_filters[mx]; \ x = width >> 2; \ y = height + QPEL_EXTRA; \ __asm__ volatile( \ @@ -530,7 +530,7 @@ void ff_hevc_put_hevc_qpel_bi_hv##w##_8_mmi(uint8_t *_dst, \ ); \ \ tmp = tmp_array; \ - filter = ff_hevc_qpel_filters[my - 1]; \ + filter = ff_hevc_qpel_filters[my]; \ x = width >> 2; \ y = height; \ __asm__ volatile( \ @@ -665,7 +665,7 @@ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ 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]; \ + const int8_t *filter = ff_hevc_epel_filters[mx]; \ int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; \ int16_t *tmp = tmp_array; \ double ftmp[12]; \ @@ -735,7 +735,7 @@ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ ); \ \ tmp = tmp_array; \ - filter = ff_hevc_epel_filters[my - 1]; \ + filter = ff_hevc_epel_filters[my]; \ x = width >> 2; \ y = height; \ __asm__ volatile( \ @@ -969,7 +969,7 @@ void ff_hevc_put_hevc_qpel_uni_hv##w##_8_mmi(uint8_t *_dst, \ offset.i = 32; \ \ src -= (QPEL_EXTRA_BEFORE * srcstride + 3); \ - filter = ff_hevc_qpel_filters[mx - 1]; \ + filter = ff_hevc_qpel_filters[mx]; \ x = width >> 2; \ y = height + QPEL_EXTRA; \ __asm__ volatile( \ @@ -1041,7 +1041,7 @@ void ff_hevc_put_hevc_qpel_uni_hv##w##_8_mmi(uint8_t *_dst, \ ); \ \ tmp = tmp_array; \ - filter = ff_hevc_qpel_filters[my - 1]; \ + filter = ff_hevc_qpel_filters[my]; \ x = width >> 2; \ y = height; \ __asm__ volatile( \ diff --git a/libavcodec/mips/hevcdsp_msa.c b/libavcodec/mips/hevcdsp_msa.c index 9c12029c1f..2b8d2d70ad 100644 --- a/libavcodec/mips/hevcdsp_msa.c +++ b/libavcodec/mips/hevcdsp_msa.c @@ -4322,7 +4322,7 @@ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR - 1]; \ + const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \ \ hevc_##DIR1##_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, \ MAX_PB_SIZE, filter, height); \ @@ -4373,8 +4373,8 @@ void ff_hevc_put_hevc_##PEL##_hv##WIDTH##_8_msa(int16_t *dst, \ intptr_t my, \ int width) \ { \ - const int8_t *filter_x = ff_hevc_##PEL##_filters[mx - 1]; \ - const int8_t *filter_y = ff_hevc_##PEL##_filters[my - 1]; \ + const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \ + const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \ \ hevc_hv_##TAP##t_##WIDTH##w_msa(src, src_stride, dst, MAX_PB_SIZE, \ filter_x, filter_y, height); \ diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index 31e81eb11f..3d4e41754d 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -88,8 +88,8 @@ IDCT_FUNCS(avx) #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]; + const uint8_t *hf = ff_hevc_ ## f ## _filters[mx]; \ + const uint8_t *vf = ff_hevc_ ## f ## _filters[my]; #define FW_PUT(p, a, b, depth, opt) \ void ff_hevc_put_hevc_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \