struct lookahead_entry *vp9_svc_lookahead_pop(VP9_COMP *const cpi, struct lookahead_ctx *ctx, int drain) { struct lookahead_entry *buf = NULL; if (ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) { buf = vp9_lookahead_peek(ctx, 0); if (buf != NULL) { // Only remove the buffer when pop the highest layer. if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) { vp9_lookahead_pop(ctx, drain); } } } return buf; }
struct lookahead_entry *vp9_svc_lookahead_pop(VP9_COMP *const cpi, struct lookahead_ctx *ctx, int drain) { struct lookahead_entry *buf = NULL; if (ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) { buf = vp9_svc_lookahead_peek(cpi, ctx, 0, 1); if (buf != NULL) { // Only remove the buffer when pop the highest layer. Simply set the // spatial_layer to -1 for lower layers. buf->svc_params[cpi->svc.spatial_layer_id].spatial_layer = -1; if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) { vp9_lookahead_pop(ctx, drain); } } } return buf; }