*.gcno *.gcda *.gcov gmon.out
check: encode decode test_szcomp
- ./encode -c -b1 -B8 -S128 ../data/example_data > ../data/test.aee
- ./decode -b1 -B8 -S128 ../data/test.aee
+ ./encode -c -b1 -B8 -R128 ../data/example_data > ../data/test.aee
+ ./decode -b1 -B8 -R128 ../data/test.aee
diff ../data/test ../data/example_data
- ./encode -c -b1024 -B8 -S128 ../data/example_data > ../data/test.aee
- ./decode -b1024 -B8 -S128 ../data/test.aee
+ ./encode -c -b1024 -B8 -R128 ../data/example_data > ../data/test.aee
+ ./decode -b1024 -B8 -R128 ../data/test.aee
diff ../data/test ../data/example_data
./test_szcomp 65536 ../data/example_data_16
state->xmax = (1ULL << strm->bit_per_sample) - 1;
}
- state->ref_int = strm->block_size * strm->segment_size;
+ state->ref_int = strm->block_size * strm->rsi;
state->in_blklen = (strm->block_size * strm->bit_per_sample
+ state->id_len) / 8 + 1;
{
case M_ID:
if (state->pp
- && (state->samples_out / strm->block_size) % strm->segment_size == 0)
+ && (state->samples_out / strm->block_size) % strm->rsi == 0)
state->ref = 1;
else
state->ref = 0;
if (zero_blocks == ROS)
{
- zero_blocks = strm->segment_size - (
+ zero_blocks = 64 - (
(state->samples_out / strm->block_size)
- % strm->segment_size);
+ % strm->rsi % 64);
}
else if (zero_blocks > ROS)
{
return AE_MEM_ERROR;
}
- /* Zero blocks can span a segment and thus need up to segment_size
- bits in encoded block */
- blklen = MAX(strm->block_size * strm->bit_per_sample,
- strm->segment_size + 10);
- blklen = (blklen + state->id_len) / 8 + 3;
+ /* Largest possible block according to specs */
+ blklen = (5 + 16 * 32) / 8 + 3;
state->block_out = (uint8_t *)malloc(blklen);
if (state->block_out == NULL)
{
/* If this is the first block in a segment
then we need to insert a reference sample.
*/
- if(state->total_blocks % strm->segment_size == 1)
+ if(state->total_blocks % strm->rsi == 1)
{
state->ref = 1;
state->last_in = state->block_in[0];
state->zero_blocks++;
- if (state->total_blocks % strm->segment_size == 0)
+ if (state->total_blocks % strm->rsi % 64 == 0)
{
#ifdef PROFILE
state->prof[0] += state->zero_blocks;
chunk = CHUNK;
strm.bit_per_sample = 8;
strm.block_size = 8;
- strm.segment_size = 2;
+ strm.rsi = 2;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
opterr = 0;
- while ((c = getopt (argc, argv, "cb:B:S:")) != -1)
+ while ((c = getopt (argc, argv, "cb:B:R:")) != -1)
switch (c)
{
case 'b':
case 'B':
strm.bit_per_sample = atoi(optarg);
break;
- case 'S':
- strm.segment_size = atoi(optarg);
+ case 'R':
+ strm.rsi = atoi(optarg);
break;
case 'c':
cflag = 1;
chunk = CHUNK;
strm.bit_per_sample = 8;
strm.block_size = 8;
- strm.segment_size = 2;
+ strm.rsi = 2;
strm.flags = AE_DATA_MSB | AE_DATA_PREPROCESS;
opterr = 0;
- while ((c = getopt (argc, argv, "cb:B:S:")) != -1)
+ while ((c = getopt (argc, argv, "cb:B:R:")) != -1)
switch (c)
{
case 'b':
case 'B':
strm.bit_per_sample = atoi(optarg);
break;
- case 'S':
- strm.segment_size = atoi(optarg);
+ case 'R':
+ strm.rsi = atoi(optarg);
break;
case 'c':
cflag = 1;
uint32_t bit_per_sample; /* resolution in bits per sample (n =
* 1,..., 32) */
uint32_t block_size; /* block size in samples (J = 8 or 16) */
- uint32_t segment_size; /* set of blocks between consecutive
- * reference samples */
+ uint32_t rsi; /* Reference sample interval, the number of
+ blocks between consecutive reference
+ samples. */
uint32_t flags;
struct internal_state *state;
strm.bit_per_sample = param->bits_per_pixel;
strm.block_size = param->pixels_per_block;
- strm.segment_size = param->pixels_per_scanline / param->pixels_per_block;
+ strm.rsi = param->pixels_per_scanline / param->pixels_per_block;
strm.flags = param->options_mask;
strm.avail_in = sourceLen;
strm.avail_out = *destLen;
strm.bit_per_sample = param->bits_per_pixel;
strm.block_size = param->pixels_per_block;
- strm.segment_size = param->pixels_per_scanline / param->pixels_per_block;
+ strm.rsi = param->pixels_per_scanline / param->pixels_per_block;
strm.flags = param->options_mask;
strm.avail_in = sourceLen;
strm.avail_out = *destLen;