From patchwork Wed Mar 27 13:01:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 47536 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp605628pzb; Wed, 27 Mar 2024 06:03:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXvxYGCFyp9uYJGelFwf8B918M1KQrkkirk359yAdCI9hVPihdIIt7JVz0Mj4qlcWdS6M7ynpQHDEWvlsGXR6I7GU1/1KedyHKAg== X-Google-Smtp-Source: AGHT+IHp1x073bV0Mtbp/ZxI7XPKJYBGj33azZkEkfJDX3wxQLyUYgnIz7tYwMOcPS660Vz2xa41 X-Received: by 2002:a17:906:7717:b0:a46:74fe:904f with SMTP id q23-20020a170906771700b00a4674fe904fmr1895900ejm.26.1711544637664; Wed, 27 Mar 2024 06:03:57 -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 sh34-20020a1709076ea200b00a4a3a4c152fsi2814598ejc.858.2024.03.27.06.03.56; Wed, 27 Mar 2024 06:03:57 -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=K4NgOTG0; 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 F0EEC68D6F6; Wed, 27 Mar 2024 15:01:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2027.outbound.protection.outlook.com [40.92.53.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1745C68D6C8 for ; Wed, 27 Mar 2024 15:01:50 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jDr+v1zKFNDeMHYxFd+KLyegwwyJLQHChLjITlUBTC1xFlYXh5qp+3DkHH626Wt6iKhOmg+02iPf7U07D0zbHGBfZBhJQ0pFgNjCh+oV3H1EBuw6RoYtq7Quhu9DmRImjlxAVW51p18UBsvMqG5M7rP3tjBuoLwES6hJsWf9SVv6foKAYZkVmFyvHsG0vpq5kbYccaaYbZyfukC0LRouQpDFxQ0TnNNgQo8lBTk3n6o275KPbc7DhOv6IPWXcwl33t8uGTAFLcy0dNOyeYns/JZP5800VXXaw/GqU6uxLNZ4R7dRy+RVLpPJ8tsof3MnXXWQW2SvMepTXYN95xQLrQ== 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=f8VgeBZkQMkDlIlrHMDO2rMZCQ7WAVu+SUc06h4bKYdP7s696i3O5Fqvm8XKXq/ECp4mjKAsXeEvB96R4ErLEmCLBJLfUwCBrfERauqjD11FHsgK46+gmFXDE+GCc3nMT8P6977bI7YU5VEPjqz4rKquVTCPDQdB5D/Cloy62nT02/gLJBfV2h+EE5mB8qkQhpB167NbZP6IbqqZBHfQVbN+PpMC/dLzh3o1ME5AlTAepDN07fUkZA4aZSK+IGDT+LlX522zlCWwdpcyvcjdenSiaQMCJFFtXGJsSYpzEzd08xTF1RRoMnfNixEumz2SY7A3NxZ2z6EWZCjEQwB34Q== 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=K4NgOTG05Qrvd3Vazq3qfkbIRiyZpwcSWuVngraAupI9C6tJvln/mc8SVJLbRoy9trKY+zlco5SsHZANcxv/BiGWLBs2JQSvTC615J3dS3L/CCT8caXx2K7/EKwZDj5yOWaZ4tyioP/cjulCkaM3eha6xHXXFbrIrVF0mzpf1mv9xw/Vt5ElsCA4vT7Lz56Z1+sAfmrBoY+E0PxRvxb5MGhaBHA48X0vPzl2mgb/bUkQVP0LnxoKaNX8cJAG0fqADepjmVhSlBMOeSxl0SIuEdWnx+sVxsYalQ2f1R5NOzgp610AmJxxBKgDwyu07PIogN9pIdR1omjgyw/crzeY7w== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by JH0PR06MB7107.apcprd06.prod.outlook.com (2603:1096:990:9b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.33; Wed, 27 Mar 2024 13:01:31 +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.7409.031; Wed, 27 Mar 2024 13:01:31 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Mar 2024 21:01:10 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240327130112.6111-1-nuomi2021@gmail.com> References: <20240327130112.6111-1-nuomi2021@gmail.com> X-TMN: [TEIOs8TOypWiaICyXgUL+Uarev1OXEIB] X-ClientProxiedBy: SG2PR01CA0117.apcprd01.prod.exchangelabs.com (2603:1096:4:40::21) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240327130112.6111-15-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|JH0PR06MB7107:EE_ X-MS-Office365-Filtering-Correlation-Id: 789fca45-eeac-4770-89a1-08dc4e5e05f1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z3lyMal4Tcyr65dlee6RRoM3xbEH5oCb2bLEmPfk56xM24uT+GoOpZTibm/+nNkNMjL01nEHRgaCz0Ah4n2ItE508P6NneC20xFFp2EPUboYasP4e/53LVCWbiU6DKXVA318FFK049q5zt5cHTdRuJGjMuxptXPTxgjQlnZxPfd0ZzoInF+XXLKBdkzI9t5AWvgZ4opgTiMVcLZVmCvpHV3hNR31myTrkpMA20UMFINJPbOCNOR1Y3YZey39MnguVjI4a/QCzlS9yqOfEysjHfrCN6gWiQ6tvhsX+to40zekrv76bW6SPek+h9eayYLSIEGN93XegslrRV7udXvxcimKleEpiv+olc8zwwNYWkKQB0oNOeNq02lmdaCmHEYvDW08lEn5o7Kz1QeWyurUP+zT6irBQ6Klc8exgj6jQ+EnasaLGavjlzIUS3a5RZX1R/aJcnqqu3AV5SExPXtZLGj2qhIHJXlUNlTkrV05Bj9l2N1fJ0DcXgc7PgRIhVidS2PUWT7MLJY+nvgpynE2q7Llw3S0b6KwqUOLWLPfuEUkYUv3yF7IzP7OKQ+dCYdbtucyy3uC/2mMqQhRx5Cj0T7oALwBUlOPZZCTQIWLVT8qPY/halx7+3dNBTg3VBD0 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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3B8UcNYeysugffN2O7ECI2dzo+5BZRQYdfb6WQ0XTce+Ln0RnteEbYYPE+NP8UFanEXX6v66lttuhprYXbBajfQcvh7R0kNvTEep4KxuNXZTivRJE8RymDyCUtiSjra7R4EFQIdFSYMzkIcvrPmGhrHX5ig7rSuppaZydH1B3y3i+YX8VY+oey2S95f2D8IG5UUmvPl0M3Kx1paXAlE+ZwtFqUb5PuQKrr4UYjwQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 789fca45-eeac-4770-89a1-08dc4e5e05f1 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2024 13:01:31.5727 (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: JH0PR06MB7107 Subject: [FFmpeg-devel] [PATCH v2 14/16] 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: ntYxxz8ZyVO8 --- 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];