308 Commits

Author SHA1 Message Date
Yaowu Xu
1a6ec3c756 Merge "Change initializations to be compatible with MSVC" into nextgenv2 2016-05-07 20:33:12 +00:00
Jingning Han
bd33326372 Dual prediction filter type for motion compensated reference
Make the bit-stream level support per direction filter type coding
for motion compensated reference.

Change-Id: I61a2360b301075f6734cfd9711b7ae68f214174d
2016-05-07 03:03:04 +00:00
Yaowu Xu
33993798e1 Change initializations to be compatible with MSVC
Change-Id: If5473dadc40d3caea61953fbd112a01939dc1183
2016-05-06 14:20:15 -07:00
Alex Converse
130cccba8d Rename pick_filter_intra.
The word 'pick' is usually used in functions that make decisions where
the bitstream allows multiple legal choices, and not to limit the
bitstream format itself.

Change-Id: Ia60709c29e004475e1aa8861aefded27ebaf4712
2016-05-05 17:06:54 -07:00
Geza Lore
1502d9e44a Fix mismatch with ext-interp.
The encoder signals the interp filter type in the frame header if all
blocks use the same filter (see bitstream.c:fix_interp_filter). This
decision is made based on the counts, but with ext-interp, the counts
are actually only incremented for blocks that fail vp10_is_interp_needed
(see for example encodeframe.c:update_state), otherwise a default value
is used (EIGHTTAP_REGULAR). The decoder however first checks if the
interp filter is signaled at the frame level, and uses that filter type
for all blocks, even if the default value should have been used.

This patch makes the decoder first check with vp10_is_interp_needed
to see if the default value should be used and then checks the frame
level signaling, which reconciles the difference between encoder and
decoder.

Change-Id: I87857ade42dea06b0d5ec2a029e9219268334dbb
2016-05-05 18:24:21 +01:00
Geza Lore
c959151fa2 Fix vp10_accumulate_frame_counts once and for all.
This ensures the multi-threaded and single-threaded encoder/decoder
always uses the same probability contexts.

Change-Id: I6f1e7c6bd8808c390c1dc0a628ae97db3acedf6d
2016-05-04 11:32:40 +01:00
Debargha Mukherjee
e536a1cc07 Merge "Compute end of frame data precisely with ext-tile." into nextgenv2 2016-05-03 22:42:42 +00:00
Debargha Mukherjee
4f5045299e Merge "Refactoring and uv fix for wedge" into nextgenv2 2016-05-03 22:36:24 +00:00
Geza Lore
cba70d29ba Compute end of frame data precisely with ext-tile.
Decoding superframes correctly requires computing the end of the
frame contents in the bitstream precisely. This patch enables
ext-tile to do so.

Also extended superframe_test to test with multiple tiles if using
ext-tile.

Change-Id: I04bb8cde8755a3d764ee3c36aa8b7a6c5c9db742
2016-05-03 19:03:00 +01:00
Geza Lore
1982d67774 Test tile row independence.
Tile rows should now be independent, so make pbi->inv_tile_order
invert the decoding order of tile rows as well as tile columns.
This should improve test coverage. Also added more tile configurations
to the tile_independence_tests.

Change-Id: I14b0f2fa9241c1acaf9e2a07071952cb33feca77
2016-05-03 19:03:00 +01:00
Debargha Mukherjee
3407785536 Refactoring and uv fix for wedge
lowres: -1.72%

Change-Id: I4c883097caac72fab8e01945454579891617145e
2016-05-03 08:02:08 -07:00
Debargha Mukherjee
88fe7871be Refactor wedge generation
Change-Id: I2ec4f562e28a4673477e20186f9d6167b24b76b8
2016-04-28 17:51:21 -07:00
Debargha Mukherjee
7ff7943455 Brings back near-near compound mode into ext-inter
lowres: improves by 0.1%

Change-Id: I245019916bf47c6e24bc8c3953b86715ab0193c9
2016-04-28 11:34:13 -07:00
Alex Converse
67058089b4 Merge "Move ZERO_TOKEN into the ANS coef tokenset." into nextgenv2 2016-04-21 18:08:04 +00:00
Alex Converse
fcea1485bb Merge "Store ANS token CDFs in the FRAME_CONTEXT rather than in a global table." into nextgenv2 2016-04-19 23:29:14 +00:00
Alex Converse
3829cd2f2f Move ZERO_TOKEN into the ANS coef tokenset.
Change-Id: I87943e027437543ab31fa3ae1aa8b2de3a063ae5
2016-04-19 15:29:47 -07:00
Alex Converse
6ca364606b Store ANS token CDFs in the FRAME_CONTEXT rather than in a global table.
This will facilitate bringing the zero node into the token set while
allowing its probability to vary independently.

