Move sync line pointers code to the end of the loop, it is simpler that way.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Dec 2008 17:04:31 +0000 (17:04 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Dec 2008 17:04:31 +0000 (17:04 +0000)
Originally committed as revision 16341 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/faxcompr.c

index 2801da2..b727284 100644 (file)
@@ -170,11 +170,6 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
             av_log(avctx, AV_LOG_ERROR, "Incorrect mode VLC\n");
             return -1;
         }
             av_log(avctx, AV_LOG_ERROR, "Incorrect mode VLC\n");
             return -1;
         }
-        //sync line pointers
-        if(runs != run_start)while(run_off <= offs){
-            run_off += *ref++;
-            run_off += *ref++;
-        }
         if(!cmode){//pass mode
             run_off += *ref++;
             run = run_off - offs;
         if(!cmode){//pass mode
             run_off += *ref++;
             run = run_off - offs;
@@ -234,6 +229,11 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
             saved_run = 0;
             mode = !mode;
         }
             saved_run = 0;
             mode = !mode;
         }
+        //sync line pointers
+        while(run_off <= offs){
+            run_off += *ref++;
+            run_off += *ref++;
+        }
     }
     *runs++ = saved_run;
     *runs++ = 0;
     }
     *runs++ = saved_run;
     *runs++ = 0;