John Koleszar [Wed, 3 Oct 2012 21:52:56 +0000 (14:52 -0700)]
fix uninitialized value in multi-res encoding
If a parent mb is available but is intra coded, then parent_ref_mv is
invalid. Check that the parent is inter coded before trying to access
the parent_ref_mv. Previously the parent_ref_mv was being read from
an uninitialized stack allocation, causing potential OOB reads and
other undefined behavior.
Adrian Grange [Tue, 2 Oct 2012 16:36:41 +0000 (09:36 -0700)]
Added Reset method to TwopassStatsStore
The stats buffer needs to be reset between runs of the
encoder. I added a Reset() function to TwopassStatsStore
and called it at the beginning of each encode.
This enables us to run multiple encodes which was
previously not possible since there was no way to reset
the stats between runs.
John Koleszar [Mon, 24 Sep 2012 21:52:18 +0000 (14:52 -0700)]
rtcd/win32: use InitializeCriticalSection explicitly
Protect the call to {Initialize,Delete}CriticalSection() with an
Interlocked{Inc,Dec}rement() pair, rather than the previous static
initialization. This should play better with AppVerifier, and fix issue
Scott LaVarnway [Wed, 26 Sep 2012 20:45:53 +0000 (13:45 -0700)]
Added unit test for subtract functions
Patch Set 1: gain familiarity with unit tests... added simple
4x4 subtract test
Patch Set 2: fixed mistakes, parameterized as suggested
Patch Set 3: randomized the source/predictor data
Change-Id: I33432bdf7c9f2a9b8c2533a37106382c2a8209ee Signed-off-by: Scott LaVarnway <slavarnway@google.com>
Marco Paniconi [Sat, 22 Sep 2012 01:54:11 +0000 (18:54 -0700)]
Update to cyclic refresh.
-Increase the amount of mbs to be refreshed.
-Replace the delta qp with a fixed and reduced delta.
-Change to the mb update loop to try to always update same amount of mbs.
Scott LaVarnway [Wed, 19 Sep 2012 19:30:44 +0000 (12:30 -0700)]
Moved vp8dx_get_raw_frame() call to vp8_get_frame()
This change is necessary for the frame-based multithreading
implementation.
Since the postproc occurs in this call, vpxdec was modified to time around
vpx_codec_get_frame()
Jim Bankoski [Fri, 7 Sep 2012 23:38:15 +0000 (16:38 -0700)]
valgrind caught uninitialized cond
If the decoder crashes and returned an error before it set up
block offsets but after it set up frame buffers. We had a
problem decoding the next keyframe because the block offsets
were never set.
Deb Mukherjee [Tue, 4 Sep 2012 19:09:05 +0000 (12:09 -0700)]
Adjusting thresholds in mfqe post-processing
Adjusts some of the qualification thresholds in mfqe to eliminate
artifacts due to wrong decisions. Besides, a new qualification
criteria is used to disable mfqe if the quality of the previous
frame is itself not too good.
Yunqing Wang [Fri, 10 Aug 2012 19:35:55 +0000 (12:35 -0700)]
Encoder denoiser performance improvement
The denoiser function was modified to reduce the computational
complexity.
1. The denoiser c function modification:
The original implementation calculated pixel's filter_coefficient
based on the pixel value difference between current raw frame and last
denoised raw frame, and stored them in lookup tables. For each pixel c,
find its coefficient using
filter_coefficient[c] = LUT[abs_diff[c]];
and then apply filtering operation for the pixel.
The denoising filter costed about 12% of encoding time when it was
turned on, and half of the time was spent on finding coefficients in
lookup tables. In order to simplify the process, a short cut was taken.
The pixel adjustments vs. pixel diff value were calculated ahead of time.
adjustment = filtered_value - current_raw
= (filter_coefficient * diff + 128) >> 8
The adjustment vs. diff curve becomes flat very quick when diff increases.
This allowed us to use only several levels to get a close approximation
of the curve. Following the denoiser algorithm, the adjustments are
further modified according to how big the motion magnitude is.
2. The sse2 function was rewritten.
This change made denoiser filter function 3x faster, and improved the
encoder performance by 7% ~ 10% with the denoiser on.
James Zern [Tue, 28 Aug 2012 00:13:09 +0000 (17:13 -0700)]
msvs/tests: fix data alignment for asm tests
Replace DECLARE_ALIGNED_ with vpx_memalign()
DECLARE_ALIGNED (__declspec(align())) does not work as intended when
used on class data members:
Data in classes or structures is aligned within the class or structure
at the minimum of its natural alignment and the current packing setting
(from #pragma pack or the /Zp compiler option)
Yunqing Wang [Tue, 21 Aug 2012 17:52:35 +0000 (10:52 -0700)]
Add biasing to ZEROMV for videos with static background
For videos with big static background(such as video conferencing
clips), the mode decision was biased to ZEROMV in order to
obtain a stable background. The percentage of ZEROMV on last
frame was used to predict if there is static area in current frame,
and checking already-encoded neighboring macroblocks' motion
vectors to make sure the local area has low motion.
Yunqing Wang [Tue, 21 Aug 2012 00:31:44 +0000 (17:31 -0700)]
Fix inter_zz_count calculation bug
The current way of counting inter_zz_count doesn't work correctly
in multi-threaded encoding. Calculating it after the frame is
encoded fixed the problem.
James Zern [Wed, 15 Aug 2012 18:45:12 +0000 (11:45 -0700)]
fix msvc configure
visual studio targets do not depend on executables, only the projects
produced.
tested with --target=x86-win32-vs9
fixes:
...
make[1]: *** No rule to make target `test_libvpx', needed by `.bins'.
Stop.
Makefile:17: recipe for target `.DEFAULT' failed
Mike Frysinger [Wed, 15 Aug 2012 15:55:31 +0000 (11:55 -0400)]
Parse out arm isa targets from dumpmachine
The current parsing logic of the dumpmachine tuple lacks any arm
cases which means tgt_isa never gets set, so for all arm targets,
we get detected as generic-gnu. Add some basic arm checks here
so the automatic detection logic works.
Mike Frysinger [Tue, 14 Aug 2012 18:24:28 +0000 (14:24 -0400)]
do not error out on generic-gnu + --enable-shared
If you build with --enabled-shared on a Linux arch not explicitly
listed, the configure script will abort because it didn't detect
"linux" in the fallback generic-gnu tuple.
Since this is the fallback tuple and people are passing
--enable-shared, assume the user knows what they're in for.
Scott LaVarnway [Thu, 2 Aug 2012 18:58:09 +0000 (11:58 -0700)]
Added row based loopfilter
Interleaved loopfiltering with decode. For 1080p clips, up to 1%
performance gain. For 4k clips, up to 10% seen. This patch is required
for better "frame-based" multithreading.
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.