summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-05 21:39:27 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-05 21:39:27 +0000
commit75f3bd09ea815d3db0790d40f679fde172b336dc (patch)
tree429864b3a2b52b418efb0e9dd5d8de66c35d356d
parent7852aff0c4b29e0de9a16b74e0d9d1d4cd6586ec (diff)
downloadmpv-75f3bd09ea815d3db0790d40f679fde172b336dc.tar.bz2
mpv-75f3bd09ea815d3db0790d40f679fde172b336dc.tar.xz
try to avoid returning odd slices.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30847 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libswscale/swscale_template.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index bbd9a1f701..48450f7629 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2651,8 +2651,10 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[],
unsigned char *aDest=(CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3]+dstStride[3]*dstY : NULL;
const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
+ const int firstLumSrcY2= vLumFilterPos[FFMIN(dstY | ((1<<c->chrDstVSubSample) - 1), dstH-1)];
const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
int lastLumSrcY= firstLumSrcY + vLumFilterSize -1; // Last line needed as input
+ int lastLumSrcY2=firstLumSrcY2+ vLumFilterSize -1; // Last line needed as input
int lastChrSrcY= firstChrSrcY + vChrFilterSize -1; // Last line needed as input
int enough_lines;
@@ -2669,7 +2671,8 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[],
firstChrSrcY, lastChrSrcY, lastInChrBuf);
// Do we have enough lines in this slice to output the dstY line
- enough_lines = lastLumSrcY < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample);
+ enough_lines = lastLumSrcY2 < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample);
+
if (!enough_lines) {
lastLumSrcY = srcSliceY + srcSliceH - 1;
lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1;