From patchwork Sat Jul 1 01:36:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 42360 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp2912500pzh; Fri, 30 Jun 2023 18:37:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjis7neF1QC82hF0jbSmQTjn29/C9lGx9PmCms4mPoLsbclrkgqHX66p9KWWaC31wHr0mP X-Received: by 2002:a2e:9150:0:b0:2b6:9ed5:bf15 with SMTP id q16-20020a2e9150000000b002b69ed5bf15mr3377851ljg.23.1688175430982; Fri, 30 Jun 2023 18:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688175430; cv=none; d=google.com; s=arc-20160816; b=UpbbLgRoWaNusaGg2MucTeGJQFnzBltQNxI/S2k9FsYTbnVP1EnVAcfvnuK52MqrMy Ofa/ZvHUbOpcGS8OVN3zHoQkubKK9j30xWHcC04vYVZeVx6HHPrjBG/R6aUEMzUpPu+Q zedG8bxBRj0mH2V95q05Dh7D1TswVkwmb4i514zmfgVCOmpC1TF3MDBcaBfjL2YvnKwc e4Mrgdlt0LdXhRbbB7Gy/FwOoML6/dZrm9F2KFB+qNsY/ShP99+2eJv36LkmdGwh70eV pYJ9sDcr/VQSAEob//zVd8P5WqOm3ocbH8XHnnwYuCc6BbWIvzMD9w3ngdqvtiEaJ+nl Y58g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=4fuUxsWyk0YI8zBE7mt5JR0ZlxNADoAjifO6b6Ecc2I=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=VuHULhMctObP0az8ekPbeAWsGToXyLQN0gIhKBRe50hKtpSbbO8RDiy3/bjKL31Qb+ uthwkFSiy5bas/qM0dSATFk8I66YsCXGjmuyacF3E3Oe/PmuIsUmCOZ5+gyWpndtY1SE DL2T1OlU7C783yY5F2LN2VZa89cBN0NyVsmTExciBsnV3kT9F+WocWby7KTQ7Wnwa+l/ egVJVkPgUfPuctXr5S+VXX0qV5afo0rXqwNfMd2bvmLtnsH9XCbWTgn64x5rladvw/ui JO4i/Ri21zIZdlE4XkHikRn/SDswyMPYducZI3CqeaA55iT0A170zva5vpK2uUPY0pkl TnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=eGo3cbJ0; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d27-20020a056402517b00b0051c1a0a584dsi8339297ede.468.2023.06.30.18.37.09; Fri, 30 Jun 2023 18:37:10 -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=@gmail.com header.s=20221208 header.b=eGo3cbJ0; 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 94C3C68BF5F; Sat, 1 Jul 2023 04:37:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 587DC68AFA8 for ; Sat, 1 Jul 2023 04:36:59 +0300 (EEST) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3a1c162cdfeso1800805b6e.2 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=1688175417; x=1690767417; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+FWVNxjwpe4epc3XZEqg2hk3L90HlY9LH8XD2UbIEbI=; b=eGo3cbJ00SgzW1HPV8tQK5emMl2xg78lNgtq3pT54BKJpQM3ixDGbRIp8EXcatINPa 91sgRNIUZP9N9Ya2oleU7cqrfQW2MLoMuA8v0gGlmi1SfuLReJSQKE7M5rTjqoaQGwVt Mgv0S9nzpj4vZiqvG5OuQ9VgkkJYbcFRM0PPN80RQmP9D/RXl4usc7sgruXGpGMYytGj Et22kusQc+IaU1l+u4SoCBHC1k6tkPfrnNX8xYHU8SWAe4h3wLrHhk3mwPJtiXNJQ4gY wDrfb6dfvqy8qyD86wn9E41d/YIl4IAKQMifnJHDs1Ix0hWaVXKawu90lmRdoGrYcQSm RFXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688175417; x=1690767417; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+FWVNxjwpe4epc3XZEqg2hk3L90HlY9LH8XD2UbIEbI=; b=Z3vAeBQU3rNT4Q49Mjh6I5ksiESPW/VR2Vornj6CT+8dDiQgPIwqbGqb7EPVajIBXO 6ffN3RKwvCS2ZjzeeMuudyAv2QL8GLW3LBlzTEknxR2GTMvBf0pLSNtVMLQPyEerKn1y eDuhHkevsCWz32EdD0SdvydSrUAqbBzgDO6wQpruxKbhykDjjgLWVXfybRVxVFWMjK9x TUf2Fv8PubM54dVKxcB8rvmIfYLhZNp7GiLVM2/qx05LRwAOE0pIAUPtxuwdrXRF7JEp 0SpvkcxWE8UP1T+YaQPI+j0NcSoIv9k6CIRzoJok6rmN8FcDoTDwI/lI5Tx/vvfzXnCM s3xA== X-Gm-Message-State: AC+VfDx3NMcUn4wvJ1wRGsnONOB4r54DAb5y6IBUyP24Z20HZGcn+x4k okeVpSBEo3ki1B83yL0o2yB07bh5SqY= X-Received: by 2002:a05:6808:191c:b0:3a3:6e43:e681 with SMTP id bf28-20020a056808191c00b003a36e43e681mr5120003oib.58.1688175417329; Fri, 30 Jun 2023 18:36:57 -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.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 18:36:56 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Jun 2023 22:36:50 -0300 Message-ID: <20230701013651.30004-1-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/cbs_h266: store SubpicIdVal 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: c9pXYrk9Oe4d And use it to derive CurrSubpicIdx Signed-off-by: James Almer --- libavcodec/cbs_h266.h | 2 ++ libavcodec/cbs_h266_syntax_template.c | 34 +++++++++++++-------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index be3c744426..edcb5ad0e3 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -552,6 +552,8 @@ typedef struct H266RawPPS { uint16_t num_tiles_in_pic; uint16_t slice_height_in_ctus[VVC_MAX_SLICES]; uint16_t num_slices_in_subpic[VVC_MAX_SLICES]; + uint16_t sub_pic_id_val[VVC_MAX_SLICES]; + uint16_t row_height_val[VVC_MAX_TILE_ROWS]; } H266RawPPS; typedef struct H266RawAUD { diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 863fecdefa..ec2bb1ccc3 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -1706,6 +1706,15 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, } } + for (i = 0; i <= sps->sps_num_subpics_minus1; i++) { + if (sps->sps_subpic_id_mapping_explicitly_signalled_flag) + current->sub_pic_id_val[i] = current->pps_subpic_id_mapping_present_flag + ? current->pps_subpic_id[i] + : sps->sps_subpic_id[i]; + else + current->sub_pic_id_val[i] = i; + } + pic_width_in_ctbs_y = AV_CEIL_RSHIFT (current->pps_pic_width_in_luma_samples, (sps->sps_log2_ctu_size_minus5 + 5)); pic_height_in_ctbs_y = AV_CEIL_RSHIFT( @@ -2697,25 +2706,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (sps->sps_subpic_info_present_flag) { ub(sps->sps_subpic_id_len_minus1 + 1, sh_subpic_id); - if (sps->sps_subpic_id_mapping_explicitly_signalled_flag) { - for (i = 0; i <= sps->sps_num_subpics_minus1; i++) { - uint16_t subpic_id_val = - pps->pps_subpic_id_mapping_present_flag ? - pps->pps_subpic_id[i] : sps->sps_subpic_id[i]; - if (subpic_id_val == current->sh_subpic_id) { - curr_subpic_idx = i; - break; - } - } - } else { - curr_subpic_idx = current->sh_subpic_id; - if (curr_subpic_idx > sps->sps_num_subpics_minus1) { - av_log(ctx->log_ctx, AV_LOG_ERROR, - "sh_subpic_id(%d) should in range [0, %d]\n", - curr_subpic_idx, sps->sps_num_subpics_minus1); - return AVERROR_INVALIDDATA; + for (i = 0; i <= sps->sps_num_subpics_minus1; i++) { + if (pps->sub_pic_id_val[i] == current->sh_subpic_id) { + curr_subpic_idx = i; + break; } } + if (i > sps->sps_num_subpics_minus1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "invalid CurrSubpicIdx %d\n", i); + return AVERROR_INVALIDDATA; + } } else { curr_subpic_idx = 0; } From patchwork Sat Jul 1 01:36:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 42361 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp2912527pzh; Fri, 30 Jun 2023 18:37:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlEO2uF6KbhAJ6mCDg7wgiAiBe+/UGpcWau5ac8N1fOiD4oz0/ePqQMtld1GNTnkg8/LUIUB X-Received: by 2002:aa7:d0d9:0:b0:51d:98e4:4c4e with SMTP id u25-20020aa7d0d9000000b0051d98e44c4emr2306265edo.40.1688175439340; Fri, 30 Jun 2023 18:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688175439; cv=none; d=google.com; s=arc-20160816; b=Hc1b53ecDCKFZMLIioStOU9eAGwx1Z6YRf10WSvb10YNLQPoECkQoleH8mSryF8LaK w0za5/OMgkI+TWMk3vSx8pqZ69phQwBDjBaA4Y/06kZV6ijy1YUTkIQW8kpQ0Mf/gRaJ P+sD6ZsIoGQnOhvMG1swJvJFv9w5cZ9oT/qwI2PJUKKV4VvkZb8ld6x7lnDfE45W8gGI PaEXhQxQxI54KKSx5FuHtBqYWpjBwtSkFFvbomNlht3IrcH7aOH8+O7QC8FRc5Z3ZO6r QQJal3ej2won6Wzgu7itYVlD6Ye36k5hvH0e8Y347bg+rTFK8fgJa9KASPOJVInH+r4x AVvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=DjQx/tu6sY+hK+q2+0azdbIfMdNNL/3v1UJFD0fr49I=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=CQq3A81vlHhk+nNUc+/TYJBkVp6AY700b2xV5twmqvbGYaQyYkULfm7oeiF3xi9L2H 7LZlZwSN18tMBfx0m9snG7mLMjaqDEV/GtQ4Cy7vUtLjOqP57OA8dwPjTv8t3VdtxHFs bLO17WouNad4tm7nYYknvox0UozeIBeq0aX9iEPmyYfW8YSVp21I3SDkIGErnVk5Zqlm flqoUI2LC5ulTKXsyTvUPN0aUuos3ewyuJKl6lLPjIZ958WqVOTZ+HqiO12GjaO8gtVh 4IQeCZ3k5MUheT+wJC0KJ0+H4gU9MtebJhRHsVV5k9ErxjMyb4ONbYdLpqvIkMvjltIP NXxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=Fr+TfW1b; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p10-20020a056402074a00b0051dd240ed28si3438776edy.157.2023.06.30.18.37.19; Fri, 30 Jun 2023 18:37:19 -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=@gmail.com header.s=20221208 header.b=Fr+TfW1b; 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 ABB1368C09C; Sat, 1 Jul 2023 04:37:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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-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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zN5GZ5j7HtM/ 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); } }