Change-Id: I57b44c0fce44debb8e612021e44713b229d1b3cf
2016-04-19 09:39:48 -07:00
Jingning Han
ec2ffda599 Handle zero motion vector residual
This commit handles the zero motion vector residuals for single
and compound reference modes, respectively. It improves the coding
performance by 0.13% with no additional encoding complexity.

Change-Id: I16075a836025bd2746da2ff4698fb9261e4b08c1
2016-04-18 18:14:01 -07:00
Yue Chen
16a99e967c Merge "Optimization for EXT_INTER + OBMC combination" into nextgenv2 2016-04-17 18:54:33 +00:00
Yue Chen
321794c4d5 Optimization for EXT_INTER + OBMC combination
In the rd loop, check the perf of obmc, whose mv is copied from regular
inter predictor, when wedge interinter is better than regular inter
(previously it will force allow_obmc = 0). The condition of the early
termination before this step is relaxed to avoid skipping too many obmc
predictions. The rates of the overhead are properly calculated for these tools.

The logic of the bitstream syntax:
(a single ref) the interintra flag is sent first, only if it is 0, we
send the obmc flag;
(compound refs) the obmc flag is sent first, only if it is 0, we send
the wedge interinter flag

Coding gain
lowres: 0.428% (2.287%->2.715%)

Change-Id: I5f3a34640b398e313cbf84235c9fe2073eb2173f
2016-04-15 17:03:20 -07:00
Jingning Han
525995a3d9 Apply motion vector precision check to candidate mv
This avoids repeatedly checking the candidate motion vector
precision level at the decoder end. The compression performance
varies at 0.01% level.

Change-Id: I4a88e95decd900d0cac9a0c2e70ba43ef7ecac38
2016-04-14 09:44:41 -07:00
Jingning Han
885a81f468 Merge "Fix a few mis-use cases of MAX_MV_REF_CANDIDATES" into nextgenv2 2016-04-13 23:44:25 +00:00
Angie Chiang
716f0ea3cf Merge changes I92819356,I50b5a313,I807e60c6,I8a8df9fd into nextgenv2
* changes:
  Branch dct to new implementation for bd12
  Change dct32x32's range
  Fit dct's stage range into 32-bit when bitdepth is 12
  Pass tx_type into get_tx_scale
2016-04-13 23:24:41 +00:00
Alex Converse
91c985fc28 Merge "Convert some vpx boolcoder calls back to vp10 generic calls." into nextgenv2 2016-04-13 23:04:17 +00:00
Jingning Han
f33a0a8215 Fix a few mis-use cases of MAX_MV_REF_CANDIDATES
Fix several use cases where MAX_MV_REF_CANDIDATES is mixed up with
is_compound flag to avoid potential coding interruption.

Change-Id: Ifdee1ef8a81ef6d1c155315c6c6a3074aa7a8b5e
2016-04-13 15:16:55 -07:00
Alex Converse
c1729d12b8 Merge "ANS: Remove extra buffer size checks causing a false decode error." into nextgenv2 2016-04-13 01:37:05 +00:00
Alex Converse
493a585273 ANS: Remove extra buffer size checks causing a false decode error.
The minimal ans partition size is now one byte. This is checked in
ans_read_init().

The read_is_valid() condition is handled by setup_token_decoder().

Change-Id: I7b202b896630bc4285532208bf7cf84567afe158
2016-04-12 15:19:30 -07:00
Angie Chiang
027d12b7d6 Merge changes I359aa49c,Ic8ca5afb into nextgenv2
* changes:
  Generalize txfm scale in highbd quantizer
  Parameterize transform scale for quantizer
2016-04-12 18:02:05 +00:00
Alex Converse
e7224b7866 Convert some vpx boolcoder calls back to vp10 generic calls.
Change-Id: I362f753ff42d4c4fb94df2419cdaad423d7a4229
2016-04-12 11:00:52 -07:00
Geza Lore
454989ff32 Make superblock size variable at the frame level.
The uncompressed frame header contains a bit to signal whether the
frame is encoded using 64x64 or 128x128 superblocks. This can vary
between any 2 frames.

vpxenc gained the --sb-size={64,128,dynamic} option, which allows the
configuration of the superblock size used (default is dynamic). 64/128
will force the encoder to always use the specified superblock size.
Dynamic would enable the encoder to choose the sb size for each
frame, but this is not implemented yet (dynamic does the same as 128
for now).

