# HG changeset patch # User arpi # Date 1003799653 0 # Node ID af87f279dbd442a856b3551e64dd5ae4bb77e432 # Parent f7ebe1935ffabd0fb64c638e154bcab6c5dc616b iv32 color scaling fix diff -r f7ebe1935ffa -r af87f279dbd4 xacodec.c --- a/xacodec.c Tue Oct 23 00:21:41 2001 +0000 +++ b/xacodec.c Tue Oct 23 01:14:13 2001 +0000 @@ -599,6 +599,13 @@ int uvstride; #if 0 + printf("YUVTabs: %d %p %p %p %p %p\n",yuv_tabs->Uskip_mask, + yuv_tabs->YUV_Y_tab, + yuv_tabs->YUV_UB_tab, + yuv_tabs->YUV_VR_tab, + yuv_tabs->YUV_UG_tab, + yuv_tabs->YUV_VG_tab ); + XA_Print("XA_YUV1611_To_CLR8('image: %08x', 'imagex: %d', 'imagey: %d', 'i_x: %d', 'i_y: %d', 'yuv_bufs: %08x', 'yuv_tabs: %08x', 'map_flag: %d', 'map: %08x', 'chdr: %08x')", image, imagex, imagey, i_x, i_y, yuv, yuv_tabs, map_flag, map, chdr); @@ -608,7 +615,11 @@ #endif // copy Y plane: - memcpy(image->planes[0],yuv->Ybuf,imagex*imagey); + if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32: + for(y=0;yplanes[0][y]=yuv->Ybuf[y]<<1; + } else + memcpy(image->planes[0],yuv->Ybuf,imagex*imagey); // scale U,V planes by 2: imagex>>=2; @@ -624,9 +635,16 @@ unsigned char *du=image->planes[1]+2*y*strideu; unsigned char *dv=image->planes[2]+2*y*stridev; int x; - for(x=0;xYUV_Y_tab){ // dirty hack to detect iv32: + for(x=0;x