private void findTruncIndices(int layerIdx, int compIdx, int lvlIdx, int tileIdx, SubbandAn subb, float fthresh, int precinctIdx)
{
int minsbi, maxsbi, b, n; // bIdx removed
//Coord ncblks = null;
SubbandAn sb;
CBlkRateDistStats cur_cblk;
PrecInfo prec = pktEnc.getPrecInfo(tileIdx, compIdx, lvlIdx, precinctIdx);
Coord cbCoord;
sb = subb;
while (sb.subb_HH != null)
{
sb = sb.subb_HH;
}
minsbi = (lvlIdx == 0)?0:1;
maxsbi = (lvlIdx == 0)?1:4;
int yend, xend;
sb = (SubbandAn) subb.getSubbandByIdx(lvlIdx, minsbi);
for (int s = minsbi; s < maxsbi; s++)
{
//loop on subbands
yend = (prec.cblk[s] != null)?prec.cblk[s].Length:0;
for (int y = 0; y < yend; y++)
{
xend = (prec.cblk[s][y] != null)?prec.cblk[s][y].Length:0;
for (int x = 0; x < xend; x++)
{
cbCoord = prec.cblk[s][y][x].idx;
b = cbCoord.x + cbCoord.y * sb.numCb.x;
//Get the current code-block
cur_cblk = cblks[tileIdx][compIdx][lvlIdx][s][b];
for (n = 0; n < cur_cblk.nVldTrunc; n++)
{
if (cur_cblk.truncSlopes[n] < fthresh)
{
break;
}
else
{
continue;
}
}
// Store the index in the code-block truncIdxs that gives
// the real truncation index.
truncIdxs[tileIdx][layerIdx][compIdx][lvlIdx][s][b] = n - 1;
} // End loop on horizontal code-blocks
} // End loop on vertical code-blocks
sb = (SubbandAn) sb.nextSubband();
} // End loop on subbands
}