aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-04 11:01:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-04 11:01:11 +0000
commit4e2b9bcc085586e9e0502e5fad2447ea671697ec (patch)
tree703de9201ab6a9d13cded108163a60c8fcad9daa /libavcodec
parent3357ff338b54ed1897443c712fbb52bed5ca48a1 (diff)
downloadffmpeg-4e2b9bcc085586e9e0502e5fad2447ea671697ec.tar.gz
Make MPEG-1/2 decoder work with the libmpeg2-style bitstream reader.
Originally committed as revision 9890 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg12.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index e62827a416..89793a5794 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -737,7 +737,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end;
}
-
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
/* now quantify & encode AC coefs */
for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
@@ -777,9 +779,14 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
}
block[j] = level;
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break;
+#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb);
+#endif
}
end:
LAST_SKIP_BITS(re, &s->gb, 2);
@@ -812,6 +819,9 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end;
}
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
/* now quantify & encode AC coefs */
for(;;) {
@@ -848,9 +858,14 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc
}
block[j] = level;
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break;
+#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb);
+#endif
}
end:
LAST_SKIP_BITS(re, &s->gb, 2);
@@ -895,6 +910,9 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end;
}
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
/* now quantify & encode AC coefs */
for(;;) {
@@ -928,9 +946,14 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
mismatch ^= level;
block[j] = level;
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break;
+#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb);
+#endif
}
end:
LAST_SKIP_BITS(re, &s->gb, 2);
@@ -965,6 +988,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end;
}
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
/* now quantify & encode AC coefs */
for(;;) {
@@ -993,9 +1019,14 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
}
block[j] = level;
+#if MIN_CACHE_BITS < 19
+ UPDATE_CACHE(re, &s->gb);
+#endif
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break;
+#if MIN_CACHE_BITS >=19
UPDATE_CACHE(re, &s->gb);
+#endif
}
end:
LAST_SKIP_BITS(re, &s->gb, 2);