diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c index 9dd4922173a14cac48fed2f10db577a1c0eb37ee..cf32d1f38bbfcd4ee1bd3653645b73010c519434 100644 --- a/vp8/vp8_dx_iface.c +++ b/vp8/vp8_dx_iface.c @@ -688,6 +688,26 @@ static vpx_codec_err_t vp8_set_dbg_options(vpx_codec_alg_priv_t *ctx, #endif } +static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx, + int ctrl_id, + va_list args) +{ + int *update_info = va_arg(args, int *); + VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi; + + if (update_info) + { + *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME + + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME + + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME; + + return VPX_CODEC_OK; + } + else + return VPX_CODEC_INVALID_PARAM; +} + + vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] = { {VP8_SET_REFERENCE, vp8_set_reference}, @@ -697,6 +717,7 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] = {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_options}, {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_options}, {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_options}, + {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates}, { -1, NULL}, }; diff --git a/vpx/vp8dx.h b/vpx/vp8dx.h index fccd407f33d54bca8faaf2e99a8a36679a631015..9feab7cc262aad799c83b907c212a10c9957e278 100644 --- a/vpx/vp8dx.h +++ b/vpx/vp8dx.h @@ -36,6 +36,30 @@ extern vpx_codec_iface_t* vpx_codec_vp8_dx(void); #include "vp8.h" +/*!\brief VP8 decoder control functions + * + * The set of macros define the control functions of VP8 decoder interface + */ +enum vp8d_dec_control_id +{ + VP8_DECODER_CTRL_ID_START = 256, + VP8D_GET_LAST_REF_UPDATES, /**< control function to get info on which reference frames were updated + by the last decode */ + VP8_DECODER_CTRL_ID_MAX +} ; + + +/*!\brief VP8 encoder control function parameter type + * + * Defines the data types that VP8E control functions take. Note that + * additional common controls are defined in vp8.h + * + */ + + +VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) + + /*! @} - end defgroup vp8_decoder */