Lines Matching refs:symbol

572 static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol)
576 if (symbol == 0)
595 static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)
597 symbol |= 0x100;
600 RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
601 symbol <<= 1;
603 while (symbol < 0x10000);
606 static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)
609 symbol |= 0x100;
613 RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
614 symbol <<= 1;
615 offs &= ~(matchByte ^ symbol);
617 while (symbol < 0x10000);
644 #define GET_PRICE(prob, symbol) \
645 p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
647 #define GET_PRICEa(prob, symbol) \
648 ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
656 static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices)
659 symbol |= 0x100;
662 price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1);
663 symbol <<= 1;
665 while (symbol < 0x10000);
669 static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)
673 symbol |= 0x100;
677 price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);
678 symbol <<= 1;
679 offs &= ~(matchByte ^ symbol);
681 while (symbol < 0x10000);
686 static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
694 bit = (symbol >> i) & 1;
700 static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
706 UInt32 bit = symbol & 1;
709 symbol >>= 1;
713 static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
716 symbol |= (1 << numBitLevels);
717 while (symbol != 1)
719 price += GET_PRICEa(probs[symbol >> 1], symbol & 1);
720 symbol >>= 1;
725 static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
732 UInt32 bit = symbol & 1;
733 symbol >>= 1;
753 static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)
755 if (symbol < kLenNumLowSymbols)
758 RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol);
763 if (symbol < kLenNumLowSymbols + kLenNumMidSymbols)
766 RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols);
771 RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols);
812 static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)
814 LenEnc_Encode(&p->p, rc, symbol, posState);