| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 clamp_mv(&clamped_mv, | 133 clamp_mv(&clamped_mv, |
| 134 xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, | 134 xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left, |
| 135 xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, | 135 xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right, |
| 136 xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, | 136 xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top, |
| 137 xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom); | 137 xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom); |
| 138 | 138 |
| 139 return clamped_mv; | 139 return clamped_mv; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // TODO(jkoleszar): In principle, pred_w, pred_h are unnecessary, as we could | |
| 143 // calculate the subsampled BLOCK_SIZE, but that type isn't defined for | |
| 144 // sizes smaller than 16x16 yet. | |
| 145 static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, | 142 static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, |
| 146 int bw, int bh, | 143 int bw, int bh, |
| 147 int x, int y, int w, int h, | 144 int x, int y, int w, int h, |
| 148 int mi_x, int mi_y) { | 145 int mi_x, int mi_y) { |
| 149 struct macroblockd_plane *const pd = &xd->plane[plane]; | 146 struct macroblockd_plane *const pd = &xd->plane[plane]; |
| 150 const MODE_INFO *mi = xd->mi_8x8[0]; | 147 const MODE_INFO *mi = xd->mi_8x8[0]; |
| 151 const int is_compound = has_second_ref(&mi->mbmi); | 148 const int is_compound = has_second_ref(&mi->mbmi); |
| 152 int ref; | 149 int ref; |
| 153 | 150 |
| 154 for (ref = 0; ref < 1 + is_compound; ++ref) { | 151 for (ref = 0; ref < 1 + is_compound; ++ref) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 237 } |
| 241 void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, | 238 void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, |
| 242 BLOCK_SIZE bsize) { | 239 BLOCK_SIZE bsize) { |
| 243 build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, | 240 build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, |
| 244 MAX_MB_PLANE - 1); | 241 MAX_MB_PLANE - 1); |
| 245 } | 242 } |
| 246 | 243 |
| 247 // TODO(jingning): This function serves as a placeholder for decoder prediction | 244 // TODO(jingning): This function serves as a placeholder for decoder prediction |
| 248 // using on demand border extension. It should be moved to /decoder/ directory. | 245 // using on demand border extension. It should be moved to /decoder/ directory. |
| 249 static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block, | 246 static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block, |
| 250 int bw, int bh, | |
| 251 int x, int y, int w, int h, | 247 int x, int y, int w, int h, |
| 252 int mi_x, int mi_y) { | 248 int mi_x, int mi_y) { |
| 253 struct macroblockd_plane *const pd = &xd->plane[plane]; | 249 struct macroblockd_plane *const pd = &xd->plane[plane]; |
| 254 const MODE_INFO *mi = xd->mi_8x8[0]; | 250 const MODE_INFO *mi = xd->mi_8x8[0]; |
| 255 const int is_compound = has_second_ref(&mi->mbmi); | 251 const int is_compound = has_second_ref(&mi->mbmi); |
| 256 int ref; | 252 int ref; |
| 257 | 253 |
| 258 for (ref = 0; ref < 1 + is_compound; ++ref) { | 254 for (ref = 0; ref < 1 + is_compound; ++ref) { |
| 259 const struct scale_factors *const sf = &xd->block_refs[ref]->sf; | 255 const struct scale_factors *const sf = &xd->block_refs[ref]->sf; |
| 260 struct buf_2d *const pre_buf = &pd->pre[ref]; | 256 struct buf_2d *const pre_buf = &pd->pre[ref]; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; | 370 const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; |
| 375 const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; | 371 const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; |
| 376 const int bw = 4 * num_4x4_w; | 372 const int bw = 4 * num_4x4_w; |
| 377 const int bh = 4 * num_4x4_h; | 373 const int bh = 4 * num_4x4_h; |
| 378 | 374 |
| 379 if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) { | 375 if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) { |
| 380 int i = 0, x, y; | 376 int i = 0, x, y; |
| 381 assert(bsize == BLOCK_8X8); | 377 assert(bsize == BLOCK_8X8); |
| 382 for (y = 0; y < num_4x4_h; ++y) | 378 for (y = 0; y < num_4x4_h; ++y) |
| 383 for (x = 0; x < num_4x4_w; ++x) | 379 for (x = 0; x < num_4x4_w; ++x) |
| 384 dec_build_inter_predictors(xd, plane, i++, bw, bh, | 380 dec_build_inter_predictors(xd, plane, i++, |
| 385 4 * x, 4 * y, 4, 4, mi_x, mi_y); | 381 4 * x, 4 * y, 4, 4, mi_x, mi_y); |
| 386 } else { | 382 } else { |
| 387 dec_build_inter_predictors(xd, plane, 0, bw, bh, | 383 dec_build_inter_predictors(xd, plane, 0, |
| 388 0, 0, bw, bh, mi_x, mi_y); | 384 0, 0, bw, bh, mi_x, mi_y); |
| 389 } | 385 } |
| 390 } | 386 } |
| 391 } | 387 } |
| OLD | NEW |