diff vcr1.c @ 1375:c93d893f6d2b libavcodec

fix
author michaelni
date Thu, 24 Jul 2003 21:52:41 +0000
parents f9b088451fb3
children a7a9df478e46
line wrap: on
line diff
--- a/vcr1.c	Thu Jul 24 12:18:46 2003 +0000
+++ b/vcr1.c	Thu Jul 24 21:52:41 2003 +0000
@@ -79,7 +79,7 @@
             for(i=0; i<4; i++)
                 a->offset[i]= *(bytestream++);
 
-            offset= a->offset[0];
+            offset= a->offset[0] - a->delta[ bytestream[2]&0xF ];
             for(x=0; x<avctx->width; x+=4){
                 luma[0]=( offset += a->delta[ bytestream[2]&0xF ]);
                 luma[1]=( offset += a->delta[ bytestream[2]>>4  ]);
@@ -87,13 +87,13 @@
                 luma[3]=( offset += a->delta[ bytestream[0]>>4  ]);
                 luma += 4;
                 
-                *(cb++) = bytestream[1];
-                *(cr++) = bytestream[3];
+                *(cb++) = bytestream[3];
+                *(cr++) = bytestream[1];
                 
                 bytestream+= 4;
             }
         }else{
-            offset= a->offset[y&3];
+            offset= a->offset[y&3] - a->delta[ bytestream[2]&0xF ];
 
             for(x=0; x<avctx->width; x+=8){
                 luma[0]=( offset += a->delta[ bytestream[2]&0xF ]);