This commit enables 8x8 DCT and hybrid transform unit tests. It
also tunes the forward hybrid transform rounding opertions for
more precise round-trip performance.
Change-Id: If05c1ce59d75d641b9c6c91527d02d3a6ef498c3
This commit makes use of the butterfly structure to enable the sse2
version implementation of 8x8 ADST/DCT hybrid transform coding.
The runtime of hybrid transform module goes down from 1170 cycles
to 245 cycles. Overall speed-up around 1.5%.
Change-Id: Ic808ffd21ece8a9d0410d8c0243d7b6c28ac3b3f
This reduced the size of the MODE_INFO array (mip and prev_mip)
by 425,568 bytes each for 1080p resolutions.
Change-Id: Ifa513ec2d0a49e8ec0867ec90620762fb7f1261d
For cases where there's no transform set in bit 0 (the left edge of
the SB) but bit 0 of mask_4x4_int is set (the edge 4 pixels from the
left edge needs filtering), it was incorrectly being skipped before.
This situation only happens on the leftmost edge of the image, as
the edge at column 0 is intentionally skipped since there aren't
pixels to the left to read.
Change-Id: Ib2fbbcb40166e90af31b1a0e13b85b68c226cbd3
Change vp9_block_error() to return a 64bit error variable, change all
callers to expect a 64bit return value (this will prevent overflows,
which we basically don't check for at all right now). Remove duplicate
block_error() function, which fixed that through truncation. Remove
old (incompatible) mmx/sse2 block_error SIMD versions and replace with
a new one that returns a 64bit value.
Encoding time of first 50 frames of bus @ 1500kbps goes from 3min29 to
3min23, i.e. a 3% overall speedup.
Change-Id: Ib71ac5508b5ee8a80f1753cd85d72df1629abe68
Encoding of bus @ 1500kbps (first 50 frames) goes from 3min57 to
3min35, i.e. approximately a 10.5% speedup. Note that the SIMD versions
which use a bilinear filter (x_offset & 7 || y_offset & 7) aren't
perfectly interleaved, and can probably be improved further in the
future. I've marked this with a few TODOs/FIXMEs in the code.
Change-Id: I5c9e900c0f0d32e431a50fecae213b510b2549f9
Improves the rd modeling function and implements them using interpolation
from a table which is a little faster. Also uses sse as input to the
modeling function rather than var - since there is no dc prediction
used and as a result the sse works a little better.
derfraw300: +0.05%
Speedup: ~1%
Change-Id: I151353c6451e0e8fe3ae18ab9842f8f67e5151ff
This uses variance to split partition. Variance is calculated using
nearest mv, always from last ref frame.
Change-Id: Idd015b4a9aa3bc82591759eac239680c07496896
The new print out includes skips and has prefixed sections so you can
grep to find things like transforms chosen on each frame.
Change-Id: I195043424647d9514cfc3ff6720a5b20d010fa1b
Optimized the quantization function by making it a two-pass
process. The first pass does a quick checking of the transform
coefficients against the base ZBIN, and only keep the good
enough set of coefficients for quantization. A skipping
check is added. If all coefficients are within the base ZBIN, no
quantization is needed. The second pass is the actual quantization
pass, which only processes the coefficient subset determined
in first pass. This reduces the computation. Furthermore, an
alternitive method is used for large transform size, which often
has sparse nonzero quantized coefficients.
Overall, the encoder speedup is about 4%. The quantization function
itself gets 20% faster.
Change-Id: I3a9dd0da6db030260b6d9c314a9fa48ecae89f22
This commit makes use of dual fdct32x32 versions for rate-distortion
optimization loop and encoding process, respectively. The one for
rd loop requires only 16 bits precision for intermediate steps.
The original fdct32x32 that allows higher intermediate precision (18
bits) was retained for the encoding process only.
This allows speed-up for fdct32x32 in the rd loop. No performance
loss observed.
Change-Id: I3237770e39a8f87ed17ae5513c87228533397cc3
This seems to only be used in the encoder. Also remove an empty wrapper
file that contained forward declarations for this function, but didn't
actually define any actual functions.
Change-Id: Ifc561eef7ebe374a7d03698055e51e105f6d614b
vp9_default_inter_mode_probs was being accessed with a different type
than it was defined with. Ensure that its declaration is included
prior to its definition.
Change-Id: I2f963f513ab2f4e339f8a3c17e3d0f03749eba16
All elements of this table are equal to 252, so replace it with a
single constant VP9_COEF_UPDATE_PROB.
Change-Id: I1e2d1d284326ce6df9899a740c2fc344b3ec81c9
The encoding time for bus at CIF goes from 661s to 625s. This commit
also enabled unit test of sad8x4/4x8 in sad_test.cc.
Change-Id: If3d10ebb56bda584bdb69bcf056599d580b12cb1
Avoid calling decode_block, inverse transform/add in the block is
a skip block for SBs smaller than 8x8 and intra-coded SBs.
Change-Id: I1684182f4a0050c8d6bb46cba6830d9425e7127d
The encoding time for bus at CIF goes from 661s to 625s. This commit
also enabled unit test of sad8x4/4x8 in sad_test.cc.
Change-Id: If3d10ebb56bda584bdb69bcf056599d580b12cb1
Modified to work with 8x8 blocks of memory. Will revisit
later for further optimizations. For the HD clip used, the
decoder improved by almost 20%.
Change-Id: Iaa4785be293a32a42e8db07141bd699f504b8c67
Modified to work with 8x8 blocks of memory. Will revisit
later for further optimizations. For the HD clip used, the
decoder improved my 20%.
Change-Id: Ia0057f55d66d1445882351ea6c43b595a5a980e5
vpxdec stays in a loop when decoding vp9. This patch is a
quick fix to stop the loop when all data has been decoded.
Eventually we should move the vp9_get_raw_frame() call into
vp8_get_frame().
Change-Id: I3f97b6b4e1fe9ba69f746a29fc54c3304956f661
The encode-side scaling was not indexing through the image correctly
for the chroma planes, causing a green checkerboard-like output in
the unit test.
Change-Id: I9abbd73615404cd6699588be3e64dcf59005bc14
Previous code indexed using the tile length coded in the bitstream
without checking that the read would be valid.
Change-Id: Ia5047762223a4f80d75016dd546dc2ef18b6887d
Removes the case of coding prob = 0 for forward updates, since that
is not an allowed probability to code.
Slightly improves efficiency but may not matter in practice.
Change-Id: I3b4caf82e8f0891992f0706d4089cc5a27568dba
This commit fixed the allowable partition types for bottom-right
corner blocks.
When a block has over half of its pixels as valid content in both
vertical and horizontal directions, allow all the four partition
types in the bit-stream. Otherwise, apply partition type constraints.
Change-Id: I2252e2de7125a8bfb1c824bf34299a13c81102e3
* New probs for subpel filters/tx_count
* Makes a change to not reset to defaults for the tx_size
probs if an intermediate frame reverts to using a fixed tx_size.
* A few updates to the parameters for backward adaptation for mode/mv
* some cosmetic cleanups
derf300: +0.06%
Change-Id: I22994d659bc31ca7a4fc8820fde24001e64a2920
Remove the bilinear filter mode, and the no-loopfilter mode, and the
related vp9_setup_version() function.
Change-Id: I32311367812faf37863131df3af37d63d03973d7
This commit has no impact but to help us debug issues. To Use call like
this:
vp9_print_modes_and_motion_vectors(cpi->common.mi, cpi->common.mi_rows,
cpi->common.mi_cols,
cpi->common.current_video_frame,
"decode_mi.stt");
Change-Id: I89e27725dae351370eb7f311a20a145ed4f1d041
No bitstream change.
Removes unused filters and the code for the case of 2 switchable filters;
also changes the 8tap-smooth filter coefficients for integer shifts to be
interpolating to be consistent with the way it is implemented currently.
Change-Id: I96c542fd8c06f4e0df507a645976f58e6de92aae
Implements ability to signal and decode frames that are
encoded using only intra coding modes. Only the decode
side has been implemented here.
Change-Id: I53ac6a8d90422cd08ba389e5236e15b45f9e93de
Change the argument of get_uv_tx_size() to be an MBMI pointer, so that the
correct column's MBMI can be passed to the function.
Change-Id: Ied6b8ec33b77cdd353119e8fd2d157811815fc98
Fixed point scaling factors are calculated once for each
reference frame by using integer division. Otherwise fixed point
scaling routines are used in all scaling calculations. This makes it
possible to calculate fixed point scaling factors on device driver
software and pass them to hardware and thus avoid division on hardware.
TODO:
- Missing check for maximum frame dimensions
(currently scaling uses 14 bits)
- Missing check for maximum scaling ratio
(upscaling 16:1, downscaling 2:1)
Problems:
- Straightforward fixed point implementation can cause error +-1
compared to integer division (i.e. in x_step_q4). Should only
be an issue for frames larger than 16k.
Change-Id: I3cf4dabd610a4dc18da3bdb31ae244ebaf5d579c
Was always using sb_type of first column in a row of 8x8 units when
determining decoded block edges as a subcondition for loop filter
skipping.
Change-Id: Ib17554633a63a90b70cdaa7bed65db035a8ad9d8
Reduces TX_SIZE contexts to 2 for each kind. The code is
cleaner and there is hardly any performance difference with
more than two contexts.
Results: almost neutral
Change-Id: I17656bd6db76224ae2856adf882504560e7dbaa4
For key frames everything is the same as before. For inter frames we try
to reference last/golden/altref frame size. If there is no match then the
actual size is encoded. Also we don't allow zero width and height anymore.
Change-Id: I49d791fd94af749c823579b0c5ef17c961372678
Made changes to the frame header to write the sync
code in the frame header for a non-displayable,
intra-only frame.
Extended reset_frame_context to 2-bits.
(Submitting on behalf of Dmitri)
Change-Id: Ie836ae0df9ed572fb4f08aabe9351a555c4f3b96
Adds coding of transform size within a frame by use of context
of transform sizes selected in left and above blocks.
Also incorporates code for generating stats.
TODO: generate and incorporate new default stats
Change-Id: I6a7af099f6ad61d448521d9a51167aedaf638ed6
Refactors mbskip coding to be compatible with coding of the rest of
the symbols. Adds forward/backward adaptation and removes a lot of
the legacy code.
Results:
fast50: +1.6%
derfraw300: +0.317%
Change-Id: I395a2976d15af044d3b8ded5acfa45f6f065f980
The partition types of blocks sitting on the frame boundary are
constrained by the block size and the position of each sub-block
relative to the frame. Hence we use truncated probability models
to handle the coding of such information.
100 frames run:
yt 0.138%
Change-Id: I85d9b45665c15280069c0234ea6f778af586d87d
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.
Change-Id: Icf39fa4d987c7abcbebb9bbdcdd6311e8fb9d3c9
Just an intermediate change set to simplify merges. Reordering several
uncompressed header bits, code restructuring + minor cleanups.
Change-Id: I28272f520762f8c4e3ad230ae39fff5102ba5c0d
With the removal of i4X4 and SPLIT_MV modes, the two entries for the
modes are no longer used. This patch remove the coding of the deltas.
Change-Id: Iea4eb500404ebe9706159380a03b8eca542fb4c3
Changes to the coding of transform sizes, along with forward
and backward probability updates.
Results:
derf300: +0.241%
Context based coding of transform sizes will be in a separate
patch.
Change-Id: I97241d60a926f014fee2de21fa4446ca56495756
Added condition to not to skip filtering of transform block edges when
the edge is also a decoding block edge.
Change-Id: Iaccb6206c4202b78e5dca3b89379556e0f4aba0c
Wrong max data size (skip has no data) and use of vp9_get_segdata()
when it should be vp9_segfeature_active().
Change-Id: I1eb97d33df6e2a42cc589049f704266fe3639902
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.
Change-Id: Ic83a69486e088a147ba83a4aedc2a0042f6b3721
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.
Change-Id: Ib6c26c5f6a8709863cf304ab890db8559687d25e
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.
Change-Id: I71afa5a49deb50c1bc38029fd07470b984c6dfe9
Code intra/inter, then comp/single, then the ref frame selection.
Use contextualization for all steps. Don't code two past frames
in comp pred mode.
Change-Id: I4639a78cd5cccb283023265dbcc07898c3e7cf95
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.
Change-Id: I77ca996e25e4a28e03bdbc542f27a3e64ca1234f
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.
Change-Id: I08f3e9683eb7bded8a76651cbc50fc0dfdd05fa7
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.
Change-Id: Iddee65ff3324ee309815ae7c1c5a8584720e7568
This avoids encoding tokens for blocks that are entirely
in the UMV border. This changes the bitstream.
Change-Id: I32b4df46ac8a990d0c37cee92fd34f8ddd4fb6c9
This commit makes the coding/reconstruction operations of intra
coding rate-distortion loop for UV components consistent with those
of the encoding process.
key frame coding gains:
derf: 0.11%
stdhd: 0.42%
Change-Id: I8d49f83924a320e3689ef2d60096c49d7f0c7a40
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)
Change-Id: Ie2718be73528c945fd0d80cfd63ca2d9cb3032de
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%
Change-Id: I0da2eb7a71361dfb8c1384927fc536b0c2790d07
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.
Change-Id: Idc03e7f827e51f1bb8d269bc3752ee297a6bbfe5
Migrates costing changes/fixes from the rebalance expt to the head
without the expt on.
Rebased.
Change-Id: I51677d62f77ed08aca8d21a4c9a13103eb8de93f
Results:
derfraw300: +0.126%
Restrict get_matching_candidate() to considering
mvs at 8x8 and larger sizes for last frame case.
This is to reduce the HW load of using vectors down
to the 4x4 level from the previous frame.
Change-Id: I6505e610fd63a4e22d67f136aec7905a01b893ba