summaryrefslogtreecommitdiff
path: root/vpx
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-03-26 10:53:38 -0700
committerMarco Paniconi <marpan@google.com>2018-03-26 13:56:55 -0700
commit223f9e36718e8c2e33c38f96345dc9877d2e19e6 (patch)
tree0c1e1b0520794e01e568a4ec22d74c8703f9f6ba /vpx
parent9037a05041ec080b9541e846af84241513e37aae (diff)
downloadlibvpx-223f9e36718e8c2e33c38f96345dc9877d2e19e6.tar
libvpx-223f9e36718e8c2e33c38f96345dc9877d2e19e6.tar.gz
libvpx-223f9e36718e8c2e33c38f96345dc9877d2e19e6.tar.bz2
libvpx-223f9e36718e8c2e33c38f96345dc9877d2e19e6.zip
vp9-svc: Allow for setting frame drop thresholds per layer.
Add encoder control to set the frame drop thresholds per spatial layer, and add a frame drop mode: 0 = per-layer drop, and 1 = constrained drop mode (a drop on a given layer forces drops to all upper layers). Default is mode 0 (per-layer dropping). Implementation for mode 1 will come in subsequent change. If the control is not used, then the spatial layer frame drop thresholds (water mark) are all equal and set to the value given by the encoder config (oxcf->drop_frames_water_mark). Bump up the ABI version. Change-Id: Id038d4181b86fa98b3d44d026f96d5f344d81629
Diffstat (limited to 'vpx')
-rw-r--r--vpx/vp8cx.h24
-rw-r--r--vpx/vpx_encoder.h2
2 files changed, 25 insertions, 1 deletions
diff --git a/vpx/vp8cx.h b/vpx/vp8cx.h
index 3452fdee0..7305742c8 100644
--- a/vpx/vp8cx.h
+++ b/vpx/vp8cx.h
@@ -611,6 +611,15 @@ enum vp8e_enc_control_id {
* Supported in codecs: VP9
*/
VP9E_SET_SVC_INTER_LAYER_PRED,
+
+ /*!\brief Codec control function to set mode and thresholds for frame
+ * dropping in SVC. Drop frame thresholds are set per-layer. Mode is set as:
+ * 0 : layer-dependent dropping, 1 : constrained dropping, current layer drop
+ * forces drop on all upper layers. Default mode is 0.
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_SET_SVC_FRAME_DROP_LAYER,
};
/*!\brief vpx 1-D scaling mode
@@ -754,6 +763,18 @@ typedef struct vpx_svc_ref_frame_config {
int alt_fb_idx[VPX_TS_MAX_LAYERS]; /**< Altref buffer index. */
} vpx_svc_ref_frame_config_t;
+/*!\brief vp9 svc frame dropping parameters.
+ *
+ * This defines the frame drop thresholds for each spatial layer, and the
+ * the frame dropping mode: 0 = layer based frame dropping (default),
+ * 1 = constrained dropping where current layer drop forces all upper
+ * spatial layers to drop.
+ */
+typedef struct vpx_svc_frame_drop {
+ int framedrop_thresh[VPX_SS_MAX_LAYERS]; /**< Frame flags. */
+ int framedrop_mode; /**< Layer-based or constrained dropping. */
+} vpx_svc_frame_drop_t;
+
/*!\cond */
/*!\brief VP8 encoder control function parameter type
*
@@ -891,6 +912,9 @@ VPX_CTRL_USE_TYPE(VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_SVC_INTER_LAYER_PRED, unsigned int)
#define VPX_CTRL_VP9E_SET_SVC_INTER_LAYER_PRED
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC_FRAME_DROP_LAYER, vpx_svc_frame_drop_t *)
+#define VPX_CTRL_VP9E_SET_SVC_FRAME_DROP_LAYER
+
/*!\endcond */
/*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus
diff --git a/vpx/vpx_encoder.h b/vpx/vpx_encoder.h
index 191d11511..4017e5719 100644
--- a/vpx/vpx_encoder.h
+++ b/vpx/vpx_encoder.h
@@ -63,7 +63,7 @@ extern "C" {
* fields to structures
*/
#define VPX_ENCODER_ABI_VERSION \
- (10 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
+ (11 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
/*! \brief Encoder capabilities bitfield
*