shithub: openh264

Download patch

ref: 9ea4d5bd73f1ade5a2a41f4fb72422687e5ee5cb
parent: 497b38e34125ff33d69ec24d34b75f1361b334c2
parent: 861f54887d5f00bd075e199005cc2c82a4187785
author: Ethan Hugg <[email protected]>
date: Mon Feb 23 08:53:58 EST 2015

Merge pull request #1816 from mstorsjo/downscale-min-limit

Avoid trying to downscale layers to dimensions below 2

--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -430,9 +430,9 @@
 
     if (iInputWidthXDstHeight > iInputHeightXDstWidth) {
       pScaledPicture->iScaledWidth[iSpatialIdx] = iCurDstWidth;
-      pScaledPicture->iScaledHeight[iSpatialIdx] = iInputHeightXDstWidth / kiInputPicWidth;
+      pScaledPicture->iScaledHeight[iSpatialIdx] = WELS_MAX (iInputHeightXDstWidth / kiInputPicWidth, 2);
     } else {
-      pScaledPicture->iScaledWidth[iSpatialIdx] = iInputWidthXDstHeight / kiInputPicHeight;
+      pScaledPicture->iScaledWidth[iSpatialIdx] = WELS_MAX (iInputWidthXDstHeight / kiInputPicHeight, 2);
       pScaledPicture->iScaledHeight[iSpatialIdx] = iCurDstHeight;
     }
   }