History

Don't downsample to anything smaller than 4x4 pixels

This makes for a chroma plane of 2x2. The SIMD versionf of generic downscalers assume that the width and height is at least 2, since it does an unconditional loop for the body of the image, and a separate step for the last pixel and last row. The SIMD versions assume that (width-1) and (height-1) are larger than zero. This fixes spurious crashes in EncodeDecodeTestAPI.SetOptionEncParamExt.

Martin Storsjö committed 11 years ago

Commit e8cdbd21 parent 67664f41 file · +2 −2Browse files

Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+2−2
@@ -430,9 +430,9 @@ bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic · 429 unmodified lines
430 430
431 if (iInputWidthXDstHeight > iInputHeightXDstWidth) {431 if (iInputWidthXDstHeight > iInputHeightXDstWidth) {
432 pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth;432 pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth;
433 pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 2);433 pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 4);
434 } else {434 } else {
435 pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 2);435 pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 4);
436 pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight;436 pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight;
437 }437 }
438 }438 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t