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

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

Issue 11555023: libvpx: Add VP9 decoder. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 8 years 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11
12 #include "vp9/encoder/vp9_treewriter.h"
13
14 static void cost(
15 int *const C,
16 vp9_tree T,
17 const vp9_prob *const P,
18 int i,
19 int c
20 ) {
21 const vp9_prob p = P [i >> 1];
22
23 do {
24 const vp9_tree_index j = T[i];
25 const int d = c + vp9_cost_bit(p, i & 1);
26
27 if (j <= 0)
28 C[-j] = d;
29 else
30 cost(C, T, P, j, d);
31 } while (++i & 1);
32 }
33 void vp9_cost_tokens(int *c, const vp9_prob *p, vp9_tree t) {
34 cost(c, t, p, 0, 0);
35 }
36
37 void vp9_cost_tokens_skip(int *c, const vp9_prob *p, vp9_tree t) {
38 cost(c, t, p, 2, 0);
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698