summaryrefslogtreecommitdiff
path: root/vpx/vp8cx.h
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-06-12 11:50:29 -0700
committerMarco Paniconi <marpan@google.com>2018-06-20 09:53:05 -0700
commit69a6506a8ff81dc3d222df21d19812e3125779dd (patch)
treee1b9033011f80bf5538560093d924d93607c4279 /vpx/vp8cx.h
parent729d7d6a2ff0f9a9d2f5534767ddb7edd6f598a7 (diff)
downloadlibvpx-69a6506a8ff81dc3d222df21d19812e3125779dd.tar
libvpx-69a6506a8ff81dc3d222df21d19812e3125779dd.tar.gz
libvpx-69a6506a8ff81dc3d222df21d19812e3125779dd.tar.bz2
libvpx-69a6506a8ff81dc3d222df21d19812e3125779dd.zip
vp9-svc: Add support for spatial layer sync frames.
Add encoder control to allow application to insert spatial layer sync frame. The sync frame disables temporal prediction for that spatial layer. This is useful for RTC application to have receiver start decoding a higher spatial layer, without inserting a key frame on base spatial layer. If the layer sync is requested on the base spatial layer this then force a key frame, otherwise it only disables the temporal reference for that spatial layer, allowing temporal prediction to continue for the other layers. Although the temporal prediction is disabled and reset on a layer sync frame, the inter-layer prediction for the sync frame is enabled on INTER frames. So the meaning of INTER_LAYER_PRED_OFF_NONKEY is modified to mean disable inter-layer prediction on non-key and non-sync frames. Added unittest for inserting layer sync frames. Bump up ABI version. Change-Id: Id458acc400a77c853551f125c4e7b6d001991f03
Diffstat (limited to 'vpx/vp8cx.h')
-rw-r--r--vpx/vp8cx.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/vpx/vp8cx.h b/vpx/vp8cx.h
index 9b60acfe5..d63365e41 100644
--- a/vpx/vp8cx.h
+++ b/vpx/vp8cx.h
@@ -637,6 +637,21 @@ enum vp8e_enc_control_id {
* Supported in codecs: VP9
*/
VP9E_SET_SVC_GF_TEMPORAL_REF,
+
+ /*!\brief Codec control function to enable spatial layer sync frame, for any
+ * spatial layer. Enabling it for layer k means spatial layer k will disable
+ * all temporal prediction, but keep the inter-layer prediction. It will
+ * refresh any temporal reference buffer for that layer, and reset the
+ * temporal layer for the superframe to 0. Setting the layer sync for base
+ * spatial layer forces a key frame. Default is off (0) for all spatial
+ * layers. Spatial layer sync flag is reset to 0 after each encoded layer,
+ * so when control is invoked it is only used for the current superframe.
+ *
+ * 0: Off (default), 1: Enabled
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_SET_SVC_SPATIAL_LAYER_SYNC,
};
/*!\brief vpx 1-D scaling mode
@@ -814,6 +829,16 @@ typedef struct vpx_svc_frame_drop {
int max_consec_drop; /**< Maximum consecutive drops, for any layer. */
} vpx_svc_frame_drop_t;
+/*!\brief vp9 svc spatial layer sync parameters.
+ *
+ * This defines the spatial layer sync flag, defined per spatial layer.
+ *
+ */
+typedef struct vpx_svc_spatial_layer_sync {
+ int spatial_layer_sync[VPX_SS_MAX_LAYERS]; /**< Sync layer flags */
+ int base_layer_intra_only; /**< Flag for setting Intra-only frame on base */
+} vpx_svc_spatial_layer_sync_t;
+
/*!\cond */
/*!\brief VP8 encoder control function parameter type
*
@@ -960,6 +985,10 @@ VPX_CTRL_USE_TYPE(VP9E_GET_SVC_REF_FRAME_CONFIG, vpx_svc_ref_frame_config_t *)
VPX_CTRL_USE_TYPE(VP9E_SET_SVC_GF_TEMPORAL_REF, unsigned int)
#define VPX_CTRL_VP9E_SET_SVC_GF_TEMPORAL_REF
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC_SPATIAL_LAYER_SYNC,
+ vpx_svc_spatial_layer_sync_t *)
+#define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC
+
/*!\endcond */
/*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus