2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the dboolhuff.LICENSE file in this directory.
6 * See the libvpx original distribution for more information,
7 * including patent information, and author information.
11 #include "dboolhuff.h"
13 const unsigned char vp8_norm[256] __attribute__ ((aligned (16))) = {
14 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
15 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
16 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
17 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
18 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
19 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
20 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
21 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
22 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
23 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
24 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
25 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
32 vp8dx_start_decode (BOOL_DECODER * br,
33 const unsigned char *source, unsigned int source_sz)
35 br->user_buffer_end = source + source_sz;
36 br->user_buffer = source;
41 if (source_sz && !source)
44 /* Populate the buffer */
45 vp8dx_bool_decoder_fill (br);
52 vp8dx_bool_decoder_fill (BOOL_DECODER * br)
54 const unsigned char *bufptr;
55 const unsigned char *bufend;
58 bufend = br->user_buffer_end;
59 bufptr = br->user_buffer;
63 VP8DX_BOOL_DECODER_FILL (count, value, bufptr, bufend);
65 br->user_buffer = bufptr;