shithub: openh264

Download patch

ref: ec0d151879f77f80a75b1f289320e30818578a3e
parent: 3b5448cbbcea4a7defd470842eaa538258b04593
author: Martin Storsjö <martin@martin.st>
date: Wed Oct 29 18:31:31 EDT 2014

Make sure the width/height is large enough in SetOptionEncParamExt

When using 4 downsampled layers, make sure the random width/height
is large enough that the downsampled layers don't have a zero size.

Since the value never will be too small now, there's no need to
use WELS_CLIP3 any longer.

--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -1985,8 +1985,8 @@
 
 
 TEST_F (EncodeDecodeTestAPI, SetOptionEncParamExt) {
-  int iWidth       = WELS_CLIP3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1,  2, MAX_WIDTH);
-  int iHeight      = WELS_CLIP3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, 2, MAX_HEIGHT);
+  int iWidth       = (((rand() % MAX_WIDTH) >> 1) + 16) << 1;
+  int iHeight      = (((rand() % MAX_HEIGHT) >> 1) + 16) << 1;
   float fFrameRate = rand() + 0.5f;
   int iEncFrameNum = WELS_CLIP3 ((rand() % ENCODE_FRAME_NUM) + 1, 1, ENCODE_FRAME_NUM);
   int iSpatialLayerNum = 4;