[FFmpeg-devel] [PATCH] swscale-test: add md5 output
Michael Niedermayer
michaelni
Mon Jul 26 02:54:20 CEST 2010
On Sat, Jul 24, 2010 at 02:10:32PM -0300, Ramiro Polla wrote:
> On Fri, Jul 23, 2010 at 9:59 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Jul 23, 2010 at 06:54:15PM -0300, Ramiro Polla wrote:
> >> $subj, to be used for regression tests. sse is still default.
> >> (indentation will be done afterwards)
> >
> > knowing how similar the output is to the input is usefull as well as its
> > usefull to know if they differ on 2 computers
>
> -sse is still left as an option to be run separately, or do you want
> both strings to be printed out?
>
> > btw, crc should be slightly faster than md5...
>
> New patch attached used av_adler32_update().
[...]
> @@ -156,21 +167,30 @@
>
> printf(" SSD=%5"PRId64",%5"PRId64",%5"PRId64",%5"PRId64"\n",
> ssdY, ssdU, ssdV, ssdA);
> + } else if (type == OUTPUT_CRC) {
> + uint32_t crc = 0;
> + for (i = 0; i < 4; i++)
> + crc = av_adler32_update(crc, dst[i], dstStride[i]*dstH+16);
> + printf(" %08x\n", crc);
> + }
>
> end:
>
> sws_freeContext(dstContext);
> + if (type == OUTPUT_SSE)
> sws_freeContext(outContext);
>
> for (i=0; i<4; i++) {
> av_free(dst[i]);
> + if (type == OUTPUT_SSE)
> av_free(out[i]);
> }
>
> return res;
> }
>
> -static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h)
> +static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
> + enum OutputType type)
> {
> const int flags[] = { SWS_FAST_BILINEAR,
> SWS_BILINEAR, SWS_BICUBIC,
> @@ -231,7 +251,8 @@
> for (j = 0; dstH[j] && !res; j++)
> res = doTest(ref, refStride, w, h, src, srcStride,
> srcFormat, dstFormat,
> - srcW, srcH, dstW[i], dstH[j], flags[k]);
> + srcW, srcH, dstW[i], dstH[j], flags[k],
> + type);
>
> sws_freeContext(srcContext);
> for (p = 0; p < 4; p++)
> @@ -254,11 +275,20 @@
> int stride[4]={W, W, W, W};
> int x, y;
> struct SwsContext *sws;
> + enum OutputType type = OUTPUT_SSE;
> AVLFG rand;
> + int i;
>
> if (!rgb_data || !data)
> return -1;
>
> + for (i = 1; i < argc; i++) {
> + if (!strcmp(argv[i], "-sse"))
> + type = OUTPUT_SSE;
> + else if (!strcmp(argv[i], "-crc"))
> + type = OUTPUT_CRC;
> + }
i think they should be flags and not exclusive, neither does what the
other does
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
if you want to spend more time on this then you could add support for the
CRC&SSE being specified in the cmd line and SSE stuff only checked if
CRC differs
also adler != CRC please name it correctly
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/20100726/38f56a2e/attachment.pgp>
More information about the ffmpeg-devel
mailing list