Merge pull request #1879 from mstorsjo/downscale-min-res

Don't downsample to anything smaller than 4x4 pixels
This commit is contained in:
zhilwang 2015-03-25 17:44:38 -07:00
commit 4768087556

View File

@ -429,11 +429,11 @@ bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic
int32_t iInputHeightXDstWidth = kiInputPicHeight * iCurDstWidth;
if (iInputWidthXDstHeight > iInputHeightXDstWidth) {
pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth;
pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iCurDstWidth, 4);
pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 4);
} else {
pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 4);
pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight;
pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iCurDstHeight, 4);
}
}