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.
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.
Alexis Ballier [Sat, 12 May 2012 19:45:13 +0000 (15:45 -0400)]
Allow target autodetection to work when cross-compiling.
Allow CHOST to override the gcc -dumpmachine output. This allows to
use the target autodetection code when cross compiling by setting the
CHOST variable.
On Gentoo, we would like to support easy cross-compilation, and for
libvpx this would basically mean copying the code in
build/make/configure.sh to setup the right --target option. It seems a
lot easier to let it guess by itself.
Another option I considered was using CROSS-gcc instead but this would
not work for our multilib setups: They use gcc -m32 to build 32bits
binaries and gcc -m32 -dumpmachine will output the 64bits version,
which would then make libvpx wrongly believe it is building for a
64bits architecture.
John Koleszar [Tue, 8 May 2012 18:23:42 +0000 (11:23 -0700)]
Use consistent range for VP8E_SET_NOISE_SENSITIVITY
Accept the same range of inputs for the VP8E_SET_NOISE_SENSITIVITY
control, regardless of whether temporal denoising is enabled or not.
This is important for maintaining compatibility with existing
applications.
John Koleszar [Fri, 4 May 2012 16:46:57 +0000 (09:46 -0700)]
Formalize encodeframe.c forward delclarations
Change If4321cc5 fixed a bug caused by forward declarations not being
kept in sync across C files, resulting in a function call with the
wrong arguments. The commit moves the affected function declarations
into a header file, along with the other symbols from encodeframe.c
that were being sloppily shared.
Attila Nagy [Mon, 16 Apr 2012 07:23:57 +0000 (10:23 +0300)]
Make global data const
Removes all runtime initialization of global data. This commit is a
squashed version of the following series cherry-picked from master.
This is necessary because of a change that was merged to the tester
that depends on the scaler being moved to the RTCD framework, which
is a worthwhile thing to include in Eider anyway.
- a91b42f02 Makes all global data in entropy.c const
- b35a0db0e Makes all global data in tokenize.c const
- 441cac8ea Makes all mode token tables const
- 5948a0210 Ports vpx_xcaler to new RTCD method
- 317d4244c Makes all mode token tables const part 2
John Koleszar [Thu, 19 Apr 2012 17:00:33 +0000 (10:00 -0700)]
multi-res: restore v1.0.0 API
Move the notion of 0 bitrate implying skip deeper into the codec,
rather than doing it at the multi-encoder API level. This preserves
v1.0.0 ABI compatibility, rather than forcing a bump to v2.0.0 over a
minor change. Also, this allows the case where the application can
selectively enable and disable the larger resolution(s) without having
to reinitialize the codec instace (for instance, if no target is
receiving the full resolution stream).
It's not clear how deep to push this check. It may be valuable to
allow the framerate adaptation code to run, for example. Currently put
the check as early as possible for simplicity, should reevaluate this
as this feature gains real use.
Original patch by Ginn Chen <ginn.chen@oracle.com> against libvpx
v0.9.0.
I've forward-ported it to the current version (which mostly
involved removing hunks that were no longer relevant), since I've
given up on getting Ginn to submit this upstream himself.
Besides imposing a performance penalty at startup in most
configurations, these relocations break the dynamic linker for
native Fennec, since it does not support them at all.