History

Remove UBSAN warnings about negative left shift

Haibo Zhu committed 11 years ago

Commit 03d16bb1 parent 3067d1212 files · +71 −71Browse files

Showing the changes to test/decoder/DecUT_DeblockCommon.cpp (1 of 12 files). Show all

Unified · Split

test/decoder/DecUT_DeblockCommon.cpp+3−3
@@ -122,7 +122,7 @@ void anchor_DeblockingLumaNormal (uint8_t* pPix, int32_t iStrideX, int32_t iStri · 121 unmodified lines
122 iTc++;122 iTc++;
123 }123 }
124 // 8-467,468,469124 // 8-467,468,469
125 iDelta = WELS_CLIP3 (((((q[0] - p[0]) << 2) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);125 iDelta = WELS_CLIP3 (((((q[0] - p[0]) * (1 << 2)) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);
126 pPix[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);126 pPix[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);
127 pPix[0] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);127 pPix[0] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);
128 }128 }
@@ -194,7 +194,7 @@ void anchor_DeblockingChromaNormal (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iS · 65 unmodified lines
194 // filterSampleFlag, 8-460194 // filterSampleFlag, 8-460
195 if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) {195 if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) {
196 // 8-467, 468, 469196 // 8-467, 468, 469
197 iDelta = WELS_CLIP3 (((((q[0] - p[0]) << 2) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);197 iDelta = WELS_CLIP3 (((((q[0] - p[0]) * (1 << 2)) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);
198 pPixCb[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);198 pPixCb[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);
199 pPixCb[iStrideX * 0 ] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);199 pPixCb[iStrideX * 0 ] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);
200 }200 }
@@ -209,7 +209,7 @@ void anchor_DeblockingChromaNormal (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iS · 8 unmodified lines
209 // filterSampleFlag, 8-460209 // filterSampleFlag, 8-460
210 if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) {210 if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) {
211 // 8-467, 468, 469211 // 8-467, 468, 469
212 iDelta = WELS_CLIP3 (((((q[0] - p[0]) << 2) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);212 iDelta = WELS_CLIP3 (((((q[0] - p[0]) * (1 << 2)) + (p[1] - q[1]) + 4) >> 3), -1 * iTc, iTc);
213 pPixCr[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);213 pPixCr[iStrideX * -1] = WELS_CLIP3 ((p[0] + iDelta), 0, 255);
214 pPixCr[iStrideX * 0 ] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);214 pPixCr[iStrideX * 0 ] = WELS_CLIP3 ((q[0] - iDelta), 0, 255);
215 }215 }

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