General refactor and cleanup.

This commit is contained in:
2024-04-30 15:37:29 +01:00
parent 47e6c8e50f
commit 123879fc7c
27 changed files with 620 additions and 725 deletions

View File

@@ -4,11 +4,14 @@ This repository contains the Aaru.Compression.Native library for [Aaru](https://
The purpose of this library is to provide compression and de-compression algorithms for Aaru.
No archiver processing code should fall here, those go in [Aaru.Compression](https://github.com/aaru-dps/Aaru/tree/devel/Aaru.Compression).
No archiver processing code should fall here, those go
in [Aaru.Compression](https://github.com/aaru-dps/Aaru/tree/devel/Aaru.Compression).
To build you just need Docker on Linux and run `build.sh`, that will generate a NuGet package for use with Aaru.Compression.
To build you just need Docker on Linux and run `build.sh`, that will generate a NuGet package for use with
Aaru.Compression.
Currently implemented algorithms are:
- Apple Data Compression (RLE with sliding dictionary created for Apple Disk Copy's NDIF)
- Apple RLE (Run Length Encoding created for Apple DART)
- [BZIP2](https://gitlab.com/bzip2/bzip2.git)

28
adc.c
View File

@@ -19,10 +19,14 @@ FORCE_INLINE int GetChunkSize(uint8_t byt)
{
switch(GetChunkType(byt))
{
case ADC_PLAIN: return (byt & 0x7F) + 1;
case ADC_TWO_BYTE: return ((byt & 0x3F) >> 2) + 3;
case ADC_THREE_BYTE: return (byt & 0x3F) + 4;
default: return -1;
case ADC_PLAIN:
return (byt & 0x7F) + 1;
case ADC_TWO_BYTE:
return ((byt & 0x3F) >> 2) + 3;
case ADC_THREE_BYTE:
return (byt & 0x3F) + 4;
default:
return -1;
}
}
@@ -30,16 +34,18 @@ FORCE_INLINE int GetOffset(uint8_t chunk[])
{
switch(GetChunkType(chunk[0]))
{
case ADC_PLAIN: return 0;
case ADC_TWO_BYTE: return ((chunk[0] & 0x03) << 8) + chunk[1];
case ADC_THREE_BYTE: return (chunk[1] << 8) + chunk[2];
default: return -1;
case ADC_PLAIN:
return 0;
case ADC_TWO_BYTE:
return ((chunk[0] & 0x03) << 8) + chunk[1];
case ADC_THREE_BYTE:
return (chunk[1] << 8) + chunk[2];
default:
return -1;
}
}
AARU_EXPORT int32_t AARU_CALL AARU_adc_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_adc_decode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size)
{
int inputPosition = 0;

View File

@@ -24,10 +24,8 @@
#include "library.h"
#include "apple_rle.h"
AARU_EXPORT int32_t AARU_CALL AARU_apple_rle_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size)
AARU_EXPORT int32_t AARU_CALL AARU_apple_rle_decode_buffer(uint8_t *dst_buffer, int32_t dst_size,
const uint8_t *src_buffer, int32_t src_size)
{
static int32_t count = 0;
static bool nextA = true; // true if A, false if B

74
flac.c
View File

@@ -12,19 +12,17 @@
#include "3rdparty/flac/include/FLAC/stream_encoder.h"
#include "flac.h"
static FLAC__StreamDecoderReadStatus
read_callback(const FLAC__StreamDecoder* decoder, FLAC__byte buffer[], size_t* bytes, void* client_data);
static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder* decoder,
const FLAC__Frame* frame,
const FLAC__int32* const buffer[],
void* client_data);
static void
error_callback(const FLAC__StreamDecoder* decoder, FLAC__StreamDecoderErrorStatus status, void* client_data);
static FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],
size_t *bytes, void *client_data);
AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size)
static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame,
const FLAC__int32 const *buffer[], void *client_data);
static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status,
void *client_data);
AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t *dst_buffer, size_t dst_size,
const uint8_t *src_buffer, size_t src_size)
{
FLAC__StreamDecoder *decoder;
FLAC__StreamDecoderInitStatus init_status;
@@ -51,8 +49,8 @@ AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t* dst_
FLAC__stream_decoder_set_md5_checking(decoder, false);
init_status = FLAC__stream_decoder_init_stream(
decoder, read_callback, NULL, NULL, NULL, NULL, write_callback, NULL, error_callback, ctx);
init_status = FLAC__stream_decoder_init_stream(decoder, read_callback, NULL, NULL, NULL, NULL, write_callback, NULL,
error_callback, ctx);
if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK)
{
@@ -72,8 +70,8 @@ AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t* dst_
return ret_size;
}
static FLAC__StreamDecoderReadStatus
read_callback(const FLAC__StreamDecoder* decoder, FLAC__byte buffer[], size_t* bytes, void* client_data)
static FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],
size_t *bytes, void *client_data)
{
aaru_flac_ctx *ctx = (aaru_flac_ctx *)client_data;
@@ -87,10 +85,8 @@ static FLAC__StreamDecoderReadStatus
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder* decoder,
const FLAC__Frame* frame,
const FLAC__int32* const buffer[],
void* client_data)
static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame,
const FLAC__int32 const *buffer[], void *client_data)
{
aaru_flac_ctx *ctx = (aaru_flac_ctx *)client_data;
size_t i;
@@ -129,27 +125,14 @@ static void error_callback(const FLAC__StreamDecoder* decoder, FLAC__StreamDecod
}
static FLAC__StreamEncoderWriteStatus encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
size_t bytes,
uint32_t samples,
uint32_t current_frame,
void* client_data);
const FLAC__byte buffer[], size_t bytes, uint32_t samples,
uint32_t current_frame, void *client_data);
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
uint32_t blocksize,
int32_t do_mid_side_stereo,
int32_t loose_mid_side_stereo,
const char* apodization,
uint32_t max_lpc_order,
uint32_t qlp_coeff_precision,
int32_t do_qlp_coeff_prec_search,
int32_t do_exhaustive_model_search,
uint32_t min_residual_partition_order,
uint32_t max_residual_partition_order,
const char* application_id,
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(
uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer, size_t src_size, uint32_t blocksize,
int32_t do_mid_side_stereo, int32_t loose_mid_side_stereo, const char *apodization, uint32_t max_lpc_order,
uint32_t qlp_coeff_precision, int32_t do_qlp_coeff_prec_search, int32_t do_exhaustive_model_search,
uint32_t min_residual_partition_order, uint32_t max_residual_partition_order, const char *application_id,
uint32_t application_id_len)
{
FLAC__StreamEncoder *encoder;
@@ -213,8 +196,8 @@ AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_
if(application_id_len > 0 && application_id != NULL)
if((metadata[0] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION)) != NULL)
FLAC__metadata_object_application_set_data(
metadata[0], (unsigned char*)application_id, application_id_len, true);
FLAC__metadata_object_application_set_data(metadata[0], (unsigned char *)application_id, application_id_len,
true);
FLAC__stream_encoder_set_metadata(encoder, metadata, 1);
@@ -246,11 +229,8 @@ AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_
}
static FLAC__StreamEncoderWriteStatus encoder_write_callback(const FLAC__StreamEncoder *encoder,
const FLAC__byte buffer[],
size_t bytes,
uint32_t samples,
uint32_t current_frame,
void* client_data)
const FLAC__byte buffer[], size_t bytes, uint32_t samples,
uint32_t current_frame, void *client_data)
{
aaru_flac_ctx *ctx = (aaru_flac_ctx *)client_data;

View File

@@ -25,81 +25,54 @@
#include "3rdparty/lzma/C/LzmaLib.h"
#include "3rdparty/zstd/lib/zstd.h"
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_decode_buffer(uint8_t* dst_buffer,
uint32_t* dst_size,
const uint8_t* src_buffer,
uint32_t src_size)
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_decode_buffer(uint8_t *dst_buffer, uint32_t *dst_size,
const uint8_t *src_buffer, uint32_t src_size)
{
return BZ2_bzBuffToBuffDecompress((char *)dst_buffer, dst_size, (char *)src_buffer, src_size, 0, 0);
}
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_encode_buffer(uint8_t* dst_buffer,
uint32_t* dst_size,
const uint8_t* src_buffer,
uint32_t src_size,
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_encode_buffer(uint8_t *dst_buffer, uint32_t *dst_size,
const uint8_t *src_buffer, uint32_t src_size,
int32_t blockSize100k)
{
return BZ2_bzBuffToBuffCompress((char *)dst_buffer, dst_size, (char *)src_buffer, src_size, blockSize100k, 0, 0);
}
AARU_EXPORT size_t AARU_CALL AARU_lzfse_decode_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
void* scratch_buffer)
AARU_EXPORT size_t AARU_CALL AARU_lzfse_decode_buffer(uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer,
size_t src_size, void *scratch_buffer)
{
return lzfse_decode_buffer(dst_buffer, dst_size, src_buffer, src_size, scratch_buffer);
}
AARU_EXPORT size_t AARU_CALL AARU_lzfse_encode_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
void* scratch_buffer)
AARU_EXPORT size_t AARU_CALL AARU_lzfse_encode_buffer(uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer,
size_t src_size, void *scratch_buffer)
{
return lzfse_encode_buffer(dst_buffer, dst_size, src_buffer, src_size, scratch_buffer);
}
AARU_EXPORT int32_t AARU_CALL AARU_lzma_decode_buffer(uint8_t* dst_buffer,
size_t* dst_size,
const uint8_t* src_buffer,
size_t* srcLen,
const uint8_t* props,
size_t propsSize)
AARU_EXPORT int32_t AARU_CALL AARU_lzma_decode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
size_t *srcLen, const uint8_t *props, size_t propsSize)
{
return LzmaUncompress(dst_buffer, dst_size, src_buffer, srcLen, props, propsSize);
}
AARU_EXPORT int32_t AARU_CALL AARU_lzma_encode_buffer(uint8_t* dst_buffer,
size_t* dst_size,
const uint8_t* src_buffer,
size_t srcLen,
uint8_t* outProps,
size_t* outPropsSize,
int32_t level,
uint32_t dictSize,
int32_t lc,
int32_t lp,
int32_t pb,
int32_t fb,
int32_t numThreads)
AARU_EXPORT int32_t AARU_CALL AARU_lzma_encode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
size_t srcLen, uint8_t *outProps, size_t *outPropsSize,
int32_t level, uint32_t dictSize, int32_t lc, int32_t lp,
int32_t pb, int32_t fb, int32_t numThreads)
{
return LzmaCompress(
dst_buffer, dst_size, src_buffer, srcLen, outProps, outPropsSize, level, dictSize, lc, lp, pb, fb, numThreads);
return LzmaCompress(dst_buffer, dst_size, src_buffer, srcLen, outProps, outPropsSize, level, dictSize, lc, lp, pb,
fb, numThreads);
}
AARU_EXPORT size_t AARU_CALL AARU_zstd_decode_buffer(void* dst_buffer,
size_t dst_size,
const void* src_buffer,
AARU_EXPORT size_t AARU_CALL AARU_zstd_decode_buffer(void *dst_buffer, size_t dst_size, const void *src_buffer,
size_t src_size)
{
return ZSTD_decompress(dst_buffer, dst_size, src_buffer, src_size);
}
AARU_EXPORT size_t AARU_CALL AARU_zstd_encode_buffer(void* dst_buffer,
size_t dst_size,
const void* src_buffer,
size_t src_size,
int32_t compressionLevel)
AARU_EXPORT size_t AARU_CALL AARU_zstd_encode_buffer(void *dst_buffer, size_t dst_size, const void *src_buffer,
size_t src_size, int32_t compressionLevel)
{
return ZSTD_compress(dst_buffer, dst_size, src_buffer, src_size, compressionLevel);
}

109
library.h
View File

@@ -54,104 +54,55 @@
#define FORCE_INLINE static inline __attribute__((always_inline))
#endif
AARU_EXPORT int32_t AARU_CALL AARU_adc_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_adc_decode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size);
AARU_EXPORT int32_t AARU_CALL AARU_apple_rle_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size);
AARU_EXPORT int32_t AARU_CALL AARU_apple_rle_decode_buffer(uint8_t *dst_buffer, int32_t dst_size,
const uint8_t *src_buffer, int32_t src_size);
AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size);
AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t *dst_buffer, size_t dst_size,
const uint8_t *src_buffer, size_t src_size);
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
uint32_t blocksize,
int32_t do_mid_side_stereo,
int32_t loose_mid_side_stereo,
const char* apodization,
uint32_t max_lpc_order,
uint32_t qlp_coeff_precision,
int32_t do_qlp_coeff_prec_search,
int32_t do_exhaustive_model_search,
uint32_t min_residual_partition_order,
uint32_t max_residual_partition_order,
const char* application_id,
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(
uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer, size_t src_size, uint32_t blocksize,
int32_t do_mid_side_stereo, int32_t loose_mid_side_stereo, const char *apodization, uint32_t max_lpc_order,
uint32_t qlp_coeff_precision, int32_t do_qlp_coeff_prec_search, int32_t do_exhaustive_model_search,
uint32_t min_residual_partition_order, uint32_t max_residual_partition_order, const char *application_id,
uint32_t application_id_len);
AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size);
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size,
int32_t dictionary_size,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size, int32_t dictionary_size,
int32_t match_len_limit);
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_decode_buffer(uint8_t* dst_buffer,
uint32_t* dst_size,
const uint8_t* src_buffer,
uint32_t src_size);
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_decode_buffer(uint8_t *dst_buffer, uint32_t *dst_size,
const uint8_t *src_buffer, uint32_t src_size);
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_encode_buffer(uint8_t* dst_buffer,
uint32_t* dst_size,
const uint8_t* src_buffer,
uint32_t src_size,
AARU_EXPORT int32_t AARU_CALL AARU_bzip2_encode_buffer(uint8_t *dst_buffer, uint32_t *dst_size,
const uint8_t *src_buffer, uint32_t src_size,
int32_t blockSize100k);
AARU_EXPORT size_t AARU_CALL AARU_lzfse_decode_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
void* scratch_buffer);
AARU_EXPORT size_t AARU_CALL AARU_lzfse_decode_buffer(uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer,
size_t src_size, void *scratch_buffer);
AARU_EXPORT size_t AARU_CALL AARU_lzfse_encode_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
void* scratch_buffer);
AARU_EXPORT size_t AARU_CALL AARU_lzfse_encode_buffer(uint8_t *dst_buffer, size_t dst_size, const uint8_t *src_buffer,
size_t src_size, void *scratch_buffer);
AARU_EXPORT int32_t AARU_CALL AARU_lzma_decode_buffer(uint8_t* dst_buffer,
size_t* dst_size,
const uint8_t* src_buffer,
size_t* src_size,
const uint8_t* props,
size_t propsSize);
AARU_EXPORT int32_t AARU_CALL AARU_lzma_decode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
size_t *src_size, const uint8_t *props, size_t propsSize);
AARU_EXPORT int32_t AARU_CALL AARU_lzma_encode_buffer(uint8_t* dst_buffer,
size_t* dst_size,
const uint8_t* src_buffer,
size_t src_size,
uint8_t* outProps,
size_t* outPropsSize,
int32_t level,
uint32_t dictSize,
int32_t lc,
int32_t lp,
int32_t pb,
int32_t fb,
int32_t numThreads);
AARU_EXPORT int32_t AARU_CALL AARU_lzma_encode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
size_t src_size, uint8_t *outProps, size_t *outPropsSize,
int32_t level, uint32_t dictSize, int32_t lc, int32_t lp,
int32_t pb, int32_t fb, int32_t numThreads);
AARU_EXPORT size_t AARU_CALL AARU_zstd_decode_buffer(void* dst_buffer,
size_t dst_size,
const void* src_buffer,
AARU_EXPORT size_t AARU_CALL AARU_zstd_decode_buffer(void *dst_buffer, size_t dst_size, const void *src_buffer,
size_t src_size);
AARU_EXPORT size_t AARU_CALL AARU_zstd_encode_buffer(void* dst_buffer,
size_t dst_size,
const void* src_buffer,
size_t src_size,
int32_t compressionLevel);
AARU_EXPORT size_t AARU_CALL AARU_zstd_encode_buffer(void *dst_buffer, size_t dst_size, const void *src_buffer,
size_t src_size, int32_t compressionLevel);
#define AARU_CHECKUMS_NATIVE_VERSION 0x06000089

11
lzip.c
View File

@@ -23,9 +23,7 @@
#include "library.h"
#include "3rdparty/lzlib/lzlib.h"
AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size)
{
int max_in_size;
@@ -83,11 +81,8 @@ AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t* dst_buffer,
return out_pos;
}
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size,
int32_t dictionary_size,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t *dst_buffer, int32_t dst_size, const uint8_t *src_buffer,
int32_t src_size, int32_t dictionary_size,
int32_t match_len_limit)
{
int max_in_size;

View File

@@ -20,8 +20,8 @@
#include <cstdint>
#include <cstring>
#include "../adc.h"
#include "../library.h"
#include "../adc.h"
#include "crc32.h"
#include "gtest/gtest.h"

View File

@@ -20,8 +20,8 @@
#include <cstdint>
#include <cstring>
#include "../apple_rle.h"
#include "../library.h"
#include "../apple_rle.h"
#include "crc32.h"
#include "gtest/gtest.h"

View File

@@ -19,6 +19,7 @@
extern "C"
{
#endif
#include <stdint.h>
#define CRC32_ISO_POLY 0xEDB88320
@@ -43,13 +44,13 @@ uint32_t crc32_data(const uint8_t *data, uint32_t len)
localTable[i] = entry;
}
for(i = 0; i < len; i++)
localHashInt = (localHashInt >> 8) ^ localTable[data[i] ^ (localHashInt & 0xff)];
for(i = 0; i < len; i++) localHashInt = (localHashInt >> 8) ^ localTable[data[i] ^ (localHashInt & 0xff)];
localHashInt ^= CRC32_ISO_SEED;
return localHashInt;
}
#ifdef __cplusplus
}
#endif

