| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 const MV *center_mv) { | 879 const MV *center_mv) { |
| 880 const MACROBLOCKD *const xd = &x->e_mbd; | 880 const MACROBLOCKD *const xd = &x->e_mbd; |
| 881 const struct buf_2d *const what = &x->plane[0].src; | 881 const struct buf_2d *const what = &x->plane[0].src; |
| 882 const struct buf_2d *const in_what = &xd->plane[0].pre[0]; | 882 const struct buf_2d *const in_what = &xd->plane[0].pre[0]; |
| 883 const int range = 64; | 883 const int range = 64; |
| 884 const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; | 884 const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; |
| 885 unsigned int best_sad = INT_MAX; | 885 unsigned int best_sad = INT_MAX; |
| 886 int r, c, i; | 886 int r, c, i; |
| 887 int start_col, end_col, start_row, end_row; | 887 int start_col, end_col, start_row, end_row; |
| 888 | 888 |
| 889 // The cfg and search_param parameters are not used in this search variant |
| 890 (void)cfg; |
| 891 (void)search_param; |
| 892 |
| 889 clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); | 893 clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max); |
| 890 *best_mv = *ref_mv; | 894 *best_mv = *ref_mv; |
| 891 *num00 = 11; | 895 *num00 = 11; |
| 892 best_sad = fn_ptr->sdf(what->buf, what->stride, | 896 best_sad = fn_ptr->sdf(what->buf, what->stride, |
| 893 get_buf_from_mv(in_what, ref_mv), in_what->stride, | 897 get_buf_from_mv(in_what, ref_mv), in_what->stride, |
| 894 0x7fffffff) + | 898 0x7fffffff) + |
| 895 mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); | 899 mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit); |
| 896 start_row = MAX(-range, x->mv_row_min - ref_mv->row); | 900 start_row = MAX(-range, x->mv_row_min - ref_mv->row); |
| 897 start_col = MAX(-range, x->mv_col_min - ref_mv->col); | 901 start_col = MAX(-range, x->mv_col_min - ref_mv->col); |
| 898 end_row = MIN(range, x->mv_row_max - ref_mv->row); | 902 end_row = MIN(range, x->mv_row_max - ref_mv->row); |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 return best_sad; | 1548 return best_sad; |
| 1545 } | 1549 } |
| 1546 | 1550 |
| 1547 // This function is called when we do joint motion search in comp_inter_inter | 1551 // This function is called when we do joint motion search in comp_inter_inter |
| 1548 // mode. | 1552 // mode. |
| 1549 int vp9_refining_search_8p_c(const MACROBLOCK *x, | 1553 int vp9_refining_search_8p_c(const MACROBLOCK *x, |
| 1550 MV *ref_mv, int error_per_bit, | 1554 MV *ref_mv, int error_per_bit, |
| 1551 int search_range, | 1555 int search_range, |
| 1552 const vp9_variance_fn_ptr_t *fn_ptr, | 1556 const vp9_variance_fn_ptr_t *fn_ptr, |
| 1553 const MV *center_mv, | 1557 const MV *center_mv, |
| 1554 const uint8_t *second_pred, int w, int h) { | 1558 const uint8_t *second_pred) { |
| 1555 const MV neighbors[8] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}, | 1559 const MV neighbors[8] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}, |
| 1556 {-1, -1}, {1, -1}, {-1, 1}, {1, 1}}; | 1560 {-1, -1}, {1, -1}, {-1, 1}, {1, 1}}; |
| 1557 const MACROBLOCKD *const xd = &x->e_mbd; | 1561 const MACROBLOCKD *const xd = &x->e_mbd; |
| 1558 const struct buf_2d *const what = &x->plane[0].src; | 1562 const struct buf_2d *const what = &x->plane[0].src; |
| 1559 const struct buf_2d *const in_what = &xd->plane[0].pre[0]; | 1563 const struct buf_2d *const in_what = &xd->plane[0].pre[0]; |
| 1560 const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; | 1564 const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3}; |
| 1561 unsigned int best_sad = fn_ptr->sdaf(what->buf, what->stride, | 1565 unsigned int best_sad = fn_ptr->sdaf(what->buf, what->stride, |
| 1562 get_buf_from_mv(in_what, ref_mv), in_what->stride, | 1566 get_buf_from_mv(in_what, ref_mv), in_what->stride, |
| 1563 second_pred, 0x7fffffff) + | 1567 second_pred, 0x7fffffff) + |
| 1564 mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit); | 1568 mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1587 | 1591 |
| 1588 if (best_site == -1) { | 1592 if (best_site == -1) { |
| 1589 break; | 1593 break; |
| 1590 } else { | 1594 } else { |
| 1591 ref_mv->row += neighbors[best_site].row; | 1595 ref_mv->row += neighbors[best_site].row; |
| 1592 ref_mv->col += neighbors[best_site].col; | 1596 ref_mv->col += neighbors[best_site].col; |
| 1593 } | 1597 } |
| 1594 } | 1598 } |
| 1595 return best_sad; | 1599 return best_sad; |
| 1596 } | 1600 } |
| OLD | NEW |