]> granicus.if.org Git - libvpx/commitdiff
Hook up VP8D_GET_LAST_REF_USED
authorJohn Koleszar <jkoleszar@google.com>
Fri, 27 Jan 2012 18:13:20 +0000 (10:13 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Fri, 27 Jan 2012 18:13:20 +0000 (10:13 -0800)
Commit 892e23a5b introduced support for the VP8D_GET_LAST_REF_USED,
but missed the mapping of the control id to the underlying function,
so it was unavailable to applications.

In addition, the underlying function vp8_references_buffer() is
moved from common/postproc.c to decoder/onyxd_if.c as postproc.c is
not built in all configurations.

Change-Id: I426dd254e7e6c4c061b70d729b69a6c384ebbe44

vp8/common/postproc.c
vp8/decoder/onyxd_if.c
vp8/vp8_dx_iface.c

index 15a214b4c03def7141b8ed8e62f5eb91c717423e..3ee04fb2454f600331852a9376aa4f53a35a1625 100644 (file)
@@ -696,23 +696,6 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei
     }
 }
 
-int vp8_references_buffer( VP8_COMMON *oci, int ref_frame )
-{
-    const MODE_INFO *mi = oci->mi;
-    int mb_row, mb_col;
-
-    for (mb_row = 0; mb_row < oci->mb_rows; mb_row++)
-    {
-        for (mb_col = 0; mb_col < oci->mb_cols; mb_col++,mi++)
-        {
-            if( mi->mbmi.ref_frame == ref_frame)
-              return 1;
-        }
-        mi++;
-    }
-    return 0;
-
-}
 
 static void multiframe_quality_enhance_block
 (
index 80648d39f3be2d8d3836549fa720d87c754f62cd..980b9237ed534e778c4dc76ae6968cb0e4a10165 100644 (file)
@@ -606,3 +606,26 @@ int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_st
     vp8_clear_system_state();
     return ret;
 }
+
+
+/* This function as written isn't decoder specific, but the encoder has
+ * much faster ways of computing this, so it's ok for it to live in a
+ * decode specific file.
+ */
+int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame )
+{
+    const MODE_INFO *mi = oci->mi;
+    int mb_row, mb_col;
+
+    for (mb_row = 0; mb_row < oci->mb_rows; mb_row++)
+    {
+        for (mb_col = 0; mb_col < oci->mb_cols; mb_col++,mi++)
+        {
+            if( mi->mbmi.ref_frame == ref_frame)
+              return 1;
+        }
+        mi++;
+    }
+    return 0;
+
+}
index de2714317c61f17cf90ba6230a04b7c1256dd862..0a62d9717da6aad8f32adbb48cfb0591a76e8e43 100644 (file)
@@ -700,7 +700,7 @@ static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
         return VPX_CODEC_INVALID_PARAM;
 }
 
-extern int vp8_references_buffer( VP8_COMMON *oci, int ref_frame );
+extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame );
 static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
                                               int ctrl_id,
                                               va_list args)
@@ -712,9 +712,9 @@ static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
     if (ref_info)
     {
         *ref_info =
-            (vp8_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
-            (vp8_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
-            (vp8_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
+            (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
+            (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
+            (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
 
         return VPX_CODEC_OK;
     }
@@ -752,6 +752,7 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
     {VP8_SET_DBG_DISPLAY_MV,        vp8_set_dbg_options},
     {VP8D_GET_LAST_REF_UPDATES,     vp8_get_last_ref_updates},
     {VP8D_GET_FRAME_CORRUPTED,      vp8_get_frame_corrupted},
+    {VP8D_GET_LAST_REF_USED,        vp8_get_last_ref_frame},
     { -1, NULL},
 };