summaryrefslogtreecommitdiff
path: root/vpx
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2013-02-01 09:35:28 -0800
committerRonald S. Bultje <rbultje@google.com>2013-02-05 15:43:03 -0800
commit1407bdc24385cc77874188d8f88e54caea66506c (patch)
treebf11aeb5294ff75fbeca736aa4ff01d8a2c6880f /vpx
parent822864131bc7448e33465c5e609c555d6e6e61da (diff)
downloadlibvpx-1407bdc24385cc77874188d8f88e54caea66506c.tar.gz
libvpx-1407bdc24385cc77874188d8f88e54caea66506c.tar.bz2
libvpx-1407bdc24385cc77874188d8f88e54caea66506c.zip
[WIP] Add column-based tiling.
This patch adds column-based tiling. The idea is to make each tile independently decodable (after reading the common frame header) and also independendly encodable (minus within-frame cost adjustments in the RD loop) to speed-up hardware & software en/decoders if they used multi-threading. Column-based tiling has the added advantage (over other tiling methods) that it minimizes realtime use-case latency, since all threads can start encoding data as soon as the first SB-row worth of data is available to the encoder. There is some test code that does random tile ordering in the decoder, to confirm that each tile is indeed independently decodable from other tiles in the same frame. At tile edges, all contexts assume default values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode), and motion vector search and ordering do not cross tiles in the same frame. t log Tile independence is not maintained between frames ATM, i.e. tile 0 of frame 1 is free to use motion vectors that point into any tile of frame 0. We support 1 (i.e. no tiling), 2 or 4 column-tiles. The loopfilter crosses tile boundaries. I discussed this briefly with Aki and he says that's OK. An in-loop loopfilter would need to do some sync between tile threads, but that shouldn't be a big issue. Resuls: with tiling disabled, we go up slightly because of improved edge use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf, ~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5% on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is concentrated in the low-bitrate end of clips, and most of it is because of the loss of edges at tile boundaries and the resulting loss of intra predictors. TODO: - more tiles (perhaps allow row-based tiling also, and max. 8 tiles)? - maybe optionally (for EC purposes), motion vectors themselves should not cross tile edges, or we should emulate such borders as if they were off-frame, to limit error propagation to within one tile only. This doesn't have to be the default behaviour but could be an optional bitstream flag. Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
Diffstat (limited to 'vpx')
-rw-r--r--vpx/vp8cx.h18
-rw-r--r--vpx/vpx_decoder.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/vpx/vp8cx.h b/vpx/vp8cx.h
index 90b7169d5..79bb5827f 100644
--- a/vpx/vp8cx.h
+++ b/vpx/vp8cx.h
@@ -187,7 +187,8 @@ enum vp8e_enc_control_id {
/* TODO(jkoleszar): Move to vp9cx.h */
- VP9E_SET_LOSSLESS
+ VP9E_SET_LOSSLESS,
+ VP9E_SET_TILE_COLUMNS
};
/*!\brief vpx 1-D scaling mode
@@ -255,6 +256,19 @@ typedef enum {
} vp8e_token_partitions;
+/*!\brief VP8 tile column mode
+ *
+ * This defines VP9 tiling mode for compressed data, i.e., the number of
+ * sub-streams in the bitstream. Used for parallelized encoding/decoding.
+ *
+ */
+
+typedef enum {
+ VP8_ONE_TILE_COLUMN = 0,
+ VP8_TWO_TILE_COLUMNS = 1,
+ VP8_FOUR_TILE_COLUMNS = 2
+} vp8e_tile_column_mode;
+
/*!\brief VP8 model tuning parameters
*
* Changes the encoder to tune for certain types of input material.
@@ -298,6 +312,8 @@ VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
+
VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
diff --git a/vpx/vpx_decoder.h b/vpx/vpx_decoder.h
index dbe6aaaaa..d2dec6f5d 100644
--- a/vpx/vpx_decoder.h
+++ b/vpx/vpx_decoder.h
@@ -101,6 +101,7 @@ extern "C" {
unsigned int threads; /**< Maximum number of threads to use, default 1 */
unsigned int w; /**< Width */
unsigned int h; /**< Height */
+ int inv_tile_order; /**< Invert tile decoding order, default 0 */
} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */