summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-03-18 10:47:51 -0700
committerDmitry Kovalev <dkovalev@google.com>2014-03-18 10:47:51 -0700
commitb8bc2d337a6f4b480ae7923e85a928faa2191ba2 (patch)
treedab6c7653030e6ba9ff0bf28fac39be6b25acfca
parent17d2394c43b6bef5b767a6f3e7f53398070c02ae (diff)
downloadlibvpx-b8bc2d337a6f4b480ae7923e85a928faa2191ba2.tar
libvpx-b8bc2d337a6f4b480ae7923e85a928faa2191ba2.tar.gz
libvpx-b8bc2d337a6f4b480ae7923e85a928faa2191ba2.tar.bz2
libvpx-b8bc2d337a6f4b480ae7923e85a928faa2191ba2.zip
Fixing warnings/errors from c++ compiler.
Change-Id: Ia561dda53f2dd10e3a10a2df2adb8027ab19397a
-rw-r--r--vp9/common/vp9_debugmodes.c4
-rw-r--r--vp9/common/vp9_entropymv.c8
-rw-r--r--vp9/decoder/vp9_decodemv.c12
-rw-r--r--vp9/vp9_cx_iface.c14
-rw-r--r--vp9/vp9_dx_iface.c8
5 files changed, 22 insertions, 24 deletions
diff --git a/vp9/common/vp9_debugmodes.c b/vp9/common/vp9_debugmodes.c
index 24c785f2a..8f150a406 100644
--- a/vp9/common/vp9_debugmodes.c
+++ b/vp9/common/vp9_debugmodes.c
@@ -22,7 +22,7 @@ static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
* and uses the passed in member offset to print out the value of an integer
* for each mbmi member value in the mi structure.
*/
-static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor,
+static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
size_t member_offset) {
int mi_row;
int mi_col;
@@ -47,7 +47,7 @@ static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor,
}
fprintf(file, "\n");
}
-void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, char *file) {
+void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, const char *file) {
int mi_row;
int mi_col;
int mi_index = 0;
diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c
index e1f5ef7b4..197b7c05e 100644
--- a/vp9/common/vp9_entropymv.c
+++ b/vp9/common/vp9_entropymv.c
@@ -122,12 +122,8 @@ static const uint8_t log_in_base_2[] = {
};
MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) {
- MV_CLASS_TYPE c = MV_CLASS_0;
- if (z >= CLASS0_SIZE * 4096)
- c = MV_CLASS_10;
- else
- c = log_in_base_2[z >> 3];
-
+ const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) ? MV_CLASS_10 :
+ (MV_CLASS_TYPE)log_in_base_2[z >> 3];
if (offset)
*offset = z - mv_class_base(c);
return c;
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index 50686b3c5..06a21ea7b 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -63,7 +63,7 @@ static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd,
TX_SIZE max_tx_size, vp9_reader *r) {
const int ctx = vp9_get_tx_size_context(xd);
const vp9_prob *tx_probs = get_tx_probs(max_tx_size, ctx, &cm->fc.tx_probs);
- TX_SIZE tx_size = vp9_read(r, tx_probs[0]);
+ TX_SIZE tx_size = (TX_SIZE)vp9_read(r, tx_probs[0]);
if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) {
tx_size += vp9_read(r, tx_probs[1]);
if (tx_size != TX_8X8 && max_tx_size >= TX_32X32)
@@ -258,7 +258,8 @@ static REFERENCE_MODE read_block_reference_mode(VP9_COMMON *cm,
vp9_reader *r) {
if (cm->reference_mode == REFERENCE_MODE_SELECT) {
const int ctx = vp9_get_reference_mode_context(cm, xd);
- const int mode = vp9_read(r, cm->fc.comp_inter_prob[ctx]);
+ const REFERENCE_MODE mode =
+ (REFERENCE_MODE)vp9_read(r, cm->fc.comp_inter_prob[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.comp_inter[ctx][mode];
return mode; // SINGLE_REFERENCE or COMPOUND_REFERENCE
@@ -314,8 +315,9 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
static INLINE INTERP_FILTER read_switchable_interp_filter(
VP9_COMMON *const cm, MACROBLOCKD *const xd, vp9_reader *r) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
- const int type = vp9_read_tree(r, vp9_switchable_interp_tree,
- cm->fc.switchable_interp_prob[ctx]);
+ const INTERP_FILTER type =
+ (INTERP_FILTER)vp9_read_tree(r, vp9_switchable_interp_tree,
+ cm->fc.switchable_interp_prob[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.switchable_interp[ctx][type];
return type;
@@ -465,7 +467,7 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm,
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2
int idx, idy;
- int b_mode;
+ MB_PREDICTION_MODE b_mode;
int_mv nearest_sub8x8[2], near_sub8x8[2];
for (idy = 0; idy < 2; idy += num_4x4_h) {
for (idx = 0; idx < 2; idx += num_4x4_w) {
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 75c6c6e14..d3097e526 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -36,7 +36,7 @@ struct vp9_extracfg {
unsigned int rc_max_intra_bitrate_pct;
unsigned int lossless;
unsigned int frame_parallel_decoding_mode;
- unsigned int aq_mode;
+ AQ_MODE aq_mode;
};
struct extraconfig_map {
@@ -59,12 +59,12 @@ static const struct extraconfig_map extracfg_map[] = {
7, /* arnr_max_frames */
5, /* arnr_strength */
3, /* arnr_type*/
- 0, /* tuning*/
+ VP8_TUNE_PSNR, /* tuning*/
10, /* cq_level */
0, /* rc_max_intra_bitrate_pct */
0, /* lossless */
0, /* frame_parallel_decoding_mode */
- 0, /* aq_mode */
+ NO_AQ, /* aq_mode */
}
}
};
@@ -217,7 +217,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
if (cfg->g_pass == VPX_RC_LAST_PASS) {
size_t packet_sz = sizeof(FIRSTPASS_STATS);
int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);
- FIRSTPASS_STATS *stats;
+ const FIRSTPASS_STATS *stats;
if (cfg->rc_twopass_stats_in.buf == NULL)
ERROR("rc_twopass_stats_in.buf not set.");
@@ -228,8 +228,8 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz)
ERROR("rc_twopass_stats_in requires at least two packets.");
- stats = (void *)((char *)cfg->rc_twopass_stats_in.buf
- + (n_packets - 1) * packet_sz);
+ stats =
+ (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1;
if ((int)(stats->count + 0.5) != n_packets - 1)
ERROR("rc_twopass_stats_in missing EOS stats packet");
@@ -529,7 +529,7 @@ static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx) {
if (priv->cx_data_sz < 4096) priv->cx_data_sz = 4096;
- priv->cx_data = malloc(priv->cx_data_sz);
+ priv->cx_data = (unsigned char *)malloc(priv->cx_data_sz);
if (priv->cx_data == NULL) return VPX_CODEC_MEM_ERROR;
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index ae6ccff9d..72701d9d1 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -80,10 +80,10 @@ static unsigned long priv_sz(const vpx_codec_dec_cfg_t *si,
static void vp9_init_ctx(vpx_codec_ctx_t *ctx, const vpx_codec_mmap_t *mmap) {
int i;
- ctx->priv = mmap->base;
+ ctx->priv = (vpx_codec_priv_t *)mmap->base;
ctx->priv->sz = sizeof(*ctx->priv);
ctx->priv->iface = ctx->iface;
- ctx->priv->alg_priv = mmap->base;
+ ctx->priv->alg_priv = (struct vpx_codec_alg_priv *)mmap->base;
for (i = 0; i < NELEMENTS(ctx->priv->alg_priv->mmaps); i++)
ctx->priv->alg_priv->mmaps[i].id = vp9_mem_req_segs[i].id;
@@ -406,7 +406,7 @@ static vpx_codec_err_t vp9_decode(vpx_codec_alg_priv_t *ctx,
long deadline) {
const uint8_t *data_start = data;
const uint8_t *data_end = data + data_sz;
- vpx_codec_err_t res = 0;
+ vpx_codec_err_t res = VPX_CODEC_OK;
uint32_t sizes[8];
int frames_this_pts, frame_count = 0;
@@ -502,7 +502,7 @@ static vpx_codec_err_t vp9_xma_get_mmap(const vpx_codec_ctx_t *ctx,
vpx_codec_mmap_t *mmap,
vpx_codec_iter_t *iter) {
vpx_codec_err_t res;
- const mem_req_t *seg_iter = *iter;
+ const mem_req_t *seg_iter = (const mem_req_t *)*iter;
/* Get address of next segment request */
do {