History

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.

Martin Storsjö committed 11 years ago

Commit c1aa2a11 parent fcae7fd1 file · +2 −2Browse files

Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all

Unified · Split

test/api/encode_decode_api_test.cpp+2−2
@@ -149,11 +149,11 @@ class EncodeDecodeTestBase : public ::testing::TestWithParam<EncodeDecodeFilePar · 148 unmodified lines
149149
150150
151151 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);
153153 }
154154
155155 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);
157157 }
158158
159159 protected:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t