comptable_codec.h 893 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "codecs.h"
  3. #include <util/generic/ptr.h>
  4. namespace NCodecs {
  5. class TCompTableCodec: public ICodec {
  6. class TImpl;
  7. TIntrusivePtr<TImpl> Impl;
  8. public:
  9. enum EQuality {
  10. Q_LOW = 0,
  11. Q_HIGH = 1
  12. };
  13. explicit TCompTableCodec(EQuality q = Q_HIGH);
  14. ~TCompTableCodec() override;
  15. static TStringBuf MyNameHQ() {
  16. return "comptable-hq";
  17. }
  18. static TStringBuf MyNameLQ() {
  19. return "comptable-lq";
  20. }
  21. TString GetName() const override;
  22. ui8 Encode(TStringBuf in, TBuffer& out) const override;
  23. void Decode(TStringBuf in, TBuffer& out) const override;
  24. protected:
  25. void DoLearn(ISequenceReader& in) override;
  26. void Save(IOutputStream* out) const override;
  27. void Load(IInputStream* in) override;
  28. };
  29. }