[FFmpeg-devel] [PATCH] checkasm: Add vf_blend tests

Timothy Gu timothygu99 at gmail.com
Sun Feb 14 17:31:21 CET 2016


On Sun, Feb 14, 2016 at 10:06:16AM +0100, Paul B Mahol wrote:
> On 2/14/16, Timothy Gu <timothygu99 at gmail.com> wrote:
> > +
> > +#include <string.h>
> > +#include "checkasm.h"
> > +#include "libavfilter/blend.h"
> > +#include "libavutil/common.h"
> > +#include "libavutil/internal.h"
> > +#include "libavutil/intreadwrite.h"
> > +
> > +#define WIDTH 256
> > +#define HEIGHT 256
> > +#define BUF_UNITS 9
> > +#define SIZE_PER_UNIT (WIDTH * HEIGHT)
> > +#define BUF_SIZE (BUF_UNITS * SIZE_PER_UNIT)
> > +
> > +#define randomize_buffers()                   \
> > +    do {                                      \
> > +        int i, j;                             \
> > +        for (i = 0; i < HEIGHT; i++) {        \
> > +            for (j = 0; j < WIDTH; j++) {     \
> > +                top1[i * WIDTH + j] =         \
> > +                top2[i * WIDTH + j] = i;      \
> > +                bot1[i * WIDTH + j] =         \
> > +                bot2[i * WIDTH + j] = j;      \
> 
> I think you failed to get my point.
> 
> For 8bit blend if you blend 256x256 horizontal gradient
> with 256x256 vertical gradient you will get blend
> function response, which is unique. And covers all
> possibilities for 8bit formats.

You might have missed the fact that I changed WIDTH and HEIGHT as well, so
that for top it'll look like this

  0   0   0   0   0   0 ...   0
  1   1   1   1   1   1 ...   1
  .   .   .   .   .   . ...   .
  .   .   .   .   .   . ...   .
  .   .   .   .   .   . ...   .
255 255 255 255 255 255 ... 255

For bottom it'll look like

  0   1   2   3   4   5 ... 255
  0   1   2   3   4   5 ... 255
  .   .   .   .   .   . ...   .
  .   .   .   .   .   . ...   .
  .   .   .   .   .   . ...   .
  0   1   2   3   4   5 ... 255

Or am I missing something?

Timothy


More information about the ffmpeg-devel mailing list