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.
Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -149,11 +149,11 @@ class EncodeDecodeTestBase : public ::testing::TestWithParam<EncodeDecodeFilePar · 148 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | virtual int GetRandWidth() { |
| 152 | − return (WELS_CLIP3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH)); | |
| 152 | + return WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | virtual int GetRandHeight() { |
| 156 | − return (WELS_CLIP3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, 2, MAX_HEIGHT)); | |
| 156 | + return WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, 2, MAX_HEIGHT); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | protected: |