| 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 11 matching lines...) Expand all Loading... |
| 22 #include "vp9/common/vp9_reconintra.h" | 22 #include "vp9/common/vp9_reconintra.h" |
| 23 | 23 |
| 24 | 24 |
| 25 static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, | 25 static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, |
| 26 const MV *ref_mv, | 26 const MV *ref_mv, |
| 27 MV *dst_mv, | 27 MV *dst_mv, |
| 28 int mb_row, | 28 int mb_row, |
| 29 int mb_col) { | 29 int mb_col) { |
| 30 MACROBLOCK *const x = &cpi->td.mb; | 30 MACROBLOCK *const x = &cpi->td.mb; |
| 31 MACROBLOCKD *const xd = &x->e_mbd; | 31 MACROBLOCKD *const xd = &x->e_mbd; |
| 32 const MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; | 32 MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; |
| 33 const SEARCH_METHODS old_search_method = mv_sf->search_method; |
| 33 const vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; | 34 const vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; |
| 34 | 35 |
| 35 const int tmp_col_min = x->mv_col_min; | 36 const int tmp_col_min = x->mv_col_min; |
| 36 const int tmp_col_max = x->mv_col_max; | 37 const int tmp_col_max = x->mv_col_max; |
| 37 const int tmp_row_min = x->mv_row_min; | 38 const int tmp_row_min = x->mv_row_min; |
| 38 const int tmp_row_max = x->mv_row_max; | 39 const int tmp_row_max = x->mv_row_max; |
| 39 MV ref_full; | 40 MV ref_full; |
| 40 int cost_list[5]; | 41 int cost_list[5]; |
| 41 | 42 |
| 42 // Further step/diamond searches as necessary | 43 // Further step/diamond searches as necessary |
| 43 int step_param = mv_sf->reduce_first_step_size; | 44 int step_param = mv_sf->reduce_first_step_size; |
| 44 step_param = VPXMIN(step_param, MAX_MVSEARCH_STEPS - 2); | 45 step_param = VPXMIN(step_param, MAX_MVSEARCH_STEPS - 2); |
| 45 | 46 |
| 46 vp9_set_mv_search_range(x, ref_mv); | 47 vp9_set_mv_search_range(x, ref_mv); |
| 47 | 48 |
| 48 ref_full.col = ref_mv->col >> 3; | 49 ref_full.col = ref_mv->col >> 3; |
| 49 ref_full.row = ref_mv->row >> 3; | 50 ref_full.row = ref_mv->row >> 3; |
| 50 | 51 |
| 51 /*cpi->sf.search_method == HEX*/ | 52 mv_sf->search_method = HEX; |
| 52 vp9_hex_search(x, &ref_full, step_param, x->errorperbit, 0, | 53 vp9_full_pixel_search(cpi, x, BLOCK_16X16, &ref_full, step_param, |
| 53 cond_cost_list(cpi, cost_list), | 54 x->errorperbit, cond_cost_list(cpi, cost_list), ref_mv, |
| 54 &v_fn_ptr, 0, ref_mv, dst_mv); | 55 dst_mv, 0, 0); |
| 56 mv_sf->search_method = old_search_method; |
| 55 | 57 |
| 56 // Try sub-pixel MC | 58 // Try sub-pixel MC |
| 57 // if (bestsme > error_thresh && bestsme < INT_MAX) | 59 // if (bestsme > error_thresh && bestsme < INT_MAX) |
| 58 { | 60 { |
| 59 int distortion; | 61 int distortion; |
| 60 unsigned int sse; | 62 unsigned int sse; |
| 61 cpi->find_fractional_mv_step( | 63 cpi->find_fractional_mv_step( |
| 62 x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit, | 64 x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit, |
| 63 &v_fn_ptr, 0, mv_sf->subpel_iters_per_step, | 65 &v_fn_ptr, 0, mv_sf->subpel_iters_per_step, |
| 64 cond_cost_list(cpi, cost_list), | 66 cond_cost_list(cpi, cost_list), |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 assert(q_cur != NULL); | 409 assert(q_cur != NULL); |
| 408 | 410 |
| 409 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, | 411 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, |
| 410 golden_ref, cpi->Source); | 412 golden_ref, cpi->Source); |
| 411 } | 413 } |
| 412 | 414 |
| 413 vpx_clear_system_state(); | 415 vpx_clear_system_state(); |
| 414 | 416 |
| 415 separate_arf_mbs(cpi); | 417 separate_arf_mbs(cpi); |
| 416 } | 418 } |
| OLD | NEW |