shithub: openh264

Download patch

ref: 4768087556ea8807bda2fa6e0ff726fd45bf5ed5
parent: cbc5681c01783a54d8f76d7a58a7bf24c0706f32
parent: b60d91f78e9013beee5ebf6ff850c01005ca9f4a
author: zhilwang <zhilwang@cisco.com>
date: Wed Mar 25 13:44:38 EDT 2015

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

Don't downsample to anything smaller than 4x4 pixels

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -429,11 +429,11 @@
     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);
     }
   }