Merge pull request #2496 from saamas/processing-relax-downsample-buffer-size-requirement

[Processing] Relax downsample buffer size requirement
This commit is contained in:
HaiboZhu 2016-06-15 10:31:53 +08:00 committed by GitHub
commit 2e6c9f7cd3

View File

@ -149,7 +149,7 @@ EResult CDownsampling::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pDs
if (iSrcWidthY <= iDstWidthY || iSrcHeightY <= iDstHeightY) {
return RET_INVALIDPARAM;
}
if (iSrcWidthY > MAX_SAMPLE_WIDTH || iSrcHeightY > MAX_SAMPLE_HEIGHT || m_bNoSampleBuffer) {
if ((iSrcWidthY >> 1) > MAX_SAMPLE_WIDTH || (iSrcHeightY >> 1) > MAX_SAMPLE_HEIGHT || m_bNoSampleBuffer) {
if ((iSrcWidthY >> 1) == iDstWidthY && (iSrcHeightY >> 1) == iDstHeightY) {
// use half average functions
DownsampleHalfAverage ((uint8_t*)pDstPixMap->pPixel[0], pDstPixMap->iStride[0],