[FFmpeg-devel] [PATCH] swscale-test: add md5 output

Michael Niedermayer michaelni
Tue Aug 17 14:14:28 CEST 2010


On Mon, Aug 16, 2010 at 05:09:35PM -0300, Ramiro Polla wrote:
> On Mon, Aug 2, 2010 at 8:29 PM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
> > On Sat, Jul 31, 2010 at 7:47 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
> >> On 08/01/2010 12:31 AM, Ramiro Polla wrote:
> >>> On Sat, Jul 31, 2010 at 7:27 PM, Vitor Sessak<vitor1001 at gmail.com> ?wrote:
> >>>> On 07/31/2010 11:10 PM, Ramiro Polla wrote:
> >>>>> On Sun, Jul 25, 2010 at 9:54 PM, Michael Niedermayer<michaelni at gmx.at>
> >>>>> ?wrote:
> >>>>>> SSE of 123 does not implicate that there is no change to a previous SSE
> >>>>>> of 123
> >>>>>> and a change of CRC does tell nothing of the SSE
> >>>>>
> >>>>> For regression tests we want a checksum to be bitexact (I'll send a
> >>>>> patch to add the bitexact flag to sws_flags later), and in this case
> >>>>> the SSE doesn't matter.
> >>>>
> >>>> It does, because every time there is a patch that is expected to change
> >>>> the
> >>>> CRC (and thus update the reference output of the tests) it is easy to
> >>>> know
> >>>> if it improves or reduce the PSNR by just looking at the diff of the
> >>>> reference file. That's the reason why "make test" prints also the
> >>>> psnr/stddev.
> >>>
> >>> Hm, I was hoping that whenever the checksum changed, the dev would
> >>> himself run swscale-test -sse...
> >>
> >> It is always clearer to see the stddev before and after the patch right
> >> there in the diff in case the reviewer want to know...
> >>
> >>> So do you think it'd be best to always print out both checksum and sse?
> >>
> >> I think it is worth the few extra bytes per test.
> >
> > New patch attached.
> 
> New patch attached which takes into account pixel formats where
> dstStride != dstW (like nv12).

>  swscale-test.c |   21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 317a52ab4eaae918dfb4c5da0cbe6868023ee5cc  swscale-test-checksum2.diff
> Index: libswscale/swscale-test.c
> ===================================================================
> --- libswscale/swscale-test.c	(revision 31964)
> +++ libswscale/swscale-test.c	(working copy)
> @@ -29,6 +29,7 @@
>  #include "libavutil/mem.h"
>  #include "libavutil/avutil.h"
>  #include "libavutil/pixdesc.h"
> +#include "libavutil/adler32.h"
>  #include "libavutil/lfg.h"
>  #include "swscale.h"
>  
> @@ -80,9 +81,10 @@
>      uint8_t *dst[4] = {0};
>      uint8_t *out[4] = {0};
>      int dstStride[4];
> -    int i;
> +    int i, j;
>      uint64_t ssdY, ssdU=0, ssdV=0, ssdA=0;
>      struct SwsContext *dstContext = NULL, *outContext = NULL;
> +    uint32_t checksum = 0;
>      int res = 0;
>  
>      av_fill_image_linesizes(dstStride, dstFormat, dstW);
> @@ -135,6 +137,19 @@
>      sws_scale(dstContext, src, srcStride, 0, srcH, dst, dstStride);
>      sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
>  
> +    for (i = 0; i < 4; i++) {
> +        if (!dstStride[i])
> +            break;
> +        if (dstW == dstStride[i]) {
> +            checksum = av_adler32_update(checksum, dst[i], dstW * dstH);
> +        } else {
> +            for (j = 0; j < dstH; j++) {
> +                checksum = av_adler32_update(checksum,
> +                                             dst[i] + j * dstStride[i], dstW);

this wont work with 16bit per sample formats nor with 1 bit per sample ...


also why adler32 and not crc32 ?

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100817/3e383a90/attachment.pgp>



More information about the ffmpeg-devel mailing list