[FFmpeg-devel] [PATCH 2/4] move the FF_QSCALE_TYPE_* defines to libavutil/internal.h

Ronald S. Bultje rsbultje at gmail.com
Mon Aug 31 14:32:27 CEST 2015


Hi,

On Mon, Aug 31, 2015 at 8:09 AM, Andreas Cadhalpun <
andreas.cadhalpun at googlemail.com> wrote:

> Hi Ronald,
>
> On 31.08.2015 00:19, Ronald S. Bultje wrote:
> > On Sat, Aug 22, 2015 at 1:57 PM, Andreas Cadhalpun <
> > andreas.cadhalpun at googlemail.com> wrote:
> >
> >> This fixes building with FF_API_QSCALE_TYPE disabled.
> >>
> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> >> ---
> >>  libavcodec/version.h | 3 ---
> >>  libavutil/internal.h | 7 +++++++
> >>  libavutil/version.h  | 3 +++
> >>  3 files changed, 10 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/libavcodec/version.h b/libavcodec/version.h
> >> index f0fa7f0..3df2bd7 100644
> >> --- a/libavcodec/version.h
> >> +++ b/libavcodec/version.h
> >> @@ -130,9 +130,6 @@
> >>  #ifndef FF_API_ERROR_RATE
> >>  #define FF_API_ERROR_RATE        (LIBAVCODEC_VERSION_MAJOR < 57)
> >>  #endif
> >> -#ifndef FF_API_QSCALE_TYPE
> >> -#define FF_API_QSCALE_TYPE       (LIBAVCODEC_VERSION_MAJOR < 57)
> >> -#endif
> >>  #ifndef FF_API_MB_TYPE
> >>  #define FF_API_MB_TYPE           (LIBAVCODEC_VERSION_MAJOR < 57)
> >>  #endif
> >> diff --git a/libavutil/internal.h b/libavutil/internal.h
> >> index 047f742..2f57210 100644
> >> --- a/libavutil/internal.h
> >> +++ b/libavutil/internal.h
> >> @@ -256,6 +256,13 @@ void avpriv_request_sample(void *avc,
> >>  #   define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG,
> >> __VA_ARGS__); } while (0)
> >>  #endif
> >>
> >> +#if !FF_API_QSCALE_TYPE
> >> +#define FF_QSCALE_TYPE_MPEG1 0
> >> +#define FF_QSCALE_TYPE_MPEG2 1
> >> +#define FF_QSCALE_TYPE_H264  2
> >> +#define FF_QSCALE_TYPE_VP56  3
> >> +#endif
> >> +
> >>  /**
> >>   * A wrapper for open() setting O_CLOEXEC.
> >>   */
> >> diff --git a/libavutil/version.h b/libavutil/version.h
> >> index 64713d3..a666de7 100644
> >> --- a/libavutil/version.h
> >> +++ b/libavutil/version.h
> >> @@ -129,6 +129,9 @@
> >>  #ifndef FF_API_HMAC
> >>  #define FF_API_HMAC                     (LIBAVUTIL_VERSION_MAJOR < 55)
> >>  #endif
> >> +#ifndef FF_API_QSCALE_TYPE
> >> +#define FF_API_QSCALE_TYPE              (LIBAVUTIL_VERSION_MAJOR < 55)
> >> +#endif
> >>  #ifndef FF_API_CRYPTO_CONTEXT
> >>  #define FF_API_CRYPTO_CONTEXT           (LIBAVUTIL_VERSION_MAJOR < 56)
> >>  #endif
> >> --
> >> 2.5.0
> >
> >
> > I don't have any better ideas, don't get me wrong, but I cringe at
> putting
> > codec-specific things in libavutil (even if it's in internal.h). This is
> > crazy and we shouldn't want this to ever become a default. I would almost
> > just propose delaying qscale bump by one version, although that is just
> > kicking the can... Does anyone have good ideas on how to deal with this
> in
> > a way that doesn't take many hours for a stupid fringe feature?
>
> These defines are used in libavcodec and libavfilter.
> Since libavfilter only uses them for ff_norm_qscale, we could also move
> that
> to libavcodec and call it avpriv_norm_qscale.
>
> Do you like this idea better?
>

Yes, let's do that (I think that's what we originally had, maybe with a
different prefix, right?). At least it keeps libavutil clean(er) and
contains this hack to libavcodec alone. It's not great but I don't see
anything better, thanks for looking at this.

The larger problem is anyway the qscale part of FF_API_AVFRAME_LAVC, which
> we need for av_frame_get_qp_table. I don't see an easy solution for that.


That was supposed to become side-data, we just never changed our code,
right? I can look at that today if you want. Is there any other upcoming
deprecation that fails compile+fate?

Ronald


More information about the ffmpeg-devel mailing list