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

Merge branch 'fix161c' into 'master'

Partial fix for #161: fix some more unsigned arithmetic issues

See merge request jvet/VVCSoftware_VTM!232
parents 9c96a44d 48dd763b
No related branches found
No related tags found
No related merge requests found
...@@ -236,11 +236,11 @@ namespace DQIntern ...@@ -236,11 +236,11 @@ namespace DQIntern
NbInfoSbb& nbSbb = sId2NbSbb[ scanId ]; NbInfoSbb& nbSbb = sId2NbSbb[ scanId ];
const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock
int cpos[5]; int cpos[5];
cpos[0] = ( posX + 1 < blockWidth ? ( raster2id[rpos+1 ] - begSbb < groupSize ? raster2id[rpos+1 ] - begSbb : 0 ) : 0 ); cpos[0] = ( posX + 1 < blockWidth ? ( raster2id[rpos+1 ] < groupSize + begSbb ? raster2id[rpos+1 ] - begSbb : 0 ) : 0 );
cpos[1] = ( posX + 2 < blockWidth ? ( raster2id[rpos+2 ] - begSbb < groupSize ? raster2id[rpos+2 ] - begSbb : 0 ) : 0 ); cpos[1] = ( posX + 2 < blockWidth ? ( raster2id[rpos+2 ] < groupSize + begSbb ? raster2id[rpos+2 ] - begSbb : 0 ) : 0 );
cpos[2] = ( posX + 1 < blockWidth && posY + 1 < blockHeight ? ( raster2id[rpos+1+blockWidth] - begSbb < groupSize ? raster2id[rpos+1+blockWidth] - begSbb : 0 ) : 0 ); cpos[2] = ( posX + 1 < blockWidth && posY + 1 < blockHeight ? ( raster2id[rpos+1+blockWidth] < groupSize + begSbb ? raster2id[rpos+1+blockWidth] - begSbb : 0 ) : 0 );
cpos[3] = ( posY + 1 < blockHeight ? ( raster2id[rpos+ blockWidth] - begSbb < groupSize ? raster2id[rpos+ blockWidth] - begSbb : 0 ) : 0 ); cpos[3] = ( posY + 1 < blockHeight ? ( raster2id[rpos+ blockWidth] < groupSize + begSbb ? raster2id[rpos+ blockWidth] - begSbb : 0 ) : 0 );
cpos[4] = ( posY + 2 < blockHeight ? ( raster2id[rpos+2*blockWidth] - begSbb < groupSize ? raster2id[rpos+2*blockWidth] - begSbb : 0 ) : 0 ); cpos[4] = ( posY + 2 < blockHeight ? ( raster2id[rpos+2*blockWidth] < groupSize + begSbb ? raster2id[rpos+2*blockWidth] - begSbb : 0 ) : 0 );
for( nbSbb.num = 0; true; ) for( nbSbb.num = 0; true; )
{ {
int nk = -1; int nk = -1;
...@@ -268,11 +268,11 @@ namespace DQIntern ...@@ -268,11 +268,11 @@ namespace DQIntern
NbInfoOut& nbOut = sId2NbOut[ scanId ]; NbInfoOut& nbOut = sId2NbOut[ scanId ];
const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock
int cpos[5]; int cpos[5];
cpos[0] = ( posX + 1 < blockWidth ? ( raster2id[rpos+1 ] - begSbb >= groupSize ? raster2id[rpos+1 ] : 0 ) : 0 ); cpos[0] = ( posX + 1 < blockWidth ? ( raster2id[rpos+1 ] >= groupSize + begSbb ? raster2id[rpos+1 ] : 0 ) : 0 );
cpos[1] = ( posX + 2 < blockWidth ? ( raster2id[rpos+2 ] - begSbb >= groupSize ? raster2id[rpos+2 ] : 0 ) : 0 ); cpos[1] = ( posX + 2 < blockWidth ? ( raster2id[rpos+2 ] >= groupSize + begSbb ? raster2id[rpos+2 ] : 0 ) : 0 );
cpos[2] = ( posX + 1 < blockWidth && posY + 1 < blockHeight ? ( raster2id[rpos+1+blockWidth] - begSbb >= groupSize ? raster2id[rpos+1+blockWidth] : 0 ) : 0 ); cpos[2] = ( posX + 1 < blockWidth && posY + 1 < blockHeight ? ( raster2id[rpos+1+blockWidth] >= groupSize + begSbb ? raster2id[rpos+1+blockWidth] : 0 ) : 0 );
cpos[3] = ( posY + 1 < blockHeight ? ( raster2id[rpos+ blockWidth] - begSbb >= groupSize ? raster2id[rpos+ blockWidth] : 0 ) : 0 ); cpos[3] = ( posY + 1 < blockHeight ? ( raster2id[rpos+ blockWidth] >= groupSize + begSbb ? raster2id[rpos+ blockWidth] : 0 ) : 0 );
cpos[4] = ( posY + 2 < blockHeight ? ( raster2id[rpos+2*blockWidth] - begSbb >= groupSize ? raster2id[rpos+2*blockWidth] : 0 ) : 0 ); cpos[4] = ( posY + 2 < blockHeight ? ( raster2id[rpos+2*blockWidth] >= groupSize + begSbb ? raster2id[rpos+2*blockWidth] : 0 ) : 0 );
for( nbOut.num = 0; true; ) for( nbOut.num = 0; true; )
{ {
int nk = -1; int nk = -1;
...@@ -312,6 +312,7 @@ namespace DQIntern ...@@ -312,6 +312,7 @@ namespace DQIntern
const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock const int begSbb = scanId - ( scanId & (groupSize-1) ); // first pos in current subblock
for( int k = 0; k < nbOut.num; k++ ) for( int k = 0; k < nbOut.num; k++ )
{ {
CHECK(begSbb > nbOut.outPos[k], "Position must be past sub block begin");
nbOut.outPos[k] -= begSbb; nbOut.outPos[k] -= begSbb;
} }
nbOut.maxDist -= scanId; nbOut.maxDist -= scanId;
......
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