VP9->VPX for reference frame flags

Change-Id: Iff86d39bed4be9a97fdd78f25f3ac6e1728fe68d
diff --git a/vp10/common/enums.h b/vp10/common/enums.h
index 18c7d16..9b10379 100644
--- a/vp10/common/enums.h
+++ b/vp10/common/enums.h
@@ -100,10 +100,10 @@
 #define EXT_TX_SIZES       3  // number of sizes that use extended transforms
 
 typedef enum {
-  VP9_LAST_FLAG = 1 << 0,
-  VP9_GOLD_FLAG = 1 << 1,
-  VP9_ALT_FLAG = 1 << 2,
-} VP9_REFFRAME;
+  VPX_LAST_FLAG = 1 << 0,
+  VPX_GOLD_FLAG = 1 << 1,
+  VPX_ALT_FLAG = 1 << 2,
+} VPX_REFFRAME;
 
 typedef enum {
   PLANE_TYPE_Y  = 0,
diff --git a/vp10/common/frame_buffers.c b/vp10/common/frame_buffers.c
index 794c80f..31ff960 100644
--- a/vp10/common/frame_buffers.c
+++ b/vp10/common/frame_buffers.c
@@ -18,7 +18,7 @@
   vp10_free_internal_frame_buffers(list);
 
   list->num_internal_frame_buffers =
-      VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+      VPX_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
   list->int_fb =
       (InternalFrameBuffer *)vpx_calloc(list->num_internal_frame_buffers,
                                         sizeof(*list->int_fb));
diff --git a/vp10/decoder/decoder.c b/vp10/decoder/decoder.c
index 228c03c..b0334f8 100644
--- a/vp10/decoder/decoder.c
+++ b/vp10/decoder/decoder.c
@@ -151,7 +151,7 @@
 }
 
 vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
-                                        VP9_REFFRAME ref_frame_flag,
+                                        VPX_REFFRAME ref_frame_flag,
                                         YV12_BUFFER_CONFIG *sd) {
   VP10_COMMON *cm = &pbi->common;
 
@@ -160,7 +160,7 @@
    * vpxenc --test-decode functionality working, and will be replaced in a
    * later commit that adds VP9-specific controls for this functionality.
    */
-  if (ref_frame_flag == VP9_LAST_FLAG) {
+  if (ref_frame_flag == VPX_LAST_FLAG) {
     const YV12_BUFFER_CONFIG *const cfg = get_ref_frame(cm, 0);
     if (cfg == NULL) {
       vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
@@ -182,7 +182,7 @@
 
 
 vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
-                                      VP9_REFFRAME ref_frame_flag,
+                                      VPX_REFFRAME ref_frame_flag,
                                       YV12_BUFFER_CONFIG *sd) {
   RefBuffer *ref_buf = NULL;
   RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
@@ -191,11 +191,11 @@
   // encoder is using the frame buffers for. This is just a stub to keep the
   // vpxenc --test-decode functionality working, and will be replaced in a
   // later commit that adds VP9-specific controls for this functionality.
-  if (ref_frame_flag == VP9_LAST_FLAG) {
+  if (ref_frame_flag == VPX_LAST_FLAG) {
     ref_buf = &cm->frame_refs[0];
-  } else if (ref_frame_flag == VP9_GOLD_FLAG) {
+  } else if (ref_frame_flag == VPX_GOLD_FLAG) {
     ref_buf = &cm->frame_refs[1];
-  } else if (ref_frame_flag == VP9_ALT_FLAG) {
+  } else if (ref_frame_flag == VPX_ALT_FLAG) {
     ref_buf = &cm->frame_refs[2];
   } else {
     vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
diff --git a/vp10/decoder/decoder.h b/vp10/decoder/decoder.h
index 52a56f0..9419f28 100644
--- a/vp10/decoder/decoder.h
+++ b/vp10/decoder/decoder.h
@@ -87,11 +87,11 @@
 int vp10_get_raw_frame(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd);
 
 vpx_codec_err_t vp10_copy_reference_dec(struct VP10Decoder *pbi,
-                                       VP9_REFFRAME ref_frame_flag,
+                                       VPX_REFFRAME ref_frame_flag,
                                        YV12_BUFFER_CONFIG *sd);
 
 vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
-                                      VP9_REFFRAME ref_frame_flag,
+                                      VPX_REFFRAME ref_frame_flag,
                                       YV12_BUFFER_CONFIG *sd);
 
 static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb,
diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c
index 564dd76..99c8d79 100644
--- a/vp10/encoder/encodeframe.c
+++ b/vp10/encoder/encodeframe.c
@@ -2549,8 +2549,8 @@
   if (segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) {
     return 0;
   } else {
-    return (!!(ref_flags & VP9_GOLD_FLAG) + !!(ref_flags & VP9_LAST_FLAG)
-        + !!(ref_flags & VP9_ALT_FLAG)) >= 2;
+    return (!!(ref_flags & VPX_GOLD_FLAG) + !!(ref_flags & VPX_LAST_FLAG)
+        + !!(ref_flags & VPX_ALT_FLAG)) >= 2;
   }
 }
 
diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c
index e2cbabe..69d2351 100644
--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -2262,26 +2262,26 @@
 }
 
 void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags) {
-  cpi->ext_refresh_golden_frame = (ref_frame_flags & VP9_GOLD_FLAG) != 0;
-  cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0;
-  cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0;
+  cpi->ext_refresh_golden_frame = (ref_frame_flags & VPX_GOLD_FLAG) != 0;
+  cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VPX_ALT_FLAG) != 0;
+  cpi->ext_refresh_last_frame = (ref_frame_flags & VPX_LAST_FLAG) != 0;
   cpi->ext_refresh_frame_flags_pending = 1;
 }
 
 static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer(VP10_COMP *cpi,
-                                VP9_REFFRAME ref_frame_flag) {
+                                VPX_REFFRAME ref_frame_flag) {
   MV_REFERENCE_FRAME ref_frame = NONE;
-  if (ref_frame_flag == VP9_LAST_FLAG)
+  if (ref_frame_flag == VPX_LAST_FLAG)
     ref_frame = LAST_FRAME;
-  else if (ref_frame_flag == VP9_GOLD_FLAG)
+  else if (ref_frame_flag == VPX_GOLD_FLAG)
     ref_frame = GOLDEN_FRAME;
-  else if (ref_frame_flag == VP9_ALT_FLAG)
+  else if (ref_frame_flag == VPX_ALT_FLAG)
     ref_frame = ALTREF_FRAME;
 
   return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame);
 }
 
