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

Michael Niedermayer michaelni at gmx.at
Sat May 14 13:44:00 CEST 2011


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.


> ---
>  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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- 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/ded0ae6e/attachment.asc>


More information about the ffmpeg-devel mailing list