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

Ramiro Polla ramiro.polla
Sat Jul 31 23:10:23 CEST 2010


Hi Michael,

On Sun, Jul 25, 2010 at 9:54 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> 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

Good idea. New patch attached.

> 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. As I said, the option to run sse is still left
to the user through the -sse switch (and it's also run by default).
But I'm working on this mainly to support swscale regression tests.
Could you please give your thoughts on how the swscale regression
tests should work? (there's another thread regarding this)

> 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

Should the libavformat muxers be renamed as well?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale-test_adler32.diff
Type: application/octet-stream
Size: 4375 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100731/26fe7658/attachment.obj>



More information about the ffmpeg-devel mailing list