From c51b1189e3d5353e842991f5859ddcea0f73e426 Mon Sep 17 00:00:00 2001 From: theuni Date: Mon, 24 Jan 2011 16:05:21 -0500 Subject: Merged cptspiff's code-reshuffle branch. Squashed commit due to build breakage during code-reshuffle history. Conflicts: xbmc/Util.cpp xbmc/cdrip/CDDARipper.cpp xbmc/filesystem/Directory.cpp xbmc/filesystem/File.cpp --- lib/UnrarXLib/coder.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/UnrarXLib/coder.hpp (limited to 'lib/UnrarXLib/coder.hpp') diff --git a/lib/UnrarXLib/coder.hpp b/lib/UnrarXLib/coder.hpp new file mode 100644 index 0000000000..f09f911c09 --- /dev/null +++ b/lib/UnrarXLib/coder.hpp @@ -0,0 +1,24 @@ +/**************************************************************************** + * Contents: 'Carryless rangecoder' by Dmitry Subbotin * + ****************************************************************************/ + +const uint TOP=1 << 24, BOT=1 << 15; + +class RangeCoder +{ + public: + void InitDecoder(Unpack *UnpackRead); + inline int GetCurrentCount(); + inline uint GetCurrentShiftCount(uint SHIFT); + inline void Decode(); + inline void PutChar(unsigned int c); + inline unsigned int GetChar(); + + uint low, code, range; + struct SUBRANGE + { + uint LowCount, HighCount, scale; + } SubRange; + + Unpack *UnpackRead; +}; -- cgit v1.2.3