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.
Adrian Grange [Fri, 27 Apr 2012 16:01:17 +0000 (09:01 -0700)]
Modified ARNR MC-filter to ignore ARF frame
The ARNR filter uses MC to find the best match between the
ARF and other nearby frames in the filter-set. Since the
ARF is a member of the filter-set, MC in that case is
unnecesssary. This patch modifies the filter so it does
not apply MC in this case.
Adrian Grange [Thu, 26 Apr 2012 22:41:38 +0000 (15:41 -0700)]
Removed MV costing from ARNR filtering
The ARNR filter uses a motion compensated temporal filter,
but the motion estimation implementation accounts for the
cost of the mv in its decision making process. The ARNR
filter uses a dummy cost table initialized to 0 as a way
to ignore the mv costs (which are irrelevant to the filter).
This CL modifies the ARNR filter implementation so that
the mv costing is ignored without the requirement for
dummy tables.
Attila Nagy [Tue, 24 Apr 2012 12:33:44 +0000 (15:33 +0300)]
Moves error concealment allocations from common parts to decoder
The backup MODE_INFO buffer used in the error concealment was
allocated in the codec common parts allocation even though this is a
decoder only resource. Moved the allocation to the decoder side.
No need to update_mode_info_border as mode_info buffers are zero
allocated.
This fixes also a potential memory leak as the EC overlaps buffer was not
properly released before reallocation after a frame size change.
Ralph Giles [Thu, 5 Jan 2012 21:05:05 +0000 (15:05 -0600)]
Have vpxenc use a default kf_max_rate of 5 seconds.
Rather than using the static default maximum keyframe spacing
provided by vpx_codec_enc_config_default() set the default
value to 5 times the frame rate. Five seconds is too long for
live streaming applications, but is a compromise between seek
efficiency and giving the encoder freedom to choose keyframe
locations.
The five second value is from James Zern's suggestion in
http://article.gmane.org/gmane.comp.multimedia.webm.user/2945
Attila Nagy [Wed, 25 Apr 2012 11:04:55 +0000 (14:04 +0300)]
Fix loopfilter race condition in multithreaded encoder
Race was introduced by https://gerrit.chromium.org/gerrit/15563.
If loopfilter related config params were changed between frames, or
after a KEY frame, there could be a mismatch between encoder's and
decoder's recontructed image. In worst case, when frame buffers are
reallocated because of a size change, the loopfilter could
do an invalid data access (segmentation fault).
Fixes:
Sync with the loopfilter before applying any encoder changes in
vp8_change_config().
Moved the loopfilter synching to the top of
encode_frame_to_data_rate() so that it's done before any alteration of
the encoder.