[FFmpeg-devel] [PATCH] Add FATE test for rare overflow-prone case

Jason Garrett-Glaser darkshikari
Sun Jan 23 21:08:35 CET 2011


2011/1/23 M?ns Rullg?rd <mans at mansr.com>:
> Jason Garrett-Glaser <jason at x264.com> writes:
>
>> On Sun, Jan 23, 2011 at 10:05 AM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>>> $subj, see issue 2547.
>>>
>>> -Vitor
>>>
>>> PS: no need to wait boxes to rsync, this sample was uploaded several days
>>> ago.
>>
>> It might be better to synthesize a clip using code similar to that
>> which I wrote for extremal plane tests in x264:
>>
>> #define EXTREMAL_PLANE(size) \
>> ? ? { \
>> ? ? ? ? int max[7]; \
>> ? ? ? ? for( int j = 0; j < 7; j++ ) \
>> ? ? ? ? ? ? max[j] = test ? rand()&PIXEL_MAX : PIXEL_MAX; \
>> ? ? ? ? fdec[48-1-FDEC_STRIDE] = (i&1)*max[0]; \
>> ? ? ? ? for( int j = 0; j < size/2; j++ ) \
>> ? ? ? ? ? ? fdec[48+j-FDEC_STRIDE] = (!!(i&2))*max[1]; \
>> ? ? ? ? for( int j = size/2; j < size-1; j++ ) \
>> ? ? ? ? ? ? fdec[48+j-FDEC_STRIDE] = (!!(i&4))*max[2]; \
>> ? ? ? ? fdec[48+(size-1)-FDEC_STRIDE] = (!!(i&8))*max[3]; \
>> ? ? ? ? for( int j = 0; j < size/2; j++ ) \
>> ? ? ? ? ? ? fdec[48+j*FDEC_STRIDE-1] = (!!(i&16))*max[4]; \
>> ? ? ? ? for( int j = size/2; j < size-1; j++ ) \
>> ? ? ? ? ? ? fdec[48+j*FDEC_STRIDE-1] = (!!(i&32))*max[5]; \
>> ? ? ? ? fdec[48+(size-1)*FDEC_STRIDE-1] = (!!(i&64))*max[6]; \
>> ? ? }
>> ? ? /* Extremal test case for planar prediction. */
>> ? ? for( int test = 0; test < 100 && ok; test++ )
>> ? ? ? ? for( int i = 0; i < 128 && ok; i++ )
>> ? ? ? ? {
>> ? ? ? ? ? ? EXTREMAL_PLANE( ?8 );
>> ? ? ? ? ? ? INTRA_TEST( ?predict_8x8c, I_PRED_CHROMA_P, ?8, 1 );
>> ? ? ? ? ? ? EXTREMAL_PLANE( 16 );
>> ? ? ? ? ? ? INTRA_TEST( predict_16x16, ?I_PRED_16x16_P, 16, 1 );
>> ? ? ? ? }
>>
>> Having spent hours on fixing bugs related to this, I can say for
>> certain that without a test this harsh, you will never, ever find all
>> possible instances of bugs in planar prediction.
>
> Would you be so kind as to create such a test clip?

Done, generation code attached.  It's in incoming as h264_extremal_plane.h264.

Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extremal_plane.c
Type: text/x-csrc
Size: 2378 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110123/c861a015/attachment.c>



More information about the ffmpeg-devel mailing list