summaryrefslogtreecommitdiffstats
path: root/liba52
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-08 14:49:17 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-08 14:49:17 +0000
commitf2cd1a822b65980f9e35799f955bbfd7f10b4e82 (patch)
treea8559554483a3c8b490c4c0ea5467378c22149af /liba52
parent61bcfde0a0d648b531f47134c53e63e8ea97f436 (diff)
downloadmpv-f2cd1a822b65980f9e35799f955bbfd7f10b4e82.tar.bz2
mpv-f2cd1a822b65980f9e35799f955bbfd7f10b4e82.tar.xz
bitstream_skip() instead of bitstream_get() if possible
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4054 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'liba52')
-rw-r--r--liba52/bitstream.h9
-rw-r--r--liba52/parse.c18
2 files changed, 18 insertions, 9 deletions
diff --git a/liba52/bitstream.h b/liba52/bitstream.h
index 0b7e31dcc9..5e42904b5f 100644
--- a/liba52/bitstream.h
+++ b/liba52/bitstream.h
@@ -86,6 +86,15 @@ bitstream_get(uint32_t num_bits) // note num_bits is practically a constant due
#endif
}
+static inline void bitstream_skip(int num_bits)
+{
+#ifdef ALT_BITSTREAM_READER
+ indx+= num_bits;
+#else
+ bitstream_get(num_bits);
+#endif
+}
+
static inline int32_t
bitstream_get_2(uint32_t num_bits)
{
diff --git a/liba52/parse.c b/liba52/parse.c
index 60858a9f31..6c254f2b23 100644
--- a/liba52/parse.c
+++ b/liba52/parse.c
@@ -155,28 +155,28 @@ int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
chaninfo = !acmod;
do {
- bitstream_get (5); /* dialnorm */
+ bitstream_skip (5); /* dialnorm */
if (bitstream_get (1)) /* compre */
- bitstream_get (8); /* compr */
+ bitstream_skip (8); /* compr */
if (bitstream_get (1)) /* langcode */
- bitstream_get (8); /* langcod */
+ bitstream_skip (8); /* langcod */
if (bitstream_get (1)) /* audprodie */
- bitstream_get (7); /* mixlevel + roomtyp */
+ bitstream_skip (7); /* mixlevel + roomtyp */
} while (chaninfo--);
- bitstream_get (2); /* copyrightb + origbs */
+ bitstream_skip (2); /* copyrightb + origbs */
if (bitstream_get (1)) /* timecod1e */
- bitstream_get (14); /* timecod1 */
+ bitstream_skip (14); /* timecod1 */
if (bitstream_get (1)) /* timecod2e */
- bitstream_get (14); /* timecod2 */
+ bitstream_skip (14); /* timecod2 */
if (bitstream_get (1)) { /* addbsie */
int addbsil;
addbsil = bitstream_get (6);
do {
- bitstream_get (8); /* addbsi */
+ bitstream_skip (8); /* addbsi */
} while (addbsil--);
}
@@ -732,7 +732,7 @@ int a52_block (a52_state_t * state, sample_t * samples)
if (bitstream_get (1)) { /* skiple */
i = bitstream_get (9); /* skipl */
while (i--)
- bitstream_get (8);
+ bitstream_skip (8);
}
if (state->output & A52_LFE)