]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix to updated SET_SVC_REF_FRAME_CONFIG control
authorMarco Paniconi <marpan@google.com>
Sat, 11 Aug 2018 19:59:40 +0000 (12:59 -0700)
committerMarco Paniconi <marpan@google.com>
Sat, 11 Aug 2018 20:17:42 +0000 (13:17 -0700)
Add flag to separate two cases of bypass (flexible) SVC mode:
usage of using the SET_SVC_REF_FRAME_CONFIG vs passing in the
frame_flags in the vpx_encode (only used for temporal layers).

This fixes failures in Datarate Temporal layer test,
introduced in commit: a66da31

Change-Id: Ie62f933987c20792d1f963d645e98c1903bdd423

vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_svc_layercontext.c
vp9/encoder/vp9_svc_layercontext.h
vp9/vp9_cx_iface.c

index 8830bfc113a7281e1068bdc3fd80da360e9fadb5..0c6681c2b689ce3ae452b1eb5f971a822e5e2af7 100644 (file)
@@ -913,7 +913,7 @@ int vp9_get_refresh_mask(VP9_COMP *cpi) {
       const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
       arf_idx = gf_group->arf_update_idx[gf_group->index];
     }
-    if (cpi->use_svc &&
+    if (cpi->use_svc && cpi->svc.use_set_ref_frame_config &&
         cpi->svc.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS)
       return cpi->svc.update_buffer_slot[cpi->svc.spatial_layer_id];
     return (cpi->refresh_last_frame << cpi->lst_fb_idx) |
index 0bd4fd29a342b5218accb182cf2fa42c54a76959..2b3397747b7559a535c33eb5a297bdabe68e4a62 100644 (file)
@@ -44,6 +44,7 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
   svc->set_intra_only_frame = 0;
   svc->previous_frame_is_intra_only = 0;
   svc->superframe_has_layer_sync = 0;
+  svc->use_set_ref_frame_config = 0;
 
   for (i = 0; i < REF_FRAMES; ++i) {
     svc->fb_idx_spatial_layer_id[i] = -1;
@@ -730,9 +731,9 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
   } else if (svc->temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_0101) {
     set_flags_and_fb_idx_for_temporal_mode2(cpi);
   } else if (svc->temporal_layering_mode ==
-             VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
-    if (cpi->ext_refresh_frame_flags_pending == 0)
-      set_flags_and_fb_idx_bypass_via_set_ref_frame_config(cpi);
+                 VP9E_TEMPORAL_LAYERING_MODE_BYPASS &&
+             svc->use_set_ref_frame_config) {
+    set_flags_and_fb_idx_bypass_via_set_ref_frame_config(cpi);
   }
 
   if (cpi->lst_fb_idx == svc->buffer_gf_temporal_ref[0].idx ||
@@ -1148,7 +1149,8 @@ void vp9_svc_update_ref_frame(VP9_COMP *const cpi) {
   SVC *const svc = &cpi->svc;
   BufferPool *const pool = cm->buffer_pool;
 
-  if (svc->temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
+  if (svc->temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS &&
+      svc->use_set_ref_frame_config) {
     vp9_svc_update_ref_frame_bypass_mode(cpi);
   } else if (cm->frame_type == KEY_FRAME) {
     // Keep track of frame index for each reference frame.
index 82d5cdca6d2902d6d804695dd4b317594c13b1c9..964a045117e534be283adbb92248156d8131b3ce 100644 (file)
@@ -167,6 +167,8 @@ typedef struct SVC {
   uint8_t superframe_has_layer_sync;
 
   uint8_t fb_idx_base[REF_FRAMES];
+
+  int use_set_ref_frame_config;
 } SVC;
 
 struct VP9_COMP;
index d202e09c3bf36ddba39f2b942006543c4f487e54..3da8758d973b5240fd20c0bc0d1c4153cafd887f 100644 (file)
@@ -1509,6 +1509,7 @@ static vpx_codec_err_t ctrl_set_svc_ref_frame_config(vpx_codec_alg_priv_t *ctx,
   VP9_COMP *const cpi = ctx->cpi;
   vpx_svc_ref_frame_config_t *data = va_arg(args, vpx_svc_ref_frame_config_t *);
   int sl;
+  cpi->svc.use_set_ref_frame_config = 1;
   for (sl = 0; sl < cpi->svc.number_spatial_layers; ++sl) {
     cpi->svc.update_buffer_slot[sl] = data->update_buffer_slot[sl];
     cpi->svc.reference_last[sl] = data->reference_last[sl];