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 9813E46AE6 for ; Sun, 2 Jul 2023 23:28:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D894F68C4E4; Mon, 3 Jul 2023 02:28:01 +0300 (EEST) Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 30EBF68016E for ; Mon, 3 Jul 2023 02:27:55 +0300 (EEST) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1b3a4c51ec2so282879fac.0 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=1688340473; x=1690932473; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aDCcXGKUQCZD3dvKJh4mkdcFJ6Qty+YxFjI4kgifrVQ=; b=OZr+38Qj4t3R/6pqbueYFaeCnh6CLO+99EZd0EsjwwlgnO2U3vqBYOHjjuHmHJvKSg 9XMxlidhtCk5wLXGuaCOy8iHSBVowUvekcB5axOLgXMlbRslObVCIOQrYP8T4dvidiPw R0y6bXIXIw/0E854FUQ92w4xEkCcUT4nUhZQkrvmTzLPH/S6dNjQSFK4yKNkGTT+x4PU TB68Rh+VK/A48e+xIyjXltvYriEE25v8k/s94OjP4Ohfa8ZX7lHjHmKNYBwyGh8uiGSf iKuxVQUW3L6/xroaESvRyqW2nDpHuQ8BzjN/GUot25IdVioAUYz9lLe0b5vwdUqEYWCr 2gSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688340473; x=1690932473; 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=aDCcXGKUQCZD3dvKJh4mkdcFJ6Qty+YxFjI4kgifrVQ=; b=SSE9SCeLF1tPm+yXxATD6hp1jrdpG0113IgHUiOPdwo/3uLeE5DbBJ3A1DGbT1QdGH IeUMC1qmoHNQGLZhdo4BL1b/xLyMLI9y1adqTp5IfOlEFKslhkRhxvMe7ZC5JQW+W+iO otqu1JPLjTdsluIMws/rcj7ypax+RyN3oAdj5VMXHo1uE/TCBqsdykFUIJiRU0d8T+4v bOIlB4iF7+V1meBGw5fpPPywmYKGZX5CU8n5+wJd1WYoKU0ilzzwE1blWyid7NMdD44s L3Sw1y9kKS1rZgfP/p+ScoxXioGPJ+TYFMoSLyKQRATLwAFT5P/VguX3wDg/lDDV10ZB vaDg== X-Gm-Message-State: AC+VfDyKjL2MH4MAffPmGRt+wbU1mevZxXAT+4VDGVSTAU80Etb7Rr7m i3r6fpzuXRVN8elCwhFuIVfxMZwn2zY= X-Google-Smtp-Source: ACHHUZ4Ys22r+IMHQaLkpzBIuaRLmt0nTkv2UVX0f5Aaz5F5dAvyUDdcxgl3I6wsJfUR33pf40R6og== X-Received: by 2002:a05:6870:2193:b0:1b0:1dcb:e706 with SMTP id l19-20020a056870219300b001b01dcbe706mr6826670oae.26.1688340472755; Sun, 02 Jul 2023 16:27:52 -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.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 16:27:52 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Jul 2023 20:26:19 -0300 Message-ID: <20230702232622.6870-1-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/cbs_h266: add support for Operating point 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 | 11 +++++++++++ libavcodec/cbs_h266_syntax_template.c | 27 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 68ccf6a7eb..8dc9ae471d 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_OPI_NUT: + { + err = cbs_h266_read_opi(ctx, &gbc, unit->content); + + if (err < 0) + return err; + } + break; case VVC_VPS_NUT: { H266RawVPS *vps = unit->content; @@ -1593,6 +1601,15 @@ static int cbs_h266_write_nal_unit(CodedBitstreamContext *ctx, int err; switch (unit->type) { + case VVC_OPI_NUT: + { + H266RawOPI *opi = unit->content; + + err = cbs_h266_write_opi(ctx, pbc, opi); + if (err < 0) + return err; + } + break; case VVC_VPS_NUT: { H266RawVPS *vps = unit->content; @@ -1965,6 +1982,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_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), CBS_UNIT_TYPE_INTERNAL_REF(VVC_PPS_NUT, H266RawPPS, extension_data.data), diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index e33d08a0f5..693d1ca1fd 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -230,6 +230,17 @@ typedef struct H266RawVUI { H266RawExtensionData extension_data; } H266RawVUI; +typedef struct H266RawOPI { + H266RawNALUnitHeader nal_unit_header; + + uint8_t opi_ols_info_present_flag; + uint8_t opi_htid_info_present_flag; + uint16_t opi_ols_idx; + uint8_t opi_htid_plus1; + uint8_t opi_extension_flag; + H266RawExtensionData extension_data; +} H266RawOPI; + typedef struct H266RawVPS { H266RawNALUnitHeader nal_unit_header; diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 957735056f..d9c8e0afbe 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -623,6 +623,33 @@ static int FUNC(ols_timing_hrd_parameters) (CodedBitstreamContext *ctx, return 0; } +static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw, + H266RawOPI *current) +{ + int err; + + HEADER("Operating point information"); + + CHECK(FUNC(nal_unit_header)(ctx, rw, + ¤t->nal_unit_header, VVC_OPI_NUT)); + + flag(opi_ols_info_present_flag); + flag(opi_htid_info_present_flag); + + if(current->opi_ols_info_present_flag) + ue(opi_ols_idx, 0, VVC_MAX_TOTAL_NUM_OLSS - 1); + + if(current->opi_htid_info_present_flag) + ub(3, opi_htid_plus1); + + flag(opi_extension_flag); + if (current->opi_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) { -- 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".