189 Commits

Author SHA1 Message Date
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
Julia Robson
0f05873c89 Fixing error when building with ref_mv experiment
Code was using variable that was only defined when
var_tx was also enabled

Change-Id: Ide02ff99b433bfc5c95b71e700c66562020cedae
2016-04-06 11:22:10 +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
Geza Lore
e0dbfdeedc Minor refactoring of partition type processing.
Change-Id: Idcb1e94298d4b7d8832d285548ec2d2ced4b2988
2016-04-04 14:51:10 +01: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
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
Geza Lore
490ba1ad25 Port large scale tile coding features from nextgen.
If configured with --enable-ext-tile, the codec uses an alternative
tile coding syntax in the bitstream. Changes include::
 - The maximum number of tile rows and columns is extended to 1024
   each.
 - The minimum tile width/height is 64 pixels (1 superblock).
 - A tile copy mode is added where a tile directly reuse the coded
   data of a previous tile
 - The meaning of the tile-columns and tile-rows codec parameters are
   overloaded to mean tile-width and tile-height in units of 64
   pixels.
 - All tiles should now be independent, including rows within the
   same columns, so large scale parallel, or independent decoding is
   possible.
 - vpxdec also gained the options to decode only a particular tile,
   tile row, or tile column.

Changes without --enable-ext-tile:
 - All tiles should now be independent, including rows within the
   same columns, so large scale parallel, or independent decoding is
   possible.
 - vpxenc default tile configuration changed to use 1 tile column.

Change-Id: I0cd08ad550967ac18622dae5e98ad23d581cb33e
2016-03-24 09:26:05 +00:00
Hui Su
daf2fb42e6 Merge "Add "entropy" experiment" into nextgenv2 2016-03-23 17:50:57 +00:00
Debargha Mukherjee
7a3bae768e Merge "Porting ext_partition experiment from nextgen" into nextgenv2 2016-03-23 04:58:38 +00:00
Yue Chen
2613b5e9d6 Merge "Refactor prediction functions of OBMC" into nextgenv2 2016-03-22 21:06:16 +00:00
Julia Robson
5cce322a09 Porting ext_partition experiment from nextgen
This has been ported under ext_partition_types because it is due
to be combined with the coding_unit_size experiment which is
already being ported under ext_partition

Change-Id: I47af869ae123ddf0aa99160dac644059d14266ee
2016-03-22 12:29:01 -07:00
Jingning Han
bfdcccd8a1 Merge "Rework the DRL syntax entropy coding system" into nextgenv2 2016-03-22 00:07:36 +00:00
Yue Chen
2e3f77316d Refactor prediction functions of OBMC
Merge the functions that generate prediction by above/left predictors
for the encoder and the decoder.

Change-Id: I57e53a8f2eb8d3028c4ed0c9abdcbf00503f95a0
2016-03-21 17:04:13 -07:00
Yaowu Xu
cbfc15b11b Merge "Properly set rate_nocoef when pallete mode is used" into nextgenv2 2016-03-21 20:44:17 +00:00
Debargha Mukherjee
1b17559327 Adds 1D transforms for ADST/FlipADST to make 16
Makes a set of 16 transforms total, adding all 1D
combinations of ADST and FlipADST, and removng all DST
transforms.

lowres, midres both improve by about 0.1% and hdres by
-0.378% in BDRATE but with fewer transforms that are also
simpler.

Further experiments to continue later.

Change-Id: I7348a4c0e12078fdea5ae3a2d36a89a319ffcc6e
2016-03-21 11:19:36 -07:00
Yaowu Xu
c96c3fa2b3 Properly set rate_nocoef when pallete mode is used
Change-Id: Iff04c82b3d3b5cf2c7700717c3c3d678bbbb9f9b
2016-03-21 11:07:53 -07:00
Jingning Han
5c9d315572 Rework the DRL syntax entropy coding system
This commit re-designs the probability model for the syntax elements
of the dynamic motion vector referencing system.

