EXT_TX introduces some new symbols to be decoded.
The encoder counts how many times these are used.
In multithreaded mode, the counts from the worker threads
need to be accumulated into the main thread.
This change means that VP10/VPxEncoderThreadTest now works
with more choices of cpu-used and number of passes.
Change-Id: Ibe7e6a3c58145265f4ead155ff98fb4cb37c3513
Properly reset the early termination flag in the recursive transform
block partitioning rate-distortion optimization scheme.
Change-Id: Ibfe918f21f11dcb1ec267c09f954c635305cc95a
Use inter_block_yrd as rate-distortion optimization for lossless
coding. This fixes transform coefficient buffer swap use case and
resolves the unit test failure related to lossless coding.
Change-Id: I1512dab5ed5760c31f7de21a06e8d9ed1eb081fa
The old workaround "p = 0 ? 0 : p -1" is misleading.
?: happens before =
assigning back to p truncates to one byte.
Therefore it is equivalent to (p - 1) & 0xFF, but the check just exists
to work around a first pass bug, so let's make the work around more
clear.
https://code.google.com/p/webm/issues/detail?id=1089
Change-Id: Ia6dcc8922e1acbac0eeca23a4d564a355c489572
This commit properly resets the recursive transform block partition
array in the settings of using largest transform block size at frame
header level. It fixes one of the unit test failure related to the use
of frame level fixed transform block size with 440 color format.
Change-Id: I6750f323e2c2510c080ffc3af82ce2041f4f60b8
The custom LCG is based on the POSIX recommend constants for a 16-bit
rand(). This implementation uses less computation than typical standard
library procedures which have been extended for 32-bit support, is
guaranteed to be reentrant, and identical everywhere.
Change-Id: I3140bbd566f44ab820d131c584a5d4ec6134c5a0
Ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/rand.html
This commit makes the recursive transform block partitioning properly
handle the non-420 color format. It resolves an enc/dec mismatch
issue in that setting when var-tx experiment is turned on.
Change-Id: I48a91de02c11b3153f897d1cca0ae948eec15605
This commit fixes an enc/dec mismatch issue in recursive transform
partitioning experiment due to merge conflict.
Change-Id: I66146ef806c008902c91d54f4f8c7ccf47996b78
Add the row and column index to the argument list of unit functions
called by foreach_transformed_block wrapper. This avoids the
repeated internal parsing according to the block index.
Change-Id: Ie7508acdac0b498487564639bc5cc6378a8a0df7
This commit fixes the merge conflicts between master and nextgenv2 and
disable early termination in choose_tx_size() to avoid failure in test.
The test failures are pre-existing, some of the issue were fixed in
masterbase already, so will have another merge to introduce the fixes.
Change-Id: Ib71889661955e73aedbb4db49d8be70425281dcb
Temporarily reset the transform type in the inter modes when
recursive transform block partitioning is used. This resolves an
enc/dec mismatch issue in nextgenv2 codebase when both var-tx and
ext-tx experiments are turned on.
Change-Id: I2543f0a567243da95b237752d46964b07b669ad9
Clear the compiler errors when both high bit-depth and recursive
transform block partition experiments are enabled.
Change-Id: If0b6396851f10c28b4f26350322ccd1ba2fc9aff
This causes the output of find_ref_mvs() to always be unique or zero.
A nice side-effect of this is that it also causes the output of
find_ref_mvs_sub8x8() to be unique-or-zero, and it will not ignore
available candidate MVs under certain conditions.
See issue 1012.
Change-Id: If4792789cb7885dbc9db420001d95f9b91b63bfa
Added optimization of the 8 bit assembly quantizer routines. This makes
these functions up to 100% faster, depending on encoding parameters.
This patch maskes the encoder faster in both the high bitdepth and 8bit
configurations. In the high bitdepth configuration, it effects profile 0
only.
Based on my profiling using 1080p input the net gain is between 1-3% for
the 8 bit config, and around 2.5-4.5% for the high bitdepth config,
depending on target bitrate. The difference between the 8 bit and high
bitdepth configurations for the same encoder run is reduced by 1% in all
cases I have profiled.
Change-Id: I86714a6b7364da20cd468cd784247009663a5140
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE and VP8E_USE_REFERENCE have been
deprecated since the initial public release
Change-Id: Ied16b441eec13434d85f1ab115d49ccaf5f2f7b0
Some more testing of this patch would probably be useful, but I
think the basics of it should work fine now.
See issue 1035.
Change-Id: I4a36d58f671c5391cb09d564581784a00ed26245
This experiment allows using full above/right edges for all transform
sizes whenever available (for d45/d63), and adds bottom/left edges for
d207.
See issue 1043.
Change-Id: I5cf7f345e783e8539bb6b6d2c9972fb1d6d0a78b
In VP9, the ref MV had to point to a block that itself fully resided
within the visible image, i.e. all borders of the image had to be
within the visible borders of the coded frame. This is somewhat
illogical, and had obscure side effects, e.g. clamping of fairly
reasonable motion vectors such as 0,0 were clipped to negative values
if the block was overhanging on frame edges (such as the last rows
on 1080p content), which makes no sense whatsoever.
Instead, relax clamping constraints such that the ref MVs are allowed
to point to blocks exactly outside the visible edges in both Y as well
as UV planes, including the 8tap filter edges (that's why the offset is
8 pixels + block size).
See issue 1037.
Change-Id: I2683eb2a18b24955e4dcce36c2940aa2ba3a1061
This has various benefits:
- simplify implementations because we don't have to switch between
multiple probability tables depending on frametype
- allows fw subexp and bw adaptivity for partitions/uvmode in keyframes
See issue 1040 point 5.
Change-Id: Ia566aa2863252d130cee9deedcf123bb2a0d3765
Locate them (code-wise) in frame_context, and have them be updated
as any other probability using the subexp forward and adaptive bw
updates.
See issue 1040 point 1.
TODOs:
- real-world default probabilities
- why is counts sometimes NULL in the decoder? Does that mean bw
adaptivity updates only work on some frames? (I haven't looked
very closely yet, maybe this is a red herring.)
Change-Id: I23b57b4e5e7574b75f16eb64823b29c22fbab42e
Account for rounding in distortion calculation in k-means;
carry out rounding before duplicates removal of base colors;
replace numbers with macros;
use prefix increment.
Slight coding gain (<0.1%) on screen_content testset.
Change-Id: Ie8bd241266da6b82c7b2874befc3a0c72b4fcd8c
This commit re-designs the recursive transform block partition
rate-distortion optimization framework. It allows the encoder to
improve speed by 10%.
Change-Id: I6dd3a7dd428a530d8012e5c6ddc40e650c8b392b
This change (in a new config experiment: universal_hp) removes the
bitstream parsing dependency of the HP MV bit on the ref MV to be
coded. It also cleans up clearing of the HP bit in near/nearestMV,
since HP is always on if it's set in the frame header.
This admittedly doesn't clean up the crap that could be cleaned up,
but that's mostly because I think this needs some careful review;
not so much for coding style, but more from hardware people and from
the codec team on what we/you want. It would also be nice to get some
actual numbers on the real quality impact of this change. If, for
example, hardware people come up and tell us they don't actually care
anymore, we should probably just this code as-is and do nothing (i.e.
discard this patch).
See issue 1036.
Change-Id: Ic9b106f34422aa0f79de0c28125b72d566bd511a
This actually has no effect whatsoever, since the input MVs themselves
are clamped by clamp_mv_ref() already, which is significantly more
restrictive in its bounds.
Change-Id: I4a3a7b2b121ee422c56428c2a12d930c3813c06e
We only write EOSB tokens if we write tokens (i.e. not for skip blocks),
and we write EOSB tokens per-plane instead of per block.
Change-Id: I8d7ee99f8ec50eb7ae809f9f9282c1c91dbf6537
Add palette mode for keyframe luma channel. Palette mode is enabled
when using "--tune-content=screen" in encoding config parameters.
on screen_content testset: +6.89%
on derlr : +0.00%
Design doc (WIP):
https://goo.gl/lD4yJw
Change-Id: Ib368b216bfd3ea21c6c27436934ad87afdaa6f88
This commit makes the rate-distortion optimization for chroma
component support the recursive transform block coding scheme.
Change-Id: I1bfed6d05b0ebb3905cb625222401e2ccbae10f3
This commit makes the transform, quantization, tokenization and
their corresponding inverse operations support recursive transform
block coding process.
Change-Id: I71f2ef3a7c2d3db7cfc63c1fd3f1337e8e0360b5
This commit re-designs the bitstream syntax to support recursive
transform block partition. The initial stage targets the inter
prediction residuals.
Change-Id: I556ab3c68c198387a2fd2d02e2b475e83cd417c3
Add the row and column index to the argument list of unit functions
called by foreach_transformed_block wrapper. This avoids the
repeated internal parsing according to the block index.
Change-Id: I42b3578eac258ebaba7a7c74f684de9abab521a6
We have historically added new bits to cat6 whenever we added a new
transform size (or bitdepth, for that matter). However, we have
always coded these new bits regardless of the actual transform size,
which means that for smaller transforms, we code bits that cannot
possibly be set. The coding (quality) impact of this is negligible,
but the bigger issue is that this allows creating bitstreams with
coefficient values that are nonsensible and can cause int overflows,
which then de facto become part of the bitstream spec. By not coding
these bits, we remove this possibility.
See issue 1065.
Change-Id: Ib3186eca2df6a7a15ddc60c8b55af182aadd964d
This is identical to what the tile size does for the last tile. See
issue 1042 (which covers generalizing the superframe/tile concepts).
Change-Id: I1f187d2e3b984e424e3b6d79201b8723069e1a50
See issue 1051. 6 bits is fairly arbitrary but at least allows writing
delta Q values that are fairly normal in other codecs. I can extend to
8 if people want full range, although I personally don't have any need
for that.
Change-Id: I0a5a7c3d9b8eb3de4418430ab0e925d4a08cd7a0
This is more a proof of concept than anything else. The problem here
isn't so much how to code it, but rather where to place the resulting
code. All intrapred DSP code lives in vpx_dsp, so do we want the vp10
specific intra pred functions to live there, or in vp10/?
See issue 1015.
Change-Id: I675f7badcc8e18fd99a9553910ecf3ddf81f0a05
Adds an early termination to the ext_tx search, and also
implements the DST transforms more efficiently.
About 4 times faster with the ext-tx experiment.
There is a 0.09% drop in performance on derflr from 1.735% to
1.648%, but worth it with the speedup achieved.
Change-Id: I2ede9d69c557f25e0a76cd5d701cc0e36e825c7c
Resolved Conflicts in the following files:
configure
vp10/common/idct.c
vp10/encoder/dct.c
vp10/encoder/encodemb.c
vp10/encoder/rdopt.c
Change-Id: I4cb3986b0b80de65c722ca29d53a0a57f5a94316
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).
Also add render_size to the encoder_param_get_to_decoder unit test.
See issue 1030.
Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
The name "display_*" (or "d_*") is used for non-compatible information
(that is, the cropped frame dimensions in pixels, as opposed to the
intended screen rendering surface size). Therefore, continuing to use
display_* would be confusing to end users. Instead, rename the field
to render_*, so that struct vpx_image can include it.
Change-Id: Iab8d2eae96492b71c4ea60c4bce8121cb2a1fe2d
In practice, this fixes the issue that if you have an odd number of
mi_cols, on the full right of the image, the UV int4x4 loopfilter
will be skipped over odd cols as well as odd rows (because it holds a
single variable for both edges).
See issue 1016.
Change-Id: Id53b501cbff9323a8239ed4775ae01fe91874b7e
Consider tha case in which skipping transform coefficients is more
efficient.
derflr +0.13%
hevclr +0.11%
hevcmr +0.14%
hevchr +0.22%
with ext-tx, the impact is -0.02%.
Change-Id: I0aa2965cf9e152396623c2fee62545bd3a3a7f07
remove static from fdct4/8/16/32 in vp10/encoder/dct.c
add prefix vp10_ to fdct4/8/16/32
add vp10/encoder/dct.h
Change-Id: I644827a191c1a7761850ec0b1da705638b618c66
This commit removes mbmi_ext_base pointer from MACROBLOCK struct.
Its use case can be fully covered by cpi->mbmi_ext_base pointer.
Change-Id: I155351609336cf5b6145ed13c21b105052727f30
This means that we don't reconstruct in 4x4 dimensions, but in
blocksize dimensions, e.g. 4x8 or 8x4. This may in some cases lead
to performance improvements. Also, if we decide to re-introduce
scalable coding support, this would fix the fact that you need to
re-scale the MV halfway the block in sub8x8 non-4x4 blocks.
See issue 1013.
Change-Id: If39c890cad20dff96635720d8c75b910cafac495
In vp9, the bottom MV would be the average of the topright and
bottomleft luma MV (instead of the bottomleft/bottomright luma MV).
See issue 993.
Change-Id: Ic91c0b195950e7b32fc26c84c04788a09321e391
This has virtually no effect on coding efficiency, but it is more
logical from a theoretical perspective (since it makes no sense to
me that you would exclude a MV from a list just because it's sign-
inversed value is identical to a value already in a list), and it
also makes the code simpler (it removes a duplicate value check in
cases where signbias is equal between the two MVs being compared).
See issue 662.
Change-Id: I23e607c6de150b9f11d1372fb2868b813c322d37
For reading, this makes the operation branchless, although it still
requires two shifts. For writing, this makes the operation as fast
as writing an unsigned value, branchlessly. This is also how other
codecs typically code signed, non-arithcoded bitstream elements.
See issue 1039.
Change-Id: I6a8182cc88a16842fb431688c38f6b52d7f24ead
Extend the ext_tx experiment to make the UV inter blocks use
the same transform type as the extended transform type used
for Y.
derflr: +1.792% (about +0.06)
Change-Id: I4a77e1f7764b2e8b523e28f42ba13559dde4f0ca
The implicitly changed value would be used for contextualizing future
skip flags of neighbour blocks (bottom/right), which is certainly not
what was intended. The original code stems from vp8, and was useful
in cases where coding of the skip flag was disabled. In vp9, the skip
flag is always coded. The result of this change is that for bitstream
parsing purposes, decoding of the skip flag becomes independent of
decoding of block coefficients.
See issue 1014.
Change-Id: I8629e6abe76f7c1d649f28cd6fe22a675ce4a15d
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).
See issue 1059.
Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
The counts didn't take usehp into account, which means that if the
scope of the refmv is too large for the hp bit to be coded, the value
(always 1) is still included in the stats. Therefore, the final
counts will not reflect the entropy of the coded bits, but rather the
entropy of the combination of coded bits and the implied value (which
is always 1). Fix that by only including counts if the hp bit is
actually coded.
See issue 1060.
Change-Id: I19a3adda4a8662a05f08a9e58d7e56ff979be11e
Unify the style of fdct4() fdct8() fdct16()
Add fdct32()
Add range_check() at each stage
Add unit test at ../../test/vp10_dct_test.cc
Change-Id: I13f76d9046c3ea473c82024b09a5bc8662e2c28e
See issue 1030. The value of frame_parallel_decoding_mode was ignored
in vp9 if refresh_frame_context was 0, so instead make it a 3-member
enum where the dependency is obviously stated.
Change-Id: I37f0177e5759f54e2e6cc6217023d5681de92438
In vp9, [0] and [1] had identical meaning, so merge them into a
single value. Make it impossible to code RESET_FRAME_CONTEXT_NONE
for intra_only frames, since that is a non-sensical combination.
See issue 1030.
Change-Id: If450c74162d35ca63a9d279beaa53ff9cdd6612b
1) copy following files from vpx_dsp/ to vp10/common/
vp10_inv_txfm.c
vp10_inv_txfm.h
vp10_inv_txfm_sse2.c
vp10_inv_txfm_sse2.h
2) change the function prefix "vpx_" to "vp10_" in above files
3) add unit test at vp10_inv_txfm_test.cc
Change-Id: I206f10f60c8b27d872c84b7482c3bb1d1cb4b913
This condition is not effectively in use. The actual reference
frame masking is done in other route.
Change-Id: Ia59c843bcac7243dada92f0f67658d7ce43df5e8
Take out speed features that affect the compression performance
to simplify the coding route. This commit removes the motion field
mode search used in speed 3.
Change-Id: Ifdf6862cb1ece8261125a56d9d89bcef60758c00
Creates new hybrid transforms combining symmetric DST with
ADST and DCT. Thus a total of 16 transforms are supported.
derfl: +1.659% (up about 0.2%)
Change-Id: Idde1cecdb59527890bf05da740099c3f6a5b9764
prevents an int -> vpx_img_fmt_t conversion warning with high-bitdepth
as it modifies the image format
Change-Id: Ie3135d031565312613a036a1e6937abb59760a7e
Does not include DST1 yet.
derflr: +1.437 (8-bit internal), +7.243 (12-bit internal)
with --enable-ext-tx
Change-Id: I91f1759fd2de794755eb6384cda52e80e979cb7d
The fields are always coded in the frame itself, so there is never any
dependency on past frames. In practice, this fixes sign_bias being
ignored when error_resilient_mode=1.
See issue 1011.
Change-Id: I9d134ef6b445ced4d100fa735ce579855a0fa5af
These frame types cannot make bitstream parsing depend on previous
frames, so the hypothetical combinations of e.g. keyframe=1 and
update_map=0 or keyframe=1 and temporal_update=1 are non-sensical.
Therefore, make it impossible to code such combinations in the vp10
bitstream header.
See issue 1044.
Change-Id: I3f0a83d5c7e3989541a469a909471424a285239d
In VP9, the order for frame header was: [0] smooth, [1] regular, [2]
sharp, [3] bilinear. Per-block, the order was [0] regular, [1] smooth
and [2] sharp. For VP10, swap smooth/regular in the frame header so
that the block ordering and frame header ordering are interchangeable.
See issue #1046.
Change-Id: Ic9ec5964874375e40cd59bef50b489a76cbe4365
Unify the style of fdct4() fdct8() fdct16()
Add fdct32()
Add range_check() at each stage
Add unit test at ../../test/vp10_dct_test.cc
Change-Id: I9e912b2c5683862e65c5a21abc3e1c260cca4576
Spatial/temporal svc code was removed. Verified using Borg test,
and the results before and after the change are matching.
Change-Id: I4c2ee5cd560428e3e50be02e57e5871ef4246390
derflr +0.202%
hevclf +0.207%
hevcmr +0.095%
hevchr +0.077%
Tested locally on several derf sequences, speed (encoder + decoder)
is slower by less than 1%.
It is part of the EXT_TX experiment, which is to be continued to
explore different transform variants.
Change-Id: I05d44994a62106538a9a241ed8d89bd7c5d14761