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 18F7F46ADE for ; Sun, 2 Jul 2023 23:28:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE5A968C4F2; Mon, 3 Jul 2023 02:28:02 +0300 (EEST) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C04E68016E for ; Mon, 3 Jul 2023 02:27:55 +0300 (EEST) Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6b73741a632so2972738a34.3 for ; Sun, 02 Jul 2023 16:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688340474; x=1690932474; 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=6lbFjLr9MsrXR7jooJtMYnVj98+NDt89eutiGEwdQe4=; b=jS4wzdXkHWhz82vgJnXtPFQ16R6AvtuevD8aQKq6bdMCaiRmzKR+XKI3VLsaLcNYi2 Pw50L0wpD4Z7GlNensqfsvyEXFxrR6OpDETOXF0ra2rsa7wZwcO5HzUMJBLZ6YI9zIHX IVeWp3OnQZwqiD86a//oAC9YmlOiukqdVH1Ti6W+SuSKigUS6y8c6PUPs1j8P/aWmE8F lF6Lv7c0NZkMOByAUuQcBAckN89g4CFfSBmGvEjq7THMEqvHVnq3SX3aLjex23M5R1Qe gTWeAfvN/khDKSdMvZs94q3vi4byCT2Y2X9X/tP+i78ds+6VkI/vMluNuA+WQwNFKJZ+ Kpqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688340474; x=1690932474; 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=6lbFjLr9MsrXR7jooJtMYnVj98+NDt89eutiGEwdQe4=; b=E9R8i7/RexAOLxrO/YdOND0ovFTBn4D2HSJPbRD/o8JS5NXWXOvXtMyBTDN1KxpsOU KgPY8MRkmR9zlU3cIV1WndUfcqDnIBBuUFGrci+qOlihPaukUyjdzp0TbUrAKFVF90EE Co3OPkG6ayPLvzjUw2JN+8fWo1KMUdei+IQ2SZByIf6cX49Ke7nviBVEcCR7jDE3Boz3 xyGQlFtNkyUdLy1slx8gX0xRSe9Dk4EejATXoNM6Tl8uEGnkN1xyYEh7jxuakomWcRzQ C5f6u7+sVfYeQ/LQ7YdkfoVbqCWgtyLx7PkS1RSMtd8wibivCcJKGymkDxFsR9A4mWBQ cT9w== X-Gm-Message-State: AC+VfDxi6Qp3AhmR1RaE1L7yMmKW6KX+Pa0/OLw2NbzeYO044mBZgwfb b+1Yct95p7ccYmGoJ1IpkfVeK94jIVI= X-Google-Smtp-Source: ACHHUZ4m3x8fCWf3gvwKPaG9TRGBUmxNe1dxsDr5W+5F/veEdHCA67kFAdZDBcJAD4+56sfhkbZCEg== X-Received: by 2002:a9d:4d13:0:b0:6b3:d369:9c0a with SMTP id n19-20020a9d4d13000000b006b3d3699c0amr7393341otf.19.1688340473815; Sun, 02 Jul 2023 16:27:53 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id f17-20020a9d7b51000000b006b89596bc61sm3265098oto.61.2023.07.02.16.27.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 16:27:53 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Jul 2023 20:26:20 -0300 Message-ID: <20230702232622.6870-2-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230702232622.6870-1-jamrial@gmail.com> References: <20230702232622.6870-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/cbs_h266: add support for Decoding capability information NALU type 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: Signed-off-by: James Almer --- libavcodec/cbs_h2645.c | 18 ++++++++++++++++++ libavcodec/cbs_h266.h | 10 ++++++++++ libavcodec/cbs_h266_syntax_template.c | 24 ++++++++++++++++++++++++ libavcodec/vvc.h | 3 +++ 4 files changed, 55 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 8dc9ae471d..95da597427 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -1059,6 +1059,14 @@ static int cbs_h266_read_nal_unit(CodedBitstreamContext *ctx, return err; switch (unit->type) { + case VVC_DCI_NUT: + { + err = cbs_h266_read_dci(ctx, &gbc, unit->content); + + if (err < 0) + return err; + } + break; case VVC_OPI_NUT: { err = cbs_h266_read_opi(ctx, &gbc, unit->content); @@ -1601,6 +1609,15 @@ static int cbs_h266_write_nal_unit(CodedBitstreamContext *ctx, int err; switch (unit->type) { + case VVC_DCI_NUT: + { + H266RawDCI *dci = unit->content; + + err = cbs_h266_write_dci(ctx, pbc, dci); + if (err < 0) + return err; + } + break; case VVC_OPI_NUT: { H266RawOPI *opi = unit->content; @@ -1982,6 +1999,7 @@ static void cbs_h266_free_sei(void *opaque, uint8_t *content) } static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = { + CBS_UNIT_TYPE_INTERNAL_REF(VVC_DCI_NUT, H266RawDCI, extension_data.data), CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data), CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data), CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data), diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 693d1ca1fd..87aa2d849d 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -241,6 +241,16 @@ typedef struct H266RawOPI { H266RawExtensionData extension_data; } H266RawOPI; +typedef struct H266RawDCI { + H266RawNALUnitHeader nal_unit_header; + + uint8_t dci_reserved_zero_4bits; + uint8_t dci_num_ptls_minus1; + H266RawProfileTierLevel dci_profile_tier_level[VVC_MAX_DCI_PTLS]; + uint8_t dci_extension_flag; + H266RawExtensionData extension_data; +} H266RawDCI; + typedef struct H266RawVPS { H266RawNALUnitHeader nal_unit_header; diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index d9c8e0afbe..4ea29ec789 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -650,6 +650,30 @@ static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw, return 0; } +static int FUNC(dci)(CodedBitstreamContext *ctx, RWContext *rw, + H266RawDCI *current) +{ + int err, i; + + HEADER("Decoding capability information"); + + CHECK(FUNC(nal_unit_header)(ctx, rw, + ¤t->nal_unit_header, VVC_DCI_NUT)); + + ub(4, dci_reserved_zero_4bits); + ub(4, dci_num_ptls_minus1); + for (i = 0; i <= current->dci_num_ptls_minus1; i++) + CHECK(FUNC(profile_tier_level)(ctx, rw, + current->dci_profile_tier_level + i, 1, 0)); + + flag(dci_extension_flag); + if (current->dci_extension_flag) + CHECK(FUNC(extension_data)(ctx, rw, ¤t->extension_data)); + CHECK(FUNC(rbsp_trailing_bits)(ctx, rw)); + + return 0; +} + static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, H266RawVPS *current) { diff --git a/libavcodec/vvc.h b/libavcodec/vvc.h index 099d2fc2ad..eda1b40eef 100644 --- a/libavcodec/vvc.h +++ b/libavcodec/vvc.h @@ -76,6 +76,9 @@ enum { //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive VVC_MAX_SUBLAYERS = 7, + //7.3.2.1 dci_num_ptls_minus1 is u(4) + VVC_MAX_DCI_PTLS = 16, + //7.4.3.3 vps_num_ptls_minus1 is u(8) VVC_MAX_PTLS = 256, -- 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".