John Koleszar [Tue, 23 Apr 2013 16:51:09 +0000 (09:51 -0700)]
Convert coeff to per-plane MACROBLOCK data
This commit moves the coeff storage from the MACROBLOCK struct to its
per-plane part. The next commit will remove the coeff member from the
BLOCK structure so that it is consistently accessed per-plane.
Also refactors vp9_sb_block_error_c and vp9_sb_uv_block_error_c to be
variable subsampling aware.
Jingning Han [Tue, 23 Apr 2013 22:07:35 +0000 (15:07 -0700)]
Enable rectangular support for comp inter-intra
This commit enables rectangular block prediction of compound
inter-intra mode. It combines the mb/sb32/sb64 prediction functions
into a unified version with configurable block width and height.
This fixes the enc/dec mismatch of the codebase when
comp-interintra-pred is enabled.
Ronald S. Bultje [Tue, 23 Apr 2013 19:32:32 +0000 (12:32 -0700)]
Make loopfilter aware of rectangular blocks.
Also use explicitely named enum values in sb_type comparisons, rather
than relying on absolute integer values, because enum values may
change in the future.
John Koleszar [Tue, 23 Apr 2013 15:26:10 +0000 (08:26 -0700)]
Move src_diff to per-plane MACROBLOCK data
First in a series of commits making certain MACROBLOCK members
addressable per-plane. This commit also refactors the block subtraction
functions vp9_subtract_b, vp9_subtract_sby_c, etc to be
loops-over-planes and variable subsampling aware.
Deb Mukherjee [Mon, 22 Apr 2013 19:43:12 +0000 (12:43 -0700)]
Bugfix from reordering frame probs patch
This fixes an intermittent mismatch issue cause by moving
the lossless mode decoding bit to after the loop filter
setup information. We need to ensure that the lossless bit
is decoded prior to loop filter setup.
Scott LaVarnway [Fri, 19 Apr 2013 20:32:15 +0000 (16:32 -0400)]
Eliminated prev_mip memsets/memcpys
For 1080 material, this buffer is currently 2,270,928 bytes. This patch swaps
ptrs instead of copying and uses the last show_frame flag instead of setting
the entire buffer to zero. For the test clip used, the decoder improved by up
to 1%.
Paul Wilkins [Fri, 19 Apr 2013 10:10:16 +0000 (11:10 +0100)]
Simplification of MVref search.
As we are no longer able to sort the candidate
mvrefs in both encoder and decode and given
that the cost of explicit signalling has proved
prohibitive, it no longer makes sense to find more
than 2 candidates.
This patch:
Modifies and simplifies add_candidate_mv()
Removes the forced addition of a 0 vector in the
MAX_MV_REF_CANDIDATES-1 position (in preparation
to reducing MAX_MV_REF_CANDIDATES to 2).
Re-orders the addition of candidates slightly.
This actually gives small gains (circa 0.2% on std-hd)
A subsequent patch will remove NEW_MVREF experiment,
reduce MAX_MV_REF_CANDIDATES to 2 and remove distance
weights as these are implicit now in the order.
Paul Wilkins [Tue, 16 Apr 2013 17:59:39 +0000 (18:59 +0100)]
Adjustments to key frame sizing.
Adjustments take heavier account of the frame near a kf
in deciding boost and limit the total number that can contribute.
Also adjusted the minq calculations such that in most cases we
generate a smaller key frame.
Modified the code that accounts for how static the sequence is and
added some adjustment based on image size. This is still very
crude but smaller images tend to behave better with a larger
delta between KF Q and other frames than larger image formats.
Changes give sizable gains in overall PSNR on all the test sets but the
biggest gains (~3%) were on the std-hd set.
The gains were smaller for SSIM but still significant.
Average PSNR results are mixed because this metric can very easily
be altered by having a very good / lossless coding of one or two frames.
Some of the YT and YT-HD clips in particular have blank lead ins and
allowing lossless coding of these appears to make a big difference to
average PSNR but it reality does not help much at all.
John Koleszar [Mon, 15 Apr 2013 20:18:24 +0000 (13:18 -0700)]
Removing rounding from UV MV calculation
Consider the previous behavior for the MV 1 3/8 (11/8 pel). In the
existing code, the fractional part of the MV is considered separately,
and rounded is applied, giving a result of 6/8. Rounding is not required
in this case, as we're increasing the precision from a q3 to a q4, and
the correct value 11/16 can be represented exactly.
John Koleszar [Sat, 13 Apr 2013 00:19:57 +0000 (17:19 -0700)]
make buid_inter_predictors block size agnostic (luma)
This commit converts the luma versions of vp9_build_inter_predictors_sb
to use a common function. Update the convolution functions to support
block sizes larger than 16x16, and add a foreach_predicted_block walker.
Next step will be to calculate the UV motion vector and implement SBUV,
then fold in vp9_build_inter16x16_predictors_mb and SPLITMV.
At the 16x16, 32x32, and 64x64 levels implemented in this commit, each
plane is predicted with only a single call to vp9_build_inter_predictor.
This is not yet called for SPLITMV. If the notion of SPLITMV/I8X8/I4X4
goes away, then the prediction block walker can go away, since we'll
always predict the whole bsize in a single step. Implemented using a
block walker at this stage for SPLITMV, as a 4x4 "prediction block size"
within the BLOCK_SIZE_MB16X16 macroblock. It would also support other
rectangular sizes too, if the blocks smaller than 16x16 remain
implemented as a SPLITMV-like thing. Just using 4x4 for now.
There's also a potential to combine with the foreach_transformed_block
walker if the logic for calculating the size of the subsampled
transform is made more straightforward, perhaps as a consequence of
supporing smaller macroblocks than 16x16. Will watch what happens there.
Jingning Han [Mon, 15 Apr 2013 16:31:27 +0000 (09:31 -0700)]
Make the use of pred buffers consistent in MB/SB
Use in-place buffers (dst of MACROBLOCKD) for macroblock prediction.
This makes the macroblock buffer handling consistent with those of
superblock. Remove predictor buffer MACROBLOCKD.