Skip to content

Commit

Permalink
[debug] print jdata compression message inside matlab
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Dec 17, 2023
1 parent 28e5101 commit 9831c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -4207,15 +4207,15 @@ int mcx_jdataencode(void* vol, int ndim, uint* dims, char* type, int byte, int
totalbytes = datalen * byte;

if (!cfg->isdumpjson) {
MCX_FPRINTF(stdout, "compressing data [%s] ...", zipformat[zipid]);
MCX_FPRINTF(cfg->flog, "compressing data [%s] ...", zipformat[zipid]);
}

/*compress data using zlib*/
ret = zmat_encode(totalbytes, (uchar*)vol, &compressedbytes, (uchar**)&compressed, zipid, &status);

if (!ret) {
if (!cfg->isdumpjson) {
MCX_FPRINTF(stdout, "compression ratio: %.1f%%\t", compressedbytes * 100.f / totalbytes);
MCX_FPRINTF(cfg->flog, "compression ratio: %.1f%%\t", compressedbytes * 100.f / totalbytes);
}

if (isubj) {
Expand All @@ -4233,7 +4233,7 @@ int mcx_jdataencode(void* vol, int ndim, uint* dims, char* type, int byte, int
ret = zmat_encode(compressedbytes, compressed, &totalbytes, (uchar**)&buf, zmBase64, &status);

if (!cfg->isdumpjson) {
MCX_FPRINTF(stdout, "after encoding: %.1f%%\n", totalbytes * 100.f / (datalen * byte));
MCX_FPRINTF(cfg->flog, "after encoding: %.1f%%\n", totalbytes * 100.f / (datalen * byte));
}

if (!ret) {
Expand Down

0 comments on commit 9831c7e

Please sign in to comment.