History

Merge commit '9064777dbb335ab4809ae09e3fdcc0245f925cdc'

* commit '9064777dbb335ab4809ae09e3fdcc0245f925cdc': checkasm: add HEVC test for testing IDCT DC

Clément Bœsch committed 9 years ago

Commit 92cb9a32 parents f475405 90647774 files · +78 −0Browse files

Showing the changes to tests (4 of 4 files). Show all

Unified · Split

4 files
  1. tests/checkasm/Makefile +1 −0
  2. tests/checkasm/checkasm.c +3 −0
  3. tests/checkasm/checkasm.h +1 −0
  4. tests/checkasm/hevc_idct.c +73 −0
tests/checkasm/Makefile+1−0
@@ -14,6 +14,7 @@ AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o · 13 unmodified lines
14AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o14AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
15AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o15AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o
16AVCODECOBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o16AVCODECOBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
17AVCODECOBJS-$(CONFIG_HEVC_DECODER) += hevc_idct.o
17AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o18AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o
18AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o19AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o
19 20
tests/checkasm/checkasm.c+3−0
@@ -89,6 +89,9 @@ static const struct { · 88 unmodified lines
89 #if CONFIG_H264QPEL89 #if CONFIG_H264QPEL
90 { "h264qpel", checkasm_check_h264qpel },90 { "h264qpel", checkasm_check_h264qpel },
91 #endif91 #endif
92 #if CONFIG_HEVC_DECODER
93 { "hevc_idct", checkasm_check_hevc_idct },
94 #endif
92 #if CONFIG_JPEG2000_DECODER95 #if CONFIG_JPEG2000_DECODER
93 { "jpeg2000dsp", checkasm_check_jpeg2000dsp },96 { "jpeg2000dsp", checkasm_check_jpeg2000dsp },
94 #endif97 #endif
tests/checkasm/checkasm.h+1−0
@@ -40,6 +40,7 @@ void checkasm_check_fmtconvert(void); · 39 unmodified lines
40void checkasm_check_h264dsp(void);40void checkasm_check_h264dsp(void);
41void checkasm_check_h264pred(void);41void checkasm_check_h264pred(void);
42void checkasm_check_h264qpel(void);42void checkasm_check_h264qpel(void);
43void checkasm_check_hevc_idct(void);
43void checkasm_check_jpeg2000dsp(void);44void checkasm_check_jpeg2000dsp(void);
44void checkasm_check_pixblockdsp(void);45void checkasm_check_pixblockdsp(void);
45void checkasm_check_synth_filter(void);46void checkasm_check_synth_filter(void);
tests/checkasm/hevc_idct.c+73−0
@@ -0,0 +1,73 @@
1/*
2 * Copyright (c) 2016 Alexandra Hájková
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <string.h>
22
23#include "libavutil/intreadwrite.h"
24
25#include "libavcodec/hevcdsp.h"
26
27#include "checkasm.h"
28
29#define randomize_buffers(buf, size) \
30 do { \
31 int j; \
32 for (j = 0; j < size; j++) { \
33 int16_t r = rnd(); \
34 AV_WN16A(buf + j, r); \
35 } \
36 } while (0)
37
38static void check_idct_dc(HEVCDSPContext h, int bit_depth)
39{
40 int i;
41 LOCAL_ALIGNED(32, int16_t, coeffs0, [32 * 32]);
42 LOCAL_ALIGNED(32, int16_t, coeffs1, [32 * 32]);
43
44 for (i = 2; i <= 5; i++) {
45 int block_size = 1 << i;
46 int size = block_size * block_size;
47 declare_func_emms(AV_CPU_FLAG_MMXEXT, void, int16_t *coeffs);
48
49 randomize_buffers(coeffs0, size);
50 memcpy(coeffs1, coeffs0, sizeof(*coeffs0) * size);
51
52 if (check_func(h.idct_dc[i - 2], "idct_%dx%d_dc_%d", block_size, block_size, bit_depth)) {
53 call_ref(coeffs0);
54 call_new(coeffs1);
55 if (memcmp(coeffs0, coeffs1, sizeof(*coeffs0) * size))
56 fail();
57 bench_new(coeffs1);
58 }
59 }
60}
61
62void checkasm_check_hevc_idct(void)
63{
64 int bit_depth;
65
66 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
67 HEVCDSPContext h;
68
69 ff_hevc_dsp_init(&h, bit_depth);
70 check_idct_dc(h, bit_depth);
71 }
72 report("idct_dc");
73}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t