diff options
| author | Antonin Descampe <antonin@gmail.com> | 2011-05-18 11:02:27 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2011-05-18 11:02:27 +0000 |
| commit | 88f43b15fab0c75c10635c9e3d6381e5d716b8e9 (patch) | |
| tree | dd05218cd57a6d2de5bfc10db1e777f84e31d314 /libopenjpeg/tcd.c | |
| parent | 0c9f6a3ac9ede04eb6faf96b7d7a9586c551a9c2 (diff) | |
defined new type "opj_bool", and new constants OPJ_FALSE and OPJ_TRUE, to avoid having to deal with "stdbool.h" (patch from Winfried)
Diffstat (limited to 'libopenjpeg/tcd.c')
| -rw-r--r-- | libopenjpeg/tcd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index 7f154f4b..26548564 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -997,7 +997,7 @@ void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final) { } } -bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info) { +opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info) { int compno, resno, bandno, precno, cblkno, passno, layno; double min, max; double cumdisto[100]; /* fixed_quality */ @@ -1149,7 +1149,7 @@ bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestre } if (!success) { - return false; + return OPJ_FALSE; } if(cstr_info) { /* Threshold for Marcela Index */ @@ -1161,7 +1161,7 @@ bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestre cumdisto[layno] = (layno == 0) ? tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]); } - return true; + return OPJ_TRUE; } int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info) { @@ -1313,7 +1313,7 @@ int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, op return l; } -bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info) { +opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info) { int l; int compno; int eof = 0; @@ -1396,7 +1396,7 @@ bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, op if (tcd->image->comps[compno].resno_decoded < 0) { opj_event_msg(tcd->cinfo, EVT_ERROR, "Error decoding tile. The number of resolutions to remove [%d+1] is higher than the number " " of resolutions in the original codestream [%d]\nModify the cp_reduce parameter.\n", tcd->cp->reduce, tile->comps[compno].numresolutions); - return false; + return OPJ_FALSE; } } @@ -1476,10 +1476,10 @@ bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, op opj_event_msg(tcd->cinfo, EVT_INFO, "- tile decoded in %f s\n", tile_time); if (eof) { - return false; + return OPJ_FALSE; } - return true; + return OPJ_TRUE; } void tcd_free_decode(opj_tcd_t *tcd) { |
