Lines Matching defs:nBits
349 const int nBits = to - from;
350 if (0 == nBits) {
354 if (nBits < 0 || 64 <= nBits) {
363 result = (block.fLow >> from) & ((1ULL << nBits) - 1);
366 nBits) - 1);
369 SkASSERT(nBits > (64 - from));
371 const int nHigh = nBits - nLow;
549 static void decode_trit_block(int* dst, int nBits, const uint64_t &block) {
593 if (0 == nBits) {
596 SkASSERT(nBits < 8);
597 m[0] = static_cast<int>(blockBits(nBits - 1, 0));
598 m[1] = static_cast<int>(blockBits(2*nBits - 1 + 2, nBits + 2));
599 m[2] = static_cast<int>(blockBits(3*nBits - 1 + 4, 2*nBits + 4));
600 m[3] = static_cast<int>(blockBits(4*nBits - 1 + 5, 3*nBits + 5));
601 m[4] = static_cast<int>(blockBits(5*nBits - 1 + 7, 4*nBits + 7));
605 static_cast<int>(blockBits(nBits + 1, nBits)) |
606 (static_cast<int>(blockBits(2*nBits + 2 + 1, 2*nBits + 2)) << 2) |
607 (static_cast<int>(blockBits[3*nBits + 4] << 4)) |
608 (static_cast<int>(blockBits(4*nBits + 5 + 1, 4*nBits + 5)) << 5) |
609 (static_cast<int>(blockBits[5*nBits + 7] << 7));
647 SkASSERT(m[i] < (1 << nBits));
652 *dst = (t[i] << nBits) + m[i];
658 static void decode_quint_block(int* dst, int nBits, const uint64_t &block) {
693 if (0 == nBits) {
696 SkASSERT(nBits < 8);
697 m[0] = static_cast<int>(blockBits(nBits - 1, 0));
698 m[1] = static_cast<int>(blockBits(2*nBits - 1 + 3, nBits + 3));
699 m[2] = static_cast<int>(blockBits(3*nBits - 1 + 5, 2*nBits + 5));
703 static_cast<int>(blockBits(nBits + 2, nBits)) |
704 (static_cast<int>(blockBits(2*nBits + 3 + 1, 2*nBits + 3)) << 3) |
705 (static_cast<int>(blockBits(3*nBits + 5 + 1, 3*nBits + 5)) << 5);
738 SkASSERT(m[i] < (1 << nBits));
743 *dst = (q[i] << nBits) + m[i];
769 int nBits, // The number of bits representing this encoding
791 int endBlockBit = startBit + 8 + 5*nBits;
798 decode_trit_block(trits, nBits, read_astc_bits(src, startBit, endBlockBit));
808 int endBlockBit = startBit + 7 + 3*nBits;
815 decode_quint_block(quints, nBits, read_astc_bits(src, startBit, endBlockBit));
824 int endValBit = startBit + nBits;
868 static inline int unquantize_bits_color(int val, int nBits) {
869 return replicate_bits(val, nBits, 8);
873 // trit followed by nBits bits. This algorithm follows the sequence
875 static inline int unquantize_trit_color(int val, int nBits) {
876 SkASSERT(nBits > 0);
877 SkASSERT(nBits < 7);
879 const int D = (val >> nBits) & 0x3;
885 const int C = Cvals[nBits - 1];
889 switch (nBits) {
929 // quint followed by nBits bits. This algorithm follows the sequence
931 static inline int unquantize_quint_color(int val, int nBits) {
932 const int D = (val >> nBits) & 0x7;
938 SkASSERT(nBits > 0);
939 SkASSERT(nBits < 6);
941 const int C = Cvals[nBits - 1];
945 switch (nBits) {
980 static void unquantize_colors(int *vals, int nVals, int nBits, int nTrits, int nQuints) {
984 vals[i] = unquantize_trit_color(vals[i], nBits);
987 vals[i] = unquantize_quint_color(vals[i], nBits);
990 vals[i] = unquantize_bits_color(vals[i], nBits);
1177 bool getColorValueEncoding(int *nBits, int *nTrits, int *nQuints) const {
1178 if (NULL == nBits || NULL == nTrits || NULL == nQuints) {
1222 *nBits = bits;