| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 uint8_t *src_y_ptr = x->plane[0].src.buf; | 460 uint8_t *src_y_ptr = x->plane[0].src.buf; |
| 461 uint8_t *ref_y_ptr; | 461 uint8_t *ref_y_ptr; |
| 462 const int num_mv_refs = MAX_MV_REF_CANDIDATES + | 462 const int num_mv_refs = MAX_MV_REF_CANDIDATES + |
| 463 (cpi->sf.adaptive_motion_search && | 463 (cpi->sf.adaptive_motion_search && |
| 464 block_size < x->max_partition_size); | 464 block_size < x->max_partition_size); |
| 465 | 465 |
| 466 MV pred_mv[3]; | 466 MV pred_mv[3]; |
| 467 pred_mv[0] = mbmi->ref_mvs[ref_frame][0].as_mv; | 467 pred_mv[0] = mbmi->ref_mvs[ref_frame][0].as_mv; |
| 468 pred_mv[1] = mbmi->ref_mvs[ref_frame][1].as_mv; | 468 pred_mv[1] = mbmi->ref_mvs[ref_frame][1].as_mv; |
| 469 pred_mv[2] = x->pred_mv[ref_frame]; | 469 pred_mv[2] = x->pred_mv[ref_frame]; |
| 470 assert(num_mv_refs <= (int)(sizeof(pred_mv) / sizeof(pred_mv[0]))); |
| 470 | 471 |
| 471 // Get the sad for each candidate reference mv. | 472 // Get the sad for each candidate reference mv. |
| 472 for (i = 0; i < num_mv_refs; ++i) { | 473 for (i = 0; i < num_mv_refs; ++i) { |
| 473 const MV *this_mv = &pred_mv[i]; | 474 const MV *this_mv = &pred_mv[i]; |
| 474 | 475 |
| 475 max_mv = MAX(max_mv, MAX(abs(this_mv->row), abs(this_mv->col)) >> 3); | 476 max_mv = MAX(max_mv, MAX(abs(this_mv->row), abs(this_mv->col)) >> 3); |
| 476 if (is_zero_mv(this_mv) && zero_seen) | 477 if (is_zero_mv(this_mv) && zero_seen) |
| 477 continue; | 478 continue; |
| 478 | 479 |
| 479 zero_seen |= is_zero_mv(this_mv); | 480 zero_seen |= is_zero_mv(this_mv); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 return ROUND_POWER_OF_TWO(5 * q, 2); | 650 return ROUND_POWER_OF_TWO(5 * q, 2); |
| 650 default: | 651 default: |
| 651 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); | 652 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); |
| 652 return -1; | 653 return -1; |
| 653 } | 654 } |
| 654 #else | 655 #else |
| 655 return 20 * q; | 656 return 20 * q; |
| 656 #endif // CONFIG_VP9_HIGHBITDEPTH | 657 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 657 } | 658 } |
| 658 | 659 |
| OLD | NEW |