Commit 892e23a5 authored by Jim Bankoski's avatar Jim Bankoski Committed by John Koleszar

vp8d - function to check if a reference frame is used.

Change-Id: Id683b4d7f46ffa99145fc4b824c7232ab4182f21
parent 34168287
......@@ -673,6 +673,24 @@ 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
(
int blksize, /* Currently only values supported are 16, 8, 4 */
......@@ -883,7 +901,6 @@ void vp8_multiframe_quality_enhance
#else
#define RTCD_VTABLE(oci) NULL
#endif
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags)
{
int q = oci->filter_level * 10 / 6;
......
......@@ -700,6 +700,27 @@ 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 );
static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args)
{
int *ref_info = va_arg(args, int *);
VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi;
VP8_COMMON *oci = &pbi->common;
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);
return VPX_CODEC_OK;
}
else
return VPX_CODEC_INVALID_PARAM;
}
static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
......
......@@ -55,6 +55,11 @@ enum vp8_dec_control_id
/** check if the indicated frame is corrupted */
VP8D_GET_FRAME_CORRUPTED,
/** control function to get info on which reference frames were used
* by the last decode
*/
VP8D_GET_LAST_REF_USED,
VP8_DECODER_CTRL_ID_MAX
} ;
......@@ -69,7 +74,7 @@ enum vp8_dec_control_id
VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
/*! @} - end defgroup vp8_decoder */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment