| 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 |
| 11 #include <limits.h> | 11 #include <limits.h> |
| 12 | 12 |
| 13 #include "./vp9_rtcd.h" | 13 #include "./vp9_rtcd.h" |
| 14 #include "./vpx_dsp_rtcd.h" | 14 #include "./vpx_dsp_rtcd.h" |
| 15 | 15 |
| 16 #include "vpx_mem/vpx_mem.h" | 16 #include "vpx_mem/vpx_mem.h" |
| 17 #include "vpx_ports/system_state.h" |
| 17 #include "vp9/encoder/vp9_segmentation.h" | 18 #include "vp9/encoder/vp9_segmentation.h" |
| 18 #include "vp9/encoder/vp9_mcomp.h" | 19 #include "vp9/encoder/vp9_mcomp.h" |
| 19 #include "vp9/common/vp9_blockd.h" | 20 #include "vp9/common/vp9_blockd.h" |
| 20 #include "vp9/common/vp9_reconinter.h" | 21 #include "vp9/common/vp9_reconinter.h" |
| 21 #include "vp9/common/vp9_reconintra.h" | 22 #include "vp9/common/vp9_reconintra.h" |
| 22 #include "vp9/common/vp9_systemdependent.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 const MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; |
| 33 const vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; | 33 const vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; |
| 34 | 34 |
| 35 const int tmp_col_min = x->mv_col_min; | 35 const int tmp_col_min = x->mv_col_min; |
| 36 const int tmp_col_max = x->mv_col_max; | 36 const int tmp_col_max = x->mv_col_max; |
| 37 const int tmp_row_min = x->mv_row_min; | 37 const int tmp_row_min = x->mv_row_min; |
| 38 const int tmp_row_max = x->mv_row_max; | 38 const int tmp_row_max = x->mv_row_max; |
| 39 MV ref_full; | 39 MV ref_full; |
| 40 int cost_list[5]; | 40 int cost_list[5]; |
| 41 | 41 |
| 42 // Further step/diamond searches as necessary | 42 // Further step/diamond searches as necessary |
| 43 int step_param = mv_sf->reduce_first_step_size; | 43 int step_param = mv_sf->reduce_first_step_size; |
| 44 step_param = MIN(step_param, MAX_MVSEARCH_STEPS - 2); | 44 step_param = VPXMIN(step_param, MAX_MVSEARCH_STEPS - 2); |
| 45 | 45 |
| 46 vp9_set_mv_search_range(x, ref_mv); | 46 vp9_set_mv_search_range(x, ref_mv); |
| 47 | 47 |
| 48 ref_full.col = ref_mv->col >> 3; | 48 ref_full.col = ref_mv->col >> 3; |
| 49 ref_full.row = ref_mv->row >> 3; | 49 ref_full.row = ref_mv->row >> 3; |
| 50 | 50 |
| 51 /*cpi->sf.search_method == HEX*/ | 51 /*cpi->sf.search_method == HEX*/ |
| 52 vp9_hex_search(x, &ref_full, step_param, x->errorperbit, 0, | 52 vp9_hex_search(x, &ref_full, step_param, x->errorperbit, 0, |
| 53 cond_cost_list(cpi, cost_list), | 53 cond_cost_list(cpi, cost_list), |
| 54 &v_fn_ptr, 0, ref_mv, dst_mv); | 54 &v_fn_ptr, 0, ref_mv, dst_mv); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 for (i = 0; i < n_frames; i++) { | 403 for (i = 0; i < n_frames; i++) { |
| 404 MBGRAPH_FRAME_STATS *frame_stats = &cpi->mbgraph_stats[i]; | 404 MBGRAPH_FRAME_STATS *frame_stats = &cpi->mbgraph_stats[i]; |
| 405 struct lookahead_entry *q_cur = vp9_lookahead_peek(cpi->lookahead, i); | 405 struct lookahead_entry *q_cur = vp9_lookahead_peek(cpi->lookahead, i); |
| 406 | 406 |
| 407 assert(q_cur != NULL); | 407 assert(q_cur != NULL); |
| 408 | 408 |
| 409 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, | 409 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, |
| 410 golden_ref, cpi->Source); | 410 golden_ref, cpi->Source); |
| 411 } | 411 } |
| 412 | 412 |
| 413 vp9_clear_system_state(); | 413 vpx_clear_system_state(); |
| 414 | 414 |
| 415 separate_arf_mbs(cpi); | 415 separate_arf_mbs(cpi); |
| 416 } | 416 } |
| OLD | NEW |