Attila Nagy [Tue, 31 Jul 2012 11:04:45 +0000 (14:04 +0300)]
Fix potential encoder dead-lock after picture resize
The sync interval for the multithreaded encoder was considered as not changing
during the encoding. This is not true if picture size is changed.
The encoder could dead-lock because the main thread and the other threads were
using different sync interval.
Attila Nagy [Tue, 31 Jul 2012 08:52:10 +0000 (11:52 +0300)]
Fix encoder mem allocation when picture size is changed
After the picture size was changed to a bigger one, the internal memory was
corrupted and multithreaded encoder was deadlocking.
Memory for last frame's MVs, segmentation map and active map were allocated when
the compressor was created (vp8_create_compressor). Buffers need to be
reallocated when picture size is changed, so, the allocation was moved to
vp8_alloc_compressor_data, which is called every time the picture is resized.
Attila Nagy [Tue, 24 Apr 2012 12:17:28 +0000 (15:17 +0300)]
Optimizes updates of encoder block ptrs
Precalculated block ptrs do not need updates during encoding.
Set these at init stage.
Moved the allocation of 'mt_current_mb_col' (last encoded MB on each
row) to vp8_alloc_compressor_data(), so that it is correctly
reallocated when frame size is changing.
Yunqing Wang [Fri, 8 Jun 2012 15:17:50 +0000 (11:17 -0400)]
multi-res: add drop_frame support
Added drop_frame support in multi-resolution encoder.
If one frame is dropped at a lower-resolution level, the next
upper-resolution level encoder needs to encode that frame
independently without any lower-resolution level motion
information.
Another issue is that if one frame is dropped at some but not all
resolution levels, a frame after that one may use different set
of reference frames at different resolution levels. This reference
frame asynchronization could degrade motion search precision in
upper-resolution level encoding, which uses lower-resolution level
motion result. This change compares the lower-resolution and upper-
resolution level's reference frames. If they are not the same, the
upper-resolution level encoder can not use lower-resolution level
motion result.
Yunqing Wang [Wed, 11 Jul 2012 18:43:51 +0000 (11:43 -0700)]
multi-res: add parameter validity checking
Added validity checking in multi-res encoder. Disable spatial
resampling and frame dropping before we have those supports.
Also, deallocate the memory for all resolution levels once error
occurs.
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.