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 is the same fix as in e8cdbd2ea7, but making sure it applies to both dimensions, that commit only fixed it for one of the dimensions. This fixes spurious crashes in EncodeDecodeTestAPI.SimulcastSVC.

Martin Storsjö committed 11 years ago

Commit b60d91f1 parent cbc56811 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
@@ -429,11 +429,11 @@ bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic · 428 unmodified lines
429429 int32_t iInputHeightXDstWidth = kiInputPicHeight * iCurDstWidth;
430430
431431 if (iInputWidthXDstHeight > iInputHeightXDstWidth) {
432− pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth;
432+ pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iCurDstWidth, 4);
433433 pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 4);
434434 } else {
435435 pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 4);
436− pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight;
436+ pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iCurDstHeight, 4);
437437 }
438438 }
439439

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