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"
14 __declspec (align (16))
15 const unsigned char vp8_norm[256] = {
17 const unsigned char vp8_norm[256] __attribute__ ((aligned (16))) = {
19 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
20 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
21 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
22 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
23 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
24 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
25 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
26 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
30 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
31 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
33 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
37 vp8dx_start_decode (BOOL_DECODER * br,
38 const unsigned char *source, unsigned int source_sz)
40 br->user_buffer_end = source + source_sz;
41 br->user_buffer = source;
46 if (source_sz && !source)
49 /* Populate the buffer */
50 vp8dx_bool_decoder_fill (br);
57 vp8dx_bool_decoder_fill (BOOL_DECODER * br)
59 const unsigned char *bufptr;
60 const unsigned char *bufend;
63 bufend = br->user_buffer_end;
64 bufptr = br->user_buffer;
68 VP8DX_BOOL_DECODER_FILL (count, value, bufptr, bufend);
70 br->user_buffer = bufptr;