From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0FE0A4C5EF for ; Sun, 23 Feb 2025 12:05:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6002068C8C4; Sun, 23 Feb 2025 14:05:11 +0200 (EET) Received: from sender2-op-o11.zoho.eu (sender2-op-o11.zoho.eu [136.143.171.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0324768C32B for ; Sun, 23 Feb 2025 14:05:03 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; t=1740312300; cv=none; d=zohomail.eu; s=zohoarc; b=DFQRaRIfikvDaXUHDyshU5dRI/zZ6UNXUYrgcW8vck9cl64g43COZvrwA7y0Kvvw0Rok4nczaMxhbCi2MyR1JH1Ps9vR1MbERsFFtPnZp5tgykceDRyL3PzjV429j9LoN6X2obkGNdWoLBXhCGkCvhPqTgBn5kgmJHsihtvDR/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1740312300; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=CykUv22nPmYYP5+1EH47cPqNQeRUfhVbSvgZ9aRRrcg=; b=g5oZEsnjrtrTx3vDV1qnSLOuCo3Rj+qfHcVwb6d9wgLprbAaS3Ns/vYbaHlu4zBCgggSRraHAYCWQYxIuoSxUz05ojkUZDG7fsfd6IggWltBdK49FebpzDP7hRH/+ko4J3oJ/qF0y8DYY3H7lG6Ox5FHT/Tab0al8SM2G7SuHbM= 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=1740312300; 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=CykUv22nPmYYP5+1EH47cPqNQeRUfhVbSvgZ9aRRrcg=; b=E3hvrfx5Ur4LthhVZPWTc9as+RZ3DhSQcnHnAQDrUNIvApq0+hCiDZWy1+2NpURs g7TnAI77tNUipkZj8qyWPphLI8ldq4brRchSRgu7M2jN8mXvp6mZZ/WqiHhzElLpKYN XsQ+qoCJt24+MUSSXmgb6w9j+a86hWZZ50vqaDWw= Received: by mx.zoho.eu with SMTPS id 1740312298347818.9609322600932; Sun, 23 Feb 2025 13:04:58 +0100 (CET) From: Frank Plowman To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Feb 2025 12:04:47 +0000 Message-ID: <20250223120454.37614-1-post@frankplowman.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-ZohoMailClient: External Subject: [FFmpeg-devel] [PATCH 1/2] lavc/vvc: Fix NumEntryPoints derivation 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 , nuomi2021@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: If pps_single_slice_per_subpic_flag is 1, slice_{width,height}_in_ctus are undefined and we must instead get the dimensions of the slice by referring to the corresponding subpicture. Signed-off-by: Frank Plowman --- libavcodec/cbs_h266_syntax_template.c | 34 ++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 58211026bb..b84f3e29db 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3440,13 +3440,35 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, for (i = 0; i < current->curr_subpic_idx; i++) { slice_idx += pps->num_slices_in_subpic[i]; } - width_in_tiles = - pps->pps_slice_width_in_tiles_minus1[slice_idx] + 1; - if (entropy_sync) - height = pps->slice_height_in_ctus[slice_idx]; - else - height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; + if (pps->pps_single_slice_per_subpic_flag) { + const int width_in_ctus = sps->sps_subpic_width_minus1[slice_idx] + 1; + const int subpic_l = sps->sps_subpic_ctu_top_left_x[slice_idx]; + const int subpic_r = subpic_l + width_in_ctus; + + int ctb_x = 0, tile_x = 0; + for (; ctb_x < subpic_l && tile_x < pps->num_tile_columns; tile_x++) + ctb_x += pps->col_width_val[tile_x]; + + width_in_tiles = 0; + for (; ctb_x < subpic_r && tile_x < pps->num_tile_columns; tile_x++) { + ctb_x += pps->col_width_val[tile_x]; + width_in_tiles++; + } + + if (entropy_sync) + height = sps->sps_subpic_height_minus1[slice_idx] + 1; + else + height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; + } else { + width_in_tiles = + pps->pps_slice_width_in_tiles_minus1[slice_idx] + 1; + + if (entropy_sync) + height = pps->slice_height_in_ctus[slice_idx]; + else + height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; + } current->num_entry_points = width_in_tiles * height; } else { -- 2.47.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".