vp9_decodframe.c 33.8 KB
Newer Older
  new_fb->corrupted |= read_compressed_header(pbi, data, first_partition_size);

  setup_block_dptrs(xd, cm->subsampling_x, cm->subsampling_y);
Dmitry Kovalev's avatar
Dmitry Kovalev committed
  // clear out the coeff buffer
  for (i = 0; i < MAX_MB_PLANE; ++i)
    vp9_zero(xd->plane[i].qcoeff);
  set_prev_mi(cm);
  *p_data_end = decode_tiles(pbi, data + first_partition_size);
John Koleszar's avatar
John Koleszar committed

  cm->last_width = cm->width;
  cm->last_height = cm->height;
  new_fb->corrupted |= xd->corrupted;
John Koleszar's avatar
John Koleszar committed

  if (!pbi->decoded_key_frame) {
    if (keyframe && !new_fb->corrupted)
John Koleszar's avatar
John Koleszar committed
      pbi->decoded_key_frame = 1;
    else
      vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
John Koleszar's avatar
John Koleszar committed
                         "A stream must start with a complete key frame");
  }
  if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) {
    vp9_adapt_coef_probs(cm);
    if (!frame_is_intra_only(cm)) {
      vp9_adapt_mode_probs(cm);
      vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv);
John Koleszar's avatar
John Koleszar committed
  }
  if (cm->refresh_frame_context)
    cm->frame_contexts[cm->frame_context_idx] = cm->fc;
John Koleszar's avatar
John Koleszar committed
  return 0;
John Koleszar's avatar
John Koleszar committed
}