-int vp10_copy_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+int vp10_copy_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
                            YV12_BUFFER_CONFIG *sd) {
   YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
   if (cfg) {
@@ -2292,7 +2292,7 @@
   }
 }
 
-int vp10_set_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+int vp10_set_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
                           YV12_BUFFER_CONFIG *sd) {
   YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
   if (cfg) {
@@ -2667,10 +2667,10 @@
 void vp10_scale_references(VP10_COMP *cpi) {
   VP10_COMMON *cm = &cpi->common;
   MV_REFERENCE_FRAME ref_frame;
-  const VP9_REFFRAME ref_mask[3] = {VP9_LAST_FLAG, VP9_GOLD_FLAG, VP9_ALT_FLAG};
+  const VPX_REFFRAME ref_mask[3] = {VPX_LAST_FLAG, VPX_GOLD_FLAG, VPX_ALT_FLAG};
 
   for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
-    // Need to convert from VP9_REFFRAME to index into ref_mask (subtract 1).
+    // Need to convert from VPX_REFFRAME to index into ref_mask (subtract 1).
     if (cpi->ref_frame_flags & ref_mask[ref_frame - 1]) {
       BufferPool *const pool = cm->buffer_pool;
       const YV12_BUFFER_CONFIG *const ref = get_ref_frame_buffer(cpi,
@@ -3367,19 +3367,19 @@
   const int gold_is_last = map[cpi->gld_fb_idx] == map[cpi->lst_fb_idx];
   const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx];
   const int gold_is_alt = map[cpi->gld_fb_idx] == map[cpi->alt_fb_idx];
-  int flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
+  int flags = VPX_ALT_FLAG | VPX_GOLD_FLAG | VPX_LAST_FLAG;
 
   if (gold_is_last)
-    flags &= ~VP9_GOLD_FLAG;
+    flags &= ~VPX_GOLD_FLAG;
 
   if (cpi->rc.frames_till_gf_update_due == INT_MAX)
-    flags &= ~VP9_GOLD_FLAG;
+    flags &= ~VPX_GOLD_FLAG;
 
   if (alt_is_last)
-    flags &= ~VP9_ALT_FLAG;
+    flags &= ~VPX_ALT_FLAG;
 
   if (gold_is_alt)
-    flags &= ~VP9_ALT_FLAG;
+    flags &= ~VPX_ALT_FLAG;
 
   return flags;
 }
@@ -4323,13 +4323,13 @@
     int ref = 7;
 
     if (flags & VP8_EFLAG_NO_REF_LAST)
-      ref ^= VP9_LAST_FLAG;
+      ref ^= VPX_LAST_FLAG;
 
     if (flags & VP8_EFLAG_NO_REF_GF)
-      ref ^= VP9_GOLD_FLAG;
+      ref ^= VPX_GOLD_FLAG;
 
     if (flags & VP8_EFLAG_NO_REF_ARF)
-      ref ^= VP9_ALT_FLAG;
+      ref ^= VPX_ALT_FLAG;
 
     vp10_use_as_reference(cpi, ref);
   }
@@ -4340,13 +4340,13 @@
     int upd = 7;
 
     if (flags & VP8_EFLAG_NO_UPD_LAST)
-      upd ^= VP9_LAST_FLAG;
+      upd ^= VPX_LAST_FLAG;
 
     if (flags & VP8_EFLAG_NO_UPD_GF)
-      upd ^= VP9_GOLD_FLAG;
+      upd ^= VPX_GOLD_FLAG;
 
     if (flags & VP8_EFLAG_NO_UPD_ARF)
-      upd ^= VP9_ALT_FLAG;
+      upd ^= VPX_ALT_FLAG;
 
     vp10_update_reference(cpi, upd);
   }
diff --git a/vp10/encoder/encoder.h b/vp10/encoder/encoder.h
index e76e6a5..82f375d 100644
--- a/vp10/encoder/encoder.h
+++ b/vp10/encoder/encoder.h
@@ -512,10 +512,10 @@
 
 void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags);
 
