]> granicus.if.org Git - libvpx/commitdiff
Recover tile coding performance
authorYunqing Wang <yunqingwang@google.com>
Fri, 25 Mar 2016 16:05:25 +0000 (09:05 -0700)
committerYunqing Wang <yunqingwang@google.com>
Fri, 25 Mar 2016 16:05:25 +0000 (09:05 -0700)
After porting tile coding from VP9 to VP10, some performance
degradation was seen because of the difference between VP9 and
Vp10 baseline. This patch disabled some features in VP10 while
tile coding is turned on. Also, an encoder control API was added
back for this use case.

Change-Id: I8f736db8388408a8cc35320a2f80abb02906571c

vp10/common/blockd.h
vp10/decoder/decoder.c
vp10/encoder/speed_features.c
vp10/vp10_cx_iface.c
vpx/vp8cx.h

index 92a088576f877aca6d31eaa89bf2dbd739cf5ce7..fb3f44b1274420cc2fab177062b28cb5dbea1a6f 100644 (file)
@@ -519,7 +519,11 @@ static const TX_TYPE filter_intra_mode_to_tx_type_lookup[FILTER_INTRA_MODES] = {
 int pick_intra_filter(int angle);
 #endif  // CONFIG_EXT_INTRA
 
+#if CONFIG_EXT_TILE
+#define FIXED_TX_TYPE 1
+#else
 #define FIXED_TX_TYPE 0
+#endif
 
 static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type,
                                           const MACROBLOCKD *xd,
index d3fee853aa1cec3de65751b6efe985b7103fc2d6..a158ee89890e5946ebc64971a8430a0d239b4088 100644 (file)
@@ -399,7 +399,13 @@ int vp10_receive_compressed_data(VP10Decoder *pbi,
 
   swap_frame_buffers(pbi);
 
-  vpx_extend_frame_inner_borders(cm->frame_to_show);
+#if CONFIG_EXT_TILE
+  // For now, we only extend the frame borders when the whole frame is decoded.
+  // Later, if needed, extend the border for the decoded tile on the frame
+  // border.
+  if (pbi->dec_tile_row == -1 && pbi->dec_tile_col == -1)
+#endif  // CONFIG_EXT_TILE
+    vpx_extend_frame_inner_borders(cm->frame_to_show);
 
   vpx_clear_system_state();
 
index c50b94926b6e40564e076b30d514c7ecbcbebae8..25766bb4530a92d45b5629a07721a5c691ed2f99 100644 (file)
@@ -494,7 +494,7 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
   sf->disable_filter_search_var_thresh = 0;
   sf->adaptive_interp_filter_search = 0;
   sf->allow_partition_search_skip = 0;
-#if CONFIG_EXT_REFS
+#if CONFIG_EXT_REFS || CONFIG_EXT_TILE
   sf->use_upsampled_references = 0;
 #else
   sf->use_upsampled_references = 1;
@@ -530,7 +530,11 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
   sf->simple_model_rd_from_var = 0;
 
   // Set this at the appropriate speed levels
+#if CONFIG_EXT_TILE
+  sf->use_transform_domain_distortion = 1;
+#else
   sf->use_transform_domain_distortion = 0;
+#endif
 
   if (oxcf->mode == REALTIME)
     set_rt_speed_feature(cpi, sf, oxcf->speed, oxcf->content);
index 5f4c003804460c55c6fec632d4f929baf99e4cbf..169c9dd6b7a87448621864644d2b5a2e87526bc8 100644 (file)
@@ -1158,6 +1158,14 @@ static vpx_image_t *encoder_get_preview(vpx_codec_alg_priv_t *ctx) {
   }
 }
 
+static vpx_codec_err_t ctrl_use_reference(vpx_codec_alg_priv_t *ctx,
+                                          va_list args) {
+  const int reference_flag = va_arg(args, int);
+
+  vp10_use_as_reference(ctx->cpi, reference_flag);
+  return VPX_CODEC_OK;
+}
+
 static vpx_codec_err_t ctrl_set_roi_map(vpx_codec_alg_priv_t *ctx,
                                         va_list args) {
   (void)ctx;
@@ -1254,6 +1262,7 @@ static vpx_codec_err_t ctrl_set_render_size(vpx_codec_alg_priv_t *ctx,
 
 static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
   {VP8_COPY_REFERENCE,                ctrl_copy_reference},
+  {VP8E_USE_REFERENCE,                ctrl_use_reference},
 
   // Setters
   {VP8_SET_REFERENCE,                 ctrl_set_reference},
index 7504c0e127cc00656edcd2bbb26f1e35a34d28bb..d9764a4816b4eb0ded278e249c5e9f5114ebff77 100644 (file)
@@ -141,6 +141,12 @@ extern vpx_codec_iface_t *vpx_codec_vp10_cx(void);
  * \sa #vpx_codec_control
  */
 enum vp8e_enc_control_id {
+  /*!\brief Codec control function to set which reference frame encoder can use.
+   *
+   * Supported in codecs: VP8, VP9
+   */
+  VP8E_USE_REFERENCE         = 7,
+
   /*!\brief Codec control function to pass an ROI map to encoder.
    *
    * Supported in codecs: VP8, VP9
@@ -703,6 +709,8 @@ typedef struct vpx_svc_ref_frame_config {
  *
  */
 
+VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int)
+#define VPX_CTRL_VP8E_USE_REFERENCE
 VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS,        int)
 #define VPX_CTRL_VP8E_SET_FRAME_FLAGS
 VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID,  int)