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

Side by Side Diff: source/libvpx/vp9/common/vp9_treecoder.h

Issue 23600008: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 static INLINE vp9_prob get_binary_prob(int n0, int n1) { 73 static INLINE vp9_prob get_binary_prob(int n0, int n1) {
74 return get_prob(n0, n0 + n1); 74 return get_prob(n0, n0 + n1);
75 } 75 }
76 76
77 /* this function assumes prob1 and prob2 are already within [1,255] range */ 77 /* this function assumes prob1 and prob2 are already within [1,255] range */
78 static INLINE vp9_prob weighted_prob(int prob1, int prob2, int factor) { 78 static INLINE vp9_prob weighted_prob(int prob1, int prob2, int factor) {
79 return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8); 79 return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8);
80 } 80 }
81 81
82 static INLINE vp9_prob merge_probs(vp9_prob pre_prob, vp9_prob prob,
83 const unsigned int ct[2],
84 unsigned int count_sat,
85 unsigned int max_update_factor) {
86 const unsigned int count = MIN(ct[0] + ct[1], count_sat);
87 const unsigned int factor = max_update_factor * count / count_sat;
88 return weighted_prob(pre_prob, prob, factor);
89 }
90
91 static INLINE vp9_prob merge_probs2(vp9_prob pre_prob,
92 const unsigned int ct[2],
93 unsigned int count_sat,
94 unsigned int max_update_factor) {
95 return merge_probs(pre_prob, get_binary_prob(ct[0], ct[1]), ct, count_sat,
96 max_update_factor);
97 }
98
99
82 #endif // VP9_COMMON_VP9_TREECODER_H_ 100 #endif // VP9_COMMON_VP9_TREECODER_H_
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_tile_common.c ('k') | source/libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698