MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / DecodeInit

Method DecodeInit

Libraries/unrar/model.cpp:569–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567
568
569bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar)
570{
571 int MaxOrder=UnpackRead->GetChar();
572 bool Reset=(MaxOrder & 0x20)!=0;
573
574 int MaxMB;
575 if (Reset)
576 MaxMB=UnpackRead->GetChar();
577 else
578 if (SubAlloc.GetAllocatedMemory()==0)
579 return(false);
580 if (MaxOrder & 0x40)
581 EscChar=UnpackRead->GetChar();
582 Coder.InitDecoder(UnpackRead);
583 if (Reset)
584 {
585 MaxOrder=(MaxOrder & 0x1f)+1;
586 if (MaxOrder>16)
587 MaxOrder=16+(MaxOrder-16)*3;
588 if (MaxOrder==1)
589 {
590 SubAlloc.StopSubAllocator();
591 return(false);
592 }
593 SubAlloc.StartSubAllocator(MaxMB+1);
594 StartModelRare(MaxOrder);
595 }
596 return(MinContext!=NULL);
597}
598
599
600int ModelPPM::DecodeChar()

Callers 1

ReadTables30Method · 0.80

Calls 5

GetAllocatedMemoryMethod · 0.80
InitDecoderMethod · 0.80
StopSubAllocatorMethod · 0.80
StartSubAllocatorMethod · 0.80
GetCharMethod · 0.45

Tested by

no test coverage detected