Constraints on tile sizes depend on the superblock size, the following
is a summary of the current bitstream syntax and semantics:

If both --enable-ext-tile is OFF and --enable-ext-partition is OFF:
     The tile coding in this case is the same as VP9. In particular,
     tiles have a minimum width of 256 pixels and a maximum width of
     4096 pixels. The tile width must be multiples of 64 pixels
     (except for the rightmost tile column). There can be a maximum
     of 64 tile columns and 4 tile rows.

If --enable-ext-tile is OFF and --enable-ext-partition is ON:
     Same constraints as above, except that tile width must be
     multiples of 128 pixels (except for the rightmost tile column).

There is no change in the bitstream syntax used for coding the tile
configuration if --enable-ext-tile is OFF.

If --enable-ext-tile is ON and --enable-ext-partition is ON:
     This is the new large scale tile coding configuration. The
     minimum/maximum tile width and height are 64/4096 pixels. Tile
     width and height must be multiples of 64 pixels. The uncompressed
     header contains two 6 bit fields that hold the tile width/heigh
     in units of 64 pixels. The maximum number of tile rows/columns
     is only limited by the maximum frame size of 65536x65536 pixels
     that can be coded in the bitstream. This yields a maximum of
     1024x1024 tile rows and columns (of 64x64 tiles in a 65536x65536
     frame).

If both --enable-ext-tile is ON and --enable-ext-partition is ON:
     Same applies as above, except that in the bitstream the 2 fields
     containing the tile width/height are in units of the superblock
     size, and the superblock size itself is also coded in the bitstream.
     If the uncompressed header signals the use of 64x64 superblocks,
     then the tile width/height fields are 6 bits wide and are in units
     of 64 pixels. If the uncompressed header signals the use of 128x128
     superblocks, then the tile width/height fields are 5 bits wide and
     are in units of 128 pixels.

The above is a summary of the bitstream. The user interface to vpxenc
(and the equivalent encoder API) behaves a follows:

If --enable-ext-tile is OFF:
     No change in the user interface. --tile-columns and --tile-rows
     specify the base 2 logarithm of the desired number of tile columns
     and tile rows. The actual number of tile rows and tile columns,
     and the particular tile width and tile height are computed by the
     codec ensuring all of the above constraints are respected.

