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 ESMTPS id 2BEEC4C301 for ; Thu, 6 Feb 2025 15:52:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3042468BD0A; Thu, 6 Feb 2025 17:52:26 +0200 (EET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2FEC468B845 for ; Thu, 6 Feb 2025 17:52:20 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8581144365 for ; Thu, 6 Feb 2025 15:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1738857139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xxFWIeN89DsJrdRrKNTaCEYH8K2iEnrU8yU5BIMk7Ik=; b=f/nW0+H4MpEHXX4jOE6/2hCMv91P6IF05qQe2nOuEVvMKYENSlCGjvxdQ9/p8TDxLlZy++ i5vHCZgAM9JfevCC/HG1X8Bz/Y/apt5hMwfrPRuoTDcvMp20/Ju4yKkmHEiCOoDS21FkiF 699plXTBYmRuYezs0k9bk/9ySC7izqfO9AAKvWX84xb/oL7sUIIXnrFNdru0RMIuwMfTBg HcKA2dgrPhyn4yhIBcMsFDCK6F0hqg6CkQ6MeyVR+DYrYpmC5UUPp0CJKEYAxVgIr7JDI6 9Et1AKM6o9XC0YKo23gAP/sf35LDVUCYUwBRTtK0fefeBfSOC1GqqpW/ZVdA/g== Date: Thu, 6 Feb 2025 16:52:18 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250206155218.GS4991@pb2> References: <20250203021603.6413-1-jamrial@gmail.com> <20250203021603.6413-2-jamrial@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250203021603.6413-2-jamrial@gmail.com> X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieejkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec: add a ffv1 parser 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="===============3823629190501468499==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3823629190501468499== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6DPVEwpgP8vNBkty" Content-Disposition: inline --6DPVEwpgP8vNBkty Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 02, 2025 at 11:16:03PM -0300, James Almer wrote: > Only setting frame and stream properties. No packetization is performed. >=20 > Signed-off-by: James Almer > --- > configure | 1 + > libavcodec/Makefile | 1 + > libavcodec/ffv1_parser.c | 86 ++++++++++++++++++++++++++++++++++++++++ > libavcodec/parsers.c | 1 + > 4 files changed, 89 insertions(+) > create mode 100644 libavcodec/ffv1_parser.c >=20 > diff --git a/configure b/configure > index 06f641ead0..f09faaf505 100755 > --- a/configure > +++ b/configure > @@ -3469,6 +3469,7 @@ vvc_qsv_decoder_select=3D"vvc_mp4toannexb_bsf qsvde= c" > aac_parser_select=3D"adts_header mpeg4audio" > av1_parser_select=3D"cbs_av1" > evc_parser_select=3D"evcparse" > +ffv1_parser_select=3D"rangecoder" > ftr_parser_select=3D"adts_header mpeg4audio" > h264_parser_select=3D"golomb h264dsp h264parse h264_sei" > hevc_parser_select=3D"hevcparse hevc_sei" > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > index 44bb34182a..973e2c45d6 100644 > --- a/libavcodec/Makefile > +++ b/libavcodec/Makefile > @@ -1207,6 +1207,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER) +=3D dvbsub_= parser.o > OBJS-$(CONFIG_DVD_NAV_PARSER) +=3D dvd_nav_parser.o > OBJS-$(CONFIG_DVDSUB_PARSER) +=3D dvdsub_parser.o > OBJS-$(CONFIG_EVC_PARSER) +=3D evc_parser.o > +OBJS-$(CONFIG_FFV1_PARSER) +=3D ffv1_parser.o ffv1_parse.o f= fv1.o > OBJS-$(CONFIG_FLAC_PARSER) +=3D flac_parser.o flacdata.o fla= c.o > OBJS-$(CONFIG_FTR_PARSER) +=3D ftr_parser.o > OBJS-$(CONFIG_G723_1_PARSER) +=3D g723_1_parser.o > diff --git a/libavcodec/ffv1_parser.c b/libavcodec/ffv1_parser.c > new file mode 100644 > index 0000000000..d0b396b693 > --- /dev/null > +++ b/libavcodec/ffv1_parser.c > @@ -0,0 +1,86 @@ > +/* > + * 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 "avcodec.h" > +#include "ffv1.h" > +#include "rangecoder.h" > + > +typedef struct FFV1ParseContext { > + FFV1Context f; > + int got_first; > +} FFV1ParseContext; > + > +static int parse(AVCodecParserContext *s, > + AVCodecContext *avctx, > + const uint8_t **poutbuf, int *poutbuf_size, > + const uint8_t *buf, int buf_size) > +{ > + FFV1ParseContext *p =3D s->priv_data; > + FFV1Context *f =3D &p->f; > + RangeCoder c; > + uint8_t keystate =3D 128; > + > + *poutbuf =3D buf; > + *poutbuf_size =3D buf_size; > + > + if (!p->got_first) { > + int ret =3D ff_ffv1_common_init(avctx, f); > + p->got_first =3D 1; > + if (ret < 0) > + return buf_size; > + > + if (avctx->extradata_size > 0 && (ret =3D ff_ffv1_read_extra_hea= der(f)) < 0) > + return buf_size; > + } > + > + ff_init_range_decoder(&c, buf, buf_size); > + ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8); > + > + f->avctx =3D avctx; > + s->key_frame =3D get_rac(&c, &keystate); > + s->pict_type =3D AV_PICTURE_TYPE_I; //FIXME I vs. P, see ffv1dec.c id remove the comment, also in ffv1dec.c patch should be ok thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued --6DPVEwpgP8vNBkty Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ6TasgAKCRBhHseHBAsP q0vEAJ9LOZL3SPdMZk++Nw/Y+uQ2OOPhMACgmCG8c2+ndZ54iFEYnoxsayJ+Q1g= =DlFY -----END PGP SIGNATURE----- --6DPVEwpgP8vNBkty-- --===============3823629190501468499== 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". --===============3823629190501468499==--