rtpvrawpay: Add missing break
[platform/upstream/gst-plugins-good.git] / gst / rtp / dboolhuff.c
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 dboolhuff.LICENSE file in this directory.
6  *  See the libvpx original distribution for more information,
7  *  including patent information, and author information.
8  */
9
10
11 #include "dboolhuff.h"
12
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};
30
31 int
32 vp8dx_start_decode (BOOL_DECODER * br,
33     const unsigned char *source, unsigned int source_sz)
34 {
35   br->user_buffer_end = source + source_sz;
36   br->user_buffer = source;
37   br->value = 0;
38   br->count = -8;
39   br->range = 255;
40
41   if (source_sz && !source)
42     return 1;
43
44   /* Populate the buffer */
45   vp8dx_bool_decoder_fill (br);
46
47   return 0;
48 }
49
50
51 void
52 vp8dx_bool_decoder_fill (BOOL_DECODER * br)
53 {
54   const unsigned char *bufptr;
55   const unsigned char *bufend;
56   VP8_BD_VALUE value;
57   int count;
58   bufend = br->user_buffer_end;
59   bufptr = br->user_buffer;
60   value = br->value;
61   count = br->count;
62
63   VP8DX_BOOL_DECODER_FILL (count, value, bufptr, bufend);
64
65   br->user_buffer = bufptr;
66   br->value = value;
67   br->count = count;
68 }