Merge commit '2eb97af66af90ca3978229da151f0b8b3a5d9370'
authorClément Bœsch <u@pkh.me>
Mon, 20 Mar 2017 18:04:12 +0000 (19:04 +0100)
committerClément Bœsch <u@pkh.me>
Mon, 20 Mar 2017 18:05:05 +0000 (19:05 +0100)
* commit '2eb97af66af90ca3978229da151f0b8b3a5d9370':
  checkasm: add a test for blockdsp

Merged-by: Clément Bœsch <u@pkh.me>
1  2 
tests/checkasm/Makefile
tests/checkasm/blockdsp.c
tests/checkasm/checkasm.c
tests/checkasm/checkasm.h

index f6b380672d708aa7911ae6c0aa2a8984598db9aa,78626339976b5bcd8a106c4998b2dec225a589c7..06b22f3764af13f4dd4891fd16969b25d4f54d16
@@@ -1,7 -1,7 +1,8 @@@
  # libavcodec tests
  # subsystems
+ AVCODECOBJS-$(CONFIG_BLOCKDSP)          += blockdsp.o
  AVCODECOBJS-$(CONFIG_BSWAPDSP)          += bswapdsp.o
 +AVCODECOBJS-$(CONFIG_FLACDSP)           += flacdsp.o
  AVCODECOBJS-$(CONFIG_FMTCONVERT)        += fmtconvert.o
  AVCODECOBJS-$(CONFIG_H264DSP)           += h264dsp.o
  AVCODECOBJS-$(CONFIG_H264PRED)          += h264pred.o
index 0000000000000000000000000000000000000000,6b4bc804fc6f4ba7c818c33971948bdf4d19332e..153699b6327639bcca9d8542a8c575fece9eb44d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,68 +1,68 @@@
 - * This file is part of Libav.
