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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 assert(ss_idx <= 3 && ss_idx >= 0); | 165 assert(ss_idx <= 3 && ss_idx >= 0); |
166 } | 166 } |
167 return res; | 167 return res; |
168 } | 168 } |
169 | 169 |
170 void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, | 170 void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, |
171 int bw, int bh, | 171 int bw, int bh, |
172 int x, int y, int w, int h, | 172 int x, int y, int w, int h, |
173 int mi_x, int mi_y) { | 173 int mi_x, int mi_y) { |
174 struct macroblockd_plane *const pd = &xd->plane[plane]; | 174 struct macroblockd_plane *const pd = &xd->plane[plane]; |
175 const MODE_INFO *mi = xd->mi[0].src_mi; | 175 const MODE_INFO *mi = xd->mi[0]; |
176 const int is_compound = has_second_ref(&mi->mbmi); | 176 const int is_compound = has_second_ref(&mi->mbmi); |
177 const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter); | 177 const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter); |
178 int ref; | 178 int ref; |
179 | 179 |
180 for (ref = 0; ref < 1 + is_compound; ++ref) { | 180 for (ref = 0; ref < 1 + is_compound; ++ref) { |
181 const struct scale_factors *const sf = &xd->block_refs[ref]->sf; | 181 const struct scale_factors *const sf = &xd->block_refs[ref]->sf; |
182 struct buf_2d *const pre_buf = &pd->pre[ref]; | 182 struct buf_2d *const pre_buf = &pd->pre[ref]; |
183 struct buf_2d *const dst_buf = &pd->dst; | 183 struct buf_2d *const dst_buf = &pd->dst; |
184 uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x; | 184 uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x; |
185 const MV mv = mi->mbmi.sb_type < BLOCK_8X8 | 185 const MV mv = mi->mbmi.sb_type < BLOCK_8X8 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 const int mi_x = mi_col * MI_SIZE; | 239 const int mi_x = mi_col * MI_SIZE; |
240 const int mi_y = mi_row * MI_SIZE; | 240 const int mi_y = mi_row * MI_SIZE; |
241 for (plane = plane_from; plane <= plane_to; ++plane) { | 241 for (plane = plane_from; plane <= plane_to; ++plane) { |
242 const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, | 242 const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, |
243 &xd->plane[plane]); | 243 &xd->plane[plane]); |
244 const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; | 244 const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; |
245 const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; | 245 const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; |
246 const int bw = 4 * num_4x4_w; | 246 const int bw = 4 * num_4x4_w; |
247 const int bh = 4 * num_4x4_h; | 247 const int bh = 4 * num_4x4_h; |
248 | 248 |
249 if (xd->mi[0].src_mi->mbmi.sb_type < BLOCK_8X8) { | 249 if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) { |
250 int i = 0, x, y; | 250 int i = 0, x, y; |
251 assert(bsize == BLOCK_8X8); | 251 assert(bsize == BLOCK_8X8); |
252 for (y = 0; y < num_4x4_h; ++y) | 252 for (y = 0; y < num_4x4_h; ++y) |
253 for (x = 0; x < num_4x4_w; ++x) | 253 for (x = 0; x < num_4x4_w; ++x) |
254 build_inter_predictors(xd, plane, i++, bw, bh, | 254 build_inter_predictors(xd, plane, i++, bw, bh, |
255 4 * x, 4 * y, 4, 4, mi_x, mi_y); | 255 4 * x, 4 * y, 4, 4, mi_x, mi_y); |
256 } else { | 256 } else { |
257 build_inter_predictors(xd, plane, 0, bw, bh, | 257 build_inter_predictors(xd, plane, 0, bw, bh, |
258 0, 0, bw, bh, mi_x, mi_y); | 258 0, 0, bw, bh, mi_x, mi_y); |
259 } | 259 } |
(...skipping 18 matching lines...) Expand all Loading... |
278 | 278 |
279 void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, | 279 void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, |
280 BLOCK_SIZE bsize) { | 280 BLOCK_SIZE bsize) { |
281 build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, | 281 build_inter_predictors_for_planes(xd, bsize, mi_row, mi_col, 0, |
282 MAX_MB_PLANE - 1); | 282 MAX_MB_PLANE - 1); |
283 } | 283 } |
284 | 284 |
285 void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE], | 285 void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE], |
286 const YV12_BUFFER_CONFIG *src, | 286 const YV12_BUFFER_CONFIG *src, |
287 int mi_row, int mi_col) { | 287 int mi_row, int mi_col) { |
288 uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, | 288 uint8_t *const buffers[MAX_MB_PLANE] = { src->y_buffer, src->u_buffer, |
289 src->alpha_buffer}; | 289 src->v_buffer}; |
290 const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, | 290 const int strides[MAX_MB_PLANE] = { src->y_stride, src->uv_stride, |
291 src->alpha_stride}; | 291 src->uv_stride}; |
292 int i; | 292 int i; |
293 | 293 |
294 for (i = 0; i < MAX_MB_PLANE; ++i) { | 294 for (i = 0; i < MAX_MB_PLANE; ++i) { |
295 struct macroblockd_plane *const pd = &planes[i]; | 295 struct macroblockd_plane *const pd = &planes[i]; |
296 setup_pred_plane(&pd->dst, buffers[i], strides[i], mi_row, mi_col, NULL, | 296 setup_pred_plane(&pd->dst, buffers[i], strides[i], mi_row, mi_col, NULL, |
297 pd->subsampling_x, pd->subsampling_y); | 297 pd->subsampling_x, pd->subsampling_y); |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx, | 301 void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx, |
302 const YV12_BUFFER_CONFIG *src, | 302 const YV12_BUFFER_CONFIG *src, |
303 int mi_row, int mi_col, | 303 int mi_row, int mi_col, |
304 const struct scale_factors *sf) { | 304 const struct scale_factors *sf) { |
305 if (src != NULL) { | 305 if (src != NULL) { |
306 int i; | 306 int i; |
307 uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, | 307 uint8_t *const buffers[MAX_MB_PLANE] = { src->y_buffer, src->u_buffer, |
308 src->alpha_buffer}; | 308 src->v_buffer}; |
309 const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, | 309 const int strides[MAX_MB_PLANE] = { src->y_stride, src->uv_stride, |
310 src->alpha_stride}; | 310 src->uv_stride}; |
311 | |
312 for (i = 0; i < MAX_MB_PLANE; ++i) { | 311 for (i = 0; i < MAX_MB_PLANE; ++i) { |
313 struct macroblockd_plane *const pd = &xd->plane[i]; | 312 struct macroblockd_plane *const pd = &xd->plane[i]; |
314 setup_pred_plane(&pd->pre[idx], buffers[i], strides[i], mi_row, mi_col, | 313 setup_pred_plane(&pd->pre[idx], buffers[i], strides[i], mi_row, mi_col, |
315 sf, pd->subsampling_x, pd->subsampling_y); | 314 sf, pd->subsampling_x, pd->subsampling_y); |
316 } | 315 } |
317 } | 316 } |
318 } | 317 } |
OLD | NEW |