getCodeword static method

int getCodeword(
  1. int symbol
)

@param symbol encoded symbol to translate to a codeword @return the codeword corresponding to the symbol.

Implementation

static int getCodeword(int symbol) {
  //int i = SYMBOL_TABLE.indexOf(symbol);
  final i = MathUtils.binarySearch(SYMBOL_TABLE, symbol & 0x3FFFF);
  if (i < 0) {
    return -1;
  }
  return (_CODEWORD_TABLE[i] - 1) % NUMBER_OF_CODEWORDS;
}