From patchwork Sun May 19 13:27:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 49024 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3927658pzb; Sun, 19 May 2024 06:50:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXkJvCIAKK2PY+/KxGfOy2v0wdJ575VEWRXP44ou/aHbBj51M4nSqsu1P1ABYvc7ZYzaBxS8f64tzwdvxjwLXUrp83+3gLJla8hgg== X-Google-Smtp-Source: AGHT+IF/SCINNteAm2N/gDlQxjlokus+5kB6de80NmWWeExM+/wyl7hzaILRNY9uGwLdZHWoW1U7 X-Received: by 2002:a05:6512:54c:b0:51b:6934:1cb1 with SMTP id 2adb3069b0e04-5220fc7acd1mr15755101e87.17.1716126609297; Sun, 19 May 2024 06:50: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 2adb3069b0e04-521f38d3d80si7543855e87.269.2024.05.19.06.50.08; Sun, 19 May 2024 06:50: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=@outlook.com header.s=selector1 header.b=kuWbjOSr; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A1D0F68D26C; Sun, 19 May 2024 16:40:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from SINPR02CU002.outbound.protection.outlook.com (mail-southeastasiaazolkn19011003.outbound.protection.outlook.com [52.103.65.3]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 35D1A68D084 for ; Sun, 19 May 2024 16:39:58 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G1vJdRXoobLMjc9TD/wExopm3n0fDz6EaIc/AvnMUslR7xqr0MCSsQeR9j6DXjjd/rDVHgpRe+2++jE2iGVxBUQZ4V9lUSiscawh2nvyfCZP3msD1+GnrQYiBl8519hKKRp61Yr1XeAG/AKL5BUaj274bGfDDVaNNG3joSkJLW0wJV3DDXLmVfVfX3VQCqtywUaKq9savr6NybA6M1iC6QQA4p8lPDfxyz3DsJDQeI1TGdPGaTNd76OY4HT93d8Ywo7DJZLdrLHyka/XsCqFaUkB4Cl9by/UPaHelnwhd45LJOaKTvJBll4tTKLizewVrqhfcvb6xoZ8YPFlXG1FMw== 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=JnvZDAMVDd7Cv6sd7S2HGKZtv3jax8tUdR3z9WlB+ik=; b=hsAs/+fToJTkJL3JdOyufn5hM/2KMAJYUN3VGJOjSYOv3a/3NbARm289c7GrOMhgl5LliprZmRG6iPufEq5D9jBIO+agS5jK7sERM2/KPoKCIyRSn7KWbk3kwgotmBfiavEHIHp8ON4WoMFsBuhnJ4LQaZw8Rblr/z9Z+78T7v3Mui8kuEEvytDy/85MZHRiNQ8kYtIjp+n9FgkUWYUpvGGGLJEpBu8Sv9EQ0Osoj50NgVK0Q10SYhAwW+DHiRLGVaDSMFhUzvgDN79StO8AXMrrXvkZrHWKayUVk+wBKExIaHUOkDVSonlj7pbXdujFzOSqZ3DktmlPmq17GmJg2Q== 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=JnvZDAMVDd7Cv6sd7S2HGKZtv3jax8tUdR3z9WlB+ik=; b=kuWbjOSrw5DW8Ca832npZmb7arChtdIMxWrxAEfny3hhJKaNpmkpFfv+9Hfv6qIzG8bUIDClJtUM4LCajJlSpPkl4EFWU7no9l5SI+Vn+FnnjVEJ67Ur9Wa+Xgp8tXeZXClaYA4SxII321xJCrSFAQBgWISSWEWEJp9ujDgbI0Laa7BweycVIiAz0SW6YaJ9S/uBVolP1goMslpKxj3i4vlQ+csBlhem8xTUYkHHBwxAjfrLo4vD8RztDoSSqPaBLrIYWN5C6ILx+j6a4v3i/raoUC2TZrIT568hnH472OJlwo9AEmoZsxD4qiAtQNyydLuf00k2XIaJ4ENjEVUhPg== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by TYUPR06MB6098.apcprd06.prod.outlook.com (2603:1096:400:358::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.34; Sun, 19 May 2024 13:39:42 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::81f7:9125:583a:1cca%4]) with mapi id 15.20.7587.030; Sun, 19 May 2024 13:39:42 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 May 2024 21:27:44 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240519132749.790832-1-nuomi2021@gmail.com> References: <20240519132749.790832-1-nuomi2021@gmail.com> X-TMN: [xUQ0qA0tiPphf6SpPb9pqbS90oA+ZD++] X-ClientProxiedBy: TYCP301CA0017.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::8) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240519132749.790832-13-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|TYUPR06MB6098:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f17a4e7-14d9-4810-b59c-08dc78092369 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: Bwj+NrDPZ+6WWI87BXWNb/r+UTlPf3PuqK962Toz3SZLrmxdD+tYKJqs7nraji7eW84jb87vMqG1BWvBXG2VNzsinIhELMM+9lWVwbJgvdKbAmW5wr5fbx4Qv6uW/g0aFsdpos23iRPAJ6frWQ5hAM6VDppAL80bNTI9ck0sL7T1CnT3KV3zZFILKNT0lg04x378KHaiZL4KbLqa85S9iew/9fhlX8HPmHQaDNDyzjC51pUwN6o21J7D1OzbFGkB61aUzkiF6f0Q1ZgFTNsw/+E5RzJNaORO8WWZJ/1n7iDcg2YxE5ng6ov4owJHxIKT+TJ9j6YcmahuvaHF/eddkESvuoa5ZCzcVeaTAWxEZ+1XRNlaP7aCVQuCCYz+tZYsEpHsoUcp4tYMPMY6j6Ejpi9gWeHMBI4NatoxW7dqu98tlXegClS2gfxYznnb+1vk6lNj7ZuEiTXyzF1r7OQTn1pC8qTVg37TFlerJlPeAWb/xv+i4Ts1Olz2T3Y8g7A5OCzU41LYyWI7YthsaqdKgWEo6app/qVUFIJFd4QReTmIL6X/75++Z7zSDWsIcCFqQrx4R+2BNZ8zVsdU7i8kK58hbD12t0zIdeF54hFjU8CLvqFIt418z9AoE+zA788i X-MS-Exchange-AntiSpam-MessageData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biYXN7FHUuo0d+D6S+zIUML+y9pPEa73ENiKB9zMyuJL8aTg+hKtoVeTJKnEgpTYqLRWABw24bSAMcgMrUSSsbQyBLPdU1h+XJDLvTa3tdQJDv2V7uXMVpVoF2hv2srKGmADjIQt0vnQPSvrzkQ5v9QiJ/jOuHbSqVhvTrDMiMXK7H2r6clfIQF0XKF5Nrs5jB1WgcIeHD/OPdl9yHMSr1Iw5yvTUZHE7rSv1fXRUPrxHS2APUvJ2am5vkXwUKo5wJ0xg/g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f17a4e7-14d9-4810-b59c-08dc78092369 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2024 13:39:42.5780 (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: TYUPR06MB6098 Subject: [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: fix dmvr, bdof, cb_prof for RPR 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: t/UQinE5AGza --- libavcodec/vvc/ctu.c | 18 +++++++++--------- libavcodec/vvc/mvs.c | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c index 242caa58f7..809510b93d 100644 --- a/libavcodec/vvc/ctu.c +++ b/libavcodec/vvc/ctu.c @@ -1689,25 +1689,25 @@ static void derive_dmvr_bdof_flag(const VVCLocalContext *lc, PredictionUnit *pu) const VVCPH *ph = &fc->ps.ph; const VVCSH *sh = &lc->sc->sh; const int poc = ph->poc; - const RefPicList *rpl0 = lc->sc->rpl + L0; - const RefPicList *rpl1 = lc->sc->rpl + L1; - const int8_t *ref_idx = pu->mi.ref_idx; const MotionInfo *mi = &pu->mi; + const int8_t *ref_idx = mi->ref_idx; + const VVCRefPic *rp0 = &lc->sc->rpl[L0].refs[ref_idx[L0]]; + const VVCRefPic *rp1 = &lc->sc->rpl[L1].refs[ref_idx[L1]]; const CodingUnit *cu = lc->cu; const PredWeightTable *w = pps->r->pps_wp_info_in_ph_flag ? &fc->ps.ph.pwt : &sh->pwt; pu->bdof_flag = 0; if (mi->pred_flag == PF_BI && - (poc - rpl0->refs[ref_idx[L0]].poc == rpl1->refs[ref_idx[L1]].poc - poc) && - !rpl0->refs[ref_idx[L0]].is_lt && !rpl1->refs[ref_idx[L1]].is_lt && + (poc - rp0->poc == rp1->poc - poc) && + !rp0->is_lt && !rp1->is_lt && !cu->ciip_flag && !mi->bcw_idx && - !w->weight_flag[L0][LUMA][mi->ref_idx[L0]] && !w->weight_flag[L1][LUMA][mi->ref_idx[L1]] && - !w->weight_flag[L0][CHROMA][mi->ref_idx[L0]] && !w->weight_flag[L1][CHROMA][mi->ref_idx[L1]] && + !w->weight_flag[L0][LUMA][ref_idx[L0]] && !w->weight_flag[L1][LUMA][ref_idx[L1]] && + !w->weight_flag[L0][CHROMA][ref_idx[L0]] && !w->weight_flag[L1][CHROMA][ref_idx[L1]] && cu->cb_width >= 8 && cu->cb_height >= 8 && - (cu->cb_width * cu->cb_height >= 128)) { - // fixme: for RprConstraintsActiveFlag + (cu->cb_width * cu->cb_height >= 128) && + !rp0->is_scaled && !rp1->is_scaled) { if (!ph->r->ph_bdof_disabled_flag && mi->motion_model_idc == MOTION_TRANSLATION && !pu->merge_subblock_flag && diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c index 9407fbfd8a..e78a9b4694 100644 --- a/libavcodec/vvc/mvs.c +++ b/libavcodec/vvc/mvs.c @@ -297,7 +297,8 @@ static int derive_cb_prof_flag_lx(const VVCLocalContext *lc, const PredictionUni if (IS_SAME_MV(cp_mv, cp_mv + 1) && IS_SAME_MV(cp_mv, cp_mv + 2)) return 0; } - //fixme: RprConstraintsActiveFlag + if (lc->sc->rpl[lx].refs[mi->ref_idx[lx]].is_scaled) + return 0; return 1; }