Commit bd72aa71 authored by James Zern's avatar James Zern Committed by Gerrit Code Review

Merge "Changes interface to avoid uninitialized warnings in vp9_cx_iface.c."

parents e589d8ea 8a774e14
......@@ -1326,7 +1326,6 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] =
0, /* ts_periodicity */
{0}, /* ts_layer_id */
}},
{ -1, {NOT_IMPLEMENTED}}
};
......@@ -1352,6 +1351,7 @@ CODEC_INTERFACE(vpx_codec_vp8_cx) =
NOT_IMPLEMENTED, /* vpx_codec_frame_get_fn_t frame_get; */
},
{
1, /* 1 cfg map */
vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t peek_si; */
vp8e_encode, /* vpx_codec_encode_fn_t encode; */
vp8e_get_cxdata, /* vpx_codec_get_cx_data_fn_t frame_get; */
......
......@@ -804,6 +804,7 @@ CODEC_INTERFACE(vpx_codec_vp8_dx) =
NOT_IMPLEMENTED,
},
{ /* encoder functions */
0,
NOT_IMPLEMENTED,
NOT_IMPLEMENTED,
NOT_IMPLEMENTED,
......
......@@ -1317,7 +1317,6 @@ static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
#endif
}
},
{ -1, {NOT_IMPLEMENTED}}
};
#ifndef VERSION_STRING
......@@ -1340,6 +1339,7 @@ CODEC_INTERFACE(vpx_codec_vp9_cx) = {
NOT_IMPLEMENTED // vpx_codec_set_fb_fn_t
},
{ // NOLINT
1, // 1 cfg map
encoder_usage_cfg_map, // vpx_codec_enc_cfg_map_t
encoder_encode, // vpx_codec_encode_fn_t
encoder_get_cxdata, // vpx_codec_get_cx_data_fn_t
......
......@@ -707,6 +707,7 @@ CODEC_INTERFACE(vpx_codec_vp9_dx) = {
decoder_set_fb_fn, // vpx_codec_set_fb_fn_t
},
{ // NOLINT
0,
NOT_IMPLEMENTED, // vpx_codec_enc_cfg_map_t
NOT_IMPLEMENTED, // vpx_codec_encode_fn_t
NOT_IMPLEMENTED, // vpx_codec_get_cx_data_fn_t
......
......@@ -340,6 +340,7 @@ struct vpx_codec_iface {
vpx_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::vpx_codec_set_fb_fn_t */
} dec;
struct vpx_codec_enc_iface {
int cfg_map_count;
vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */
vpx_codec_encode_fn_t encode; /**< \copydoc ::vpx_codec_encode_fn_t */
vpx_codec_get_cx_data_fn_t get_cx_data; /**< \copydoc ::vpx_codec_get_cx_data_fn_t */
......
......@@ -162,6 +162,7 @@ vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
unsigned int usage) {
vpx_codec_err_t res;
vpx_codec_enc_cfg_map_t *map;
int i;
if (!iface || !cfg || usage > INT_MAX)
res = VPX_CODEC_INVALID_PARAM;
......@@ -170,7 +171,8 @@ vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
else {
res = VPX_CODEC_INVALID_PARAM;
for (map = iface->enc.cfg_maps; map->usage >= 0; map++) {
for (i = 0; i < iface->enc.cfg_map_count; ++i) {
map = iface->enc.cfg_maps + i;
if (map->usage == (int)usage) {
*cfg = map->cfg;
cfg->g_usage = usage;
......
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