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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 { | 515 { |
516 int b; | 516 int b; |
517 | 517 |
518 for (b = 0; b < xd->mbmi.partition_count; b++) | 518 for (b = 0; b < xd->mbmi.partition_count; b++) |
519 { | 519 { |
520 inter_b_modes[x->partition->bmi[b].mode] ++; | 520 inter_b_modes[x->partition->bmi[b].mode] ++; |
521 } | 521 } |
522 } | 522 } |
523 | 523 |
524 #endif | 524 #endif |
| 525 // Keep track of how many (consecutive) times a block is coded |
| 526 // as ZEROMV_LASTREF, for base layer frames. |
| 527 // Reset to 0 if its coded as anything else. |
| 528 if (cpi->current_layer == 0) { |
| 529 if (xd->mode_info_context->mbmi.mode == ZEROMV && |
| 530 xd->mode_info_context->mbmi.ref_frame == LAST_FRAME) { |
| 531 // Increment, check for wrap-around. |
| 532 if (cpi->consec_zero_last[map_index+mb_col] < 255) |
| 533 cpi->consec_zero_last[map_index+mb_col] += 1; |
| 534 } else { |
| 535 cpi->consec_zero_last[map_index+mb_col] = 0; |
| 536 } |
| 537 } |
525 | 538 |
526 /* Special case code for cyclic refresh | 539 /* Special case code for cyclic refresh |
527 * If cyclic update enabled then copy xd->mbmi.segment_id; (which | 540 * If cyclic update enabled then copy xd->mbmi.segment_id; (which |
528 * may have been updated based on mode during | 541 * may have been updated based on mode during |
529 * vp8cx_encode_inter_macroblock()) back into the global | 542 * vp8cx_encode_inter_macroblock()) back into the global |
530 * segmentation map | 543 * segmentation map |
531 */ | 544 */ |
532 if ((cpi->current_layer == 0) && | 545 if ((cpi->current_layer == 0) && |
533 (cpi->cyclic_refresh_mode_enabled && | 546 (cpi->cyclic_refresh_mode_enabled && |
534 xd->segmentation_enabled)) | 547 xd->segmentation_enabled)) |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 vp8_fix_contexts(xd); | 1408 vp8_fix_contexts(xd); |
1396 } | 1409 } |
1397 else | 1410 else |
1398 { | 1411 { |
1399 vp8_stuff_mb(cpi, x, t); | 1412 vp8_stuff_mb(cpi, x, t); |
1400 } | 1413 } |
1401 } | 1414 } |
1402 | 1415 |
1403 return rate; | 1416 return rate; |
1404 } | 1417 } |
OLD | NEW |