[FFmpeg-devel] [PATCH 1/2] avcodec/libx264: Add support for Sony XAVC Class 300 and 480

lance.lmwang at gmail.com lance.lmwang at gmail.com
Tue Jun 22 04:40:59 EEST 2021


On Mon, Jun 21, 2021 at 05:07:48PM +0200, Michael Niedermayer wrote:
> On Sun, Jun 20, 2021 at 09:42:38AM +0800, lance.lmwang at gmail.com wrote:
> > From: Limin Wang <lance.lmwang at gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> >  libavcodec/libx264.c | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> > index 36fdb56..89f5c7b 100644
> > --- a/libavcodec/libx264.c
> > +++ b/libavcodec/libx264.c
> > @@ -749,6 +749,17 @@ static av_cold int X264_init(AVCodecContext *avctx)
> >          av_log(avctx, AV_LOG_ERROR,
> >                 "x264 too old for AVC Intra, at least version 142 needed\n");
> >  #endif
> > +
> > +    if (x4->avcintra_class > 200) {
> > +#if X264_BUILD < 164
> > +        av_log(avctx, AV_LOG_ERROR,
> > +                "x264 too old for AVC Intra 300/480, at least version 164 needed\n");
> > +        return AVERROR(EINVAL);
> > +#endif
> 
> > +        /* AVC-Intra 300/480 only supported by Sony XAVC flavor */
> > +        x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY;
> > +    }
> 
> this needs a #else or something
> 
> libavcodec/libx264.c: In function ‘X264_init’:
> libavcodec/libx264.c:760:20: error: ‘x264_param_t {aka struct x264_param_t}’ has no member named ‘i_avcintra_flavor’; did you mean ‘i_avcintra_class’?
>          x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY;
>                     ^~~~~~~~~~~~~~~~~
>                     i_avcintra_class
> libavcodec/libx264.c:760:40: error: ‘X264_AVCINTRA_FLAVOR_SONY’ undeclared (first use in this function)
>          x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY;
>                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
> libavcodec/libx264.c:760:40: note: each undeclared identifier is reported only once for each function it appears in
> ffbuild/common.mak:67: recipe for target 'libavcodec/libx264.o' failed
> make: *** [libavcodec/libx264.o] Error 1

have updated the patch, I think v2 is good to use, but v3 will not build the code
if > 142.

> 
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> "I am not trying to be anyone's saviour, I'm trying to think about the
>  future and not be sad" - Elon Musk
> 



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list