From patchwork Sat Jul 13 14:58:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 50524 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:2298:b0:482:c625:d099 with SMTP id fp24csp1415355vqb; Sat, 13 Jul 2024 08:16:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX3P0Mp7GX91DWFA1bY8qEs3PQKE3uUcIQIgvWFulAsfpdEb1Y8yroVJ85zx8iOwaL5Dk0sGjGhLqnVla1oEJznlxvTv5/h4VGJrg== X-Google-Smtp-Source: AGHT+IEGG08sUDemTVX6mDi0onqovNrR9QHkJvc6PNqumeLES1Xj722FBTg6U9Mp3TyFkFKabt4R X-Received: by 2002:a2e:9482:0:b0:2ec:56b9:259f with SMTP id 38308e7fff4ca-2eeb319134dmr89987361fa.48.1720883807550; Sat, 13 Jul 2024 08:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720883807; cv=none; d=google.com; s=arc-20160816; b=Z/EN+JhSY+nvMHi8MfVE02zKee9U9w4qyYGSoBf8swOC9lNxlIvadsaYAutFrN8NWh xZBOqpG1hNO+2tybh6i3aAy+EIdWjldSKAXrBhbVSejBN+B8U5rgGhLXDQq/I3ihvIEh 86fOM727wEjP0Wthu0eCYHWEplwswSEOuyYy7DMVONAw8Lt+tm+Ht91JHd4HCsyNUxp5 RPEvd9ZHCOQbHqQ/1fXQQcGdLj5ATI2PMCKCLfLIstiKE07BnCaT4vh+2hF6GNR15w5G wQkHD49rBFcnm0lx5FE+hRBE8nFBlAW200mmfSX3TBIEZDldUvB8zVo5Gu8BAEpHmFxL COQg== 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=nWQRfDpudIhXUFPafOY+NyFU0UwEam5iOVKRBeEMUww=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=u4hCljG5bqfqmmcGmm/ngFw3UCg821ravd7cEGB9x2cbfExvbVcfjcGQelIFQuCucw TTUAoJ3ymugMTYIZ6kEa/viU8Q2F0KJrV5pORExRnhs4c+XBnprnVfjg3eKyI6ZSgleC 449vPco9XdPbOQcRfcr9E3veJtPNgn6uXc9GQtHgC23JkVPVZXC4oz1msmidIDgE9kC9 TBW4hZZwKb2IyHiveZU7hCJlsWZlr521ro45xTve2VAgji6PcxmmCvMCwe0cwo88G5WD lSb3PS9rk56ShW6FfWbNJlZDCSbxfPk5gEVpr7YeC5uWCqx7GS+eypFhe1wxvOI77AG9 Fqqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=c++iPuXS; 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 38308e7fff4ca-2eee192b102si4124341fa.409.2024.07.13.08.16.47; Sat, 13 Jul 2024 08:16:47 -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=20230601 header.b=c++iPuXS; 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 86D9368DC1F; Sat, 13 Jul 2024 17:59:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2944068DBE7 for ; Sat, 13 Jul 2024 17:59:08 +0300 (EEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1fb72eb3143so20937305ad.1 for ; Sat, 13 Jul 2024 07:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720882745; x=1721487545; darn=ffmpeg.org; 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=+sOx6JUcFYH0ztM3qtw525t3MyAp0VRey9dd9lq6wR8=; b=c++iPuXSlBiY64aSHkUi8+qW0FR//C455YzvXNYtmck6ezPDYIJYC08ctpchP8/4Ic iuecwJDOSYmuSdrdgywbSr2P/EY/p0jmxO+oV813KhzMhZIm6WoAVV9N/59GLl5L6KCh VVvRhcK3PPzLRjL2xWkVcIPvgzq/j58sEDo/LNW00yNOT5pYIHjDZgzcXeNU5myp04Ko Fd92BI4x6P8B6h/ENCltmfhThe5hu1bDGllqLFcuhJiKEKfA9XvqQA3s55ELlS2sTOid duGwjB07HsX89CktCLn1dWJAbctBCCRlGL0ZPqPtByE9p7A9nKmUvf3//U49kXWvipDX C6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720882745; x=1721487545; 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=+sOx6JUcFYH0ztM3qtw525t3MyAp0VRey9dd9lq6wR8=; b=WFVMZmxLXPPvrI9E6v9ovOv5iKB+egjko8W0Pyf1oWATDY38yTVylVk8XbR0WC0CjC Mcuv+omtfBbmYde1lgwXg88SbSNFZQ7dWvCe27u8wSzbmdKZ8LRiWPkdqkk9XygfidBA 6OB8UiVHApbZtcWSxhGS+USjt36Fy3tmZAPaAEmLnBVsIEKx9RUR27jeGpJ6gFkn48JR FbRAMAQLf7v85fu1/QCQZ0D1BvoiCnxFYMmppaOi+tEIQOwInuJw5RrKrvFCSwiZKsFv 6EKE42ALqQvEgW7uF6IT+xJlS5hD2rV6vsDmp08GfCXrZpORpaDtvYCjH1GhPHWU+k8o iw9A== X-Gm-Message-State: AOJu0Yw9hri/ampTwVFKA/WN2jSurqFHzQdP1F3OtI0rath0n9jKzkr5 WH8nJOBDRvrIKm3QHqdSmlN6C8IFrS8+/AdsDr6aKQE0nnchn3eE7C5f+Q== X-Received: by 2002:a17:902:e843:b0:1fb:80a3:5826 with SMTP id d9443c01a7336-1fc0b4b4829mr28432385ad.4.1720882745473; Sat, 13 Jul 2024 07:59:05 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fc0eea3cfbsm9800275ad.115.2024.07.13.07.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 07:59:04 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Jul 2024 11:58:45 -0300 Message-ID: <20240713145846.1331-3-jamrial@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240713145846.1331-1-jamrial@gmail.com> References: <20240713145846.1331-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/cbs_h265: reindent after the previous commit 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: IWSIkIlqjPl0 Signed-off-by: James Almer --- libavcodec/cbs_h265_syntax_template.c | 124 +++++++++++++------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 2f8ee0db10..1826950e8e 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++ b/libavcodec/cbs_h265_syntax_template.c @@ -806,7 +806,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, } if (current->nal_unit_header.nuh_layer_id == 0) - u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1); + u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1); else { u(3, sps_ext_or_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS); infer(sps_max_sub_layers_minus1, current->sps_ext_or_max_sub_layers_minus1 == 7 @@ -816,25 +816,25 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, multi_layer_ext_sps_flag = current->nal_unit_header.nuh_layer_id && current->sps_ext_or_max_sub_layers_minus1 == 7; if (!multi_layer_ext_sps_flag) { - flag(sps_temporal_id_nesting_flag); + flag(sps_temporal_id_nesting_flag); - if (vps->vps_temporal_id_nesting_flag && - !current->sps_temporal_id_nesting_flag) { - av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " - "sps_temporal_id_nesting_flag must be 1 if " - "vps_temporal_id_nesting_flag is 1.\n"); - return AVERROR_INVALIDDATA; - } - if (current->sps_max_sub_layers_minus1 == 0 && - current->sps_temporal_id_nesting_flag != 1) { - av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " - "sps_temporal_id_nesting_flag must be 1 if " - "sps_max_sub_layers_minus1 is 0.\n"); - return AVERROR_INVALIDDATA; - } + if (vps->vps_temporal_id_nesting_flag && + !current->sps_temporal_id_nesting_flag) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " + "sps_temporal_id_nesting_flag must be 1 if " + "vps_temporal_id_nesting_flag is 1.\n"); + return AVERROR_INVALIDDATA; + } + if (current->sps_max_sub_layers_minus1 == 0 && + current->sps_temporal_id_nesting_flag != 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " + "sps_temporal_id_nesting_flag must be 1 if " + "sps_max_sub_layers_minus1 is 0.\n"); + return AVERROR_INVALIDDATA; + } - CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, - 1, current->sps_max_sub_layers_minus1)); + CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, + 1, current->sps_max_sub_layers_minus1)); } else { if (current->sps_max_sub_layers_minus1 > 0) infer(sps_temporal_id_nesting_flag, vps->vps_temporal_id_nesting_flag); @@ -849,56 +849,56 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->update_rep_format_flag) ub(8, sps_rep_format_idx); } else { - ue(chroma_format_idc, 0, 3); - if (current->chroma_format_idc == 3) - flag(separate_colour_plane_flag); - else - infer(separate_colour_plane_flag, 0); + ue(chroma_format_idc, 0, 3); + if (current->chroma_format_idc == 3) + flag(separate_colour_plane_flag); + else + infer(separate_colour_plane_flag, 0); - ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); - ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); + ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); + ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); - flag(conformance_window_flag); - if (current->conformance_window_flag) { - ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); - ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); - ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); - ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); - } else { - infer(conf_win_left_offset, 0); - infer(conf_win_right_offset, 0); - infer(conf_win_top_offset, 0); - infer(conf_win_bottom_offset, 0); - } + flag(conformance_window_flag); + if (current->conformance_window_flag) { + ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); + ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); + ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); + ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); + } else { + infer(conf_win_left_offset, 0); + infer(conf_win_right_offset, 0); + infer(conf_win_top_offset, 0); + infer(conf_win_bottom_offset, 0); + } - ue(bit_depth_luma_minus8, 0, 8); - ue(bit_depth_chroma_minus8, 0, 8); + ue(bit_depth_luma_minus8, 0, 8); + ue(bit_depth_chroma_minus8, 0, 8); } ue(log2_max_pic_order_cnt_lsb_minus4, 0, 12); if (!multi_layer_ext_sps_flag) { - flag(sps_sub_layer_ordering_info_present_flag); - for (i = (current->sps_sub_layer_ordering_info_present_flag ? - 0 : current->sps_max_sub_layers_minus1); - i <= current->sps_max_sub_layers_minus1; i++) { - ues(sps_max_dec_pic_buffering_minus1[i], - 0, HEVC_MAX_DPB_SIZE - 1, 1, i); - ues(sps_max_num_reorder_pics[i], - 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); - ues(sps_max_latency_increase_plus1[i], - 0, UINT32_MAX - 1, 1, i); - } - if (!current->sps_sub_layer_ordering_info_present_flag) { - for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { - infer(sps_max_dec_pic_buffering_minus1[i], - current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); - infer(sps_max_num_reorder_pics[i], - current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); - infer(sps_max_latency_increase_plus1[i], - current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); + flag(sps_sub_layer_ordering_info_present_flag); + for (i = (current->sps_sub_layer_ordering_info_present_flag ? + 0 : current->sps_max_sub_layers_minus1); + i <= current->sps_max_sub_layers_minus1; i++) { + ues(sps_max_dec_pic_buffering_minus1[i], + 0, HEVC_MAX_DPB_SIZE - 1, 1, i); + ues(sps_max_num_reorder_pics[i], + 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); + ues(sps_max_latency_increase_plus1[i], + 0, UINT32_MAX - 1, 1, i); + } + if (!current->sps_sub_layer_ordering_info_present_flag) { + for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { + infer(sps_max_dec_pic_buffering_minus1[i], + current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); + infer(sps_max_num_reorder_pics[i], + current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); + infer(sps_max_latency_increase_plus1[i], + current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); + } } - } } ue(log2_min_luma_coding_block_size_minus3, 0, 3); @@ -937,9 +937,9 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_infer_scaling_list_flag) ub(6, sps_scaling_list_ref_layer_id); else { - flag(sps_scaling_list_data_present_flag); - if (current->sps_scaling_list_data_present_flag) - CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); + flag(sps_scaling_list_data_present_flag); + if (current->sps_scaling_list_data_present_flag) + CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); } } else { infer(sps_scaling_list_data_present_flag, 0);