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

2016-02-14 Thread Michael Niedermayer
On Sat, Feb 13, 2016 at 03:04:58PM -0800, Timothy Gu wrote:
> ---
>  tests/checkasm/Makefile   |   1 +
>  tests/checkasm/checkasm.c |   3 ++
>  tests/checkasm/checkasm.h |   1 +
>  tests/checkasm/vf_blend.c | 130 
> ++
>  4 files changed, 135 insertions(+)
>  create mode 100644 tests/checkasm/vf_blend.c

fails to build unless i applied to wrong patches

make fate
...
tests/checkasm/vf_blend.c: In function ‘checkasm_check_blend’:
tests/checkasm/vf_blend.c:105:5: error: implicit declaration of function 
‘ff_blend_init’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make: *** [tests/checkasm/vf_blend.o] Error 1


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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2016-02-14 Thread Timothy Gu
On Sun, Feb 14, 2016 at 10:06:16AM +0100, Paul B Mahol wrote:
> On 2/14/16, Timothy Gu  wrote:
> > +
> > +#include 
> > +#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
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2016-02-14 Thread Paul B Mahol
On 2/14/16, Timothy Gu  wrote:
> ---
>  tests/checkasm/Makefile   |   1 +
>  tests/checkasm/checkasm.c |   3 ++
>  tests/checkasm/checkasm.h |   1 +
>  tests/checkasm/vf_blend.c | 130
> ++
>  4 files changed, 135 insertions(+)
>  create mode 100644 tests/checkasm/vf_blend.c
>
> diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
> index 07fe5bc..bfd7c11 100644
> --- a/tests/checkasm/Makefile
> +++ b/tests/checkasm/Makefile
> @@ -1,5 +1,6 @@
>  # libavcodec tests
>  AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o
> +AVCODECOBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
>  AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
>  AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
>  AVCODECOBJS-$(CONFIG_FLACDSP)  += flacdsp.o
> diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
> index 49fd2af..1e73e34 100644
> --- a/tests/checkasm/checkasm.c
> +++ b/tests/checkasm/checkasm.c
> @@ -68,6 +68,9 @@ static const struct {
>  #if CONFIG_ALAC_DECODER
>  { "alacdsp", checkasm_check_alacdsp },
>  #endif
> +#if CONFIG_BLEND_FILTER
> +{ "vf_blend", checkasm_check_blend },
> +#endif
>  #if CONFIG_BSWAPDSP
>  { "bswapdsp", checkasm_check_bswapdsp },
>  #endif
> diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
> index 5c07f89..0c8bc2d 100644
> --- a/tests/checkasm/checkasm.h
> +++ b/tests/checkasm/checkasm.h
> @@ -31,6 +31,7 @@
>  #include "libavutil/timer.h"
>
>  void checkasm_check_alacdsp(void);
> +void checkasm_check_blend(void);
>  void checkasm_check_bswapdsp(void);
>  void checkasm_check_flacdsp(void);
>  void checkasm_check_fmtconvert(void);
> diff --git a/tests/checkasm/vf_blend.c b/tests/checkasm/vf_blend.c
> new file mode 100644
> index 000..51e1391
> --- /dev/null
> +++ b/tests/checkasm/vf_blend.c
> @@ -0,0 +1,130 @@
> +/*
> + * Copyright (c) 2016 Tiancheng "Timothy" Gu
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +
> +#include 
> +#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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2016-02-13 Thread Timothy Gu
---
 tests/checkasm/Makefile   |   1 +
 tests/checkasm/checkasm.c |   3 ++
 tests/checkasm/checkasm.h |   1 +
 tests/checkasm/vf_blend.c | 130 ++
 4 files changed, 135 insertions(+)
 create mode 100644 tests/checkasm/vf_blend.c

diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 07fe5bc..bfd7c11 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -1,5 +1,6 @@
 # libavcodec tests
 AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o
+AVCODECOBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
 AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
 AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
 AVCODECOBJS-$(CONFIG_FLACDSP)  += flacdsp.o
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 49fd2af..1e73e34 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -68,6 +68,9 @@ static const struct {
 #if CONFIG_ALAC_DECODER
 { "alacdsp", checkasm_check_alacdsp },
 #endif
+#if CONFIG_BLEND_FILTER
+{ "vf_blend", checkasm_check_blend },
+#endif
 #if CONFIG_BSWAPDSP
 { "bswapdsp", checkasm_check_bswapdsp },
 #endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 5c07f89..0c8bc2d 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -31,6 +31,7 @@
 #include "libavutil/timer.h"
 
 void checkasm_check_alacdsp(void);
+void checkasm_check_blend(void);
 void checkasm_check_bswapdsp(void);
 void checkasm_check_flacdsp(void);
 void checkasm_check_fmtconvert(void);
diff --git a/tests/checkasm/vf_blend.c b/tests/checkasm/vf_blend.c
new file mode 100644
index 000..51e1391
--- /dev/null
+++ b/tests/checkasm/vf_blend.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2016 Tiancheng "Timothy" Gu
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include 
+#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;  \
+} \
+} \
+for (i = 0; i < SIZE_PER_UNIT; i += 4) { \
+uint32_t r = rnd();   \
+AV_WN32A(dst1 + i, r);\
+AV_WN32A(dst2 + i, r);\
+} \
+for (; i < BUF_SIZE; i += 4) {\
+uint32_t r = rnd();   \
+AV_WN32A(top1 + i, r);\
+AV_WN32A(top2 + i, r);\
+r = rnd();\
+AV_WN32A(bot1 + i, r);\
+AV_WN32A(bot2 + i, r);\
+r = rnd();\
+AV_WN32A(dst1 + i, r);\
+AV_WN32A(dst2 + i, r);\
+} \
+} while (0)
+
+#define check_blend_func() 
\
+do {   
\
+int i; 
\
+declare_func(void, const uint8_t *top, ptrdiff_t top_linesize, 
\
+ const uint8_t *bottom, ptrdiff_t bottom_linesize, 
\
+ uint8_t *dst, ptrdiff_t dst_linesize, 
\
+ ptrdiff_t width, ptrdiff_t start, ptrdiff_t end,  
\
+ struct FilterParams *param, double *values);  
\
+