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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } variance_node; | 253 } variance_node; |
254 | 254 |
255 typedef enum { | 255 typedef enum { |
256 V16X16, | 256 V16X16, |
257 V32X32, | 257 V32X32, |
258 V64X64, | 258 V64X64, |
259 } TREE_LEVEL; | 259 } TREE_LEVEL; |
260 | 260 |
261 static void tree_to_node(void *data, BLOCK_SIZE bsize, variance_node *node) { | 261 static void tree_to_node(void *data, BLOCK_SIZE bsize, variance_node *node) { |
262 int i; | 262 int i; |
| 263 node->part_variances = NULL; |
| 264 vpx_memset(node->split, 0, sizeof(node->split)); |
263 switch (bsize) { | 265 switch (bsize) { |
264 case BLOCK_64X64: { | 266 case BLOCK_64X64: { |
265 v64x64 *vt = (v64x64 *) data; | 267 v64x64 *vt = (v64x64 *) data; |
266 node->part_variances = &vt->part_variances; | 268 node->part_variances = &vt->part_variances; |
267 for (i = 0; i < 4; i++) | 269 for (i = 0; i < 4; i++) |
268 node->split[i] = &vt->split[i].part_variances.none; | 270 node->split[i] = &vt->split[i].part_variances.none; |
269 break; | 271 break; |
270 } | 272 } |
271 case BLOCK_32X32: { | 273 case BLOCK_32X32: { |
272 v32x32 *vt = (v32x32 *) data; | 274 v32x32 *vt = (v32x32 *) data; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 rd_opt->comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff; | 633 rd_opt->comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff; |
632 rd_opt->comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff; | 634 rd_opt->comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff; |
633 | 635 |
634 for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) | 636 for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) |
635 rd_opt->filter_diff[i] += ctx->best_filter_diff[i]; | 637 rd_opt->filter_diff[i] += ctx->best_filter_diff[i]; |
636 } | 638 } |
637 } | 639 } |
638 | 640 |
639 void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src, | 641 void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src, |
640 int mi_row, int mi_col) { | 642 int mi_row, int mi_col) { |
641 uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer, | 643 uint8_t *const buffers[3] = {src->y_buffer, src->u_buffer, src->v_buffer }; |
642 src->alpha_buffer}; | 644 const int strides[3] = {src->y_stride, src->uv_stride, src->uv_stride }; |
643 const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, | |
644 src->alpha_stride}; | |
645 int i; | 645 int i; |
646 | 646 |
647 // Set current frame pointer. | 647 // Set current frame pointer. |
648 x->e_mbd.cur_buf = src; | 648 x->e_mbd.cur_buf = src; |
649 | 649 |
650 for (i = 0; i < MAX_MB_PLANE; i++) | 650 for (i = 0; i < MAX_MB_PLANE; i++) |
651 setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mi_row, mi_col, | 651 setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mi_row, mi_col, |
652 NULL, x->e_mbd.plane[i].subsampling_x, | 652 NULL, x->e_mbd.plane[i].subsampling_x, |
653 x->e_mbd.plane[i].subsampling_y); | 653 x->e_mbd.plane[i].subsampling_y); |
654 } | 654 } |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 } | 2355 } |
2356 } | 2356 } |
2357 } | 2357 } |
2358 | 2358 |
2359 static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { | 2359 static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) { |
2360 if (frame_is_intra_only(&cpi->common)) | 2360 if (frame_is_intra_only(&cpi->common)) |
2361 return INTRA_FRAME; | 2361 return INTRA_FRAME; |
2362 else if (cpi->rc.is_src_frame_alt_ref && cpi->refresh_golden_frame) | 2362 else if (cpi->rc.is_src_frame_alt_ref && cpi->refresh_golden_frame) |
2363 return ALTREF_FRAME; | 2363 return ALTREF_FRAME; |
2364 else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) | 2364 else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) |
| 2365 return GOLDEN_FRAME; |
| 2366 else |
2365 return LAST_FRAME; | 2367 return LAST_FRAME; |
2366 else | |
2367 return GOLDEN_FRAME; | |
2368 } | 2368 } |
2369 | 2369 |
2370 static TX_MODE select_tx_mode(const VP9_COMP *cpi) { | 2370 static TX_MODE select_tx_mode(const VP9_COMP *cpi) { |
2371 if (cpi->mb.e_mbd.lossless) { | 2371 if (cpi->mb.e_mbd.lossless) { |
2372 return ONLY_4X4; | 2372 return ONLY_4X4; |
2373 } else if (cpi->common.current_video_frame == 0) { | 2373 } else if (cpi->common.current_video_frame == 0) { |
2374 return TX_MODE_SELECT; | 2374 return TX_MODE_SELECT; |
2375 } else { | 2375 } else { |
2376 if (cpi->sf.tx_size_search_method == USE_LARGESTALL) { | 2376 if (cpi->sf.tx_size_search_method == USE_LARGESTALL) { |
2377 return ALLOW_32X32; | 2377 return ALLOW_32X32; |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3426 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; | 3426 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; |
3427 } | 3427 } |
3428 | 3428 |
3429 for (y = 0; y < mi_height; y++) | 3429 for (y = 0; y < mi_height; y++) |
3430 for (x = 0; x < mi_width; x++) | 3430 for (x = 0; x < mi_width; x++) |
3431 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) | 3431 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) |
3432 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size; | 3432 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size; |
3433 } | 3433 } |
3434 } | 3434 } |
3435 } | 3435 } |
OLD | NEW |