Misclleanous cleanups.

Fix some formatting.
Increase metadata chunk size slightly.
This commit is contained in:
Moinak Ghosh 2014-12-19 19:15:39 +05:30
parent 2cd41ec257
commit 9a5361f010
8 changed files with 15 additions and 12 deletions

View file

@ -224,7 +224,7 @@ pack_audio(WavpackContext *wpc, read_data *rdat)
uint32_t samples_remaining, input_samples = INPUT_SAMPLES, samples_read = 0;
int bytes_per_sample;
int32_t *sample_buffer;
unsigned char *input_buffer;
unsigned char *input_buffer = NULL; // Silence compiler
// don't use an absurd amount of memory just because we have an absurd number of channels

View file

@ -110,7 +110,8 @@ static int delta2_encode_real(uchar_t *src, uint64_t srclen, uchar_t *dst, uint6
* buffer then delta encoding is aborted.
*/
int
delta2_encode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen, int rle_thresh, int nstrides)
delta2_encode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen,
int rle_thresh, int nstrides)
{
if (srclen > MAX_THRESH) {
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: srclen: %" PRIu64 " is too big.\n", srclen));
@ -135,7 +136,8 @@ delta2_encode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen, int
if (rv == -1)
return (rv);
*dstlen += MAIN_HDR;
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: srclen: %" PRIu64 ", dstlen: %" PRIu64 "\n", srclen, *dstlen));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: srclen: %" PRIu64 ", dstlen: %" PRIu64 "\n",
srclen, *dstlen));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: header overhead: %d\n", hdr_ovr));
} else {
uchar_t *srcpos, *dstpos, *lastdst, *lastsrc, *dstend;
@ -205,9 +207,11 @@ delta2_encode(uchar_t *src, uint64_t srclen, uchar_t *dst, uint64_t *dstlen, int
}
*dstlen = dstpos - dst;
DEBUG_STAT_EN(en = get_wtime_millis());
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: srclen: %" PRIu64 ", dstlen: %" PRIu64 "\n", srclen, *dstlen));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: srclen: %" PRIu64 ", dstlen: %" PRIu64 "\n",
srclen, *dstlen));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: header overhead: %d\n", hdr_ovr));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: Processed at %.3f MB/s\n", get_mb_s(srclen, strt, en)));
DEBUG_STAT_EN(fprintf(stderr, "DELTA2: Processed at %.3f MB/s\n",
get_mb_s(srclen, strt, en)));
}
return (0);
}

View file

@ -1014,7 +1014,7 @@ Inverse_E89(uint8_t *src, uint64_t sz)
* a block contains valid x86 code by trying to estimate some instruction metrics.
*/
int
dispack_encode(uchar_t *from, uint64_t fromlen, uchar_t *to, uint64_t *dstlen, int stype)
dispack_encode(uchar_t *from, uint64_t fromlen, uchar_t *to, uint64_t *dstlen)
{
uchar_t *pos, *hdr, type, *pos_to, *to_last;
sU32 len;

View file

@ -31,8 +31,7 @@
extern "C" {
#endif
int dispack_encode(uchar_t *from, uint64_t fromlen, uchar_t *to, uint64_t *_dstlen,
int stype);
int dispack_encode(uchar_t *from, uint64_t fromlen, uchar_t *to, uint64_t *_dstlen);
int dispack_decode(uchar_t *from, uint64_t fromlen, uchar_t *to, uint64_t *dstlen);
int Forward_E89(uint8_t *src, uint64_t sz);

View file

@ -41,7 +41,7 @@
#include "allocator.h"
#include "meta_stream.h"
#define METADATA_CHUNK_SIZE (2 * 1024 * 1024)
#define METADATA_CHUNK_SIZE (3 * 1024 * 1024)
extern int bzip2_compress(void *src, uint64_t srclen, void *dst, uint64_t *dstlen,
int level, uchar_t chdr, int btype, void *data);

View file

@ -86,7 +86,7 @@ struct ext_entry {
{"bib" , TYPE_TEXT, 3},
{"lua" , TYPE_TEXT, 3},
{"nse" , TYPE_TEXT, 3},
{"dtd" , TYPE_TEXT, 3},
{"dtd" , TYPE_TEXT|TYPE_MARKUP, 3},
{"qml" , TYPE_TEXT|TYPE_MARKUP, 3},
{"fa" , TYPE_TEXT|TYPE_DNA_SEQ, 2},
{"faa" , TYPE_TEXT|TYPE_DNA_SEQ, 3},

View file

@ -73,7 +73,7 @@ ps,TYPE_TEXT
bib,TYPE_TEXT
lua,TYPE_TEXT
nse,TYPE_TEXT
dtd,TYPE_TEXT
dtd,TYPE_TEXT|TYPE_MARKUP
qml,TYPE_TEXT|TYPE_MARKUP
# These are all genomic data file extensions

View file

@ -193,7 +193,7 @@ typedef int32_t bsize_t;
#ifdef __APPLE__
#define CLOCK_MONOTONIC 0
#define CLOCK_REALTIME 1
#define CLOCK_REALTIME 1
#endif
/*