View File

@@ -24,6 +24,7 @@ extern "C"
#endif
uint32_t crc32_data(const uint8_t *data, uint32_t len);
#ifdef __cplusplus
}
#endif

View File

@@ -20,8 +20,8 @@
#include <cstddef>
#include <cstdint>
#include "../flac.h"
#include "../library.h"
#include "../flac.h"
#include "crc32.h"
#include "gtest/gtest.h"
@@ -109,22 +109,9 @@ TEST_F(flacFixture, flacCompress)
original_crc = crc32_data(original, original_len);
// Compress
newSize = AARU_flac_encode_redbook_buffer(cmp_buffer,
cmp_len,
original,
original_len,
4608,
1,
0,
"partial_tukey(0/1.0/1.0)",
12,
0,
1,
false,
0,
8,
"Aaru.Compression.Native.Tests",
strlen("Aaru.Compression.Native.Tests"));
newSize = AARU_flac_encode_redbook_buffer(cmp_buffer, cmp_len, original, original_len, 4608, 1, 0,
"partial_tukey(0/1.0/1.0)", 12, 0, 1, false, 0, 8,
"Aaru.Compression.Native.Tests", strlen("Aaru.Compression.Native.Tests"));
cmp_len = newSize;
// Decompress

View File

@@ -114,8 +114,8 @@ TEST_F(lzmaFixture, lzmaCompress)
original_crc = crc32_data(original, original_len);
// Compress
err = AARU_lzma_encode_buffer(
cmp_buffer, &cmp_len, original, original_len, props, &props_len, 9, 1048576, 3, 0, 2, 273, 2);
err = AARU_lzma_encode_buffer(cmp_buffer, &cmp_len, original, original_len, props, &props_len, 9, 1048576, 3, 0, 2,
273, 2);
EXPECT_EQ(err, 0);
// Decompress