/* Copyright (C) Teemu Suutari */ #ifndef STREAMCODEC_H #define STREAMCODEC_H #include #include #include "onekpaq_common.h" class StreamCodec { public: enum class EncodeMode : uint { Single=1, Multi, SingleFast, MultiFast, ModeLast=MultiFast }; enum class EncoderComplexity : uint { Low=1, Medium, High, ComplexityLast=High }; StreamCodec() { } ~StreamCodec() = default; std::vector CreateSingleStream(); const std::vector &GetAsmDest1() { return _destAsm1; } const std::vector &GetAsmDest2() { return _destAsm2; } EncodeMode getMode() const { return _mode; } uint GetShift() const { return _shift; } void Encode(const std::vector> &blocks,EncodeMode mode,EncoderComplexity complexity,const std::string &cacheFileName); void LoadStream(std::vector singleStream); std::vector Decode(); std::vector DecodeAsmStream(); private: std::vector CreateAsmHeader(); std::vector> _header; std::vector _dest; // encoded stream std::vector _destAsm1; std::vector _destAsm2; EncodeMode _mode=EncodeMode::Single; uint _shift; }; #endif