if (constrained_framedrop_) {
vpx_svc_frame_drop_t svc_drop_frame;
- svc_drop_frame.framedrop_mode = 1;
+ svc_drop_frame.framedrop_mode = CONSTRAINED_LAYER_DROP;
for (i = 0; i < number_spatial_layers_; i++)
svc_drop_frame.framedrop_thresh[i] = 30;
encoder->Control(VP9E_SET_SVC_FRAME_DROP_LAYER, &svc_drop_frame);
(!cpi->use_svc ||
!cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
int svc_prev_layer_dropped = 0;
- // In the contrained framedrop mode for svc (framedrop_mode = 1), if the
- // previous spatial layer was dropped, drop the current spatial layer.
+ // In the contrained framedrop mode for svc (framedrop_mode =
+ // CONSTRAINED_LAYER_DROP), if the previous spatial layer was dropped, drop
+ // the current spatial layer.
if (cpi->use_svc && cpi->svc.spatial_layer_id > 0 &&
cpi->svc.drop_spatial_layer[cpi->svc.spatial_layer_id - 1])
svc_prev_layer_dropped = 1;
- if ((svc_prev_layer_dropped && cpi->svc.framedrop_mode) ||
+ if ((svc_prev_layer_dropped &&
+ cpi->svc.framedrop_mode == CONSTRAINED_LAYER_DROP) ||
vp9_rc_drop_frame(cpi)) {
vp9_rc_postencode_update_drop_frame(cpi);
cpi->ext_refresh_frame_flags_pending = 0;
static int check_buffer(VP9_COMP *cpi, int drop_mark) {
SVC *svc = &cpi->svc;
- if (!cpi->use_svc || !cpi->svc.framedrop_mode) {
+ if (!cpi->use_svc || cpi->svc.framedrop_mode == LAYER_DROP) {
RATE_CONTROL *const rc = &cpi->rc;
return (rc->buffer_level <= drop_mark);
} else {
int i;
- // For SVC in the constrained framedrop mode (svc->framedrop_mode = 1):
- // the condition on buffer (to drop frame) is checked on current and
- // upper spatial layers.
+ // For SVC in the constrained framedrop mode (svc->framedrop_mode =
+ // CONSTRAINED_LAYER_DROP): the condition on buffer (to drop frame) is
+ // checked on current and upper spatial layers.
for (i = svc->spatial_layer_id; i < svc->number_spatial_layers; ++i) {
const int layer = LAYER_IDS_TO_IDX(i, svc->temporal_layer_id,
svc->number_temporal_layers);
svc->non_reference_frame = 0;
svc->skip_enhancement_layer = 0;
svc->disable_inter_layer_pred = INTER_LAYER_PRED_ON;
- svc->framedrop_mode = 0;
+ svc->framedrop_mode = LAYER_DROP;
for (i = 0; i < REF_FRAMES; ++i) svc->ref_frame_index[i] = -1;
for (sl = 0; sl < oxcf->ss_number_layers; ++sl) {
int last_layer_dropped[VPX_MAX_LAYERS];
int drop_spatial_layer[VPX_MAX_LAYERS];
int framedrop_thresh[VPX_MAX_LAYERS];
- int framedrop_mode;
+ SVC_LAYER_DROP_MODE framedrop_mode;
INTER_LAYER_PRED disable_inter_layer_pred;
} SVC;
int temporal_layer_id; /**< Temporal layer id number. */
} vpx_svc_layer_id_t;
-/*!\brief vp9 svc frame flag parameters.
+/*!\brief vp9 svc frame flag parameters.
*
* This defines the frame flags and buffer indices for each spatial layer for
* svc encoding.
int alt_fb_idx[VPX_TS_MAX_LAYERS]; /**< Altref buffer index. */
} vpx_svc_ref_frame_config_t;
-/*!\brief vp9 svc frame dropping parameters.
+/*!\brief VP9 svc frame dropping mode.
+ *
+ * This defines the frame drop mode for SVC.
+ *
+ */
+typedef enum {
+ LAYER_DROP, /**< Any spatial layer can drop. */
+ CONSTRAINED_LAYER_DROP
+ /**< Upper layers are constrained to drop if current layer drops. */
+} SVC_LAYER_DROP_MODE;
+
+/*!\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),
*/
typedef struct vpx_svc_frame_drop {
int framedrop_thresh[VPX_SS_MAX_LAYERS]; /**< Frame drop thresholds */
- int framedrop_mode; /**< Layer-based or constrained dropping. */
+ SVC_LAYER_DROP_MODE
+ framedrop_mode; /**< Layer-based or constrained dropping. */
} vpx_svc_frame_drop_t;
/*!\cond */