Change-Id: Icfb8203c7e8f64e10e99f5890e25e6f6b15fe5d1
2016-03-21 09:52:33 -07:00
Jingning Han
4914ae4622 Merge "Enable dynamic motion vector referencing for newmv mode" into nextgenv2 2016-03-19 00:40:04 +00:00
Debargha Mukherjee
3c065ac46a Merge "Refactor bsse and skip_txfm in MACROBLOCK." into nextgenv2 2016-03-18 23:51:40 +00:00
Debargha Mukherjee
05029a47a1 Merge "Refactor save_context restore_context in rd_pick_partition." into nextgenv2 2016-03-18 23:51:06 +00:00
Jingning Han
93748c3e4f Enable dynamic motion vector referencing for newmv mode
This commit enables the dynamic motion vector predictor for NEWMV
mode. It allows the codec to select the best motion vector predictor
in a rate-distortion optimization framework for motion vector
residual coding. The compression performance is improved:
lowres  0.14%
midres  0.27%
hdres   0.24%

Change-Id: I6a601c74eb6cb0b71a613336d40363359f2edecd
2016-03-18 09:51:37 -07:00
Geza Lore
f8cfb72a32 Refactor bsse and skip_txfm in MACROBLOCK.
Simple refactoring to 2 dimensional arrays, in preparation for 128
wide superblocks.

Change-Id: I40d447bd9fbd4f755534ea3cc82fc8f4676cea07
2016-03-18 15:30:10 +00:00
Geza Lore
efe7d4e5a2 Refactor mbmi->inter_tx_size to 2D array.
This is in preparation of increasing the superblock size.

Change-Id: I9197e397399fbe8aec1178a45ea0337dd90412d7
2016-03-18 15:30:09 +00:00
Geza Lore
24659dbca3 Refactor save_context restore_context in rd_pick_partition.
This is a cosmetic patch that removes a great deal of conditional
compilation around CONFIG_VAR_TX from the partition search function.

Change-Id: I9dcef9d4fe6847b793c77bdf565a5cacbdfacd59
2016-03-17 15:53:59 +00:00
hui su
83b47af18d Add "entropy" experiment
This patch added two features to improve entropy coding efficiency
for coefficient tokens.

1. Choose 1 of 4 default probability tables based on q-index for
key-frames.
It is ported from nextgen branch:
https://chromium-review.googlesource.com/#/c/280586/

2. Do backward update after each superblock (64X64) row using
subframe token counts.

Coding gain: 0.1% on lowres; 0.42% on midres; 0.36% on hdres.
Much larger gain for key-frames: 2.6%, 2.3%, 1.7%.

Design doc: go/huisu-entropy

Change-Id: Ia3b6a615636be09247d70e4c520405637561532b
2016-03-16 11:55:50 -07:00
Angie Chiang
f330444a09 Merge "remove filter_cache" into nextgenv2 2016-03-16 17:21:53 +00:00
Geza Lore
c2005c578b Factor out zeroing above and left context.
Change-Id: I6e5d8cff869c7415a924f845c9e6ccaabe2b7a9b
2016-03-16 13:08:29 +00:00
Geza Lore
8735c17ceb Fix build without supertx.
Change-Id: Ib60821487710f6cf06aaa8ddcbdd5487ba1cbe4f
2016-03-16 13:08:13 +00:00
Yaowu Xu
2becffaef5 Properly set the estimate of rate_nocoef
This commit fixes the computation of rate_nocoef for situation when
rate_y is uninitialized at INT_MAX for  x->skip is true.

Change-Id: If3dde4e4ee16667f4408067d3bb3084f916272f1
2016-03-15 15:00:53 -07:00
Angie Chiang
b6fef12481 remove filter_cache
PSNR test
        lowres  hdres
lowbd   -0.013  0.067
highbd  -0.044  0.039

Change-Id: Iefdb1e966bd004b2027456778185b675e8fb9b81
2016-03-15 14:40:59 -07:00
hui su
78b0bd0a0d Complete (mostly) migration of palette mode
Coding gain on screen_content is 12.2% (was 6.6%).

Some features such as frame-level color buffer, adaptive
entropy coding, are coming in future patches.