+ /*
+  * Copyright (c) 2015 Henrik Gramner
+  *
 - * Libav is free software; you can redistribute it and/or modify
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * 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.
+  *
 - * with Libav; if not, write to the Free Software Foundation, Inc.,
++ * 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 <string.h>
+ #include "checkasm.h"
+ #include "libavcodec/blockdsp.h"
+ #include "libavutil/common.h"
+ #include "libavutil/internal.h"
+ #include "libavutil/intreadwrite.h"
+ #define randomize_buffers(size)             \
+     do {                                    \
+         int i;                              \
+         for (i = 0; i < size; i++) {        \
+             uint16_t r = rnd();             \
+             AV_WN16A(buf0 + i, r);          \
+             AV_WN16A(buf1 + i, r);          \
+         }                                   \
+     } while (0)
+ #define check_clear(func, size)                                     \
+ do {                                                                \
+     if (check_func(h.func, "blockdsp." #func)) {                    \
+         declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block);   \
+         randomize_buffers(size);                                    \
+         call_ref(buf0);                                             \
+         call_new(buf1);                                             \
+         if (memcmp(buf0, buf1, sizeof(*buf0) * size))               \
+             fail();                                                 \
+         bench_new(buf0);                                            \
+     }                                                               \
+ } while (0)
+ void checkasm_check_blockdsp(void)
+ {
+     LOCAL_ALIGNED_16(uint16_t, buf0, [6 * 8 * 8]);
+     LOCAL_ALIGNED_16(uint16_t, buf1, [6 * 8 * 8]);
+     AVCodecContext avctx = { 0 };
+     BlockDSPContext h;
+     ff_blockdsp_init(&h, &avctx);
+     check_clear(clear_block,  8 * 8);
+     check_clear(clear_blocks, 8 * 8 * 6);
+     report("blockdsp");
+ }
index efbce3250b18865323607dbbadb0bd305ad1286f,525284ad4b7a913a35cb9549c032bd18e93c30a5..abaaec716f517c5bfec3d00373294911ed5ab66f
@@@ -64,60 -64,40 +64,63 @@@ static const struct 
      const char *name;
      void (*func)(void);
  } tests[] = {
 -#if CONFIG_BLOCKDSP
 -    { "blockdsp", checkasm_check_blockdsp },
 +#if CONFIG_AVCODEC
 +    #if CONFIG_ALAC_DECODER
 +        { "alacdsp", checkasm_check_alacdsp },
 +    #endif
++    #if CONFIG_BLOCKDSP
++        { "blockdsp", checkasm_check_blockdsp },
++    #endif
 +    #if CONFIG_BSWAPDSP
 +        { "bswapdsp", checkasm_check_bswapdsp },
 +    #endif
 +    #if CONFIG_DCA_DECODER
 +        { "synth_filter", checkasm_check_synth_filter },
 +    #endif
 +    #if CONFIG_FLACDSP
 +        { "flacdsp", checkasm_check_flacdsp },
 +    #endif
 +    #if CONFIG_FMTCONVERT
 +        { "fmtconvert", checkasm_check_fmtconvert },
 +    #endif
 +    #if CONFIG_H264DSP
 +        { "h264dsp", checkasm_check_h264dsp },
 +    #endif
 +    #if CONFIG_H264PRED
 +        { "h264pred", checkasm_check_h264pred },
 +    #endif
 +    #if CONFIG_H264QPEL
 +        { "h264qpel", checkasm_check_h264qpel },
 +    #endif
 +    #if CONFIG_HEVC_DECODER
 +        { "hevc_idct", checkasm_check_hevc_idct },
 +    #endif
 +    #if CONFIG_JPEG2000_DECODER
 +        { "jpeg2000dsp", checkasm_check_jpeg2000dsp },
 +    #endif
 +    #if CONFIG_PIXBLOCKDSP
 +        { "pixblockdsp", checkasm_check_pixblockdsp },
 +    #endif
 +    #if CONFIG_V210_ENCODER
 +        { "v210enc", checkasm_check_v210enc },
 +    #endif
 +    #if CONFIG_VP8DSP
 +        { "vp8dsp", checkasm_check_vp8dsp },
 +    #endif
 +    #if CONFIG_VP9_DECODER
 +        { "vp9dsp", checkasm_check_vp9dsp },
 +    #endif
 +    #if CONFIG_VIDEODSP
 +        { "videodsp", checkasm_check_videodsp },
 +    #endif
  #endif
 -#if CONFIG_BSWAPDSP
 -    { "bswapdsp", checkasm_check_bswapdsp },
 -#endif
 -#if CONFIG_DCA_DECODER
 -    { "dcadsp", checkasm_check_dcadsp },
 -    { "synth_filter", checkasm_check_synth_filter },
 -#endif
 -#if CONFIG_FMTCONVERT
 -    { "fmtconvert", checkasm_check_fmtconvert },
 -#endif
 -#if CONFIG_H264DSP
 -    { "h264dsp", checkasm_check_h264dsp },
 -#endif
 -#if CONFIG_H264PRED
 -    { "h264pred", checkasm_check_h264pred },
 -#endif
 -#if CONFIG_H264QPEL
 -    { "h264qpel", checkasm_check_h264qpel },
 -#endif
 -#if CONFIG_HEVC_DECODER
 -    { "hevc_mc", checkasm_check_hevc_mc },
 -    { "hevc_idct", checkasm_check_hevc_idct },
 -#endif
 -#if CONFIG_V210_ENCODER
 -    { "v210enc", checkasm_check_v210enc },
 -#endif
 -#if CONFIG_VP8DSP
 -    { "vp8dsp", checkasm_check_vp8dsp },
 -#endif
 -#if CONFIG_VP9_DECODER
 -    { "vp9dsp", checkasm_check_vp9dsp },
 +#if CONFIG_AVFILTER
 +    #if CONFIG_BLEND_FILTER
 +        { "vf_blend", checkasm_check_blend },
 +    #endif
 +    #if CONFIG_COLORSPACE_FILTER
 +        { "vf_colorspace", checkasm_check_colorspace },
 +    #endif
  #endif
      { NULL }
  };
index a3db2a91b96aae38d9189e99fb57f39d9503385f,c1141aab747cc5c03172c964e6ce3e040aec0c4b..6a5c5149459cd95abda5ea39596e5fdbef8ac7bc
  #include "libavutil/lfg.h"
  #include "libavutil/timer.h"
  
 +void checkasm_check_alacdsp(void);
 +void checkasm_check_blend(void);
+ void checkasm_check_blockdsp(void);
  void checkasm_check_bswapdsp(void);
 -void checkasm_check_dcadsp(void);
 +void checkasm_check_colorspace(void);
 +void checkasm_check_flacdsp(void);
  void checkasm_check_fmtconvert(void);
  void checkasm_check_h264dsp(void);
  void checkasm_check_h264pred(void);