Use WelsClip3 instead of WELS_CLIP3 for random values

Since WELS_CLIP3 is a macro, using it will cause the arguments
to be evalated multiple times, which means that the clip will
not work as intended. If using a rand() argument, always use
WelsClip3 instead, which is an inline function.
This commit is contained in:
Martin Storsjö 2015-01-19 10:02:21 +02:00
parent fcae7fd300
commit c1aa2a1edb

View File

@ -149,11 +149,11 @@ class EncodeDecodeTestBase : public ::testing::TestWithParam<EncodeDecodeFilePar
virtual int GetRandWidth() {
return (WELS_CLIP3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH));
return WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH);
}
virtual int GetRandHeight() {
return (WELS_CLIP3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, 2, MAX_HEIGHT));
return WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, 2, MAX_HEIGHT);
}
protected: