Yunqing Wang [Thu, 28 Jun 2012 17:37:53 +0000 (10:37 -0700)]
Add unit test for vp8_sixtap_predict functions
This unit test tests vp8_sixtap_predict function against preset
data and random generated data. The test against preset data
checks the correctness of the functions, and the test against
random data checks if the optimized six-tap predictor functions
generate matching result as the c functions. It tests the
following functions:
vp8_sixtap_predict16x16_c
vp8_sixtap_predict16x16_mmx
vp8_sixtap_predict16x16_sse2
vp8_sixtap_predict16x16_ssse3
Yunqing Wang [Mon, 2 Jul 2012 23:50:48 +0000 (16:50 -0700)]
Add 0 offsets handling in SSSE3 sixtap_predict functions
This patch fixed issue 458 by calling copy function when both
offsets are 0, which guarantees the SSSE3 functions output
same result as the c function for all possible offsets.
John Koleszar [Fri, 29 Jun 2012 19:15:00 +0000 (12:15 -0700)]
Build unit test driver from the default target
We need an easy way to build the unit test driver without running the
tests. This enables passing options like --gtest_filter to the
executable, which can't be done very cleanly when running under
`make test`.
Fixed a number of compiler errors/warnings when building the tests
in various configurations by Jenkins.
John Koleszar [Mon, 25 Jun 2012 17:09:05 +0000 (10:09 -0700)]
gen_asm_deps.sh: regex fix
Fixed the quantifier that optionally matches a quote before the
filename. This was originally reported in the homebrew project[1].
Note that this fix is different than patch posted there, as there are
some platforms that don't have the quote, so it needs to be included
in the expression optionally.
John Koleszar [Wed, 20 Jun 2012 21:45:22 +0000 (14:45 -0700)]
Add support for downloading test data
The commit introduces a make target 'testdata' that downloads the
required test data from the WebM project website. The data will also
be downloaded if invoking `make test` but is not a strict requirement
for only building the test executable.
The download directory is taken from the LIBVPX_TEST_DATA_PATH
environment variable, or may be specified as part of the make command.
If unset, it defaults to the current directory. It's expected that
most developers will want to set this environment variable to a place
outside their source/build trees, to avoid having to download the data
more than once.
To add test data file:
1) add a line to test/test.mk:
LIBVPX_TEST_DATA-yes += foo-bar-file.y4m
2) add its sha1sum to the test/test-data.sha1 file in the following
format:
Adrian Grange [Tue, 19 Jun 2012 19:03:36 +0000 (12:03 -0700)]
Added unit test for vp8_post_proc_down_and_across
This is a unit test for the post-processing functions:
- vp8_post_proc_down_and_across_c
- vp8_post_proc_down_and_across_mmx
- vp8_post_proc_down_and_across_xmm
Johann [Tue, 12 Jun 2012 15:58:11 +0000 (08:58 -0700)]
Clean Android build defaults
Disable unit-tests. The logging in GTest would need to be adjusted.
Restructure ARM cpu detection. Flatten if-else logic.
Change #if defined(HAVE_*) to #if HAVE_* because we only need to check
for features that the library was actually built with. This should have
been harmless, as disabled feature sets wouldn't have any features to
call.
Attila Nagy [Thu, 12 Apr 2012 09:50:19 +0000 (12:50 +0300)]
Enables building examples with Android NDK
Soft enable runtime cpu detect for armv7-android target, so that it
can be disabled and remove dependency on 'cpufeatures' lib.
Change the arm_cpu_caps implementation selection such that 'no rtcd' takes
precedence over system type.
Switch to use -mtune instead of -mcpu. NDK was complaining about
-mcpu=cortex-a8 conflicting with -march=armv7-a, not sure why.
Add a linker flag to fix some cortex-a8 bug, as suggested by NDK Dev
Guide.
Rob Bradford [Mon, 28 May 2012 12:00:24 +0000 (13:00 +0100)]
Fix pkg-config file to pull in libm
vpx uses symbols in libm and thus we need to provide an indication to
the user of libvpx that if they want to link against libvpx they must
also link against libm.
John Koleszar [Fri, 15 Jun 2012 22:40:13 +0000 (15:40 -0700)]
Remove threading dependencies with --disable-multithread
Avoid a pthreads dependency via pthread_once() when compiled with
--disable-multithread.
In addition, this synchronization is disabled for Win32 as well, even
though we can be sure that the required primatives exist, so that the
requirements on the application when built with --disable-multithread
are consistent across platforms.
Users using libvpx built with --disable-multithread in a multithreaded
context should provide their own synchronization. Updated the
documentation to vpx_codec_enc_init_ver() and vpx_codec_dec_init_ver()
to note this requirement. Moved the RTCD initialization call to match
this description, as previously it didn't happen until the first
frame.
John Koleszar [Mon, 21 May 2012 21:30:56 +0000 (14:30 -0700)]
Fix pedantic compiler warnings
Allows building the library with the gcc -pedantic option, for improved
portabilty. In particular, this commit removes usage of C99/C++ style
single-line comments and dynamic struct initializers. This is a
continuation of the work done in commit 97b766a46, which removed most
of these warnings for decode only builds.
Yunqing Wang [Thu, 7 Jun 2012 17:57:21 +0000 (13:57 -0400)]
Fix decimation_count in drop_frame
Frame dropping decision is made by evaluating both current frame
and next frame's buffer_level. If both buffer_levels are less
than drop_mark, next frame is dropped. When frame dropping is
over, namely, buffer_level becomes normal again, we need to
reset decimation_count to 0.
Marco Paniconi [Wed, 6 Jun 2012 18:38:48 +0000 (11:38 -0700)]
Reset Q for key frame when spatial resizing occurs.
The logic for spatial resizing is done after the Q is selected for the
frame. This causes a problem that the Q we select for the (resized)
key frame may be based on a different resolution than the frame we
will encode.
This fix is to ensure that, when resize is on, the selected Q is still
based on the resolution of the frame to be encoded.
Alpha Lam [Wed, 30 May 2012 18:18:35 +0000 (11:18 -0700)]
Fix windows build: obj_int_extract to extract numbrs from .rdata
The change in assembly offset files to define values as const int broke
Windows build, because the variables are stored in .rdata section instead
of .data section.
This CL changes the integer peeking from .data to .rdata.
Alpha Lam [Thu, 24 May 2012 04:35:35 +0000 (21:35 -0700)]
asm_*_offsets to define variables as constants
This change is to allow obj_int_extract to extract all integers
in the data segment. With the const keyword these variables are
forced into the .rodata segment even for zero variable value.
We had a problem before that zero valueed variables would get
assigned to BSS segment that fooled obj_int_extract to give
incorrect values.
Stefan Holmer [Wed, 30 May 2012 10:17:06 +0000 (12:17 +0200)]
Added another denoising threshold for finding DC shifts.
Compares the sum of differences between the input block and the averaged
block. If they differ too much the block will not be filtered. Negligible
perfomance hit.
Alpha Lam [Wed, 30 May 2012 18:18:35 +0000 (11:18 -0700)]
Fix windows build: obj_int_extract to extract numbrs from .rdata
The change in assembly offset files to define values as const int broke
Windows build, because the variables are stored in .rdata section instead
of .data section.
This CL changes the integer peeking from .data to .rdata.
Stefan Holmer [Wed, 30 May 2012 10:17:06 +0000 (12:17 +0200)]
Added another denoising threshold for finding DC shifts.
Compares the sum of differences between the input block and the averaged
block. If they differ too much the block will not be filtered. Negligible
perfomance hit.
Alpha Lam [Thu, 24 May 2012 04:35:35 +0000 (21:35 -0700)]
asm_*_offsets to define variables as constants
This change is to allow obj_int_extract to extract all integers
in the data segment. With the const keyword these variables are
forced into the .rodata segment even for zero variable value.
We had a problem before that zero valueed variables would get
assigned to BSS segment that fooled obj_int_extract to give
incorrect values.
Attila Nagy [Tue, 22 May 2012 11:19:10 +0000 (14:19 +0300)]
Fix another multithreaded encoder loopfilter race condition
After a key frame encoding, the frame type could change while
filtering is still going on. Pass the frame type as parameter to the
loopfilter function and don't read it from common storage.
vp8cx_set_alt_lf_level has to be done before packing the stream.
Currently alt_lf_level is not used so there hasn't been any visible
problem here.
John Koleszar [Wed, 23 May 2012 19:07:53 +0000 (12:07 -0700)]
Prevent external frame size changes in two-pass
The two-pass code does not support the case where the application
changes the frame size dynamically. Add this case to the validation
checks in the vpx_codec_enc_config_set() path.
* changes:
Add initial keyframe tests
Move all tests to test/ directory
Enable unit tests by default
Build unit tests monolithically
configure: initial support for CXX, CXXFLAGS variables
Yunqing Wang [Wed, 23 May 2012 17:40:24 +0000 (13:40 -0400)]
multi-res: modify memory allocation code
Reverted part of change in memory alllocation code, which ensures
that the function returns 0 and encoder works correctly when
CONFIG_MULTI_RES_ENCODING isn't turned on.
Attila Nagy [Tue, 22 May 2012 11:19:10 +0000 (14:19 +0300)]
Fix another multithreaded encoder loopfilter race condition
After a key frame encoding, the frame type could change while
filtering is still going on. Pass the frame type as parameter to the
loopfilter function and don't read it from common storage.
vp8cx_set_alt_lf_level has to be done before packing the stream.
Currently alt_lf_level is not used so there hasn't been any visible
problem here.
John Koleszar [Wed, 16 May 2012 23:25:51 +0000 (16:25 -0700)]
Build unit tests monolithically
Rework unit tests to have a single executable rather than many, which
should avoid pollution of the visual studio project namespace, improve
build times, and make it easier to use the gtest test sharding system
when we get these going on the continuous build cluster.
John Koleszar [Tue, 22 May 2012 17:37:20 +0000 (10:37 -0700)]
configure: initial support for CXX, CXXFLAGS variables
Use CXX rather than assuming g++ to invoke the compiler. Also introduce
separate CXXFLAGS, as certain CFLAGS we enable by default cause warnings
with g++.
Yunqing Wang [Wed, 16 May 2012 19:06:42 +0000 (15:06 -0400)]
multi-res: force Key frame sychronization
In multi-resolution encoding, frame_type decision for each frame
is made by the lowest-resolution encoder. For all other higher-
resolution encoders, kf_mode is always set to VPX_KF_DISABLED,
and they are forced to use the same frame_type picked by the
lowest-resolution encoder.