[xiph-cvs] cvs commit: snatch x11.c

Monty xiphmont at xiph.org
Thu Nov 15 22:30:24 PST 2001



xiphmont    01/11/15 22:30:23

  Modified:    .        x11.c
  Log:
  odd size capture fix
  signed char fix
  one yuv addressing one-off bug
  
  Monty

Revision  Changes    Path
1.26      +6 -8      snatch/x11.c

Index: x11.c
===================================================================
RCS file: /usr/local/cvsroot/snatch/x11.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- x11.c	2001/11/16 06:04:14	1.25
+++ x11.c	2001/11/16 06:30:23	1.26
@@ -544,11 +544,11 @@
       unsigned char *y2=workbuffer+yuv_w;
       unsigned char *u=workbuffer+yuv_w*yuv_h;
       unsigned char *v=u+yuv_w*yuv_h/4;
-      unsigned char *ptr1=image->data;
-      unsigned char *ptr2=image->data+image->bytes_per_line;
       if(image->byte_order){      
         
         for(i=0;i<yuv_h;i+=2){
+	  unsigned char *ptr1=image->data+i*image->bytes_per_line;
+	  unsigned char *ptr2=ptr1+image->bytes_per_line;
           for(j=0;j<yuv_w;j+=2){
             long yval,uval,vval;
             
@@ -577,8 +577,6 @@
             ptr1+=8;
             ptr2+=8;
           }
-	  ptr1+=image->bytes_per_line;
-	  ptr2+=image->bytes_per_line;
           y1+=yuv_w;
           y2+=yuv_w;
 
@@ -587,6 +585,8 @@
       }else{
 
         for(i=0;i<yuv_h;i+=2){
+	  unsigned char *ptr1=image->data+i*image->bytes_per_line;
+	  unsigned char *ptr2=ptr1+image->bytes_per_line;
           for(j=0;j<yuv_w;j+=2){
             long yval,uval,vval;
             
@@ -597,7 +597,7 @@
 
             yval  = ptr1[6]*19595 + ptr1[5]*38470 + ptr1[4]*7471;
             uval += ptr1[4]*65536 - ptr1[6]*22117 - ptr1[5]*43419;
-	    vval += ptr1[5]*65536 - ptr1[5]*54878 - ptr1[4]*10658;
+	    vval += ptr1[6]*65536 - ptr1[5]*54878 - ptr1[4]*10658;
             *y1++ = yval>>16;
 
             yval  = ptr2[2]*19595 + ptr2[1]*38470 + ptr2[0]*7471;
@@ -607,7 +607,7 @@
 
             yval  = ptr2[6]*19595 + ptr2[5]*38470 + ptr2[4]*7471;
             uval += ptr2[4]*65536 - ptr2[6]*22117 - ptr2[5]*43419;
-	    vval += ptr2[5]*65536 - ptr2[5]*54878 - ptr2[4]*10658;
+	    vval += ptr2[6]*65536 - ptr2[5]*54878 - ptr2[4]*10658;
             *y2++ = yval>>16;
             
             *u++  = (uval>>19)+128;
@@ -615,8 +615,6 @@
             ptr1+=8;
             ptr2+=8;
           }
-	  ptr1+=image->bytes_per_line;
-	  ptr2+=image->bytes_per_line;
           y1+=yuv_w;
           y2+=yuv_w;
 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list