From patchwork Tue Mar 19 19:47:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Plowman X-Patchwork-Id: 47231 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:958e:b0:1a3:31a3:7958 with SMTP id iu14csp1894993pzb; Tue, 19 Mar 2024 12:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcx7xclxnJhdbPay44GE42Palg+lRq9LZKGdQ+TgAnlKnZFELHXSFq8GD5jSPklgi7rvKIZXKrgYIL8H2g7Y5Y6agXEDFgwj3azg== X-Google-Smtp-Source: AGHT+IFlErunRxbKGHRcNK89PcsjxBanuyS3bxjWKBCb5p0pLi/uTyVsphKUkWJGQkGm05g6CYCu X-Received: by 2002:a05:6402:3887:b0:567:156e:7893 with SMTP id fd7-20020a056402388700b00567156e7893mr2424756edb.4.1710877689422; Tue, 19 Mar 2024 12:48:09 -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 q16-20020a056402519000b00568c609c617si3287271edd.328.2024.03.19.12.48.08; Tue, 19 Mar 2024 12:48:09 -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=@frankplowman.com header.s=zmail header.b=EnvBf8lo; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B09268D42E; Tue, 19 Mar 2024 21:48:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from sender-op-o11.zoho.eu (sender-op-o11.zoho.eu [136.143.169.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3973668D278 for ; Tue, 19 Mar 2024 21:47:58 +0200 (EET) Delivered-To: post@frankplowman.com ARC-Seal: i=1; a=rsa-sha256; t=1710877675; cv=none; d=zohomail.eu; s=zohoarc; b=Ml4I75RwMmD+vOyFN/oVAeo18bhDB2bTqq9gaDWu7SipIVc1TDbA360mnucmw0GBr97JQQ6gZ44cL0XaA1DZkG+h5ytIhY0rqQAco/8ItUqW8UPT7xYGczED4vlAUSCJlvVGSyj83yNrxV1UPho+HU1aJhNuGaJnTAAZUlJ7lbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1710877675; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=zGsJD5dttKAxx1dVg33EOHf4c0V+TQ1lXaIL922iRWA=; b=lJJKelXazaxwO05I1ztAhFNp/RdvBX++QyakUfZoYBjiE02LEvkJVo3wXAd/GGFV1xwsTwoLaVfnkOISKEiBXWFQAidkZrdKHR/NirTeCrH1cQCgd0fAObuMU5GWWaIOV5zOJ4M45NyEh13pcwGKVgQ1f5giAcjj8zcVz+i1/K8= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=frankplowman.com; spf=pass smtp.mailfrom=post@frankplowman.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1710877675; s=zmail; d=frankplowman.com; i=post@frankplowman.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=zGsJD5dttKAxx1dVg33EOHf4c0V+TQ1lXaIL922iRWA=; b=EnvBf8lolo+Shgxhz1l+/HH7G33I6+vAkq+RP83F6Y3O6dchBULVBBXk9On9Tz/F mhXG2utNz97i+G1LCDP1TSrb6IqJwqjzBRmljUv7OtDdCgXCl+t9fV/hGz66B2Gg8Cr lhd36o8VQAntF5gkwYHBh+UmfNcYChdk+VOnluJ8= Received: from localhost.localdomain (frankplowman.com [51.89.148.29]) by mx.zoho.eu with SMTPS id 1710877674426834.853855092723; Tue, 19 Mar 2024 20:47:54 +0100 (CET) From: Frank Plowman To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 19:47:51 +0000 Message-ID: <20240319194751.34086-1-post@frankplowman.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-ZohoMailClient: External Subject: [FFmpeg-devel] [PATCH] lavc/vvc: Fix check whether QG is in first tile col 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: Frank Plowman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Q+6N6qsiC5NK The second part of this condition is intended to check whether the current quantisation group is in the first CTU column of the current tile. The issue is that ctb_to_col_bd gives the x-ordinate of the first column of the current tile *in CTUs*, while xQg gives the x-ordinate of the quantisation group *in samples*. Rectify this by shifting xQg by ctb_log2_size to get xQg in CTUs before comparing. Fixes FFVVC issues #201 and #203. --- libavcodec/vvc/vvc_ctu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vvc/vvc_ctu.c b/libavcodec/vvc/vvc_ctu.c index 519bd1ba76..8ba12c8d9f 100644 --- a/libavcodec/vvc/vvc_ctu.c +++ b/libavcodec/vvc/vvc_ctu.c @@ -96,7 +96,7 @@ static int get_qp_y_pred(const VVCLocalContext *lc) if (lc->na.cand_up) { const int first_qg_in_ctu = !(xQg & ctb_size_mask) && !(yQg & ctb_size_mask); const int qPy_up = fc->tab.qp[LUMA][x_cb + (y_cb - 1) * min_cb_width]; - if (first_qg_in_ctu && pps->ctb_to_col_bd[xQg >> ctb_log2_size] == xQg) + if (first_qg_in_ctu && pps->ctb_to_col_bd[xQg >> ctb_log2_size] == xQg >> ctb_log2_size) return qPy_up; }