From patchwork Mon Mar 18 14:16:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 47176 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:958e:b0:1a3:31a3:7958 with SMTP id iu14csp1042982pzb; Mon, 18 Mar 2024 07:19:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW2qb6yMie4hJLD0mX54CB5+Xxye3Pp7XkVroeuInflQ5ZGaq0K9HSaeCS/C/G1PYwgABYuXVLns3po1lrD80BuG4oe1fsqc/Ffeg== X-Google-Smtp-Source: AGHT+IFsQMJzFuPmP5m+BxFDbQK5Cr3LZnpTl5uwP9WNuo7ixHH2t1lAC0Svt8janSJunGcaZ7An X-Received: by 2002:a17:906:3090:b0:a46:1817:6b35 with SMTP id 16-20020a170906309000b00a4618176b35mr6510346ejv.55.1710771562866; Mon, 18 Mar 2024 07:19:22 -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 sh20-20020a1709076e9400b00a46a154ff39si2594117ejc.756.2024.03.18.07.19.22; Mon, 18 Mar 2024 07:19:22 -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=THWhKs8c; 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 D0B9068D2E9; Mon, 18 Mar 2024 16:17:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2032.outbound.protection.outlook.com [40.92.107.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69D1C68D2D1 for ; Mon, 18 Mar 2024 16:17:23 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M3MruNjR6akZWysOmxLxbNfRJwk3fqmPwyUX6TybI+5jHjC0fmtjw0ce7bd0cuVf7n6P50iqw2zRJO0XM2oh9JLkHRcBGjmSkUj7/hHo1L0irT/xpV2oBmfNy1agHLkvYvs13nnWbhovqrnH3Xv1VxKcXxpGYpGmkMGOEAqdHjKBYXHF/qO7dgwL/fkgU2Cm1M48XgZf//xYCLx5Hp+hSd59Q9THDQPDhUEOYnGlksZMOwwyTPbgaiqgUPGLmUCEYpaq+wCN5pSRC2CM73W5NaVjPRnuIyFOyr2DCBv/+LYf9DZ7kCHbzO8NdUrPHm7t5Y4Rf9CmLMpkn5j+K4dHlg== 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=ithhzWDXZiuuzLm2evX4RDDRFzZlvgPcz3A9uL4L12o=; b=OFyjsHDqSLrYAIAYJzBDz1GHxQ+bKK/jKd4JrlDz46uaWeMiPrH6fED+/PjUdmj+827fUTz3oOh4g52y6/7NyqaoRmTzBReCEWxfjUrRcmge0ZIIzG9viE0BToDuhApjhuV9n/hh/uJnoNSP5HssAAW++SPE/ECZP/qJUuK4JUiyNOCZgAlRfAWy0UYWtBdROqeDzCf3Pd1Fu1e6XAJDA/3+QODfd+WyhkOfCuCmnlrRxosnFCMul2iigb0/ZTfxkuAFyGmKQK2EuRaNOcJ/kxmKamysoQZkqUcuL5kTmE1/JcKcaEH6+e+W8aNjRW1UGRTzxKB+lMmYi1dwnfwrLw== 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=ithhzWDXZiuuzLm2evX4RDDRFzZlvgPcz3A9uL4L12o=; b=THWhKs8cwNe8dWjhWZYgPJ8LXiGHGjG1RnB5PJ5AsWv/aKa1pzUgBWZL12NETP/Ko8/D6V49pSxVKlSUiPs9QRfgTbtsT33hY3lrnhTC8I6oVurHE5aG4++8dekdpIB2o4ppSPqzaNsbwSHtKuODPIdzNCV6doO6RElCbJU2uvApl94vMlko0dJJ/4fz0CfCF5YqD1zRo52fvhw0ARZnq9s9zAXUKWR7RfkSjnWDTGCYp/PMuFHUwAg27mUzXRXbyT2qymLlny87zvIBGSil9rODZNvUVaWCT5pWskswiAwPN7Sl7KDVQ83rWPWgeIubsYDM+0kJ7RLUL/WMBND3xA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by JH0PR06MB6604.apcprd06.prod.outlook.com (2603:1096:990:3f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Mon, 18 Mar 2024 14:17:07 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::d001:da90:518b:ec1c]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::d001:da90:518b:ec1c%3]) with mapi id 15.20.7386.025; Mon, 18 Mar 2024 14:17:07 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Mar 2024 22:16:24 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240318141626.3375-1-nuomi2021@gmail.com> References: <20240318141626.3375-1-nuomi2021@gmail.com> X-TMN: [8X+ucXHv5U86CeD78+bK5ex5+OelrcEN] X-ClientProxiedBy: TYAPR01CA0085.jpnprd01.prod.outlook.com (2603:1096:404:2c::25) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240318141626.3375-13-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|JH0PR06MB6604:EE_ X-MS-Office365-Filtering-Correlation-Id: e7eaea68-e686-47d9-5b9a-08dc475617f0 X-MS-Exchange-SLBlob-MailProps: znQPCv1HvwVyACnTOSFL5RJO0O1WevBvb4uardwQ+CP2sJZpMoJn0hV3ss43rHFzOiXZ7zh91KGThlJkawa/IBrUkQlToxkAkv7kone8jdUuciVO4rLozrOhe6Bq+chaHrYL13J5wYUxBzWB71Wu0KOpwyRSR6pOPJ6duC0/fmaX9+1T1uoX+y/DHXI6/9LMvX2HlG17OwOLggqyI8XHSqDsFm5UBxCan9PuL9gprx9q4QRIBoZHzRDmFsHE3JvVuR//F+q4eEXsfr7i7qQz/OgRb/11ZTlf2yfbtlwWED4GyfCu9HBzpWYMkUJldsgWxHv7VHoJSn+gdPU0yi5yKfmVQyHywnwh37C7ISFxmPqdr5sdVsRPlvAxwdUaHAK8AtTui+IOn9DG6Y9R/EZvzTh/6Xrw3HTal2paG2RlMc0ii1eWzWdgsejzL4v+dIrQSAE3WdBwJYENB+bvWSTXeb4lTLnCe1C3lD8TclrnY93Av6JiZq7+mxFylw5exEiU1on9S0UgTaB9cgMgJZKrbV+NOqQB31xV57ujho4nj0qewFFF5GbRRAL2IhxjVL1mNe4bbc4toV6b3xjqn+um0ZuZFvpBnb/chudYis5NA4Rs7sO4AyxxsEupdh2+AIA2lACCCW13psC3DC+JHUACMoCWdYihH3ND9VWZa0SpNd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Eg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7eaea68-e686-47d9-5b9a-08dc475617f0 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 14:17:07.6571 (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: JH0PR06MB6604 Subject: [FFmpeg-devel] [PATCH 12/14] avcodec/vvcdec: alf, support subpicture 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: pyXiiHD9FsE5 --- libavcodec/vvc/vvc_filter.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavcodec/vvc/vvc_filter.c b/libavcodec/vvc/vvc_filter.c index 6b4c2050c7..de0816619b 100644 --- a/libavcodec/vvc/vvc_filter.c +++ b/libavcodec/vvc/vvc_filter.c @@ -1199,6 +1199,7 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0) void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) { VVCFrameContext *fc = lc->fc; + const VVCSPS *sps = fc->ps.sps; const VVCPPS *pps = fc->ps.pps; const int rx = x0 >> fc->ps.sps->ctb_log2_size_y; const int ry = y0 >> fc->ps.sps->ctb_log2_size_y; @@ -1207,6 +1208,7 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps; const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps); const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1; + const int subpic_idx = lc->sc->sh.r->curr_subpic_idx; ALFParams *alf = &CTB(fc->tab.alf, rx, ry); int edges[MAX_EDGES] = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 }; @@ -1224,6 +1226,13 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) edges[BOTTOM] = edges[BOTTOM] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1); } + if (!sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]) { + edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SUBPIC); + edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SUBPIC); + edges[RIGHT] = edges[RIGHT] || fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx; + edges[BOTTOM] = edges[BOTTOM] || fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry; + } + for (int c_idx = 0; c_idx < c_end; c_idx++) { const int hs = fc->ps.sps->hshift[c_idx]; const int vs = fc->ps.sps->vshift[c_idx];