Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
4ce1e13b
Commit
4ce1e13b
authored
Aug 15, 2019
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkasm: add opusdsp tests
parent
6b22e28f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
0 deletions
+109
-0
Makefile
tests/checkasm/Makefile
+1
-0
checkasm.c
tests/checkasm/checkasm.c
+3
-0
checkasm.h
tests/checkasm/checkasm.h
+1
-0
opusdsp.c
tests/checkasm/opusdsp.c
+103
-0
checkasm.mak
tests/fate/checkasm.mak
+1
-0
No files found.
tests/checkasm/Makefile
View file @
4ce1e13b
...
...
@@ -22,6 +22,7 @@ AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
AVCODECOBJS-$(CONFIG_EXR_DECODER)
+=
exrdsp.o
AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER)
+=
huffyuvdsp.o
AVCODECOBJS-$(CONFIG_JPEG2000_DECODER)
+=
jpeg2000dsp.o
AVCODECOBJS-$(CONFIG_OPUS_DECODER)
+=
opusdsp.o
AVCODECOBJS-$(CONFIG_PIXBLOCKDSP)
+=
pixblockdsp.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER)
+=
hevc_add_res.o
hevc_idct.o
hevc_sao.o
AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER)
+=
utvideodsp.o
...
...
tests/checkasm/checkasm.c
View file @
4ce1e13b
...
...
@@ -130,6 +130,9 @@ static const struct {
#if CONFIG_LLVIDENCDSP
{
"llviddspenc"
,
checkasm_check_llviddspenc
},
#endif
#if CONFIG_OPUS_DECODER
{
"opusdsp"
,
checkasm_check_opusdsp
},
#endif
#if CONFIG_PIXBLOCKDSP
{
"pixblockdsp"
,
checkasm_check_pixblockdsp
},
#endif
...
...
tests/checkasm/checkasm.h
View file @
4ce1e13b
...
...
@@ -64,6 +64,7 @@ void checkasm_check_jpeg2000dsp(void);
void
checkasm_check_llviddsp
(
void
);
void
checkasm_check_llviddspenc
(
void
);
void
checkasm_check_nlmeans
(
void
);
void
checkasm_check_opusdsp
(
void
);
void
checkasm_check_pixblockdsp
(
void
);
void
checkasm_check_sbrdsp
(
void
);
void
checkasm_check_synth_filter
(
void
);
...
...
tests/checkasm/opusdsp.c
0 → 100644
View file @
4ce1e13b
/*
* 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 "libavcodec/opusdsp.h"
#include "checkasm.h"
#define randomize_float(buf, len) \
do { \
for (int i = 0; i < len; i++) { \
float f = (float)rnd() / (UINT_MAX >> 5) - 16.0f; \
buf[i] = f; \
} \
} while (0)
#define EPS 0.005
#define MAX_SIZE (960)
/* period is between 15 and 1022, inclusive */
static
void
test_postfilter
(
int
period
)
{
LOCAL_ALIGNED
(
16
,
float
,
data0
,
[
MAX_SIZE
+
1024
]);
LOCAL_ALIGNED
(
16
,
float
,
data1
,
[
MAX_SIZE
+
1024
]);
/* This filter can explode very easily, so use a tapset from the codec.
* In the codec these are usually multiplied by at least 0.09375f,
* so its outside the largest filter value, but the filter is still stable
* so use it. */
float
gains
[
3
]
=
{
0
.
3066406250
f
,
0
.
2170410156
f
,
0
.
1296386719
f
};
/* The codec will always call with an offset which is aligned once
* (period + 2) is subtracted, but here we have to align it outselves. */
int
offset
=
FFALIGN
(
period
+
2
,
4
);
declare_func
(
void
,
float
*
data
,
int
period
,
float
*
gains
,
int
len
);
randomize_float
(
data0
,
MAX_SIZE
+
1024
);
memcpy
(
data1
,
data0
,
(
MAX_SIZE
+
1024
)
*
sizeof
(
float
));
call_ref
(
data0
+
offset
,
period
,
gains
,
MAX_SIZE
);
call_new
(
data1
+
offset
,
period
,
gains
,
MAX_SIZE
);
if
(
!
float_near_abs_eps_array
(
data0
+
offset
,
data1
+
offset
,
EPS
,
MAX_SIZE
))
fail
();
bench_new
(
data1
+
offset
,
period
,
gains
,
MAX_SIZE
);
}
static
void
test_deemphasis
(
void
)
{
LOCAL_ALIGNED
(
16
,
float
,
src
,
[
FFALIGN
(
MAX_SIZE
,
4
)]);
LOCAL_ALIGNED
(
16
,
float
,
dst0
,
[
FFALIGN
(
MAX_SIZE
,
4
)]);
LOCAL_ALIGNED
(
16
,
float
,
dst1
,
[
FFALIGN
(
MAX_SIZE
,
4
)]);
float
coeff0
=
(
float
)
rnd
()
/
(
UINT_MAX
>>
5
)
-
16
.
0
f
,
coeff1
=
coeff0
;
declare_func
(
float
,
float
*
out
,
float
*
in
,
float
coeff
,
int
len
);
randomize_float
(
src
,
MAX_SIZE
);
coeff0
=
call_ref
(
dst0
,
src
,
coeff0
,
MAX_SIZE
);
coeff1
=
call_new
(
dst1
,
src
,
coeff1
,
MAX_SIZE
);
if
(
!
float_near_abs_eps
(
coeff0
,
coeff1
,
EPS
)
||
!
float_near_abs_eps_array
(
dst0
,
dst1
,
EPS
,
MAX_SIZE
))
fail
();
bench_new
(
dst1
,
src
,
coeff1
,
MAX_SIZE
);
}
void
checkasm_check_opusdsp
(
void
)
{
OpusDSP
ctx
;
ff_opus_dsp_init
(
&
ctx
);
if
(
check_func
(
ctx
.
postfilter
,
"postfilter_15"
))
test_postfilter
(
15
);
report
(
"postfilter_15"
);
if
(
check_func
(
ctx
.
postfilter
,
"postfilter_512"
))
test_postfilter
(
512
);
report
(
"postfilter_512"
);
if
(
check_func
(
ctx
.
postfilter
,
"postfilter_1022"
))
test_postfilter
(
1022
);
report
(
"postfilter_1022"
);
if
(
check_func
(
ctx
.
deemphasis
,
"deemphasis"
))
test_deemphasis
();
report
(
"deemphasis"
);
}
tests/fate/checkasm.mak
View file @
4ce1e13b
...
...
@@ -19,6 +19,7 @@ FATE_CHECKASM = fate-checkasm-aacpsdsp \
fate-checkasm-jpeg2000dsp \
fate-checkasm-llviddsp \
fate-checkasm-llviddspenc \
fate-checkasm-opusdsp \
fate-checkasm-pixblockdsp \
fate-checkasm-sbrdsp \
fate-checkasm-synth_filter \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment