summaryrefslogtreecommitdiff
path: root/libavcodec/common.c
diff options
context:
space:
mode:
authorBERO <bero@geocities.co.jp>2003-05-14 00:32:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-05-14 00:32:22 +0000
commitd8e00c099731b8499a8c377469ac5796f5bd186c (patch)
tree711680cabebcfad66236563377db4e1ee77545b6 /libavcodec/common.c
parent7062fad6e9e5d506f2cdaa31c75c404ccd1315ab (diff)
bitstream reader optimize patch by (BERO <bero at geocities dot co dot jp>)
Originally committed as revision 1871 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.c')
-rw-r--r--libavcodec/common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/common.c b/libavcodec/common.c
index 8c50fbc8d6..4f70e6f924 100644
--- a/libavcodec/common.c
+++ b/libavcodec/common.c
@@ -140,9 +140,19 @@ void init_get_bits(GetBitContext *s,
#ifdef ALT_BITSTREAM_READER
s->index=0;
#elif defined LIBMPEG2_BITSTREAM_READER
+#ifdef LIBMPEG2_BITSTREAM_HACK
+ if ((int)buffer&1) {
+ /* word alignment */
+ s->cache = (*buffer++)<<24;
+ s->buffer_ptr = buffer;
+ s->bit_count = 16-8;
+ } else
+#endif
+ {
s->buffer_ptr = buffer;
s->bit_count = 16;
s->cache = 0;
+ }
#elif defined A32_BITSTREAM_READER
s->buffer_ptr = (uint32_t*)buffer;
s->bit_count = 32;