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

Michael Niedermayer michaelni at gmx.at
Sat May 14 21:24:15 CEST 2011


On Sat, May 14, 2011 at 03:28:29PM +0200, Stefano Sabatini wrote:
> 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

>  vf_showinfo.c |   16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 56d6d171a4a66e4aca13f8589cf57caf9bef3a7d  0001-showinfo-fix-computation-of-Adler-checksum.patch
> From 08103fada95bd6606f03865837c6abe500851b24 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sat, 14 May 2011 13:20:52 +0200
> Subject: [PATCH] showinfo: fix computation of Adler checksum
> 
> Previously the code was computing the checksum only for the first line
> of each plane.
> ---
>  libavfilter/vf_showinfo.c |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)

LGTM

[...]

-- 
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/20110514/d99d1f00/attachment.asc>


More information about the ffmpeg-devel mailing list