[FFmpeg-devel] [PATCH] Add AV_QSCALE_TYPE_* and switch all code from FF_QSCALE_TYPE_ to them

Michael Niedermayer michaelni at gmx.at
Fri Nov 15 16:32:35 CET 2013


On Fri, Nov 15, 2013 at 07:38:53AM +0100, Clément Bœsch wrote:
> On Fri, Nov 15, 2013 at 02:36:26AM +0100, Michael Niedermayer wrote:
> > qscale_type is needed for the postprocessing filters
> > this commit thus moves all code away from the types that are sheduled
> > to be removed.
> > Alternatively we could keep the FF_ types or equivalent or
> > transfer the information differently of course
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavcodec/avcodec.h   |    4 ++++
> >  libavcodec/h263dec.c   |    4 ++--
> >  libavcodec/mjpegdec.c  |    2 +-
> >  libavcodec/mpeg12dec.c |    4 ++--
> >  libavcodec/rv10.c      |    4 ++--
> >  libavcodec/rv34.c      |    4 ++--
> >  libavfilter/vf_spp.c   |    8 ++++----
> >  7 files changed, 17 insertions(+), 13 deletions(-)
> > 
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 67dc49f..23af06c 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -915,6 +915,10 @@ typedef struct AVPanScan{
> >      int16_t position[3][2];
> >  }AVPanScan;
> >  
> > +#define AV_QSCALE_TYPE_MPEG1 0
> > +#define AV_QSCALE_TYPE_MPEG2 1
> > +#define AV_QSCALE_TYPE_H264  2
> > +#define AV_QSCALE_TYPE_VP56  3
> >  #if FF_API_QSCALE_TYPE
> >  #define FF_QSCALE_TYPE_MPEG1 0
> >  #define FF_QSCALE_TYPE_MPEG2 1
> 
> All of this happens in libavcodec, and the filter already depends on it,
> so why not use AVCodecID instead of adding random syms? This would
> potentially simplify defining a norm_qscale() callback in those decoders
> in a later change.
> 
> Yes this would mean another function and deprecate the old, but I think
> it's better than exposing new random codec related symbols outside of
> codecs themselves.

we use FF_QSCALE_TYPE_MPEG2 for mpeg1, another mpeg1 decoder might
use the mpeg1 scaling, and mpeg2 can use  mpeg1 style too so
if its not normalized then the codec id is not enough.
mpeg4  can use both h263 as well as mpeg2 style quantization


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131115/d480d1f4/attachment.asc>


More information about the ffmpeg-devel mailing list