summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/vlc.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/vlc.h')
-rw-r--r--apps/plugins/mpegplayer/vlc.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/apps/plugins/mpegplayer/vlc.h b/apps/plugins/mpegplayer/vlc.h
index dbef8f881f..90245cc8ea 100644
--- a/apps/plugins/mpegplayer/vlc.h
+++ b/apps/plugins/mpegplayer/vlc.h
@@ -21,35 +21,35 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23 23
24#define GETWORD(bit_buf,shift,bit_ptr) \ 24#define GETWORD(bit_buf, shift, bit_ptr) \
25do { \ 25do { \
26 bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \ 26 bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \
27 bit_ptr += 2; \ 27 bit_ptr += 2; \
28} while (0) 28} while (0)
29 29
30static inline void bitstream_init (mpeg2_decoder_t * decoder, 30static inline void bitstream_init (mpeg2_decoder_t * decoder,
31 const uint8_t * start) 31 const uint8_t * start)
32{ 32{
33 decoder->bitstream_buf = 33 decoder->bitstream_buf =
34 (start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3]; 34 (start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3];
35 decoder->bitstream_ptr = start + 4; 35 decoder->bitstream_ptr = start + 4;
36 decoder->bitstream_bits = -16; 36 decoder->bitstream_bits = -16;
37} 37}
38 38
39/* make sure that there are at least 16 valid bits in bit_buf */ 39/* make sure that there are at least 16 valid bits in bit_buf */
40#define NEEDBITS(bit_buf,bits,bit_ptr) \ 40#define NEEDBITS(bit_buf, bits, bit_ptr) \
41do { \ 41do { \
42 if (unlikely (bits > 0)) { \ 42 if (unlikely (bits > 0)) { \
43 GETWORD (bit_buf, bits, bit_ptr); \ 43 GETWORD (bit_buf, bits, bit_ptr); \
44 bits -= 16; \ 44 bits -= 16; \
45 } \ 45 } \
46} while (0) 46} while (0)
47 47
48/* remove num valid bits from bit_buf */ 48/* remove num valid bits from bit_buf */
49#define DUMPBITS(bit_buf,bits,num) \ 49#define DUMPBITS(bit_buf, bits, num) \
50do { \ 50do { \
51 bit_buf <<= (num); \ 51 bit_buf <<= (num); \
52 bits += (num); \ 52 bits += (num); \
53} while (0) 53} while (0)
54 54
55/* take num bits from the high part of bit_buf and zero extend them */ 55/* take num bits from the high part of bit_buf and zero extend them */
@@ -124,7 +124,7 @@ static const MBtab MB_B [] ICONST_ATTR = {
124 {0, 0}, {INTRA|QUANT, 6}, 124 {0, 0}, {INTRA|QUANT, 6},
125 {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6}, 125 {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6},
126 {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5}, 126 {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5},
127 {INTRA, 5}, {INTRA, 5}, 127 {INTRA, 5}, {INTRA, 5},
128 {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4}, 128 {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4},
129 {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, 129 {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4},
130 {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, 130 {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3},
@@ -301,7 +301,7 @@ static const DCTtab DCT_B14_8 [] ICONST_ATTR = {
301}; 301};
302 302
303static const DCTtab DCT_B14AC_5 [] ICONST_ATTR = { 303static const DCTtab DCT_B14AC_5 [] ICONST_ATTR = {
304 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, 304 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
305 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, 305 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
306 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, 306 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
307 {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, 307 {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2},
@@ -311,7 +311,7 @@ static const DCTtab DCT_B14AC_5 [] ICONST_ATTR = {
311}; 311};
312 312
313static const DCTtab DCT_B14DC_5 [] ICONST_ATTR = { 313static const DCTtab DCT_B14DC_5 [] ICONST_ATTR = {
314 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, 314 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
315 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, 315 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
316 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, 316 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
317 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, 317 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1},
@@ -393,7 +393,7 @@ static const DCTtab DCT_B15_8 [] ICONST_ATTR = {
393 393
394 394
395static const MBAtab MBA_5 [] ICONST_ATTR = { 395static const MBAtab MBA_5 [] ICONST_ATTR = {
396 {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4}, 396 {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
397 {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, 397 {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
398 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, 398 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1},
399 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1} 399 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}