From patchwork Mon Sep 13 23:23:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 30231 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4466736iov; Mon, 13 Sep 2021 16:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw93Vo1hua+tNz46XkRZvYJzEp9zpyDi7tcMbvoA+Ig/mUMz3wgGPgP4y4xql/LYjNaqaOx X-Received: by 2002:a17:906:401:: with SMTP id d1mr16090131eja.242.1631575491734; Mon, 13 Sep 2021 16:24:51 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z8si8484537edc.287.2021.09.13.16.24.51; Mon, 13 Sep 2021 16:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=iCEYUSaA; 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 6C28368AEDA; Tue, 14 Sep 2021 02:24:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071035.outbound.protection.outlook.com [40.92.71.35]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AEC068AED0 for ; Tue, 14 Sep 2021 02:24:18 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6jPtUmdKaO/9iqPcK6OXX/FEvj2OpEK00t/zlP0LWwgEkyjebp3nZXw44qlLIiNjQXDOI8axR3h7E9lV2M2du6YvQX12GlnMvEZn8Fj5P608Sk+SQIrcj8oFp6/9CMEUbOFVemXBWOW/K7E3MlazHtDD0j7Q7Yzy5i5lOoFcpifZP8SLdfOWgH/hOvhCPVfRSpd5+UG/lnThesCTj3crK/DBYv7ZthkktshvFmu6XA3jR2xXnvrvDcaogS3Bul7XT1WDIqahRIXJPqBaYxN1ksEZvY/38qC3CnziHB/IgRxZBL0fDtwDA2kqoj+r0IDhLHtro9DV4haebRJDs2/OQ== 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; bh=HCmJIkLVPTWBRbQuEntT05efVBPJUAEfAMvG2qO5kHY=; b=Dfz4pNP57HubD+iAZq52n7P5vN6cRvg8ZryAzIIuI71P5j1PHM/5L2Qvk+H+yOkauEdH5kg1DLBNam859bbMUiThP9zdWjX61qRA23+KfAH0GHWX1CdJBXzWHJTq7OJaQBV3Q2wA5gUadioy4u0+R3nuLsZgVndwGhzphrKffF5FnWUACuPCdHbJ/qjwujOuhuJ9v9DaZSCkhhpnQsBIAQRrZDYDz3RPifxn0pxMYnOYV4ie19t7pkBrEaliA5/wVW71RlW7aCgthd9l5bPCHgybhEesbkSDL1MEd3MUvO+mNRjVJ2ml3eKnlfiZ84WIyH/crnYU3PTbc0Yx3xWWrQ== 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=HCmJIkLVPTWBRbQuEntT05efVBPJUAEfAMvG2qO5kHY=; b=iCEYUSaAcTJTZUK1WWCvnsnkeoy/sCHoBQm8ClcBDP5hbQuvcaam+vyDSWm4NOLHLKUqfBWhSkZYFUlWwqp1rwiF55GfZP77kyoWJuOy2q2Su9mcHdj2RYBO0MtQgJI1+d55VVlZW0PTqbyfGBd/Ek/lGYXquDjeqmEI37U2uevJKY9c0czSDX42gIHpI3gc/cDQtAe0sqRfc3w+GZBZKiMOeulnk//bpNqMBXfK7kMxb7Hcn8hAZ4sl/Wue3FParjbJOnDFW4GNUkbt2SpAaY/xisKQrGshfqY1KAXx5UDGBKP+6gNjAixMLvOlWah+1J5VCyEp0Vi1Nv+s2RqT/A== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4216.eurprd03.prod.outlook.com (2603:10a6:20b:d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Mon, 13 Sep 2021 23:24:16 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::787b:2156:ca99:fe00%4]) with mapi id 15.20.4500.019; Mon, 13 Sep 2021 23:24:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Sep 2021 01:23:32 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [S0lA3J7uU0gk3LfnAP5BimXQJLBYE+lZ] X-ClientProxiedBy: AM4P190CA0008.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::18) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210913232339.3115725-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM4P190CA0008.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 23:24:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3033350-1bea-4e55-3e82-08d9770d9ac1 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSwGI4buAwfZe0futHLJHOz0QDEUDGZHWb/cSG2yZKffuhOiG4jCbmtEXCqz4v8l7KqSeiepVBIuwva0EHpcUfmvldulW/6palHEQ2U/BwZ7ne0jlGlrRFRV3w9MZ8zWR3He1IS92Lt79YwVkbFopYMjaKsfpTQWfKey/02uoHvlU/gxIRQ/V3pG6JQWtmOLbfEbhR6fdj4aB+d8svwkiTetUUwzRrSo3Hs6lNDoXy39DQsLDMIZEwGrEeimwXWgoOV2g661lKUCRYChzWgm991JhzoJX5uOdunRbgRz+2LIzw59VUH/frv+jtlN5B7A0+jXF60ECNiQC6HB5g9gWO0ozEQHyuSdDS6h8d+kKeCvDEtK88szTc1lknlSeUbW/HFTPt95chuGvK70a/JnGoYqEIh5YjXVEocl8/XqGgRRzrBCWbROOdcHS6yDnX8uG+PjJA6DlwyiqYu0XJu+btBam0m5Xs+z+xeIJy4R/sUMYoCm4u3KSFFPSMPmvGuN4jFweBfrigpkawvrSLTB6PhyaCdbs0VYRnhVYR7qpNbTrGrUi0m06lWrsvFaxehHRsn2HgCrkyPE8CzPVCSwIoLqYXG4Pe/7MZTWZ1D54c0AMZCJk/AaCbVdPgJTjkWmgWizCNwjvLk2sTpZ5OapWgncHLPCSFemByec5MpUsV59bWicmIwdJun3X6dKF4LL8BKakt4lSZx5cLnjSd4CrXD9OE1sv+Y0yqmh01NgAkIAQRsc2MY0E60EsXlwziSjww= X-MS-TrafficTypeDiagnostic: AM6PR03MB4216: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LU5DRG0EnXmv4d2Domduu8WaXiE7/rdqzp8OtpEJxKBUBcNp6Z6dGjE8Deo61YYNo80TTG9gmvI1jJPkaz5IaPwSXRjezidArXanFYuAkdy0HGE5VDJWryTgk2Afqn3+66jBCkubkOtJUn8A1hLXrf4xNQ6jL5suojlK7qB1Nwc456Yf8n4hPOg0pZTcvy62wDfrgM8tPQYOioOiMSrsJIM4Rj+qvvVwxI53rszflsOwO+ZJqvxzL35TFn8GbV4OvBFUjT2daer8YNOCzCc2R0lAtl4s4zjuiUZ8Pd8ZJBS5HOpVg9Vnsdb0+hSxM1uEqjDhfzm6CiWcJ0sCpNO6sUAEX5cb8Ia2Bn5Mat9dn1S/Qha1W1SfeUK6hCFEpy2nU7HLXGfPhFhSKlaqIvHAn1F8KPrkDDoDHEOZfae8CdIAqbo26qyi3xDs/w0TE+Yz X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: InX17H+nb0wnLj1a3wA7Qjww+P+/mZTUFnYNC90ZcH1fAmtYsC6qoIQMPCc6WO4XBygxlYs6ISw1/LQHZiMjvCQb1Pf29gEoKn9Avrip5DNB0LmlhjSM614wpyd3Gt2zf0Gyt6grj1QU9gfHoP769Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3033350-1bea-4e55-3e82-08d9770d9ac1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 23:24:16.6541 (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: AM6PR03MB4216 Subject: [FFmpeg-devel] [PATCH v2 07/14] avfilter/vf_spp: Add dummy element to array to avoid shift 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: +p/J9StSDcWF Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_spp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c index 6c15dbaf66..b9b5f7bc78 100644 --- a/libavfilter/vf_spp.c +++ b/libavfilter/vf_spp.c @@ -93,7 +93,8 @@ DECLARE_ALIGNED(8, static const uint8_t, ldither)[8][8] = { { 42, 26, 38, 22, 41, 25, 37, 21 }, }; -static const uint8_t offset[127][2] = { +static const uint8_t offset[128][2] = { + {0,0}, // unused {0,0}, {0,0}, {4,4}, // quality = 1 {0,0}, {2,2}, {6,4}, {4,6}, // quality = 2 @@ -283,8 +284,8 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, qp = FFMAX(1, ff_norm_qscale(qp, p->qscale_type)); } for (i = 0; i < count; i++) { - const int x1 = x + offset[i + count - 1][0]; - const int y1 = y + offset[i + count - 1][1]; + const int x1 = x + offset[i + count][0]; + const int y1 = y + offset[i + count][1]; const int index = x1 + y1*linesize; p->dct->get_pixels_unaligned(block, p->src + sample_bytes*index, sample_bytes*linesize); p->dct->fdct(block);