[FFmpeg-cvslog] r18608 - trunk/libavcodec/xan.c

reimar subversion
Sat Apr 18 19:26:01 CEST 2009


Author: reimar
Date: Sat Apr 18 19:26:00 2009
New Revision: 18608

Log:
Avoid code duplication in xan_unpack for the final memcpy.

Modified:
   trunk/libavcodec/xan.c

Modified: trunk/libavcodec/xan.c
==============================================================================
--- trunk/libavcodec/xan.c	Sat Apr 18 17:01:20 2009	(r18607)
+++ trunk/libavcodec/xan.c	Sat Apr 18 19:26:00 2009	(r18608)
@@ -157,17 +157,18 @@ static void xan_unpack(unsigned char *de
             av_memcpy_backptr(dest, back, size2);
             dest += size2;
         } else {
+            int finish;
             size = ((opcode & 0x1f) << 2) + 4;
 
-            if (size > 0x70)
-                break;
+            finish = size > 0x70;
+            if (finish)
+                size = opcode & 3;
 
             memcpy(dest, src, size);  dest += size;  src += size;
+            if (finish)
+                return;
         }
     }
-
-    size = opcode & 3;
-    memcpy(dest, src, size);  dest += size;  src += size;
 }
 
 static inline void xan_wc3_output_pixel_run(XanContext *s,



More information about the ffmpeg-cvslog mailing list