[Mplayer-cvslog] CVS: main xacodec.c,1.12,1.13
Arpi of Ize
arpi at mplayer.dev.hu
Tue Oct 23 03:14:32 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv22622
Modified Files:
xacodec.c
Log Message:
iv32 color scaling fix
Index: xacodec.c
===================================================================
RCS file: /cvsroot/mplayer/main/xacodec.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- xacodec.c 23 Oct 2001 00:12:46 -0000 1.12
+++ xacodec.c 23 Oct 2001 01:14:13 -0000 1.13
@@ -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;y<imagey*imagex;y++)
+ image->planes[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;x<imagex;x++){
- du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x];
- dv[2*x]=dv[2*x+1]=dv[2*x+stridev]=dv[2*x+stridev+1]=sv[x];
+ if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32:
+ for(x=0;x<imagex;x++){
+ du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x]*2;
+ dv[2*x]=dv[2*x+1]=dv[2*x+stridev]=dv[2*x+stridev+1]=sv[x]*2;
+ }
+ } else {
+ for(x=0;x<imagex;x++){
+ du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x];
+ dv[2*x]=dv[2*x+1]=dv[2*x+stridev]=dv[2*x+stridev+1]=sv[x];
+ }
}
}
More information about the MPlayer-cvslog
mailing list