-int vp10_copy_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+int vp10_copy_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
                            YV12_BUFFER_CONFIG *sd);
 
-int vp10_set_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+int vp10_set_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
                           YV12_BUFFER_CONFIG *sd);
 
 int vp10_update_entropy(VP10_COMP *cpi, int update);
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index 3841ea4..6b59161 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -2999,8 +2999,8 @@
   int_mv single_newmv[MAX_REF_FRAMES] = { { 0 } };
   INTERP_FILTER single_inter_filter[MB_MODE_COUNT][MAX_REF_FRAMES];
   int single_skippable[MB_MODE_COUNT][MAX_REF_FRAMES];
-  static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
-                                    VP9_ALT_FLAG };
+  static const int flag_list[4] = { 0, VPX_LAST_FLAG, VPX_GOLD_FLAG,
+                                    VPX_ALT_FLAG };
   int64_t best_rd = best_rd_so_far;
   int64_t best_pred_diff[REFERENCE_MODES];
   int64_t best_pred_rd[REFERENCE_MODES];
@@ -3721,8 +3721,8 @@
   int comp_pred, i;
   int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES];
   struct buf_2d yv12_mb[4][MAX_MB_PLANE];
-  static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
-                                    VP9_ALT_FLAG };
+  static const int flag_list[4] = { 0, VPX_LAST_FLAG, VPX_GOLD_FLAG,
+                                    VPX_ALT_FLAG };
   int64_t best_rd = best_rd_so_far;
   int64_t best_yrd = best_rd_so_far;  // FIXME(rbultje) more precise
   int64_t best_pred_diff[REFERENCE_MODES];
diff --git a/vp10/vp10_cx_iface.c b/vp10/vp10_cx_iface.c
index dc5912a..aabfe89 100644
--- a/vp10/vp10_cx_iface.c
+++ b/vp10/vp10_cx_iface.c
@@ -104,17 +104,17 @@
   BufferPool              *buffer_pool;
 };
 
-static VP9_REFFRAME ref_frame_to_vp10_reframe(vpx_ref_frame_type_t frame) {
+static VPX_REFFRAME ref_frame_to_vp10_reframe(vpx_ref_frame_type_t frame) {
   switch (frame) {
     case VP8_LAST_FRAME:
-      return VP9_LAST_FLAG;
+      return VPX_LAST_FLAG;
     case VP8_GOLD_FRAME:
-      return VP9_GOLD_FLAG;
+      return VPX_GOLD_FLAG;
     case VP8_ALTR_FRAME:
-      return VP9_ALT_FLAG;
+      return VPX_ALT_FLAG;
   }
   assert(0 && "Invalid Reference Frame");
-  return VP9_LAST_FLAG;
+  return VPX_LAST_FLAG;
 }
 
 static vpx_codec_err_t update_error_state(vpx_codec_alg_priv_t *ctx,
diff --git a/vp10/vp10_dx_iface.c b/vp10/vp10_dx_iface.c
index bcb7740..ad20d18 100644
--- a/vp10/vp10_dx_iface.c
+++ b/vp10/vp10_dx_iface.c
@@ -806,7 +806,7 @@
     FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
     image2yuvconfig(&frame->img, &sd);
     return vp10_set_reference_dec(&frame_worker_data->pbi->common,
-                                 (VP9_REFFRAME)frame->frame_type, &sd);
+                                 (VPX_REFFRAME)frame->frame_type, &sd);
   } else {
     return VPX_CODEC_INVALID_PARAM;
   }
@@ -829,7 +829,7 @@
     FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
     image2yuvconfig(&frame->img, &sd);
     return vp10_copy_reference_dec(frame_worker_data->pbi,
-                                  (VP9_REFFRAME)frame->frame_type, &sd);
+                                  (VPX_REFFRAME)frame->frame_type, &sd);
   } else {
     return VPX_CODEC_INVALID_PARAM;
   }
diff --git a/vpx/vpx_frame_buffer.h b/vpx/vpx_frame_buffer.h
index 9036459..109aec4 100644
--- a/vpx/vpx_frame_buffer.h
+++ b/vpx/vpx_frame_buffer.h
@@ -30,7 +30,7 @@
 
 /*!\brief The maximum number of reference buffers that a VP9 encoder may use.
  */
-#define VP9_MAXIMUM_REF_BUFFERS 8
+#define VPX_MAXIMUM_REF_BUFFERS 8
 
 /*!\brief External frame buffer
  *