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

Side by Side Diff: source/libvpx/vp9/common/vp9_entropy.c

Issue 1217053002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 5 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/common/vp9_entropy.h ('k') | source/libvpx/vp9/common/vp9_entropymode.h » ('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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 }; 126 };
127 127
128 const uint8_t vp9_coefband_trans_4x4[16] = { 128 const uint8_t vp9_coefband_trans_4x4[16] = {
129 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 129 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5,
130 }; 130 };
131 131
132 const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = { 132 const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = {
133 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5 133 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5
134 }; 134 };
135 135
136 const vp9_tree_index vp9_coefmodel_tree[TREE_SIZE(UNCONSTRAINED_NODES + 1)] = {
137 -EOB_MODEL_TOKEN, 2,
138 -ZERO_TOKEN, 4,
139 -ONE_TOKEN, -TWO_TOKEN,
140 };
141
142 // Model obtained from a 2-sided zero-centerd distribuition derived 136 // Model obtained from a 2-sided zero-centerd distribuition derived
143 // from a Pareto distribution. The cdf of the distribution is: 137 // from a Pareto distribution. The cdf of the distribution is:
144 // cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta] 138 // cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta]
145 // 139 //
146 // For a given beta and a given probablity of the 1-node, the alpha 140 // For a given beta and a given probablity of the 1-node, the alpha
147 // is first solved, and then the {alpha, beta} pair is used to generate 141 // is first solved, and then the {alpha, beta} pair is used to generate
148 // the probabilities for the rest of the nodes. 142 // the probabilities for the rest of the nodes.
149 143
150 // beta = 8 144 // beta = 8
151 145
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 } else if (cm->last_frame_type == KEY_FRAME) { 808 } else if (cm->last_frame_type == KEY_FRAME) {
815 update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ 809 update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */
816 count_sat = COEF_COUNT_SAT_AFTER_KEY; 810 count_sat = COEF_COUNT_SAT_AFTER_KEY;
817 } else { 811 } else {
818 update_factor = COEF_MAX_UPDATE_FACTOR; 812 update_factor = COEF_MAX_UPDATE_FACTOR;
819 count_sat = COEF_COUNT_SAT; 813 count_sat = COEF_COUNT_SAT;
820 } 814 }
821 for (t = TX_4X4; t <= TX_32X32; t++) 815 for (t = TX_4X4; t <= TX_32X32; t++)
822 adapt_coef_probs(cm, t, count_sat, update_factor); 816 adapt_coef_probs(cm, t, count_sat, update_factor);
823 } 817 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_entropy.h ('k') | source/libvpx/vp9/common/vp9_entropymode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698