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

Monty xiphmont at xiph.org
Sat Feb 23 14:57:47 PST 2002



xiphmont    02/02/23 14:57:47

  Modified:    .        snatchconvert.c
  Log:
  Fix YUV letterboxing bug (was boxing a green border)

Revision  Changes    Path
1.12      +7 -1      snatch/snatchconvert.c

Index: snatchconvert.c
===================================================================
RCS file: /usr/local/cvsroot/snatch/snatchconvert.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- snatchconvert.c	2002/02/22 21:34:00	1.11
+++ snatchconvert.c	2002/02/23 22:57:46	1.12
@@ -640,7 +640,7 @@
   int dyo=(dh-sh)/4,syo=0;
   
   /* dirt simple for now. No scaling, just centering */
-  memset(dst,0,dw*dh*3/2);
+  memset(dst,1,dw*dh*3/2);
   
   if(dyo<0){
     syo= -dyo;
@@ -656,6 +656,8 @@
     unsigned char *dptr=dst+(y+dyo*2)*dw+dxo*2;
     for(x=0;x<sw && x<dw;x++)
       *dptr++=*sptr++;
+    for(x=0;x<dw;x++)
+      *dptr++=0;
   }
 
   src+=sw*sh;
@@ -670,6 +672,8 @@
     unsigned char *dptr=dst+(y+dyo)*dw+dxo;
     for(x=0;x<sw && x<dw;x++)
       *dptr++=*sptr++;
+    for(x=0;x<dw;x++)
+      *dptr++=128;
   }
 
   src+=sw*sh;
@@ -680,6 +684,8 @@
     unsigned char *dptr=dst+(y+dyo)*dw+dxo;
     for(x=0;x<sw && x<dw;x++)
       *dptr++=*sptr++;
+    for(x=0;x<dw;x++)
+      *dptr++=128;
   }
 
 }

<p><p><p>--- >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