Lines Matching refs:symbol
552 static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol)
556 if (symbol == 0)
575 static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)
577 symbol |= 0x100;
580 RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
581 symbol <<= 1;
583 while (symbol < 0x10000);
586 static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)
589 symbol |= 0x100;
593 RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
594 symbol <<= 1;
595 offs &= ~(matchByte ^ symbol);
597 while (symbol < 0x10000);
624 #define GET_PRICE(prob, symbol) \
625 p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
627 #define GET_PRICEa(prob, symbol) \
628 ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
636 static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices)
639 symbol |= 0x100;
642 price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1);
643 symbol <<= 1;
645 while (symbol < 0x10000);
649 static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)
653 symbol |= 0x100;
657 price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);
658 symbol <<= 1;
659 offs &= ~(matchByte ^ symbol);
661 while (symbol < 0x10000);
666 static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
674 bit = (symbol >> i) & 1;
680 static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
686 UInt32 bit = symbol & 1;
689 symbol >>= 1;
693 static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
696 symbol |= (1 << numBitLevels);
697 while (symbol != 1)
699 price += GET_PRICEa(probs[symbol >> 1], symbol & 1);
700 symbol >>= 1;
705 static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
712 UInt32 bit = symbol & 1;
713 symbol >>= 1;
733 static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)
735 if (symbol < kLenNumLowSymbols)
738 RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol);
743 if (symbol < kLenNumLowSymbols + kLenNumMidSymbols)
746 RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols);
751 RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols);
792 static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)
794 LenEnc_Encode(&p->p, rc, symbol, posState);