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)) const unsigned char vp8_norm[256] = {
16 const unsigned char vp8_norm[256] __attribute__ ((aligned (16))) = {
18 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
19 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
20 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
21 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
22 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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 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,
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};
36 vp8dx_start_decode (BOOL_DECODER * br,
37 const unsigned char *source, unsigned int source_sz)
39 br->user_buffer_end = source + source_sz;
40 br->user_buffer = source;
45 if (source_sz && !source)
48 /* Populate the buffer */
49 vp8dx_bool_decoder_fill (br);
56 vp8dx_bool_decoder_fill (BOOL_DECODER * br)
58 const unsigned char *bufptr;
59 const unsigned char *bufend;
62 bufend = br->user_buffer_end;
63 bufptr = br->user_buffer;
67 VP8DX_BOOL_DECODER_FILL (count, value, bufptr, bufend);
69 br->user_buffer = bufptr;