From patchwork Fri Nov 17 13:03:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 44696 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a20:b0:181:818d:5e7f with SMTP id e32csp559551pzh; Fri, 17 Nov 2023 05:03:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGteCMJnTTdaY7oqeNvRE77+bgaUlRT24xL7brzDSJXV6pNWBba7nZ8mMBuS6FCkvr4MYwE X-Received: by 2002:a05:6512:3e28:b0:500:7a23:720b with SMTP id i40-20020a0565123e2800b005007a23720bmr18251429lfv.55.1700226217516; Fri, 17 Nov 2023 05:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700226217; cv=none; d=google.com; s=arc-20160816; b=MKvRc2N5W5lgTLwUMM1KI1o4QYxiSyhHN93s2kGUzL0kO7kkLRXGCN1nlfotEgEKK/ pXiLv0HP90YPq1n2Gh4VFmZ0L5tymQZx+g0eAqDKYwImVow30BQgYE2i8Gb3/Yh6N7Sk JA8IaqcM6NIiRJhHSC1EwxMMNw/Typv550tCSNLJ5wkgPIo+wLZLAQjR5Y9Hi3B9E8J4 uuZyqnQIUfjEZbJhtWPK1wNY2iWyihKJqfTNZdul2NAPGsTO9M8jTCFBjoImjwVicocm I7J94Kah1sbXtNPYKZkjgEnZ0ZV6OzHPq1tiIGZ/Si4/5tvY21sAPP6kXrNuMJipzcyu aubA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=EiEWH+0Hh/P5pWBGXmbBVw/6V7vBmHWy3Peq171T8AI=; fh=paNsSD/gLXCX8XaG2wP2EhSbyn4+hY3DzFJxc2Arm+k=; b=MT6N3HvqatTBH2UmQF5NBX2v4ByeE7Z8vld21SQ08rJXrNBl6guFex5DiHffMdLFiG t+iDl3rTV9Frb7fig3T3LbNINdxWizi7m4KZJbFU9USCHNaAQpEJp+7H9HM7QVoFT1zD oFUHg99EqJFCd4Gw7B+kmGAfg/ZsyfCTNMIkg50vgZvHa1K8zW15AJ7UJDo2L5zLsU9o IqmD+anE2pNHTfLqIWFYRgDbtpRpaburkCV4Ax85rf0doDYT1e/WVkttoDWcmeexutZM TnJ9Hv0IHKPEW1FbXjc1ybnVg4tBywoCAZR2oTZbHb/LeORiLS/6FYFTNEVtdGruXPsz rjTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b="e2Nw0k/1"; 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 k15-20020a1709065fcf00b009e740a9fbf8si882855ejv.508.2023.11.17.05.03.36; Fri, 17 Nov 2023 05:03:37 -0800 (PST) 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="e2Nw0k/1"; 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 9DC2D68CD08; Fri, 17 Nov 2023 15:03:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 539F668C778 for ; Fri, 17 Nov 2023 15:03:27 +0200 (EET) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40859dee28cso16148265e9.0 for ; Fri, 17 Nov 2023 05:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700226206; x=1700831006; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=K6uTupceGFohu8hMAC4V2ePF54PjJU1OUnqasjJbRPs=; b=e2Nw0k/15ZtFryuQITQujN4qu/N/CM7h4IeVIH7XNFKid0ZlOFQQCM31rG140XNE2B 47xllBv6nbKauR2Nng/hZg8Uh7CPyegEKDcHHliZSFiUGQD1NP8ICoVTuTGtIFa5gejN u6d3+t2JHUi6Y/DFpV3dAsdYTVy/D7tPRNKUF213mQSJ9RXrz05/lxoWVazr1uHTYJoB 8DNUlvIdPD08Fwb8CJKRbjhI1oCLJTRyj9SRa1DdhlRiCTbgFcB6NJUEsJawuOE9L2Ee qPkWOEFgWqqjaPVpFPj0D6hOYkDYkwAuqRSJ4JudYpe0BgT47hb7NMXIE+uOQySJXmwq qoFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700226206; x=1700831006; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K6uTupceGFohu8hMAC4V2ePF54PjJU1OUnqasjJbRPs=; b=ndqOKqQh4jD3fmM6pjwfwVBTFYjRDIIYD8S+oKzYQg7kJ24+u2+zLHRoqX0k0/LtJk w4Mrvl50Ra1+Rnf8Eon3SKOuoLDtba4chwgLXKeAi2JvJBGP6IyYHzXB6B6uHmFuG+qi oaNfPs9ZEaA7lObxHzMjO/XVTvTNi+jbj6CMpSK4jRO2uOWPccYMoqwyP3XiQXd+oOoq MoC2Rw/fk36n71/hfUvc/5MVlSon80S2yyhRRFzpct/t4Re6YHM7cI4zNBiqJbIr59/N OaQUpPcSUdXXNP+Hb3WaasvAktuIfT2N8d9VZbr/Ns20KLkVDULUNF9ryV5322kvs6lM iBPg== X-Gm-Message-State: AOJu0YyM/RTFxJatFgn5fo8g+MzE5B/M1Ke8de+AfeKoaVD+/7yGQ5+k QDNbE1F70sOChAfqeopb+iyMrn/Qth79kMtB X-Received: by 2002:a05:600c:3143:b0:3fb:feb0:6f40 with SMTP id h3-20020a05600c314300b003fbfeb06f40mr16007010wmo.11.1700226205954; Fri, 17 Nov 2023 05:03:25 -0800 (PST) Received: from localhost.localdomain ([49.51.162.193]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0040a48430837sm6919203wmp.13.2023.11.17.05.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 05:03:25 -0800 (PST) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Nov 2023 21:03:21 +0800 Message-Id: <20231117130322.3502477-1-mypopydev@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support 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: Jun Zhao , Jun Zhao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: LBeDzqvSBCNa Add sps_multilayer_extensio support. Signed-off-by: Jun Zhao --- libavcodec/cbs_h265.h | 3 +++ libavcodec/cbs_h265_syntax_template.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h index 1b1195f198..15951269fd 100644 --- a/libavcodec/cbs_h265.h +++ b/libavcodec/cbs_h265.h @@ -330,6 +330,9 @@ typedef struct H265RawSPS { uint8_t persistent_rice_adaptation_enabled_flag; uint8_t cabac_bypass_alignment_enabled_flag; + // Multilayer extension. + uint8_t inter_view_mv_vert_constraint_flag; + // Screen content coding extension. uint8_t sps_curr_pic_ref_enabled_flag; uint8_t palette_mode_enabled_flag; diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 2d4b954718..1e3bc1acd8 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++ b/libavcodec/cbs_h265_syntax_template.c @@ -717,6 +717,16 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw, return 0; } +static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawSPS *current) +{ + int err; + + flag(inter_view_mv_vert_constraint_flag); + + return 0; +} + static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw, H265RawSPS *current) { @@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_range_extension_flag) CHECK(FUNC(sps_range_extension)(ctx, rw, current)); if (current->sps_multilayer_extension_flag) - return AVERROR_PATCHWELCOME; + CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current)); if (current->sps_3d_extension_flag) return AVERROR_PATCHWELCOME; if (current->sps_scc_extension_flag) From patchwork Fri Nov 17 13:03:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 44697 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a20:b0:181:818d:5e7f with SMTP id e32csp559698pzh; Fri, 17 Nov 2023 05:03:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrfvIgDqKKJw2sHNWJKKV8zfOMTge7bk04BJgnRn7bsqj+LWEKzTiURxfQrAHpT14UORsy X-Received: by 2002:aa7:d3d1:0:b0:53f:23eb:24c8 with SMTP id o17-20020aa7d3d1000000b0053f23eb24c8mr12073150edr.40.1700226226566; Fri, 17 Nov 2023 05:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700226226; cv=none; d=google.com; s=arc-20160816; b=NlgLkD01oPNUaWAoHfPUQ8qge76bNbUP5vKlmJ0VFRyTgHj2vwJMebC6lXPD2ojQ4q SJ/BUfLQXcWlUxzxWhnoLiwflALXwomjGic/7ZOoyQlc+V8pGQxrm+h11En/yPUkMY+s c3RzUFj1MgnU9ERQIJRENbkHf1wFvR9M7V3C1F3QFIpkDsrnA6upbNqCsUfLgcOMMGX2 3lEki/UgvlkYS0woridQImM3odwkSMTBKDaHH0mAChO+wOoouom9DwBrkXdvO9fS/SWN IIZa5GcPvpLzUVWIrAkK3YhYY2SEa4u0Cffnkoqj79P20xh5mf39lMxwZQ8D/3xaIUUo ktuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=WQB3raZTISaCTFzCUvGDUHJngaEJYRylUhyeBvyp9yA=; fh=paNsSD/gLXCX8XaG2wP2EhSbyn4+hY3DzFJxc2Arm+k=; b=yJbhNWxtuMAIA/CAVr7IS6Zd2afQeurwtzXHQKLg7VBgsuV/r9FfjkGtldeLs3c+6C 90LrrayvkqUPJXRYcWiJVssVCGUC9V3pOLma3aKxdrM+Acwn76/ZxEyVFucSe0rLayo4 rA7cAjpPLCGTjosyKDVI5jhAsCBJoNrTjBlEr1rN7C4ZZ7ydxB1GB4Wy9Y3m6mt9sCJQ iDY4PXIMTKknChpY5bfmigt+YCKqhhNds4N70KICT3TEvQv1nAPLIyAJ1nMlNbo39cEe e4WjSk1t/Urd71vy8fZOvsgTTMHR+DMSsbppqjV2fri6tAGi21wemEP9hJ8+cK6ADGzy /6TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=I2wQBZDn; 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 d10-20020a056402516a00b0053f943c9f92si956524ede.117.2023.11.17.05.03.46; Fri, 17 Nov 2023 05:03:46 -0800 (PST) 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=I2wQBZDn; 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 D388568CC7E; Fri, 17 Nov 2023 15:03:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B336968CD0D for ; Fri, 17 Nov 2023 15:03:29 +0200 (EET) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4084de32db5so17130815e9.0 for ; Fri, 17 Nov 2023 05:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700226209; x=1700831009; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X+qSP686b9RJkWUgKAgQEDFYz3PNsE/3EHV6DRRVkyA=; b=I2wQBZDn7Air2Cnm7IRNp+U9gzopSP3wf1l3MPcQ6URgFli4oVxjETPCH1The+WR+D RK9YHNQKHQ91fkRxYPRqLlfkEPW7dNI4I/sowYj53DgX7sh6IsJXIY+LHGfIIGYV19Br SAkT90AjMMiQRc6yslPC2F6v2l8UwrdhPMziow5dxILslLJWVi8pS0e4w6jySYLFwFjI H950GWyNRlFlm5Mjo1+vuANvgDJyWyY/7nRK+TsS9DRBPU+c8eQqFpj4COlD/hhx8Z52 cvRvJ+YW7eUtscWiUn504diYGoQa517URAjJo1pi/h4CQSserrrG57NDuSORdr7B5Wrh l7pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700226209; x=1700831009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X+qSP686b9RJkWUgKAgQEDFYz3PNsE/3EHV6DRRVkyA=; b=B4+nC/I0JrGwRCy7MeiI/16gUipk6ogq5dI6LFAwOUspee3nshjzUYCGsVdNg0pIIX MUUcDNQWaWa+SlMW2F+VG2bRLjyuVylUcBZ+sU40hgb2Iyy6urdTRwl1sVdyFnZoFTRP 3512NTSNtSDCeYxUlz12XSksojQeUDnpAsZUeA49HZ707A9vM34gl55M+qxKSsTxS1G9 qydoGEg/xLmkadIFxam7oVMCJRFScvBnesQSFPhPPRm1ZJ6JFvGaGPc4ugDb0qves8tL DFr8id0v/T8kmBwDfvXPQicdMz4Bl9avX3L19XStsdFrtGlqGI00FU1Ncs7LwB8RD4IJ 91yA== X-Gm-Message-State: AOJu0YxccpTLOEY7V/tKo1RcvVSYjNII1Jia5nrUwlfTnVKuUPz2w1LU l7iBCDp/hKPEXHi9aEkxrxWj3iCyilcuNIoO X-Received: by 2002:a05:600c:4703:b0:405:3cc5:1105 with SMTP id v3-20020a05600c470300b004053cc51105mr15547311wmo.8.1700226208850; Fri, 17 Nov 2023 05:03:28 -0800 (PST) Received: from localhost.localdomain ([49.51.162.193]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0040a48430837sm6919203wmp.13.2023.11.17.05.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 05:03:28 -0800 (PST) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Nov 2023 21:03:22 +0800 Message-Id: <20231117130322.3502477-2-mypopydev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117130322.3502477-1-mypopydev@gmail.com> References: <20231117130322.3502477-1-mypopydev@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support 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: Jun Zhao , Jun Zhao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZzBANXOKS4xc Add pps_multilayer_extensio support. Signed-off-by: Jun Zhao --- libavcodec/cbs_h265.h | 28 ++++++++++++++++ libavcodec/cbs_h265_syntax_template.c | 48 ++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h index 15951269fd..d83dc97072 100644 --- a/libavcodec/cbs_h265.h +++ b/libavcodec/cbs_h265.h @@ -421,6 +421,34 @@ typedef struct H265RawPPS { uint8_t log2_sao_offset_scale_luma; uint8_t log2_sao_offset_scale_chroma; + // Multilayer extension + uint8_t poc_reset_info_present_flag; + uint8_t pps_infer_scaling_list_flag; + uint8_t pps_scaling_list_ref_layer_id; + uint8_t num_ref_loc_offsets; + uint8_t ref_loc_offset_layer_id[HEVC_MAX_LAYERS]; + + uint8_t scaled_ref_layer_offset_present_flag[HEVC_MAX_LAYERS]; + int16_t scaled_ref_layer_left_offset[HEVC_MAX_LAYERS]; + int16_t scaled_ref_layer_top_offset[HEVC_MAX_LAYERS]; + int16_t scaled_ref_layer_right_offset[HEVC_MAX_LAYERS]; + int16_t scaled_ref_layer_bottom_offset[HEVC_MAX_LAYERS]; + + uint8_t ref_region_offset_present_flag[HEVC_MAX_LAYERS]; + int16_t ref_region_left_offset[HEVC_MAX_LAYERS]; + int16_t ref_region_top_offset[HEVC_MAX_LAYERS]; + int16_t ref_region_right_offset[HEVC_MAX_LAYERS]; + int16_t ref_region_bottom_offset[HEVC_MAX_LAYERS]; + + uint8_t resample_phase_set_present_flag[HEVC_MAX_LAYERS]; + uint8_t phase_hor_luma[HEVC_MAX_LAYERS]; + uint8_t phase_ver_luma[HEVC_MAX_LAYERS]; + uint8_t phase_hor_chroma_plus8[HEVC_MAX_LAYERS]; + uint8_t phase_ver_chroma_plus8[HEVC_MAX_LAYERS]; + + uint8_t colour_mapping_enabled_flag; + // TODO: colour_mapping_table + // Screen content coding extension. uint8_t pps_curr_pic_ref_enabled_flag; uint8_t residual_adaptive_colour_transform_enabled_flag; diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 1e3bc1acd8..de8b838209 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++ b/libavcodec/cbs_h265_syntax_template.c @@ -1003,6 +1003,52 @@ static int FUNC(pps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw, return 0; } +static int FUNC(pps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw, + H265RawPPS *current) +{ + int err, i, index; + + flag(poc_reset_info_present_flag); + flag(pps_infer_scaling_list_flag); + if (current->pps_infer_scaling_list_flag) + ub(6, pps_scaling_list_ref_layer_id); + ue(num_ref_loc_offsets, 0, HEVC_MAX_LAYERS); + + for (i=0; inum_ref_loc_offsets; i++) { + ub(6, ref_loc_offset_layer_id[i]); + index = current->ref_loc_offset_layer_id[i]; + + flag(scaled_ref_layer_offset_present_flag[i]); + if (current->scaled_ref_layer_offset_present_flag[i]) { + se(scaled_ref_layer_left_offset[index], -16383, +16384); + se(scaled_ref_layer_top_offset[index], -16383, +16384); + se(scaled_ref_layer_right_offset[index], -16383, +16384); + se(scaled_ref_layer_bottom_offset[index], -16383, +16384); + } + + flag(ref_region_offset_present_flag[i]); + if (current->ref_region_offset_present_flag[i]) { + se(ref_region_left_offset[index], -16383, +16384); + se(ref_region_top_offset[index], -16383, +16384); + se(ref_region_right_offset[index], -16383, +16384); + se(ref_region_bottom_offset[index], -16383, +16384); + } + + flag(resample_phase_set_present_flag[i]); + if (current->resample_phase_set_present_flag[i]) { + ue(phase_hor_luma[index], 0, 31); + ue(phase_ver_luma[index], 0, 31); + ue(phase_hor_chroma_plus8[index], 0, 63); + ue(phase_ver_chroma_plus8[index], 0, 63); + } + } + + flag(colour_mapping_enabled_flag); + if (current->colour_mapping_enabled_flag) + return AVERROR_PATCHWELCOME; + return 0; +} + static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw, H265RawPPS *current) { @@ -1153,7 +1199,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->pps_range_extension_flag) CHECK(FUNC(pps_range_extension)(ctx, rw, current)); if (current->pps_multilayer_extension_flag) - return AVERROR_PATCHWELCOME; + CHECK(FUNC(pps_multilayer_extension)(ctx, rw, current)); if (current->pps_3d_extension_flag) return AVERROR_PATCHWELCOME; if (current->pps_scc_extension_flag)