minimum slice size fix (fixes 422P 1 line per slice, used by huffyuv)

Originally committed as revision 11214 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
This commit is contained in:
Michael Niedermayer 2003-10-22 00:19:20 +00:00
parent b465449eb7
commit c4f1e443e7

View File

@ -1963,10 +1963,9 @@ SwsContext *sws_getContext(int srcW, int srcH, int origSrcFormat, int dstW, int
int chrI= i*c->chrDstH / dstH; int chrI= i*c->chrDstH / dstH;
int nextSlice= MAX(c->vLumFilterPos[i ] + c->vLumFilterSize - 1, int nextSlice= MAX(c->vLumFilterPos[i ] + c->vLumFilterSize - 1,
((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)<<c->chrSrcVSubSample)); ((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)<<c->chrSrcVSubSample));
if(c->chrSrcVSubSample > 1)
nextSlice&= ~3; // Slices start at boundaries which are divisable through 4 nextSlice>>= c->chrSrcVSubSample;
else nextSlice<<= c->chrSrcVSubSample;
nextSlice&= ~1; // Slices start at boundaries which are divisable through 2
if(c->vLumFilterPos[i ] + c->vLumBufSize < nextSlice) if(c->vLumFilterPos[i ] + c->vLumBufSize < nextSlice)
c->vLumBufSize= nextSlice - c->vLumFilterPos[i ]; c->vLumBufSize= nextSlice - c->vLumFilterPos[i ];
if(c->vChrFilterPos[chrI] + c->vChrBufSize < (nextSlice>>c->chrSrcVSubSample)) if(c->vChrFilterPos[chrI] + c->vChrBufSize < (nextSlice>>c->chrSrcVSubSample))