Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v1 06/11] avformat: add demuxer and probe support for H266/VVC
Date: Wed, 19 Oct 2022 14:06:56 +0200
Message-ID: <20221019120656.GA295890@pb2> (raw)
In-Reply-To: <20221019072508.23460-7-thomas.ff@spin-digital.com>


[-- Attachment #1.1: Type: text/plain, Size: 7187 bytes --]

On Wed, Oct 19, 2022 at 09:25:03AM +0200, thomas.ff@spin-digital.com wrote:
> From: Thomas Siedel <thomas.ff@spin-digital.com>
> 
> Add demuxer to probe raw vvc and parse vvcc byte stream format.
> 
> Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com>
> ---
>  libavformat/Makefile     |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/demux.c      |   7 +-
>  libavformat/vvc.c        | 918 +++++++++++++++++++++++++++++++++++++++
>  libavformat/vvc.h        |  99 +++++
>  libavformat/vvcdec.c     |  61 +++
>  6 files changed, 1085 insertions(+), 2 deletions(-)
>  create mode 100644 libavformat/vvc.c
>  create mode 100644 libavformat/vvc.h
>  create mode 100644 libavformat/vvcdec.c
> 
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index d7f198bf39..00ab4ded89 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -595,6 +595,7 @@ OBJS-$(CONFIG_VOC_MUXER)                 += vocenc.o voc.o
>  OBJS-$(CONFIG_VPK_DEMUXER)               += vpk.o
>  OBJS-$(CONFIG_VPLAYER_DEMUXER)           += vplayerdec.o subtitles.o
>  OBJS-$(CONFIG_VQF_DEMUXER)               += vqf.o
> +OBJS-$(CONFIG_VVC_DEMUXER)               += vvcdec.o rawdec.o
>  OBJS-$(CONFIG_W64_DEMUXER)               += wavdec.o w64.o pcm.o
>  OBJS-$(CONFIG_W64_MUXER)                 += wavenc.o w64.o
>  OBJS-$(CONFIG_WAV_DEMUXER)               += wavdec.o pcm.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 47c419a009..a4e3822681 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -474,6 +474,7 @@ extern const AVOutputFormat ff_voc_muxer;
>  extern const AVInputFormat  ff_vpk_demuxer;
>  extern const AVInputFormat  ff_vplayer_demuxer;
>  extern const AVInputFormat  ff_vqf_demuxer;
> +extern const AVInputFormat  ff_vvc_demuxer;
>  extern const AVInputFormat  ff_w64_demuxer;
>  extern const AVOutputFormat ff_w64_muxer;
>  extern const AVInputFormat  ff_wav_demuxer;
> diff --git a/libavformat/demux.c b/libavformat/demux.c
> index 2dfd82a63c..8dbde23fcd 100644
> --- a/libavformat/demux.c
> +++ b/libavformat/demux.c
> @@ -120,6 +120,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
>          { "mp3",        AV_CODEC_ID_MP3,          AVMEDIA_TYPE_AUDIO    },
>          { "mpegvideo",  AV_CODEC_ID_MPEG2VIDEO,   AVMEDIA_TYPE_VIDEO    },
>          { "truehd",     AV_CODEC_ID_TRUEHD,       AVMEDIA_TYPE_AUDIO    },
> +        { "vvc",        AV_CODEC_ID_VVC,          AVMEDIA_TYPE_VIDEO    },
>          { 0 }
>      };
>      int score;
> @@ -743,7 +744,8 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t
>  {
>      FFStream *const sti = ffstream(st);
>      int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
> -                       st->codecpar->codec_id != AV_CODEC_ID_HEVC;
> +                       st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
> +                       st->codecpar->codec_id != AV_CODEC_ID_VVC;
>  
>      if (!onein_oneout) {
>          int delay = sti->avctx->has_b_frames;
> @@ -933,7 +935,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
>      int64_t offset;
>      AVRational duration;
>      int onein_oneout = st->codecpar->codec_id != AV_CODEC_ID_H264 &&
> -                       st->codecpar->codec_id != AV_CODEC_ID_HEVC;
> +                       st->codecpar->codec_id != AV_CODEC_ID_HEVC &&
> +                       st->codecpar->codec_id != AV_CODEC_ID_VVC;
>  
>      if (s->flags & AVFMT_FLAG_NOFILLIN)
>          return;
> diff --git a/libavformat/vvc.c b/libavformat/vvc.c
> new file mode 100644
> index 0000000000..fd0527242f
> --- /dev/null
> +++ b/libavformat/vvc.c
> @@ -0,0 +1,918 @@
> +/*
> + * VVC helper functions for muxers
> + *
> + * Copyright (C) 2022, Thomas Siedel
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include "libavcodec/get_bits.h"
> +#include "libavcodec/golomb.h"
> +#include "libavcodec/vvc.h"
> +#include "libavutil/intreadwrite.h"
> +#include "avc.h"
> +#include "avio.h"
> +#include "avio_internal.h"
> +#include "vvc.h"
> +
> +typedef struct VVCCNALUnitArray {
> +    uint8_t  array_completeness;
> +    uint8_t  NAL_unit_type;
> +    uint16_t num_nalus;
> +    uint16_t *nal_unit_length;
> +    uint8_t  **nal_unit;
> +} VVCCNALUnitArray;
> +
> +typedef struct VVCPTLRecord {
> +    uint8_t  num_bytes_constraint_info;
> +    uint8_t  general_profile_idc;
> +    uint8_t  general_tier_flag;
> +    uint8_t  general_level_idc;
> +    uint8_t  ptl_frame_only_constraint_flag;
> +    uint8_t  ptl_multilayer_enabled_flag;
> +    uint8_t  *general_constraint_info;
> +    uint8_t  *ptl_sublayer_level_present_flag;
> +    uint8_t  *sublayer_level_idc;
> +    uint8_t  ptl_num_sub_profiles;
> +    uint32_t *general_sub_profile_idc;
> +} VVCPTLRecord;
> +
> +typedef struct VVCDecoderConfigurationRecord {
> +    uint8_t  lengthSizeMinusOne;
> +    uint8_t  ptl_present_flag;
> +    uint16_t ols_idx;
> +    uint8_t  num_sublayers;
> +    uint8_t  constant_frame_rate;
> +    uint8_t  chroma_format_idc;
> +    uint8_t  bit_depth_minus8;
> +    VVCPTLRecord ptl;
> +    uint16_t max_picture_width;
> +    uint16_t max_picture_height;
> +    uint16_t avg_frame_rate;
> +    uint8_t  num_of_arrays;
> +    VVCCNALUnitArray *array;
> +} VVCDecoderConfigurationRecord;
> +
> +typedef struct VVCCProfileTierLevel {
> +    uint8_t profile_idc;
> +    uint8_t tier_flag;
> +    uint8_t general_level_idc;
> +    uint8_t ptl_frame_only_constraint_flag;
> +    uint8_t ptl_multilayer_enabled_flag;
> +// general_constraint_info
> +    uint8_t   gci_present_flag;
> +    unsigned __int128 gci_general_constraints;

not standard and not building

src/libavformat/vvc.c:78:14: error: ‘__int128’ is not supported on this target
     unsigned __int128 gci_general_constraints;
              ^~~~~~~~
src/ffbuild/common.mak:81: recipe for target 'libavformat/vvc.o' failed
make: *** [libavformat/vvc.o] Error 1
make: *** Waiting for unfinished jobs....

if you really need 128bit ints there is libavutil/integer.h
but maybe you dont need 128bit ints

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

  reply	other threads:[~2022-10-19 12:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  7:24 [FFmpeg-devel] [PATCH v1 00/11] Add " thomas.ff
2022-10-19  7:24 ` [FFmpeg-devel] [PATCH v1 01/11] avcodec: add enum types " thomas.ff
2022-10-19  7:24 ` [FFmpeg-devel] [PATCH v1 02/11] avcodec: add cbs " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 03/11] avcodec: enable " thomas.ff
2022-10-19 23:07   ` James Almer
2022-10-24 14:23     ` Thomas Siedel
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 04/11] avcodec: add bitstream parser " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 05/11] avcodec: add MP4 to annexb support " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 06/11] avformat: add demuxer and probe " thomas.ff
2022-10-19 12:06   ` Michael Niedermayer [this message]
2022-10-24 14:19     ` Thomas Siedel
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 07/11] avformat: add muxer " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 08/11] avcodec: add external decoder libvvdec " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 09/11] avcodec: add external encoder libvvenc " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 10/11] avformat: add ts stream types " thomas.ff
2022-10-19  7:25 ` [FFmpeg-devel] [PATCH v1 11/11] avcodec: increase minor version " thomas.ff
2022-12-13  6:19 ` [FFmpeg-devel] [PATCH v1 00/11] Add support " Nuo Mi
2022-12-15  9:11   ` Thomas Siedel
2023-01-03 14:02     ` Thomas Siedel
2023-01-10  2:56       ` Nuo Mi
2023-01-10 11:08         ` mypopy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019120656.GA295890@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git