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 "vpx_mem/vpx_mem.h" | 13 #include "vpx_mem/vpx_mem.h" |
14 #include "vp9/encoder/vp9_rdopt.h" | 14 #include "vp9/encoder/vp9_rdopt.h" |
15 #include "vp9/encoder/vp9_segmentation.h" | 15 #include "vp9/encoder/vp9_segmentation.h" |
16 #include "vp9/encoder/vp9_mcomp.h" | 16 #include "vp9/encoder/vp9_mcomp.h" |
17 #include "vp9/common/vp9_blockd.h" | 17 #include "vp9/common/vp9_blockd.h" |
18 #include "vp9/common/vp9_reconinter.h" | 18 #include "vp9/common/vp9_reconinter.h" |
19 #include "vp9/common/vp9_reconintra.h" | 19 #include "vp9/common/vp9_reconintra.h" |
20 #include "vp9/common/vp9_systemdependent.h" | 20 #include "vp9/common/vp9_systemdependent.h" |
21 | 21 |
22 | 22 |
23 | |
24 static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, | 23 static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, |
25 const MV *ref_mv, | 24 const MV *ref_mv, |
26 MV *dst_mv, | 25 MV *dst_mv, |
27 int mb_row, | 26 int mb_row, |
28 int mb_col) { | 27 int mb_col) { |
29 MACROBLOCK *const x = &cpi->mb; | 28 MACROBLOCK *const x = &cpi->mb; |
30 MACROBLOCKD *const xd = &x->e_mbd; | 29 MACROBLOCKD *const xd = &x->e_mbd; |
31 vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; | 30 vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16]; |
32 | 31 |
33 const int tmp_col_min = x->mv_col_min; | 32 const int tmp_col_min = x->mv_col_min; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 YV12_BUFFER_CONFIG *buf, | 229 YV12_BUFFER_CONFIG *buf, |
231 YV12_BUFFER_CONFIG *golden_ref, | 230 YV12_BUFFER_CONFIG *golden_ref, |
232 YV12_BUFFER_CONFIG *alt_ref) { | 231 YV12_BUFFER_CONFIG *alt_ref) { |
233 MACROBLOCK *const x = &cpi->mb; | 232 MACROBLOCK *const x = &cpi->mb; |
234 MACROBLOCKD *const xd = &x->e_mbd; | 233 MACROBLOCKD *const xd = &x->e_mbd; |
235 VP9_COMMON *const cm = &cpi->common; | 234 VP9_COMMON *const cm = &cpi->common; |
236 | 235 |
237 int mb_col, mb_row, offset = 0; | 236 int mb_col, mb_row, offset = 0; |
238 int mb_y_offset = 0, arf_y_offset = 0, gld_y_offset = 0; | 237 int mb_y_offset = 0, arf_y_offset = 0, gld_y_offset = 0; |
239 MV arf_top_mv = {0, 0}, gld_top_mv = {0, 0}; | 238 MV arf_top_mv = {0, 0}, gld_top_mv = {0, 0}; |
240 MODE_INFO mi_local = { { 0 } }; | 239 MODE_INFO mi_local; |
241 | 240 |
| 241 vp9_zero(mi_local); |
242 // Set up limit values for motion vectors to prevent them extending outside | 242 // Set up limit values for motion vectors to prevent them extending outside |
243 // the UMV borders. | 243 // the UMV borders. |
244 x->mv_row_min = -BORDER_MV_PIXELS_B16; | 244 x->mv_row_min = -BORDER_MV_PIXELS_B16; |
245 x->mv_row_max = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16; | 245 x->mv_row_max = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16; |
246 xd->up_available = 0; | 246 xd->up_available = 0; |
247 xd->plane[0].dst.stride = buf->y_stride; | 247 xd->plane[0].dst.stride = buf->y_stride; |
248 xd->plane[0].pre[0].stride = buf->y_stride; | 248 xd->plane[0].pre[0].stride = buf->y_stride; |
249 xd->plane[1].dst.stride = buf->uv_stride; | 249 xd->plane[1].dst.stride = buf->uv_stride; |
250 xd->mi[0] = &mi_local; | 250 xd->mi[0] = &mi_local; |
251 mi_local.mbmi.sb_type = BLOCK_16X16; | 251 mi_local.mbmi.sb_type = BLOCK_16X16; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 assert(q_cur != NULL); | 405 assert(q_cur != NULL); |
406 | 406 |
407 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, | 407 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, |
408 golden_ref, cpi->Source); | 408 golden_ref, cpi->Source); |
409 } | 409 } |
410 | 410 |
411 vp9_clear_system_state(); | 411 vp9_clear_system_state(); |
412 | 412 |
413 separate_arf_mbs(cpi); | 413 separate_arf_mbs(cpi); |
414 } | 414 } |
OLD | NEW |