@Test public void intlog2() throws Exception { assertThat(DvbMath.intlog2(8), is(3 << 24)); assertThat(DvbMath.intlog2(1024), is(10 << 24)); assertThat(DvbMath.intlog2(0x80000000), is(31 << 24)); }
static int intlog2(int value) { int msb = fls(value) - 1; int significand = value << (31 - msb); int logentry = (significand >> 23) & 0xff; int interpolation = ((significand & 0x7fffff) * ((LOG_TABLE[(logentry + 1) & 0xff] - LOG_TABLE[logentry]) & 0xffff)) >> 15; return (msb << 24) + (LOG_TABLE[logentry] << 8) + interpolation; }
DvbMath { static int intlog2(int value) { int msb = fls(value) - 1; int significand = value << (31 - msb); int logentry = (significand >> 23) & 0xff; int interpolation = ((significand & 0x7fffff) * ((LOG_TABLE[(logentry + 1) & 0xff] - LOG_TABLE[logentry]) & 0xffff)) >> 15; return (msb << 24) + (LOG_TABLE[logentry] << 8) + interpolation; } }
DvbMath { static int intlog2(int value) { int msb = fls(value) - 1; int significand = value << (31 - msb); int logentry = (significand >> 23) & 0xff; int interpolation = ((significand & 0x7fffff) * ((LOG_TABLE[(logentry + 1) & 0xff] - LOG_TABLE[logentry]) & 0xffff)) >> 15; return (msb << 24) + (LOG_TABLE[logentry] << 8) + interpolation; }  }
DvbMath { static int intlog2(int value) { int msb = fls(value) - 1; int significand = value << (31 - msb); int logentry = (significand >> 23) & 0xff; int interpolation = ((significand & 0x7fffff) * ((LOG_TABLE[(logentry + 1) & 0xff] - LOG_TABLE[logentry]) & 0xffff)) >> 15; return (msb << 24) + (LOG_TABLE[logentry] << 8) + interpolation; }  static int intlog10(int value); static long divU64(long dividend, long divisor); static long divRoundClosest(long x, long divisor); }
DvbMath { static int intlog2(int value) { int msb = fls(value) - 1; int significand = value << (31 - msb); int logentry = (significand >> 23) & 0xff; int interpolation = ((significand & 0x7fffff) * ((LOG_TABLE[(logentry + 1) & 0xff] - LOG_TABLE[logentry]) & 0xffff)) >> 15; return (msb << 24) + (LOG_TABLE[logentry] << 8) + interpolation; }  static int intlog10(int value); static long divU64(long dividend, long divisor); static long divRoundClosest(long x, long divisor);  }