* 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;
}
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;
};
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;
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)
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
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;
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) {
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 {
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 */
}
}
};
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.");
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");
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;
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;
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;
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 {