Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: source/libvpx/vp9/encoder/vp9_rd.c

Issue 996503002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_rd.h ('k') | source/libvpx/vp9/encoder/vp9_rdopt.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 const int x = 4 * (raster_block & ((1 << bw) - 1)); 525 const int x = 4 * (raster_block & ((1 << bw) - 1));
526 return y * stride + x; 526 return y * stride + x;
527 } 527 }
528 528
529 int16_t* vp9_raster_block_offset_int16(BLOCK_SIZE plane_bsize, 529 int16_t* vp9_raster_block_offset_int16(BLOCK_SIZE plane_bsize,
530 int raster_block, int16_t *base) { 530 int raster_block, int16_t *base) {
531 const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; 531 const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
532 return base + vp9_raster_block_offset(plane_bsize, raster_block, stride); 532 return base + vp9_raster_block_offset(plane_bsize, raster_block, stride);
533 } 533 }
534 534
535 const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, 535 YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi,
536 int ref_frame) { 536 int ref_frame) {
537 const VP9_COMMON *const cm = &cpi->common; 537 const VP9_COMMON *const cm = &cpi->common;
538 const int ref_idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)];
539 const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1]; 538 const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1];
540 return (scaled_idx != ref_idx) ? 539 const int ref_idx = get_ref_frame_buf_idx(cpi, ref_frame);
541 &cm->buffer_pool->frame_bufs[scaled_idx].buf : NULL; 540 return
541 (scaled_idx != ref_idx && scaled_idx != INVALID_IDX) ?
542 &cm->buffer_pool->frame_bufs[scaled_idx].buf : NULL;
542 } 543 }
543 544
544 int vp9_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) { 545 int vp9_get_switchable_rate(const VP9_COMP *cpi, const MACROBLOCKD *const xd) {
545 const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi; 546 const MB_MODE_INFO *const mbmi = &xd->mi[0].src_mi->mbmi;
546 const int ctx = vp9_get_pred_context_switchable_interp(xd); 547 const int ctx = vp9_get_pred_context_switchable_interp(xd);
547 return SWITCHABLE_INTERP_RATE_FACTOR * 548 return SWITCHABLE_INTERP_RATE_FACTOR *
548 cpi->switchable_interp_costs[ctx][mbmi->interp_filter]; 549 cpi->switchable_interp_costs[ctx][mbmi->interp_filter];
549 } 550 }
550 551
551 void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) { 552 void vp9_set_rd_speed_thresholds(VP9_COMP *cpi) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return ROUND_POWER_OF_TWO(5 * q, 2); 648 return ROUND_POWER_OF_TWO(5 * q, 2);
648 default: 649 default:
649 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");
650 return -1; 651 return -1;
651 } 652 }
652 #else 653 #else
653 return 20 * q; 654 return 20 * q;
654 #endif // CONFIG_VP9_HIGHBITDEPTH 655 #endif // CONFIG_VP9_HIGHBITDEPTH
655 } 656 }
656 657
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_rd.h ('k') | source/libvpx/vp9/encoder/vp9_rdopt.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698