[FFmpeg-devel] [PATCH] dv codec : allow selecting between 720p60 and 720p50 profiles based on framerate

aureshy lapoiss devaureshy at gmail.com
Wed Dec 3 15:41:55 CET 2014


>
> is av_div_q() what you meant to use or av_cmp_q() ?


I use av_div_q to allow both frame rates 25/1 and 50/1 to select the same
profile.

you cannot change public API, you can add new public API if needed
> though
>

I forgot that. Should I use av_dv_codec_profile2 for the new name?

Steve



On Wed, Dec 3, 2014 at 1:46 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> On Wed, Dec 03, 2014 at 12:48:46PM +0100, Steve Jiekak wrote:
> >
> > Signed-off-by: Steve Jiekak <devaureshy at gmail.com>
> > ---
> >  libavcodec/dv_profile.c |   14 +++++++++++---
> >  libavcodec/dv_profile.h |    2 +-
> >  libavcodec/dvenc.c      |    2 +-
> >  libavformat/dv.c        |    2 +-
> >  libavformat/dvenc.c     |    3 ++-
> >  5 files changed, 16 insertions(+), 7 deletions(-)
> >
> > diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
> > index b301cbf..5c4e23c 100644
> > --- a/libavcodec/dv_profile.c
> > +++ b/libavcodec/dv_profile.c
> > @@ -312,18 +312,26 @@ const AVDVProfile *av_dv_frame_profile(const
> AVDVProfile *sys,
> >  }
> >
> >  const AVDVProfile *av_dv_codec_profile(int width, int height,
> > -                                       enum AVPixelFormat pix_fmt)
> > +                                       enum AVPixelFormat pix_fmt,
> > +                                       AVRational time_base)
> >  {
> > +    const AVDVProfile *p = NULL;
> >  #if CONFIG_DVPROFILE
> >      int i;
> > +    /* frame rate is necessary to select between 720p50 and 720p60
> profiles */
> > +    int validtimebase = time_base.num == 0 || time_base.den == 0;
> >
> >      for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
> >          if (height  == dv_profiles[i].height  &&
> >              pix_fmt == dv_profiles[i].pix_fmt &&
> >              width   == dv_profiles[i].width)
> > -            return &dv_profiles[i];
> > +        {
> > +            p = &dv_profiles[i];
> > +            if( !validtimebase || av_div_q(p->time_base, time_base).num
> == 1 )
>
> is av_div_q() what you meant to use or av_cmp_q() ?
>
>
> > +                return p;
> > +        }
> >  #endif
> >
> > -    return NULL;
> > +    return p;
> >  }
> >
> > diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
> > index d4437c9..c595f21 100644
> > --- a/libavcodec/dv_profile.h
> > +++ b/libavcodec/dv_profile.h
> > @@ -81,6 +81,6 @@ const AVDVProfile *av_dv_frame_profile(const
> AVDVProfile *sys,
> >  /**
> >   * Get a DV profile for the provided stream parameters.
> >   */
> > -const AVDVProfile *av_dv_codec_profile(int width, int height, enum
> AVPixelFormat pix_fmt);
> > +const AVDVProfile *av_dv_codec_profile(int width, int height, enum
> AVPixelFormat pix_fmt, AVRational time_base);
>
> you cannot change public API, you can add new public API if needed
> though
>
> make sure you bump minor version and update APIChanges accordingly
> though
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


More information about the ffmpeg-devel mailing list