summaryrefslogtreecommitdiffstats
path: root/postproc
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-04 13:50:20 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-04 13:50:20 +0000
commita28c29e8f347330fa1a4f5a1e1f197aadf44a8c3 (patch)
treebde21cac95996781df11e47542decdc104c7e929 /postproc
parent1ed7a2cf0a5b6d64f2cf20d8e2b0aa7fb6589115 (diff)
downloadmpv-a28c29e8f347330fa1a4f5a1e1f197aadf44a8c3.tar.bz2
mpv-a28c29e8f347330fa1a4f5a1e1f197aadf44a8c3.tar.xz
green line fix for dstw%8!=0
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2681 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r--postproc/swscale.c15
-rw-r--r--postproc/swscale_template.c15
2 files changed, 22 insertions, 8 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c
index 38f2e0721e..e92364fd70 100644
--- a/postproc/swscale.c
+++ b/postproc/swscale.c
@@ -11,6 +11,7 @@
#include "swscale.h"
#include "../mmx_defs.h"
#undef MOVNTQ
+#undef PAVGB
//#undef HAVE_MMX2
//#undef HAVE_MMX
@@ -1399,10 +1400,15 @@ static int old_dstw= -1;
static int old_s_xinc= -1;
#endif
-int srcWidth= (dstw*s_xinc + 0x8000)>>16;
-int dstUVw= fullUVIpol ? dstw : dstw/2;
+int srcWidth;
+int dstUVw;
int i;
+if(((dstw + 7)&(~7)) >= dststride) dstw&= ~7;
+
+srcWidth= (dstw*s_xinc + 0x8000)>>16;
+dstUVw= fullUVIpol ? dstw : dstw/2;
+
#ifdef HAVE_MMX2
canMMX2BeUsed= (s_xinc <= 0x10000 && (dstw&31)==0 && (srcWidth&15)==0) ? 1 : 0;
#endif
@@ -1420,6 +1426,7 @@ else s_xinc2= s_xinc;
// force calculation of the horizontal interpolation of the first line
if(y==0){
+// printf("dstw %d, srcw %d, mmx2 %d\n", dstw, srcWidth, canMMX2BeUsed);
s_last_ypos=-99;
s_last_y1pos=-99;
s_srcypos= s_yinc/2 - 0x8000;
@@ -1429,9 +1436,9 @@ else s_xinc2= s_xinc;
for(i=dstw-2; i<dstw+20; i++)
{
pix_buf_uv[0][i] = pix_buf_uv[1][i]
- = pix_buf_uv[0][2048+i] = pix_buf_uv[1][2048+i] = 128;
+ = pix_buf_uv[0][2048+i] = pix_buf_uv[1][2048+i] = 128*128;
pix_buf_uv[0][i/2] = pix_buf_uv[1][i/2]
- = pix_buf_uv[0][2048+i/2] = pix_buf_uv[1][2048+i/2] = 128;
+ = pix_buf_uv[0][2048+i/2] = pix_buf_uv[1][2048+i/2] = 128*128;
pix_buf_y[0][i]= pix_buf_y[1][i]= 0;
}
diff --git a/postproc/swscale_template.c b/postproc/swscale_template.c
index 38f2e0721e..e92364fd70 100644
--- a/postproc/swscale_template.c
+++ b/postproc/swscale_template.c
@@ -11,6 +11,7 @@
#include "swscale.h"
#include "../mmx_defs.h"
#undef MOVNTQ
+#undef PAVGB
//#undef HAVE_MMX2
//#undef HAVE_MMX
@@ -1399,10 +1400,15 @@ static int old_dstw= -1;
static int old_s_xinc= -1;
#endif
-int srcWidth= (dstw*s_xinc + 0x8000)>>16;
-int dstUVw= fullUVIpol ? dstw : dstw/2;
+int srcWidth;
+int dstUVw;
int i;
+if(((dstw + 7)&(~7)) >= dststride) dstw&= ~7;
+
+srcWidth= (dstw*s_xinc + 0x8000)>>16;
+dstUVw= fullUVIpol ? dstw : dstw/2;
+
#ifdef HAVE_MMX2
canMMX2BeUsed= (s_xinc <= 0x10000 && (dstw&31)==0 && (srcWidth&15)==0) ? 1 : 0;
#endif
@@ -1420,6 +1426,7 @@ else s_xinc2= s_xinc;
// force calculation of the horizontal interpolation of the first line
if(y==0){
+// printf("dstw %d, srcw %d, mmx2 %d\n", dstw, srcWidth, canMMX2BeUsed);
s_last_ypos=-99;
s_last_y1pos=-99;
s_srcypos= s_yinc/2 - 0x8000;
@@ -1429,9 +1436,9 @@ else s_xinc2= s_xinc;
for(i=dstw-2; i<dstw+20; i++)
{
pix_buf_uv[0][i] = pix_buf_uv[1][i]
- = pix_buf_uv[0][2048+i] = pix_buf_uv[1][2048+i] = 128;
+ = pix_buf_uv[0][2048+i] = pix_buf_uv[1][2048+i] = 128*128;
pix_buf_uv[0][i/2] = pix_buf_uv[1][i/2]
- = pix_buf_uv[0][2048+i/2] = pix_buf_uv[1][2048+i/2] = 128;
+ = pix_buf_uv[0][2048+i/2] = pix_buf_uv[1][2048+i/2] = 128*128;
pix_buf_y[0][i]= pix_buf_y[1][i]= 0;
}