[FFmpeg-devel] [PATCH] Implement av_get_pix_fmt_chroma_shift()

Michael Niedermayer michaelni
Sun Jan 31 02:55:25 CET 2010


On Sun, Jan 31, 2010 at 02:26:52AM +0100, Stefano Sabatini wrote:
> On date Sunday 2010-01-31 02:12:17 +0100, Michael Niedermayer encoded:
> > On Sat, Jan 30, 2010 at 04:06:50PM +0100, Stefano Sabatini wrote:
> > [...]
> > > Index: ffmpeg/libavutil/pixdesc.c
> > > ===================================================================
> > > --- ffmpeg.orig/libavutil/pixdesc.c	2010-01-30 15:32:48.000000000 +0100
> > > +++ ffmpeg/libavutil/pixdesc.c	2010-01-30 15:57:39.000000000 +0100
> > > @@ -703,3 +703,11 @@
> > >  
> > >      return bits >> log2_pixels;
> > >  }
> > > +
> > > +void av_get_pix_fmt_chroma_shift(int *w_shift, int *h_shift, enum PixelFormat pix_fmt)
> > > +{
> > > +    if (w_shift)
> > > +        *w_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;
> > > +    if (h_shift)
> > > +        *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
> > > +}
> > 
> > what about a
> > 
> > int get_true(){
> >     return 1;
> > }
> 
> Not that I care so much about it, but this operation is performed *a
> lot* in the codebase, so adding a very specialized function for
> simplifying the code doesn't look so weird to me.

what looks weird to me is that you want to put it in libavutil.

quoting doc/avutil.txt:
    AVUtil
    ======
    libavutil is a small lightweight library of generally useful functions.
    It is not a library for code needed by both libavcodec and libavformat.

besides this having these 2 line wraper functions used across libs creates ABI
issues, we cannot change the function anymore without a major version bump.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100131/14aa959b/attachment.pgp>



More information about the ffmpeg-devel mailing list