Commit 8a8b662e authored by Dmitry Kovalev's avatar Dmitry Kovalev

Removing ctrl_id parameter from vpx_codec_control_fn_t.

Change-Id: I2b61c8c17ded1074dea92b4f6ad9be84d128b52a
parent 26a76dc3
This diff is collapsed.
......@@ -576,8 +576,7 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args)
va_list args)
{
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
......@@ -598,8 +597,7 @@ static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args)
va_list args)
{
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
......@@ -620,7 +618,6 @@ static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args)
{
#if CONFIG_POSTPROC
......@@ -640,31 +637,56 @@ static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
#endif
}
static vpx_codec_err_t vp8_set_dbg_options(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args)
{
static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
va_list args) {
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
int data = va_arg(args, int);
ctx->dbg_color_ref_frame_flag = va_arg(args, int);
return VPX_CODEC_OK;
#else
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
#endif
}
#define MAP(id, var) case id: var = data; break;
static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
va_list args) {
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
ctx->dbg_color_mb_modes_flag = va_arg(args, int);
return VPX_CODEC_OK;
#else
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
#endif
}
switch (ctrl_id)
{
MAP (VP8_SET_DBG_COLOR_REF_FRAME, ctx->dbg_color_ref_frame_flag);
MAP (VP8_SET_DBG_COLOR_MB_MODES, ctx->dbg_color_mb_modes_flag);
MAP (VP8_SET_DBG_COLOR_B_MODES, ctx->dbg_color_b_modes_flag);
MAP (VP8_SET_DBG_DISPLAY_MV, ctx->dbg_display_mv_flag);
}
static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
va_list args) {
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
ctx->dbg_color_b_modes_flag = va_arg(args, int);
return VPX_CODEC_OK;
#else
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
#endif
}
return VPX_CODEC_OK;
static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
va_list args) {
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
ctx->dbg_display_mv_flag = va_arg(args, int);
return VPX_CODEC_OK;
#else
return VPX_CODEC_INCAPABLE;
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
#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 *);
......@@ -685,7 +707,6 @@ static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
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)
{
int *ref_info = va_arg(args, int *);
......@@ -706,7 +727,6 @@ static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args)
{
......@@ -725,7 +745,6 @@ static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args)
{
vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
......@@ -748,10 +767,10 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
{VP8_SET_REFERENCE, vp8_set_reference},
{VP8_COPY_REFERENCE, vp8_get_reference},
{VP8_SET_POSTPROC, vp8_set_postproc},
{VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_options},
{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},
{VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame},
{VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes},
{VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes},
{VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv},
{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},
......
This diff is collapsed.
......@@ -452,7 +452,7 @@ static vpx_codec_err_t decoder_set_fb_fn(
}
static vpx_codec_err_t ctrl_set_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
va_list args) {
vpx_ref_frame_t *const data = va_arg(args, vpx_ref_frame_t *);
if (data) {
......@@ -468,7 +468,7 @@ static vpx_codec_err_t ctrl_set_reference(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t ctrl_copy_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
va_list args) {
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
if (data) {
......@@ -485,7 +485,7 @@ static vpx_codec_err_t ctrl_copy_reference(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
va_list args) {
vp9_ref_frame_t *data = va_arg(args, vp9_ref_frame_t *);
if (data) {
......@@ -500,7 +500,7 @@ static vpx_codec_err_t ctrl_get_reference(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t ctrl_set_postproc(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
va_list args) {
#if CONFIG_VP9_POSTPROC
vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
......@@ -512,17 +512,21 @@ static vpx_codec_err_t ctrl_set_postproc(vpx_codec_alg_priv_t *ctx,
return VPX_CODEC_INVALID_PARAM;
}
#else
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
#endif
}
static vpx_codec_err_t ctrl_set_dbg_options(vpx_codec_alg_priv_t *ctx,
int ctrl_id, va_list args) {
va_list args) {
(void)ctx;
(void)args;
return VPX_CODEC_INCAPABLE;
}
static vpx_codec_err_t ctrl_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
int ctrl_id, va_list args) {
va_list args) {
int *const update_info = va_arg(args, int *);
if (update_info) {
......@@ -538,7 +542,7 @@ static vpx_codec_err_t ctrl_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t ctrl_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
int ctrl_id, va_list args) {
va_list args) {
int *corrupted = va_arg(args, int *);
if (corrupted) {
......@@ -553,7 +557,7 @@ static vpx_codec_err_t ctrl_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t ctrl_get_display_size(vpx_codec_alg_priv_t *ctx,
int ctrl_id, va_list args) {
va_list args) {
int *const display_size = va_arg(args, int *);
if (display_size) {
......@@ -571,13 +575,12 @@ static vpx_codec_err_t ctrl_get_display_size(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t ctrl_set_invert_tile_order(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
va_list args) {
ctx->invert_tile_order = va_arg(args, int);
return VPX_CODEC_OK;
}
static vpx_codec_err_t ctrl_set_decryptor(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args) {
vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
ctx->decrypt_cb = init ? init->decrypt_cb : NULL;
......
......@@ -154,9 +154,8 @@ typedef vpx_codec_err_t (*vpx_codec_get_si_fn_t)(vpx_codec_alg_priv_t *ctx,
* \retval #VPX_CODEC_OK
* The internal state data was deserialized.
*/
typedef vpx_codec_err_t (*vpx_codec_control_fn_t)(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list ap);
typedef vpx_codec_err_t (*vpx_codec_control_fn_t)(vpx_codec_alg_priv_t *ctx,
va_list ap);
/*!\brief control function pointer mapping
*
......@@ -403,35 +402,12 @@ struct vpx_codec_priv_enc_mr_cfg
#undef VPX_CTRL_USE_TYPE
#define VPX_CTRL_USE_TYPE(id, typ) \
static typ id##__value(va_list args) {return va_arg(args, typ);} \
static typ id##__convert(void *x)\
{\
union\
{\
void *x;\
typ d;\
} u;\
u.x = x;\
return u.d;\
}
#undef VPX_CTRL_USE_TYPE_DEPRECATED
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \
static typ id##__value(va_list args) {return va_arg(args, typ);} \
static typ id##__convert(void *x)\
{\
union\
{\
void *x;\
typ d;\
} u;\
u.x = x;\
return u.d;\
}
#define CAST(id, arg) id##__value(arg)
#define RECAST(id, x) id##__convert(x)
/* CODEC_INTERFACE convenience macro
*
......
......@@ -125,7 +125,7 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx,
va_list ap;
va_start(ap, ctrl_id);
res = entry->fn(ctx->priv->alg_priv, ctrl_id, ap);
res = entry->fn(ctx->priv->alg_priv, ap);
va_end(ap);
break;
}
......
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