Don't crash if motion vector ref points to out-of-bounds area.
This can only happen if partition is partly out-of-frame, in which
case the referenced mv is either out-of-frame also (and thus has the
same value as an already-read one), or it is actually uninitialized,
in which case we don't want to use it.
Paul Wilkins [Fri, 7 Jun 2013 11:29:15 +0000 (12:29 +0100)]
Compound inter encoder bug fix.
In the longer term the encoder should allow compound as long
as one of the buffers has opposite sign bias and as per the decoder
this buffer is then set as the fixed reference. However at the moment
the encoder and RD loop only supports the case where the ALTREF_FRAME
buffer (or third of the 3 allowed in any given frame) is the odd one out.
This patch fixes a bug that would allow compound inter and set
fixed ref to ALTREF_FRAME when it is not the odd one out.
John Koleszar [Wed, 3 Oct 2012 19:11:05 +0000 (12:11 -0700)]
Add cheap show-buffer operation
Adds the ability to have the decoder show one of the existing reference
frames directly, without having to code it indirectly as a series of
skip blocks.
Yaowu Xu [Fri, 7 Jun 2013 05:10:07 +0000 (22:10 -0700)]
Fix a merge conflict
ref_frame in MB_Mode_Info was changed in the ref frame coding patch
to be an array to handle first and second reference frame, this patch
fix the loop filter code that use the pointer directly as reference
frame.
Split partition probabilities between keyframes and non-keyframes,
since they are fairly different. Also have per-blocksize interframe
y intramode probabilities, since these vary heavily between different
blocksizes.
Lastly, replace default probabilities for partitioning and intra modes
with new ones generated from current codec. Replace counts with actual
probabilities also.
John Koleszar [Thu, 30 May 2013 16:12:57 +0000 (09:12 -0700)]
Reimplementation of loop filter
This version of the loop filter supports non-4:2:0 subsampling and
a fourth plane, as well as changing the filtering order to be more
friendly to hardware implementations.
The filters are applied first to all vertical edges within the
64x64 SB, followed by the top horizontal edge and any internal
horizontal edges. Since filtering is applied on each 4x4 edge
serially, a dependency is created from filtering one block edge
to the next. It would be possible to remove this depencnecy by
building all filtering decisions from the unfiltered
reconstruction data.
Paul Wilkins [Mon, 3 Jun 2013 11:51:29 +0000 (12:51 +0100)]
Rd thresholds change with block size.
Added structures to support independent rd thresholds
for different block sizes (and set experimental block
size correction factors).
Added structure to to allow dynamic adaptation of thresholds
per mode and per block size basis depending on how often
the mode/block size combination is seen (currently fixed factor).
Removed some unused variables.
TODO
- Adaptation of thresholds based on how often each mode chosen.
- The baseline mode values could also be adjusted based on
the block size (e.g. for a particular intra mode use a low threshold
for 4x4 prediction blocks but a relatively high value for 64x64.
Jingning Han [Thu, 6 Jun 2013 04:14:14 +0000 (21:14 -0700)]
Fix UV intra coding rd loop
This commit makes the coding/reconstruction operations of intra
coding rate-distortion loop for UV components consistent with those
of the encoding process.
Deb Mukherjee [Tue, 4 Jun 2013 22:25:16 +0000 (15:25 -0700)]
Clean-ups on switchable interpolation and mv_ref
Adds backward adaptation and differential forward updates of switchable
interpolation filter probabilities. Also adds some cosmetic cleanups
and minor fixes on mv_ref probabilities.
derfraw300: +0.353% (with most coming from switchable interp changes)
Jingning Han [Mon, 3 Jun 2013 22:33:31 +0000 (15:33 -0700)]
Make sb intra rd search consistent with encoding
This commit makes operations of the superblock intra coding rate
distortion optimization consistent with those used in the encoding
process. Given the test prediction mode and transform size, the rd
optimizer encodes and reconstructs each transformed block of the
superblock consecutively, then computes the total rate-distortion
costs accosicated with the current superblock to select the coding
decisions.
It achieves coding performance gains:
derf 0.353%
yt 1.111%
Jingning Han [Mon, 3 Jun 2013 16:16:48 +0000 (09:16 -0700)]
Put iterative motion search under speed control
Enable iterative motion search for compound inter-inter prediction
of block sizes 4x4/4x8/8x4 only when best coding quality is selected.
The iterative motion search provides about 0.1% gains for derf and
stdhd at this point, at the expense of longer runtime.
Jim Bankoski [Thu, 30 May 2013 22:13:08 +0000 (15:13 -0700)]
Creates a new speed 1:
This speed 1 - uses variance threshold stolen from static-thresh
to determine split. Any superblock with greater than the variance
set by static thresh * quantizer index squared is split. In addition
transform size is set to largest size less than or equal to partition
size, sub pixel filter is set to normal, and only 12 modes are used
at all.
Ronald S. Bultje [Thu, 30 May 2013 19:49:38 +0000 (12:49 -0700)]
Remove splitmv.
We leave it in rdopt.c as a local define for now - this can be removed
later. In all other places, we remove it, thereby slightly decreasing
the size of some arrays in the bitstream.
Ronald S. Bultje [Thu, 30 May 2013 18:27:40 +0000 (11:27 -0700)]
Remove i4x4_pred.
It remains as a local define in rdopt.c so we can distinguish between
split and non-split modes in the RD loop, but disappears outside that
scope in the codec.
Yaowu Xu [Thu, 30 May 2013 21:24:12 +0000 (14:24 -0700)]
Changed to use a new variant of WHT
The commit changed to use a new variant of Walsh-Hadamard Transform
by Tim Terriberry. This new variant has the best compression among a
number of variants that developed by Tim.