[FFmpeg-devel] [PATCH] showinfo: fix computation of Adler CRC

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat May 14 15:28:29 CEST 2011


On date Saturday 2011-05-14 13:44:00 +0200, Michael Niedermayer encoded:
> On Sat, May 14, 2011 at 01:21:54PM +0200, Stefano Sabatini wrote:
> > Previously the code was computing the CRC only for the first line of
> > each plane.
> 
> ok, but please dont call adler32, CRC, crc means cyclic redundancy
> check theres nothing cyclic on adler32.

Yes, I'll do in a separate patch.

> > ---
> >  libavfilter/vf_showinfo.c |   26 +++++++++++++++++++++-----
> >  1 files changed, 21 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
> > index d512199..bc644a7 100644
> > --- a/libavfilter/vf_showinfo.c
> > +++ b/libavfilter/vf_showinfo.c
> > @@ -29,6 +29,7 @@
> >  
> >  typedef struct {
> >      unsigned int frame;
> > +    int vsub;
> >  } ShowInfoContext;
> >  
> >  static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
> > @@ -38,18 +39,32 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
> >      return 0;
> >  }
> >  
> > +static int config_input(AVFilterLink *inlink)
> > +{
> > +    ShowInfoContext *showinfo = inlink->dst->priv;
> > +
> > +    showinfo->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
> > +    return 0;
> > +}
> 
> that might be condidered overkill, simply fetching the log2_chroma_h
> outside the loop should do, but feel free to keep it if you prefer

Good idea.
-- 
FFmpeg = Freak Forgiving Mind-dumbing Practical Evanescent Gangster
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-showinfo-fix-computation-of-Adler-checksum.patch
Type: text/x-diff
Size: 1736 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110514/cfe9a416/attachment.bin>


More information about the ffmpeg-devel mailing list