ShiftLow() public method

public ShiftLow ( ) : void
return void
Beispiel #1
0
 public void Encode(Encoder encoder, uint symbol)
 {
     // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol);
     // UpdateModel(symbol);
     uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob;
     if (symbol == 0)
     {
         encoder.Range = newBound;
         Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
     }
     else
     {
         encoder.Low += newBound;
         encoder.Range -= newBound;
         Prob -= (Prob) >> kNumMoveBits;
     }
     if (encoder.Range < Encoder.kTopValue)
     {
         encoder.Range <<= 8;
         encoder.ShiftLow();
     }
 }