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 B65F244584 for ; Wed, 19 Oct 2022 12:07:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75EAF68BD65; Wed, 19 Oct 2022 15:07:05 +0300 (EEST) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 451FE68BC8C for ; Wed, 19 Oct 2022 15:06:59 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id C572E100004 for ; Wed, 19 Oct 2022 12:06:57 +0000 (UTC) Date: Wed, 19 Oct 2022 14:06:56 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20221019120656.GA295890@pb2> References: <20221019072508.23460-1-thomas.ff@spin-digital.com> <20221019072508.23460-7-thomas.ff@spin-digital.com> MIME-Version: 1.0 In-Reply-To: <20221019072508.23460-7-thomas.ff@spin-digital.com> Subject: Re: [FFmpeg-devel] [PATCH v1 06/11] avformat: add demuxer and probe support for H266/VVC 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: multipart/mixed; boundary="===============3620018108138054534==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3620018108138054534== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2022 at 09:25:03AM +0200, thomas.ff@spin-digital.com wrote: > From: Thomas Siedel >=20 > Add demuxer to probe raw vvc and parse vvcc byte stream format. >=20 > Signed-off-by: Thomas Siedel > --- > 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 >=20 > 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) +=3D vocenc.= o voc.o > OBJS-$(CONFIG_VPK_DEMUXER) +=3D vpk.o > OBJS-$(CONFIG_VPLAYER_DEMUXER) +=3D vplayerdec.o subtitles.o > OBJS-$(CONFIG_VQF_DEMUXER) +=3D vqf.o > +OBJS-$(CONFIG_VVC_DEMUXER) +=3D vvcdec.o rawdec.o > OBJS-$(CONFIG_W64_DEMUXER) +=3D wavdec.o w64.o pcm.o > OBJS-$(CONFIG_W64_MUXER) +=3D wavenc.o w64.o > OBJS-$(CONFIG_WAV_DEMUXER) +=3D 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, i= nt64_t *pts_buffer, int64_t > { > FFStream *const sti =3D ffstream(st); > int onein_oneout =3D st->codecpar->codec_id !=3D AV_CODEC_ID_H264 && > - st->codecpar->codec_id !=3D AV_CODEC_ID_HEVC; > + st->codecpar->codec_id !=3D AV_CODEC_ID_HEVC && > + st->codecpar->codec_id !=3D AV_CODEC_ID_VVC; > =20 > if (!onein_oneout) { > int delay =3D sti->avctx->has_b_frames; > @@ -933,7 +935,8 @@ static void compute_pkt_fields(AVFormatContext *s, AV= Stream *st, > int64_t offset; > AVRational duration; > int onein_oneout =3D st->codecpar->codec_id !=3D AV_CODEC_ID_H264 && > - st->codecpar->codec_id !=3D AV_CODEC_ID_HEVC; > + st->codecpar->codec_id !=3D AV_CODEC_ID_HEVC && > + st->codecpar->codec_id !=3D AV_CODEC_ID_VVC; > =20 > 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-1= 301 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: =E2=80=98__int128=E2=80=99 is not suppo= rted 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 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY0/oWQAKCRBhHseHBAsP q/RKAJ0UeDZPca6ZM4Fw/QASBld0Xtl3FQCfYjZzLM5FuU7BIe1J7EpATlkwsRk= =Fc1T -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn-- --===============3620018108138054534== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3620018108138054534==--