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

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

Issue 54923004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « source/libvpx/vp9/common/vp9_tile_common.c ('k') | source/libvpx/vp9/common/vp9_treecoder.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 #ifndef VP9_COMMON_VP9_TREECODER_H_ 11 #ifndef VP9_COMMON_VP9_TREECODER_H_
12 #define VP9_COMMON_VP9_TREECODER_H_ 12 #define VP9_COMMON_VP9_TREECODER_H_
13 13
14 #include "./vpx_config.h" 14 #include "./vpx_config.h"
15 #include "vpx/vpx_integer.h" 15 #include "vpx/vpx_integer.h"
16 #include "vp9/common/vp9_common.h" 16 #include "vp9/common/vp9_common.h"
17 17
18 typedef uint8_t vp9_prob; 18 typedef uint8_t vp9_prob;
19 19
20 #define vp9_prob_half ((vp9_prob) 128) 20 #define vp9_prob_half ((vp9_prob) 128)
21 21
22 typedef int8_t vp9_tree_index; 22 typedef int8_t vp9_tree_index;
23 23
24 #define TREE_SIZE(leaf_count) (2 * (leaf_count) - 2)
25
24 #define vp9_complement(x) (255 - x) 26 #define vp9_complement(x) (255 - x)
25 27
26 /* We build coding trees compactly in arrays. 28 /* We build coding trees compactly in arrays.
27 Each node of the tree is a pair of vp9_tree_indices. 29 Each node of the tree is a pair of vp9_tree_indices.
28 Array index often references a corresponding probability table. 30 Array index often references a corresponding probability table.
29 Index <= 0 means done encoding/decoding and value = -Index, 31 Index <= 0 means done encoding/decoding and value = -Index,
30 Index > 0 means need another bit, specification at index. 32 Index > 0 means need another bit, specification at index.
31 Nonnegative indices are always even; processing begins at node 0. */ 33 Nonnegative indices are always even; processing begins at node 0. */
32 34
33 typedef const vp9_tree_index vp9_tree[], *vp9_tree_p; 35 typedef const vp9_tree_index vp9_tree[];
34 36
35 struct vp9_token { 37 struct vp9_token {
36 int value; 38 int value;
37 int len; 39 int len;
38 }; 40 };
39 41
40 /* Construct encoding array from tree. */ 42 /* Construct encoding array from tree. */
41 43
42 void vp9_tokens_from_tree(struct vp9_token*, vp9_tree); 44 void vp9_tokens_from_tree(struct vp9_token*, vp9_tree);
43 void vp9_tokens_from_tree_offset(struct vp9_token*, vp9_tree, int offset); 45 void vp9_tokens_from_tree_offset(struct vp9_token*, vp9_tree, int offset);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 static INLINE vp9_prob merge_probs2(vp9_prob pre_prob, 93 static INLINE vp9_prob merge_probs2(vp9_prob pre_prob,
92 const unsigned int ct[2], 94 const unsigned int ct[2],
93 unsigned int count_sat, 95 unsigned int count_sat,
94 unsigned int max_update_factor) { 96 unsigned int max_update_factor) {
95 return merge_probs(pre_prob, get_binary_prob(ct[0], ct[1]), ct, count_sat, 97 return merge_probs(pre_prob, get_binary_prob(ct[0], ct[1]), ct, count_sat,
96 max_update_factor); 98 max_update_factor);
97 } 99 }
98 100
99 101
100 #endif // VP9_COMMON_VP9_TREECODER_H_ 102 #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/vp9_treecoder.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698