If --enable-ext-tile is ON, but --enable-ext-partition is OFF:
     No change in the user interface. --tile-columns and --tile-rows
     specify the WIDTH and HEIGHT of the tiles in unit of 64 pixels.
     The valid values are in the range [1, 64] (which corresponds to
     [64, 4096] pixels in increments of 64.

If both --enable-ext-tile is ON and --enable-ext-partition is ON:
     If --sb-size=64 (default):
         The user interface is the same as in the previous point.
         --tile-columns and --tile-rows specify tile WIDTH and HEIGHT,
         in units of 64 pixels, in the range [1, 64] (which corresponds
         to [64, 4096] pixels in increments of 64).
     If --sb-size=128 or --sb-size=dynamic:
         --tile-columns and --tile-rows specify tile WIDTH and HEIGHT,
         in units of 128 pixels in the range [1, 32] (which corresponds
         to [128, 4096] pixels in increments of 128).

Change-Id: Idc9beee1ad12ff1634e83671985d14c680f9179a
2016-04-07 10:34:25 +01:00
Debargha Mukherjee
de3d15bb2c Merge "Refactoring and cosmetic changes to ext-inter expt" into nextgenv2 2016-04-06 01:19:06 +00:00
Debargha Mukherjee
0fc82ea1cf Refactoring and cosmetic changes to ext-inter expt
Change-Id: Icd457480744b7734b3c412c9fed43be738373334
2016-04-05 15:16:18 -07:00
Geza Lore
8917146a12 Fix supertx with ext-tile.
Change-Id: Ic2135c3812be009085c7c8e8dc15ee2ba618a67e
2016-04-05 12:49:55 +01:00
Geza Lore
f0290cd127 Refactor get_partition to be universal.
Change-Id: I3a2fe4073bb94c5afc24d9274e6edcdb3aed934f
2016-04-04 15:22:25 +01:00
Angie Chiang
75ae90f7a9 Pass tx_type into get_tx_scale
Change-Id: I8a8df9fdefa492f66cf2cd29b0b081ad69b5d85e
2016-04-01 12:53:10 -07:00
Alex Converse
0f68d80420 Remove duplicate ans parameter in bitstream functions.
Change-Id: Icd459209dae328f90c9a875259fe5d201b2a4e45
2016-04-01 11:33:06 -07:00
Alex Converse
fb9186d68d ANS experiment: Use ANS everywhere.
Use ANS for all entropy coded data in VP10 including the compressed header and
modes and motion vectors. ANS tokens continue to be used for DCT tokens.

Change-Id: Idf709a747150601e4d95d81ecfb3dc7253d349df
2016-04-01 11:32:31 -07:00
Debargha Mukherjee
2a6389bb8b Merge "Fix interpolation values and decouple interintra" into nextgenv2 2016-03-31 21:47:10 +00:00
Debargha Mukherjee
2be211e971 Fix interpolation values and decouple interintra
Decouples interintra modes and probability models from regular
intra modes, to enable creating/optimizing new interintra modes.
Also, fixes interpolation values for 128x128 interintra and obmc.

Change-Id: I5c2016db49b8f029164e5fe84c6274d4e02ff90e
2016-03-31 12:12:51 -07:00
Geza Lore
511da8cbe5 Rename MI_BLOCK_SIZE and MI_MASK macros.
Rename MI_BLOCK_SIZE.* -> MAX_MIB_SIZE.* (MIB is for MI Block).
Rename MI_MASK.* -> MAX_MIB_MASK.*

There are no functional changes.

This is in preparation for coding the superblock size at the frame
level, which will require some of these constants to become variables.
The new names better reflect future semantics, and hence make the code
clearer.

Change-Id: Iee08d97554cf4cc16a5dc166a3ffd1ab91529992
2016-03-31 09:57:41 +01:00
Angie Chiang
64413a6ca7 Parameterize transform scale for quantizer
This is to facilitate changing transform scale later

Change-Id: Ic8ca5afba57d2489ebd191ccc40c1b31605a0d8c
2016-03-30 15:25:26 -07:00
Geza Lore
552d5cd715 Extend superblock size fo 128x128 pixels.
If --enable-ext-partition is used at build time, the superblock size
(sometimes also referred to as coding unit (CU) size) is extended to
128x128 pixels.

Change-Id: Ie09cec6b7e8d765b7555ff5d80974aab60803f3a
2016-03-30 18:23:06 +01:00
Jingning Han
b534987110 Merge "Rework the predicted motion vector for sub8x8 block" into nextgenv2 2016-03-28 23:10:35 +00:00
Jingning Han
0586460938 Rework the predicted motion vector for sub8x8 block
This commit makes the sub8x8 block to use its nearest neighbor's
motion vector as predicted motion vector for NEWMV mode. It improves
the coding performance by 0.12%.

Change-Id: I99e56715b327573ce7e8a26e3515a4984dadfd98
2016-03-28 14:58:17 -07:00
Angie Chiang
4144a11552 Merge "Use vp10_[fwd/inv]_txfm2d_add_32x32 for bd 10" into nextgenv2 2016-03-28 19:20:48 +00:00
Yunqing Wang
89a8174fec Merge "Make set_reference control API work in VP9 and VP10" into nextgenv2 2016-03-28 18:33:03 +00:00
Angie Chiang
46b234478f Use vp10_[fwd/inv]_txfm2d_add_32x32 for bd 10
Change-Id: I996c48a90d7d71b52594a91a35cb8712c7fc212e
2016-03-28 11:08:40 -07:00
Alex Converse
72e29c3a73 Merge changes I3c72a2d8,I9905f3a8 into nextgenv2
* changes:
  Add pluggable bitwriters.
  Add pluggable bitreaders.
2016-03-28 16:59:18 +00:00
Yunqing Wang
9aaa3c933c Make set_reference control API work in VP9 and VP10
Moved the API patch from NextGen to NextGenv2 and also added this
API to VP10. An example was included. To try it, for example, run
the following command:
$ examples/vpx_cx_set_ref vp10 352 288 in.yuv out.ivf 4 30

Change-Id: Ib56bc3d365e530cfc8d859a13ddbf4c007907b81
2016-03-28 09:55:24 -07:00
hui su
8a128c2a72 Fixes for Palette mode
This patch fixes 2 issues in Palette mode:
1. More memory is needed in PALETTE_BUFFER for 444 video format.
2. A merge issue caused by
https://chromium-review.googlesource.com/#/c/333940/7

Change-Id: I2aedc7dfdfb6b66fbd600189ec6e1e2cc6120d40
2016-03-25 18:16:44 -07:00