Change-Id: I2658cf5ec0cbb02cff685475759f3b68c9807697
2016-03-11 09:56:21 -08:00
Debargha Mukherjee
ce4b35d510 Merge "Adds compound wedge prediction modes" into nextgenv2 2016-03-10 17:44:45 +00:00
Debargha Mukherjee
f34deab243 Adds compound wedge prediction modes
Incorporates wedge compound prediction modes.

Change-Id: Ie73b54b629105b9dcc5f3763be87f35b09ad2ec7
2016-03-10 07:19:54 -08:00
hui su
954e560f9e Refactor entropy coding of transform size
No performance change.

Change-Id: If35125fed909d89235b303514f77a33183bb36b3
2016-03-08 16:46:00 -08:00
Jingning Han
7174d637e8 Properly restore transform block skip flag in RD search
This commit fixes an encoding issue related to var-tx and ref-mv
experiments that causes the codec to use random values for transform
block skip flag.

Change-Id: I8daa6d6b88ea45b5bbeb81b43dd0eeff545c8e5a
2016-03-03 13:52:49 -08:00
Debargha Mukherjee
48589e8d07 Merge "Some refactoring and cleanups of interp filter" into nextgenv2 2016-02-29 15:55:48 +00:00
Debargha Mukherjee
bab2912b5e Some refactoring and cleanups of interp filter
Includes various cosmetic changes and refactoring including
naming the sharp filters differently (since they are no longer
8-tap).

Change-Id: Ida5a19ca0daa9f6a64a6734394c685b2a4a2564a
2016-02-26 15:42:49 -08:00
Geza Lore
7ded038af5 Port interintra experiment from nextgen.
The interintra experiment, which combines an inter prediction and an
inter prediction have been ported from the nextgen branch. The
experiment is merged into ext_inter, so there is no separate configure
option to enable it.

Change-Id: I0cc20cefd29e9b77ab7bbbb709abc11512320325
2016-02-26 13:01:51 -08:00
Debargha Mukherjee
c1e51beba6 Merge "Experiment to use image domain dist in baseline." into nextgenv2 2016-02-24 18:30:50 +00:00
Yue Chen
a614262edb Optimizing obmc rd decision by checking the real rd cost
Instead of using model_rd_for_sb() to estimate the cost and make the
decision on bmc/obmc, we use super_block_yrd/uvrd() to calculate and
compare the real rd costs of bmc and obmc.

Average bit-rate reduction(%) of obmc experiment:
derflr/derfhd/hevcmr/hevchd
2.353/TBD/TBD/TBD
Before the optimization, the coding gain was:
1.582/1.109/1.600/1.164

Note: there is still some mysterious bug because that compared to
the previous version, the performance at low bit rate drops a lot.

Change-Id: I8dbee04a272190f10516a3953c1ae690f8136766
2016-02-23 14:16:12 -08:00
Geza Lore
3c4b56c4dd Experiment to use image domain dist in baseline.
Change-Id: Ib29f510289716b5ab5c7d74d32a450c190308a83
2016-02-23 09:35:40 -08:00
Geza Lore
c582aacb7a Tweak encoding flags for supertx.
Change-Id: I46f69d3a176897294d33c3f6d30b23c75b6267a8
2016-02-16 11:24:17 -08:00
Debargha Mukherjee
8cc04ef505 Merge "Further supertx costing fixes." into nextgenv2 2016-02-16 18:02:24 +00:00
Yue Chen
d1cad9c3f5 Overlapped block motion compensation experiment
In this experiment, an obmc inter prediction mode is enabled for
>= 8X8 inter blocks. When the obmc flag is on, the regular block-
based motion compensation will be refined by using predictors of
the above and left blocks.
Fixed some compatibility issues with vp9_highbitdepth, supertx,
ref_mv, and ext_interp.

Coding gain (%) on derflr/hevcmr/hevchd
OBMC:
1.047/1.022/0.708
OBMC + SUPERTX:
1.652/1.616/1.137
SUPERTX:
0.862/0.779/0.630

Change-Id: I5d8d3c4729c6d3ccb03ec7034563107893103b7f
2016-02-12 13:36:25 -08:00
Geza Lore
599003969d Further supertx costing fixes.
Change-Id: I85897168c7fda3fd79daaba985b6607fd7df476b
2016-02-12 11:47:26 -08:00