summaryrefslogtreecommitdiff
path: root/libavcodec/h261dec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-08-31 23:01:09 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-09-01 19:41:20 +0200
commite8d0b84e8a5893ed29993e743de82079c93b5fb6 (patch)
tree0ad0f50185bb2921be6ae02c15bfaa4eb6a19ebe /libavcodec/h261dec.c
parent36c0043344fd6d99e92f42cfd1d718a9272ad632 (diff)
h261dec, ituh263dec: Move condition.
Stops compiler from doing incredibly stupid things. With vsynth1-flv inner loop goes from 3501 to 3275 decicycles. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/h261dec.c')
-rw-r--r--libavcodec/h261dec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 9b95775efd..a8aae6ed39 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -309,13 +309,13 @@ static int h261_decode_block(H261Context *h, int16_t *block, int n, int coded)
for (;;) {
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TCOEFF_VLC_BITS, 2, 0);
- if (run == 66 && level) {
- CLOSE_READER(re, &s->gb);
- av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n",
- s->mb_x, s->mb_y);
- return -1;
- }
if (run == 66) {
+ if (level) {
+ CLOSE_READER(re, &s->gb);
+ av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n",
+ s->mb_x, s->mb_y);
+ return -1;
+ }
/* escape */
/* The remaining combinations of (run, level) are encoded with a
* 20-bit word consisting of 6 bits escape, 6 bits run and 8 bits