Implement Qualcomm Sahara VIP and fix a few bugs

* Qualcomm Sahara VIP
* Project Cleanup
* Allow unlocking an already unlocked phone
This commit is contained in:
Gustave Monce
2021-08-11 14:33:49 +02:00
parent 9f4c92f437
commit c5fcb1ec8d
72 changed files with 987 additions and 861 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ namespace SevenZip.Compression.RangeCoder
{
internal class Encoder
{
public const uint kTopValue = (1 << 24);
public const uint kTopValue = 1 << 24;
private System.IO.Stream Stream;
@@ -128,7 +128,7 @@ namespace SevenZip.Compression.RangeCoder
internal class Decoder
{
public const uint kTopValue = (1 << 24);
public const uint kTopValue = 1 << 24;
public uint Range;
public uint Code;
// public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16);
+3 -3
View File
@@ -5,7 +5,7 @@ namespace SevenZip.Compression.RangeCoder
internal struct BitEncoder
{
public const int kNumBitModelTotalBits = 11;
public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
public const uint kBitModelTotal = 1 << kNumBitModelTotalBits;
private const int kNumMoveBits = 5;
private const int kNumMoveReducingBits = 2;
public const int kNumBitPriceShiftBits = 6;
@@ -53,7 +53,7 @@ namespace SevenZip.Compression.RangeCoder
static BitEncoder()
{
const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
const int kNumBits = kNumBitModelTotalBits - kNumMoveReducingBits;
for (int i = kNumBits - 1; i >= 0; i--)
{
UInt32 start = (UInt32)1 << (kNumBits - i - 1);
@@ -77,7 +77,7 @@ namespace SevenZip.Compression.RangeCoder
internal struct BitDecoder
{
public const int kNumBitModelTotalBits = 11;
public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
public const uint kBitModelTotal = 1 << kNumBitModelTotalBits;
private const int kNumMoveBits = 5;
private uint Prob;
@@ -141,7 +141,7 @@ namespace SevenZip.Compression.RangeCoder
uint bit = Models[m].Decode(rangeDecoder);
m <<= 1;
m += bit;
symbol |= (bit << bitIndex);
symbol |= bit << bitIndex;
}
return symbol;
}
@@ -156,7 +156,7 @@ namespace SevenZip.Compression.RangeCoder
uint bit = Models[startIndex + m].Decode(rangeDecoder);
m <<= 1;
m += bit;
symbol |= (bit << bitIndex);
symbol |= bit << bitIndex;
}
return symbol;
}