Commit f081b209 authored by michael's avatar michael

make mpeg1/2 decoder work ith the libmpeg2 style bitstream reader


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9890 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d7f36dca
...@@ -737,7 +737,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, ...@@ -737,7 +737,9 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end; goto end;
} }
#if MIN_CACHE_BITS < 19
UPDATE_CACHE(re, &s->gb);
#endif
/* now quantify & encode AC coefs */ /* now quantify & encode AC coefs */
for(;;) { for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); 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, ...@@ -777,9 +779,14 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
} }
block[j] = 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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break; break;
#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
#endif
} }
end: end:
LAST_SKIP_BITS(re, &s->gb, 2); LAST_SKIP_BITS(re, &s->gb, 2);
...@@ -812,6 +819,9 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc ...@@ -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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end; goto end;
} }
#if MIN_CACHE_BITS < 19
UPDATE_CACHE(re, &s->gb);
#endif
/* now quantify & encode AC coefs */ /* now quantify & encode AC coefs */
for(;;) { for(;;) {
...@@ -848,9 +858,14 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc ...@@ -848,9 +858,14 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *bloc
} }
block[j] = 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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break; break;
#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
#endif
} }
end: end:
LAST_SKIP_BITS(re, &s->gb, 2); LAST_SKIP_BITS(re, &s->gb, 2);
...@@ -895,6 +910,9 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, ...@@ -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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end; goto end;
} }
#if MIN_CACHE_BITS < 19
UPDATE_CACHE(re, &s->gb);
#endif
/* now quantify & encode AC coefs */ /* now quantify & encode AC coefs */
for(;;) { for(;;) {
...@@ -928,9 +946,14 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, ...@@ -928,9 +946,14 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
mismatch ^= level; mismatch ^= level;
block[j] = 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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break; break;
#if MIN_CACHE_BITS >= 19
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
#endif
} }
end: end:
LAST_SKIP_BITS(re, &s->gb, 2); LAST_SKIP_BITS(re, &s->gb, 2);
...@@ -965,6 +988,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, ...@@ -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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
goto end; goto end;
} }
#if MIN_CACHE_BITS < 19
UPDATE_CACHE(re, &s->gb);
#endif
/* now quantify & encode AC coefs */ /* now quantify & encode AC coefs */
for(;;) { for(;;) {
...@@ -993,9 +1019,14 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, ...@@ -993,9 +1019,14 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
} }
block[j] = 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) if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break; break;
#if MIN_CACHE_BITS >=19
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
#endif
} }
end: end:
LAST_SKIP_BITS(re, &s->gb, 2); LAST_SKIP_BITS(re, &s->gb, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment