Mercurial > mplayer.hg
comparison postproc/swscale.c @ 2274:9ee34c6950e0
xinc scaled by 16 instead of 8
author | arpi |
---|---|
date | Fri, 19 Oct 2001 02:21:47 +0000 |
parents | a8d57bbc4413 |
children | 9b9c3363abbe |
comparison
equal
deleted
inserted
replaced
2273:e407fc4562f1 | 2274:9ee34c6950e0 |
---|---|
69 | 69 |
70 | 70 |
71 // *** bilinear scaling and yuv->rgb conversion of yv12 slices: | 71 // *** bilinear scaling and yuv->rgb conversion of yv12 slices: |
72 // *** Note: it's called multiple times while decoding a frame, first time y==0 | 72 // *** Note: it's called multiple times while decoding a frame, first time y==0 |
73 // *** Designed to upscale, but may work for downscale too. | 73 // *** Designed to upscale, but may work for downscale too. |
74 // s_xinc = (src_width << 8) / dst_width | 74 // s_xinc = (src_width << 16) / dst_width |
75 // s_yinc = (src_height << 16) / dst_height | 75 // s_yinc = (src_height << 16) / dst_height |
76 void SwScale_YV12slice_brg24(unsigned char* srcptr[],int stride[], int y, int h, | 76 void SwScale_YV12slice_brg24(unsigned char* srcptr[],int stride[], int y, int h, |
77 unsigned char* dstptr, int dststride, int dstw, int dstbpp, | 77 unsigned char* dstptr, int dststride, int dstw, int dstbpp, |
78 unsigned int s_xinc,unsigned int s_yinc){ | 78 unsigned int s_xinc,unsigned int s_yinc){ |
79 | 79 |
102 static int s_xinc2_diff=0; | 102 static int s_xinc2_diff=0; |
103 #endif | 103 #endif |
104 int canMMX2BeUsed; | 104 int canMMX2BeUsed; |
105 | 105 |
106 // we need that precission at least for the mmx2 code | 106 // we need that precission at least for the mmx2 code |
107 s_xinc*= 256; | 107 //s_xinc*= 256; |
108 s_xinc2=s_xinc>>1; | 108 s_xinc2=s_xinc>>1; |
109 canMMX2BeUsed= (s_xinc <= 0x10000 && (dstw&31)==0) ? 1 : 0; | 109 canMMX2BeUsed= (s_xinc <= 0x10000 && (dstw&31)==0) ? 1 : 0; |
110 | 110 |
111 #ifdef HAVE_MMX2 | 111 #ifdef HAVE_MMX2 |
112 if(canMMX2BeUsed) | 112 if(canMMX2BeUsed) |