Newer
Older
xd->lossless = pc->base_qindex == 0 &&
pc->y_dc_delta_q == 0 &&
pc->uv_dc_delta_q == 0 &&
pc->uv_ac_delta_q == 0;
if (xd->lossless) {
xd->itxm_add = vp9_idct_add_lossless_c;
xd->itxm_add_y_block = vp9_idct_add_y_block_lossless_c;
xd->itxm_add_uv_block = vp9_idct_add_uv_block_lossless_c;
} else {
xd->itxm_add = vp9_idct_add;
xd->itxm_add_y_block = vp9_idct_add_y_block;
xd->itxm_add_uv_block = vp9_idct_add_uv_block;
}
if (!keyframe)
vp9_setup_interp_filters(xd, pc->mcomp_filter_type, pc);
pc->fc = pc->frame_contexts[pc->frame_context_idx];
setup_segmentation(pc, xd, &header_bc);
setup_txfm_mode(pc, xd->lossless, &header_bc);
read_coef_probs(pbi, &header_bc);
// Initialize xd pointers. Any reference should do for xd->pre, so use 0.
setup_pre_planes(xd, &pc->yv12_fb[pc->active_ref_idx[0]], NULL,
0, 0, NULL, NULL);
setup_dst_planes(xd, new_fb, 0, 0);
// Create the segmentation map structure and set to 0
if (!pc->last_frame_seg_map)
CHECK_MEM_ERROR(pc->last_frame_seg_map,
vpx_calloc((pc->mi_rows * pc->mi_cols), 1));
vp9_setup_block_dptrs(xd, pc->subsampling_x, pc->subsampling_y);
for (i = 0; i < MAX_MB_PLANE; ++i)
vp9_zero(xd->plane[i].qcoeff);
set_prev_mi(pc);
vp9_decode_mode_mvs_init(pbi, &header_bc);
decode_tiles(pbi, data, first_partition_size, &header_bc, &residual_bc);
pc->last_width = pc->width;
pc->last_height = pc->height;
new_fb->corrupted = vp9_reader_has_error(&header_bc) | xd->corrupted;
if (keyframe && !new_fb->corrupted)
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
// Adaptation
if (!pc->error_resilient_mode && !pc->frame_parallel_decoding_mode) {
vp9_adapt_mode_context(pc);
vp9_adapt_nmv_probs(pc, xd->allow_high_precision_mv);
if (pc->refresh_frame_context)
pc->frame_contexts[pc->frame_context_idx] = pc->fc;
*p_data_end = vp9_reader_find_end(&residual_bc);