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

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

Issue 1162573005: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 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
11 #include <assert.h> 11 #include <assert.h>
12 #include <math.h> 12 #include <math.h>
13 #include <stdio.h> 13 #include <stdio.h>
14 14
15 #include "./vp9_rtcd.h" 15 #include "./vp9_rtcd.h"
16 16
17 #include "vpx_mem/vpx_mem.h" 17 #include "vpx_mem/vpx_mem.h"
18 #include "vpx_ports/mem.h"
18 19
19 #include "vp9/common/vp9_common.h" 20 #include "vp9/common/vp9_common.h"
20 #include "vp9/common/vp9_entropy.h" 21 #include "vp9/common/vp9_entropy.h"
21 #include "vp9/common/vp9_entropymode.h" 22 #include "vp9/common/vp9_entropymode.h"
22 #include "vp9/common/vp9_mvref_common.h" 23 #include "vp9/common/vp9_mvref_common.h"
23 #include "vp9/common/vp9_pred_common.h" 24 #include "vp9/common/vp9_pred_common.h"
24 #include "vp9/common/vp9_quant_common.h" 25 #include "vp9/common/vp9_quant_common.h"
25 #include "vp9/common/vp9_reconinter.h" 26 #include "vp9/common/vp9_reconinter.h"
26 #include "vp9/common/vp9_reconintra.h" 27 #include "vp9/common/vp9_reconintra.h"
27 #include "vp9/common/vp9_seg_common.h" 28 #include "vp9/common/vp9_seg_common.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Initialize the sad lut tables using a formulaic calculation for now. 122 // Initialize the sad lut tables using a formulaic calculation for now.
122 // This is to make it easier to resolve the impact of experimental changes 123 // This is to make it easier to resolve the impact of experimental changes
123 // to the quantizer tables. 124 // to the quantizer tables.
124 for (i = 0; i < range; i++) { 125 for (i = 0; i < range; i++) {
125 const double q = vp9_convert_qindex_to_q(i, bit_depth); 126 const double q = vp9_convert_qindex_to_q(i, bit_depth);
126 bit16lut[i] = (int)(0.0418 * q + 2.4107); 127 bit16lut[i] = (int)(0.0418 * q + 2.4107);
127 bit4lut[i] = (int)(0.063 * q + 2.742); 128 bit4lut[i] = (int)(0.063 * q + 2.742);
128 } 129 }
129 } 130 }
130 131
131 void vp9_init_me_luts() { 132 void vp9_init_me_luts(void) {
132 init_me_luts_bd(sad_per_bit16lut_8, sad_per_bit4lut_8, QINDEX_RANGE, 133 init_me_luts_bd(sad_per_bit16lut_8, sad_per_bit4lut_8, QINDEX_RANGE,
133 VPX_BITS_8); 134 VPX_BITS_8);
134 #if CONFIG_VP9_HIGHBITDEPTH 135 #if CONFIG_VP9_HIGHBITDEPTH
135 init_me_luts_bd(sad_per_bit16lut_10, sad_per_bit4lut_10, QINDEX_RANGE, 136 init_me_luts_bd(sad_per_bit16lut_10, sad_per_bit4lut_10, QINDEX_RANGE,
136 VPX_BITS_10); 137 VPX_BITS_10);
137 init_me_luts_bd(sad_per_bit16lut_12, sad_per_bit4lut_12, QINDEX_RANGE, 138 init_me_luts_bd(sad_per_bit16lut_12, sad_per_bit4lut_12, QINDEX_RANGE,
138 VPX_BITS_12); 139 VPX_BITS_12);
139 #endif 140 #endif
140 } 141 }
141 142
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 return ROUND_POWER_OF_TWO(5 * q, 2); 655 return ROUND_POWER_OF_TWO(5 * q, 2);
655 default: 656 default:
656 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); 657 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12");
657 return -1; 658 return -1;
658 } 659 }
659 #else 660 #else
660 return 20 * q; 661 return 20 * q;
661 #endif // CONFIG_VP9_HIGHBITDEPTH 662 #endif // CONFIG_VP9_HIGHBITDEPTH
662 } 663 }
663 664
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