From 9bd7efd8643524c4afc2224399b12f85de0d18e1 Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Wed, 8 Nov 2023 15:46:22 +0000 Subject: [PATCH] Added hc level options for AES front end Signed-off-by: Richard Chapman --- system/jlib/jlzw.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/system/jlib/jlzw.cpp b/system/jlib/jlzw.cpp index 2fd0258fd53..19c2b5f436a 100644 --- a/system/jlib/jlzw.cpp +++ b/system/jlib/jlzw.cpp @@ -2875,7 +2875,7 @@ ICompressHandlerIterator *getCompressHandlerIterator() bool addCompressorHandler(ICompressHandler *handler) { - if (compressors.lookup(handler->queryMethod())) + if (compressors.lookup(handler->queryType())) { handler->Release(); return false; // already registered @@ -2956,13 +2956,20 @@ MODULE_INIT(INIT_PRIORITY_STANDARD) }; class CAESLZ4HCCompressHandler : public CCompressHandlerBase { + StringBuffer typestring; + StringBuffer levelstring; public: - virtual const char *queryType() const { return "AESLZ4HC"; } + CAESLZ4HCCompressHandler(unsigned level) + { + typestring.appendf("AESLZ4HC_%u", level); + levelstring.appendf("hclevel=%u", level); + } + virtual const char *queryType() const { return typestring.str(); } virtual CompressionMethod queryMethod() const { return (CompressionMethod) (COMPRESS_METHOD_AES|COMPRESS_METHOD_LZ4HC); } virtual ICompressor *getCompressor(const char *options) { assertex(options); - return new CAESCompressor(options, strlen(options),createLZ4Compressor(nullptr, true)); + return new CAESCompressor(options, strlen(options),createLZ4Compressor(levelstring, true)); } virtual IExpander *getExpander(const char *options) { @@ -3005,7 +3012,8 @@ MODULE_INIT(INIT_PRIORITY_STANDARD) addCompressorHandler(new CLZWCompressHandler()); addCompressorHandler(new CAESCompressHandler()); addCompressorHandler(new CAESLZ4CompressHandler()); - addCompressorHandler(new CAESLZ4HCCompressHandler()); + addCompressorHandler(new CAESLZ4HCCompressHandler(3)); + addCompressorHandler(new CAESLZ4HCCompressHandler(9)); addCompressorHandler(new CDiffCompressHandler()); addCompressorHandler(new CRDiffCompressHandler()); addCompressorHandler(new CRandRDiffCompressHandler());