Skip to content
Snippets Groups Projects
Commit 4b1c3d53 authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'fix_ticket_744' into 'master'

Fix for Ticket #744 - Overflow in joint Cb/Cr transform

See merge request jvet/VVCSoftware_VTM!1168
parents 65e58502 e276e285
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,7 @@ template<int signedMode> void invTransformCbCr( PelBuf &resCb, PelBuf &resCr )
if ( signedMode == 1 ) { cr[x] = cb[x] >> 1; }
else if ( signedMode == -1 ) { cr[x] = -cb[x] >> 1; }
else if ( signedMode == 2 ) { cr[x] = cb[x]; }
else if ( signedMode == -2 ) { cr[x] = -cb[x]; }
else if ( signedMode == -2 ) { cr[x] = (cb[x] == -32768 && sizeof(Pel) == 2) ? 32767 : -cb[x]; } // non-normative clipping to prevent 16-bit overflow
else if ( signedMode == 3 ) { cb[x] = cr[x] >> 1; }
else if ( signedMode == -3 ) { cb[x] = -cr[x] >> 1; }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment