1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp9/decoder/vp9_treereader.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* 1.5 + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license 1.8 + * that can be found in the LICENSE file in the root of the source 1.9 + * tree. An additional intellectual property rights grant can be found 1.10 + * in the file PATENTS. All contributing project authors may 1.11 + * be found in the AUTHORS file in the root of the source tree. 1.12 + */ 1.13 + 1.14 + 1.15 +#ifndef VP9_DECODER_VP9_TREEREADER_H_ 1.16 +#define VP9_DECODER_VP9_TREEREADER_H_ 1.17 + 1.18 +#include "vp9/common/vp9_treecoder.h" 1.19 +#include "vp9/decoder/vp9_dboolhuff.h" 1.20 + 1.21 +// Intent of tree data structure is to make decoding trivial. 1.22 +static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */ 1.23 + vp9_tree t, 1.24 + const vp9_prob *const p) { 1.25 + register vp9_tree_index i = 0; 1.26 + 1.27 + while ((i = t[ i + vp9_read(r, p[i >> 1])]) > 0) 1.28 + continue; 1.29 + 1.30 + return -i; 1.31 +} 1.32 + 1.33 +#endif // VP9_DECODER_VP9_TREEREADER_H_