diff --git a/iaa.cpp b/iaa.cpp index 1ec6fe2..2e0ca66 100644 --- a/iaa.cpp +++ b/iaa.cpp @@ -218,7 +218,7 @@ int UncompressIAA(uint8_t* input, uint32_t* input_length, uint8_t* output, job->dictionary = nullptr; qpl_status status = qpl_execute_job(job); - if (status != QPL_STS_OK) { + if (status != QPL_STS_OK && status != QPL_STS_MORE_OUTPUT_NEEDED) { Log(LogLevel::LOG_ERROR, "UncompressIAA() Line ", __LINE__, " qpl_execute_job status ", status, "\n"); return 1; diff --git a/logging.h b/logging.h index 7b74d9f..b5e8301 100644 --- a/logging.h +++ b/logging.h @@ -61,6 +61,7 @@ inline void Log(LogLevel level, Args&&... args) { } std::ostream& stream = GetLogStream(); + stream << std::dec; switch (level) { case LogLevel::LOG_ERROR: stream << "Error: "; diff --git a/qat.cpp b/qat.cpp index 2ef4c0c..d5bc57e 100644 --- a/qat.cpp +++ b/qat.cpp @@ -100,6 +100,7 @@ void QATJob::Init(QzSessionPtr &qzSession, CompressedFormat format, } // Initialize QAT hardware + qzSetLogLevel(LOG_NONE); int status = qzInit(session.get(), 0); if (status != QZ_OK && status != QZ_DUPLICATE) { Log(LogLevel::LOG_ERROR, "qzInit() failure Line ", __LINE__, " session ", diff --git a/qat.h b/qat.h index 3a04045..f81285e 100644 --- a/qat.h +++ b/qat.h @@ -14,6 +14,8 @@ #define VISIBLE_FOR_TESTING __attribute__((visibility("default"))) +inline constexpr unsigned int QAT_DEST_BUFFER_MIN_SIZE = 512; + inline constexpr unsigned int QAT_HW_BUFF_SZ = QZ_HW_BUFF_MAX_SZ; class QATJob { diff --git a/zlib_accel.cpp b/zlib_accel.cpp index e260841..72c5105 100644 --- a/zlib_accel.cpp +++ b/zlib_accel.cpp @@ -296,7 +296,7 @@ int ZEXPORT deflate(z_streamp strm, int flush) { #endif #ifdef USE_QAT qat_available = - configs[USE_QAT_COMPRESS] && + configs[USE_QAT_COMPRESS] && output_len >= QAT_DEST_BUFFER_MIN_SIZE && SupportedOptionsQAT(deflate_settings->window_bits, input_len); #endif @@ -1352,7 +1352,6 @@ int ZEXPORT gzeof(gzFile file) { GzipFile* gz = gzip_files.Get(file); return gz->reached_eof; } - #if defined(__clang__) #pragma clang attribute pop #endif