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 ESMTP id EB08C469B4 for ; Sat, 1 Jul 2023 01:37:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7A0EA68C074; Sat, 1 Jul 2023 04:37:07 +0300 (EEST) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 07DDB68AFA8 for ; Sat, 1 Jul 2023 04:37:00 +0300 (EEST) Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-39ecf031271so1921189b6e.1 for ; Fri, 30 Jun 2023 18:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688175418; x=1690767418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zdlckUtlX3k+6K+4EErhDM2IrNzY0boE9H0cIGC1Hfc=; b=Fr+TfW1bv5/I0oZukgC6sBKQJEmf+Aq+APXN4xQ2ZIQvXA9Qq7cSMtxAbUYj9D6EfZ qAneWi3RwrrrkNV4lbXTfcD5OVIMIxFsbUCbq+wb6DlWScLd+oCmVqqZmYlgFRn9Mi11 JggLxgfEbY6uIKhgOZ0ho6aHtYa9IJ3YcZ3ot9AGyRFl3yKYU9TkNuBvirOJBV2MsCDk WMFAOkpLfm5ilIl+0FOg3OWO45/spK2jxBArmccVe5x3/NQLJzDEN+IDMaPXX1MSiBk6 8ebt1Qk0rt/GGrOo3Bi5E74VNsKS/lZrz3uibeHUEb5xuwcmWteqaSYjQBBRpn7hTLoZ sH2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688175418; x=1690767418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zdlckUtlX3k+6K+4EErhDM2IrNzY0boE9H0cIGC1Hfc=; b=cweXpLe0GoUlEhx4mLvgEl/4O6ZgJquynFnkfmWp/Pxf73RdXun/bi2OPLYQ5IV6jN oxAPrGu2wgaxRQCXkQs+ETwXPTtfhY9ppspFbvOsWGrMGoLibg3czFNWYEErZUxlxVYJ 2qwoS/fRbVYjSuDfNUr0sGHxQYLF+gAgSF6EG4KKzs4JCNRPqm5jayhug8E7sFiDJ+vX gbmb0Uw26rGUmqG11gQkNoFUqjWm8xy1lOwPtz0cH1ZduK33w5gWPHLksI5ZTQhfWqFR c1mqhsllx/pfkm7stbh1y/xsJ127GmlEq23rUY0J0YZE/hRg3rLVFZprA+7Evhx/+8aA 6Bmw== X-Gm-Message-State: AC+VfDwWpM7rTQP+fKwDeVKqx8FQjFpfbBxgTOsWCXdDVTjREpV6Cs+c ut9Jkr2O6pCdrS8sowY8KLcB2LcNQ4s= X-Google-Smtp-Source: ACHHUZ4OWrwes3Wbc2SwnwWB9MOoDj6/h3XbD39EOp05PTiLlNr54U6j+KQrDkNfYUuFRVXLLIe5TQ== X-Received: by 2002:a05:6808:2a44:b0:39e:b58c:13d5 with SMTP id fa4-20020a0568082a4400b0039eb58c13d5mr4573771oib.17.1688175418398; Fri, 30 Jun 2023 18:36:58 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id h19-20020a056808015300b003a0619d78ebsm3037240oie.55.2023.06.30.18.36.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 18:36:58 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Jun 2023 22:36:51 -0300 Message-ID: <20230701013651.30004-2-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230701013651.30004-1-jamrial@gmail.com> References: <20230701013651.30004-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_h266: store RowHeightVal in the context 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 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: Stop overwriting values from the bitstream array pps_tile_row_height_minus1. Signed-off-by: James Almer --- libavcodec/cbs_h266_syntax_template.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index ec2bb1ccc3..625995a2bd 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -1779,14 +1779,14 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, "Tile row height(%d) exceeds picture height\n",i); return AVERROR_INVALIDDATA; } + current->row_height_val[i] = current->pps_tile_row_height_minus1[i] + 1; remaining_size -= (current->pps_tile_row_height_minus1[i] + 1); } - unified_size = (i == 0 ? pic_height_in_ctbs_y : - (current->pps_tile_row_height_minus1[i - 1] + 1)); + unified_size = current->pps_tile_row_height_minus1[i - 1] + 1; while (remaining_size > 0) { unified_size = FFMIN(remaining_size, unified_size); - current->pps_tile_row_height_minus1[i] = unified_size - 1; + current->row_height_val[i] = unified_size; remaining_size -= unified_size; i++; } @@ -1855,17 +1855,17 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, ctu_x += current->pps_tile_column_width_minus1[j] + 1; } for (j = 0; j < tile_y; j++) { - ctu_y += current->pps_tile_row_height_minus1[j] + 1; + ctu_y += current->row_height_val[j]; } if (current->pps_slice_width_in_tiles_minus1[i] == 0 && current->pps_slice_height_in_tiles_minus1[i] == 0 && - current->pps_tile_row_height_minus1[tile_y] > 0) { + current->row_height_val[tile_y] > 1) { int num_slices_in_tile, uniform_slice_height, remaining_height_in_ctbs_y; remaining_height_in_ctbs_y = - current->pps_tile_row_height_minus1[tile_y] + 1; + current->row_height_val[tile_y]; ues(pps_num_exp_slices_in_tile[i], - 0, current->pps_tile_row_height_minus1[tile_y], 1, i); + 0, current->row_height_val[tile_y] - 1, 1, i); if (current->pps_num_exp_slices_in_tile[i] == 0) { num_slices_in_tile = 1; slice_top_left_ctu_x[i] = ctu_x; @@ -1875,7 +1875,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, for (j = 0; j < current->pps_num_exp_slices_in_tile[i]; j++) { ues(pps_exp_slice_height_in_ctus_minus1[i][j], 0, - current->pps_tile_row_height_minus1[tile_y], 2, + current->row_height_val[tile_y] - 1, 2, i, j); slice_height_in_ctus = current-> @@ -1890,7 +1890,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, remaining_height_in_ctbs_y -= slice_height_in_ctus; } uniform_slice_height = 1 + - (j == 0 ? current->pps_tile_row_height_minus1[tile_y] : + (j == 0 ? current->row_height_val[tile_y] - 1: current->pps_exp_slice_height_in_ctus_minus1[i][j-1]); while (remaining_height_in_ctbs_y > uniform_slice_height) { current->slice_height_in_ctus[i + j] = @@ -1919,7 +1919,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, j <= current->pps_slice_height_in_tiles_minus1[i]; j++) { height += - current->pps_tile_row_height_minus1[tile_y + j] + 1; + current->row_height_val[tile_y + j]; } current->slice_height_in_ctus[i] = height; @@ -1959,7 +1959,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, ctu_x += current->pps_tile_column_width_minus1[j] + 1; } for (j = 0; j < tile_y; j++) { - ctu_y += current->pps_tile_row_height_minus1[j] + 1; + ctu_y += current->row_height_val[j]; } slice_top_left_ctu_x[i] = ctu_x; slice_top_left_ctu_y[i] = ctu_y; @@ -1972,7 +1972,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, for (j = 0; j <= current->pps_slice_height_in_tiles_minus1[i]; j++) { height += - current->pps_tile_row_height_minus1[tile_y + j] + 1; + current->row_height_val[tile_y + j]; } current->slice_height_in_ctus[i] = height; @@ -2015,6 +2015,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, infer(pps_tile_column_width_minus1[0], pic_width_in_ctbs_y - 1); infer(pps_num_exp_tile_rows_minus1, 0); infer(pps_tile_row_height_minus1[0], pic_height_in_ctbs_y - 1); + infer(row_height_val[0], pic_height_in_ctbs_y); infer(num_tile_columns, 1); infer(num_tile_rows, 1); infer(num_tiles_in_pic, 1); @@ -3037,7 +3038,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_slice_address + current->sh_num_tiles_in_slice_minus1; tile_idx++) { tile_y = tile_idx / pps->num_tile_rows; - height = pps->pps_tile_row_height_minus1[tile_y] + 1; + height = pps->row_height_val[tile_y]; num_entry_points += (entropy_sync ? height : 1); } } -- 2.41.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".