| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 int raster_block, int16_t *base) { | 528 int raster_block, int16_t *base) { |
| 529 const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; | 529 const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; |
| 530 return base + vp9_raster_block_offset(plane_bsize, raster_block, stride); | 530 return base + vp9_raster_block_offset(plane_bsize, raster_block, stride); |
| 531 } | 531 } |
| 532 | 532 |
| 533 const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, | 533 const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, |
| 534 int ref_frame) { | 534 int ref_frame) { |
| 535 const VP9_COMMON *const cm = &cpi->common; | 535 const VP9_COMMON *const cm = &cpi->common; |
| 536 const int ref_idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)]; | 536 const int ref_idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)]; |
| 537 const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1]; | 537 const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1]; |
| 538 return (scaled_idx != ref_idx) ? | 538 return (scaled_idx != ref_idx) ? &cm->frame_bufs[scaled_idx].buf : NULL; |
| 539 &cm->buffer_pool->frame_bufs[scaled_idx].buf : NULL; | |
| 540 } | 539 } |
| 541 | 540 |
| 542 int vp9_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) { | 541 int vp9_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) { |
| 543 const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; | 542 const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; |
| 544 const int ctx = vp9_get_pred_context_switchable_interp(xd); | 543 const int ctx = vp9_get_pred_context_switchable_interp(xd); |
| 545 return SWITCHABLE_INTERP_RATE_FACTOR * | 544 return SWITCHABLE_INTERP_RATE_FACTOR * |
| 546 cpi->switchable_interp_costs[ctx][mbmi->interp_filter]; | 545 cpi->switchable_interp_costs[ctx][mbmi->interp_filter]; |
| 547 } | 546 } |
| 548 | 547 |
| 549 void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) { | 548 void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 564 rd->thresh_mult[THR_NEARESTG] = 0; | 563 rd->thresh_mult[THR_NEARESTG] = 0; |
| 565 rd->thresh_mult[THR_NEARESTA] = 0; | 564 rd->thresh_mult[THR_NEARESTA] = 0; |
| 566 } | 565 } |
| 567 | 566 |
| 568 rd->thresh_mult[THR_DC] += 1000; | 567 rd->thresh_mult[THR_DC] += 1000; |
| 569 | 568 |
| 570 rd->thresh_mult[THR_NEWMV] += 1000; | 569 rd->thresh_mult[THR_NEWMV] += 1000; |
| 571 rd->thresh_mult[THR_NEWA] += 1000; | 570 rd->thresh_mult[THR_NEWA] += 1000; |
| 572 rd->thresh_mult[THR_NEWG] += 1000; | 571 rd->thresh_mult[THR_NEWG] += 1000; |
| 573 | 572 |
| 573 // Adjust threshold only in real time mode, which only uses last |
| 574 // reference frame. |
| 575 rd->thresh_mult[THR_NEWMV] += sf->elevate_newmv_thresh; |
| 576 |
| 574 rd->thresh_mult[THR_NEARMV] += 1000; | 577 rd->thresh_mult[THR_NEARMV] += 1000; |
| 575 rd->thresh_mult[THR_NEARA] += 1000; | 578 rd->thresh_mult[THR_NEARA] += 1000; |
| 576 rd->thresh_mult[THR_COMP_NEARESTLA] += 1000; | 579 rd->thresh_mult[THR_COMP_NEARESTLA] += 1000; |
| 577 rd->thresh_mult[THR_COMP_NEARESTGA] += 1000; | 580 rd->thresh_mult[THR_COMP_NEARESTGA] += 1000; |
| 578 | 581 |
| 579 rd->thresh_mult[THR_TM] += 1000; | 582 rd->thresh_mult[THR_TM] += 1000; |
| 580 | 583 |
| 581 rd->thresh_mult[THR_COMP_NEARLA] += 1500; | 584 rd->thresh_mult[THR_COMP_NEARLA] += 1500; |
| 582 rd->thresh_mult[THR_COMP_NEWLA] += 2000; | 585 rd->thresh_mult[THR_COMP_NEWLA] += 2000; |
| 583 rd->thresh_mult[THR_NEARG] += 1000; | 586 rd->thresh_mult[THR_NEARG] += 1000; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 return ROUND_POWER_OF_TWO(5 * q, 2); | 648 return ROUND_POWER_OF_TWO(5 * q, 2); |
| 646 default: | 649 default: |
| 647 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); | 650 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); |
| 648 return -1; | 651 return -1; |
| 649 } | 652 } |
| 650 #else | 653 #else |
| 651 return 20 * q; | 654 return 20 * q; |
| 652 #endif // CONFIG_VP9_HIGHBITDEPTH | 655 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 653 } | 656 } |
| 654 | 657 |
| OLD | NEW |