[xiph-commits] r15965 - branches/theora-thusnelda/examples

gmaxwell at svn.xiph.org gmaxwell at svn.xiph.org
Wed Apr 29 12:00:24 PDT 2009


Author: gmaxwell
Date: 2009-04-29 12:00:23 -0700 (Wed, 29 Apr 2009)
New Revision: 15965

Modified:
   branches/theora-thusnelda/examples/player_example.c
Log:
Correct offset handling in player_example for YUV 4:2:2

Modified: branches/theora-thusnelda/examples/player_example.c
===================================================================
--- branches/theora-thusnelda/examples/player_example.c	2009-04-29 05:00:06 UTC (rev 15964)
+++ branches/theora-thusnelda/examples/player_example.c	2009-04-29 19:00:23 UTC (rev 15965)
@@ -362,9 +362,9 @@
   /* problems may exist for odd frame rect for some encodings */
 
   y_offset=(ti.offset_x&~1)+yuv.y_stride*(ti.offset_y&~1);
-  uv_offset=(ti.offset_x/2)+(yuv.uv_stride)*(ti.offset_y/2);
 
   if (px_fmt==OC_PF_422) {
+    uv_offset=(ti.offset_x/2))+(yuv.uv_stride)*(ti.offset_y);
     /* SDL doesn't have a planar 4:2:2 */ 
     for(i=0;i<yuv_overlay->h;i++) {
       int j;
@@ -380,6 +380,7 @@
       }
     }
   } else {
+    uv_offset=(ti.offset_x/2))+(yuv.uv_stride)*(ti.offset_y/2);
     for(i=0;i<yuv_overlay->h;i++)
       memcpy(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i,
            yuv.y+y_offset+yuv.y_stride*i,



More information about the commits mailing list