[FFmpeg-devel] [PATCH v12 5/9] libavcodec/dnxucdec: DNxUncompressed decoder

Diederick C. Niehorster dcnieho at gmail.com
Wed Oct 23 10:12:13 EEST 2024


On Wed, Oct 23, 2024 at 8:44 AM James Almer <jamrial at gmail.com> wrote:
>
> On 10/21/2024 4:57 PM, Martin Schitter wrote:
> > ---
> >   libavcodec/Makefile    |   1 +
> >   libavcodec/allcodecs.c |   1 +
> >   libavcodec/dnxucdec.c  | 338 +++++++++++++++++++++++++++++++++++++++++
> >   3 files changed, 340 insertions(+)
> >   create mode 100644 libavcodec/dnxucdec.c
> >
> > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > index dd5d0de..e13b127 100644
> > --- a/libavcodec/Makefile
> > +++ b/libavcodec/Makefile
> > @@ -328,6 +328,7 @@ OBJS-$(CONFIG_DFPWM_DECODER)           += dfpwmdec.o
> >   OBJS-$(CONFIG_DFPWM_ENCODER)           += dfpwmenc.o
> >   OBJS-$(CONFIG_DNXHD_DECODER)           += dnxhddec.o dnxhddata.o
> >   OBJS-$(CONFIG_DNXHD_ENCODER)           += dnxhdenc.o dnxhddata.o
> > +OBJS-$(CONFIG_DNXUC_DECODER)           += dnxucdec.o
> >   OBJS-$(CONFIG_DOLBY_E_DECODER)         += dolby_e.o dolby_e_parse.o kbdwin.o
> >   OBJS-$(CONFIG_DPX_DECODER)             += dpx.o
> >   OBJS-$(CONFIG_DPX_ENCODER)             += dpxenc.o
> > diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> > index c7e5f99..ccca2ad 100644
> > --- a/libavcodec/allcodecs.c
> > +++ b/libavcodec/allcodecs.c
> > @@ -93,6 +93,7 @@ extern const FFCodec ff_dfa_decoder;
> >   extern const FFCodec ff_dirac_decoder;
> >   extern const FFCodec ff_dnxhd_encoder;
> >   extern const FFCodec ff_dnxhd_decoder;
> > +extern const FFCodec ff_dnxuc_decoder;
> >   extern const FFCodec ff_dpx_encoder;
> >   extern const FFCodec ff_dpx_decoder;
> >   extern const FFCodec ff_dsicinvideo_decoder;
> > diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c
> > new file mode 100644
> > index 0000000..9d5847d
> > --- /dev/null
> > +++ b/libavcodec/dnxucdec.c
> > @@ -0,0 +1,338 @@
> > +/*
> > + * Avid DNxUncomressed / SMPTE RDD 50 decoder
> > + * Copyright (c) 2024 Martin Schitter
> > + *
> > + * 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
> > + */
> > +
> > +/*
> > + This decoder for DNxUncompressed video data is mostly based on
> > + reverse engineering of output generated by DaVinci Resolve 19
> > + but was later also checked against the SMPTE RDD 50 specification.
> > +
> > + Not all DNxUncompressed pixel format variants are supported,
> > + but at least an elementary base set is already usable:
> > +
> > +  - YUV 4:2:2 8/10/12/16bit/half/float   (16bit untested)
> > +    YUV 4:4:4 8/16bit/half/float         (all untested!)
> > +  - RGB 8/10/12/16bit/half/float         (16bit untested)
> > +    Alpha/Y 8/16bit                      (all untested!)
>
> That's not good...
>
> [...]

Is your suggested to only include the cases that have been tested and
remove the rest? That would make sense, it seems other cases can be
added trivially once samples become available now that this groundwork
is done.
@Martin, is there any way you could get samples of the other formats?
Perhaps by downloading a trial version of acid media composer, or if
my google fu works well, by installing a codec pack
https://kb.avid.com/pkb/articles/en_US/Knowledge/Avid-QuickTime-Codecs-LE,w
hich should allow using these codecs in after effects and such.


More information about the ffmpeg-devel mailing list