OLD | NEW |
1 /* | 1 /* |
2 Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 int inter_mode_ctx, ref, is_compound; | 431 int inter_mode_ctx, ref, is_compound; |
432 | 432 |
433 read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame); | 433 read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame); |
434 is_compound = has_second_ref(mbmi); | 434 is_compound = has_second_ref(mbmi); |
435 | 435 |
436 for (ref = 0; ref < 1 + is_compound; ++ref) { | 436 for (ref = 0; ref < 1 + is_compound; ++ref) { |
437 const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; | 437 const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref]; |
438 RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME]; | 438 RefBuffer *ref_buf = &cm->frame_refs[frame - LAST_FRAME]; |
439 xd->block_refs[ref] = ref_buf; | 439 xd->block_refs[ref] = ref_buf; |
440 if ((!vp9_is_valid_scale(&ref_buf->sf))) | 440 if ((!vp9_is_valid_scale(&ref_buf->sf))) |
441 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, | 441 vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM, |
442 "Reference frame has invalid dimensions"); | 442 "Reference frame has invalid dimensions"); |
443 if (ref_buf->buf->corrupted) | |
444 vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, | |
445 "Block reference is corrupt"); | |
446 vp9_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, | 443 vp9_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, |
447 &ref_buf->sf); | 444 &ref_buf->sf); |
448 vp9_find_mv_refs(cm, xd, tile, mi, frame, mbmi->ref_mvs[frame], | 445 vp9_find_mv_refs(cm, xd, tile, mi, frame, mbmi->ref_mvs[frame], |
449 mi_row, mi_col); | 446 mi_row, mi_col); |
450 } | 447 } |
451 | 448 |
452 inter_mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]]; | 449 inter_mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]]; |
453 | 450 |
454 if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { | 451 if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) { |
455 mbmi->mode = ZEROMV; | 452 mbmi->mode = ZEROMV; |
456 if (bsize < BLOCK_8X8) { | 453 if (bsize < BLOCK_8X8) { |
457 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, | 454 vpx_internal_error(xd->error_info, VPX_CODEC_UNSUP_BITSTREAM, |
458 "Invalid usage of segement feature on small blocks"); | 455 "Invalid usage of segement feature on small blocks"); |
459 return; | 456 return; |
460 } | 457 } |
461 } else { | 458 } else { |
462 if (bsize >= BLOCK_8X8) | 459 if (bsize >= BLOCK_8X8) |
463 mbmi->mode = read_inter_mode(cm, r, inter_mode_ctx); | 460 mbmi->mode = read_inter_mode(cm, r, inter_mode_ctx); |
464 } | 461 } |
465 | 462 |
466 if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) { | 463 if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) { |
467 for (ref = 0; ref < 1 + is_compound; ++ref) { | 464 for (ref = 0; ref < 1 + is_compound; ++ref) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; | 558 MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; |
562 for (w = 0; w < x_mis; ++w) { | 559 for (w = 0; w < x_mis; ++w) { |
563 MV_REF *const mv = frame_mv + w; | 560 MV_REF *const mv = frame_mv + w; |
564 mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; | 561 mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; |
565 mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; | 562 mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; |
566 mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; | 563 mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; |
567 mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; | 564 mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; |
568 } | 565 } |
569 } | 566 } |
570 } | 567 } |
OLD | NEW |