diff options
| author | Antonin Descampe <antonin@gmail.com> | 2014-04-17 09:31:37 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2014-04-17 09:31:37 +0000 |
| commit | 7199d9b5d32e9974afa62243756b027fc394f860 (patch) | |
| tree | 909c03c737feed9462147776f988d0059e58a928 /src/bin | |
| parent | d19a4ab6768c48b542c0add922eba0dcddae9ffe (diff) | |
[trunk] refactoring of rsiz, profiles, and extensions management
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/jp2/convert.c | 9 | ||||
| -rw-r--r-- | src/bin/jp2/opj_compress.c | 10 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c index b41618c7..1b2d3618 100644 --- a/src/bin/jp2/convert.c +++ b/src/bin/jp2/convert.c @@ -2597,6 +2597,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters) int has_alpha = 0; unsigned short tiBps, tiPhoto, tiSf, tiSpp, tiPC; unsigned int tiWidth, tiHeight; + OPJ_BOOL is_cinema = OPJ_IS_CINEMA(parameters->rsiz); tif = TIFFOpen(filename, "r"); @@ -2669,7 +2670,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters) */ memset(&cmptparm[0], 0, 4 * sizeof(opj_image_cmptparm_t)); - if ((tiPhoto == PHOTOMETRIC_RGB) && (parameters->cp_cinema)) { + if ((tiPhoto == PHOTOMETRIC_RGB) && (is_cinema)) { fprintf(stdout,"WARNING:\n" "Input image bitdepth is %d bits\n" "TIF conversion has automatically rescaled to 12-bits\n" @@ -2685,7 +2686,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters) /*#define USETILEMODE*/ for(j = 0; j < numcomps; j++) { - if(parameters->cp_cinema) + if(is_cinema) { cmptparm[j].prec = 12; cmptparm[j].bpp = 12; @@ -2754,7 +2755,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters) if(has_alpha) image->comps[3].data[index] = ( dat8[i+7] << 8 ) | dat8[i+6]; - if(parameters->cp_cinema) + if(is_cinema) { /* Rounding 16 to 12 bits */ @@ -2791,7 +2792,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters) image->comps[3].data[index] = dat8[i+3]; #endif - if(parameters->cp_cinema) + if(is_cinema) { /* Rounding 8 to 12 bits */ diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c index b8cdafcd..aba30ef9 100644 --- a/src/bin/jp2/opj_compress.c +++ b/src/bin/jp2/opj_compress.c @@ -968,9 +968,13 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param int fps=0; sscanf(opj_optarg,"%d",&fps); if(fps == 24){ - parameters->cp_cinema = OPJ_CINEMA2K_24; + parameters->rsiz = OPJ_PROFILE_CINEMA_2K; + parameters->max_comp_size = OPJ_CINEMA_24_COMP; + parameters->max_cs_size = OPJ_CINEMA_24_CS; }else if(fps == 48 ){ - parameters->cp_cinema = OPJ_CINEMA2K_48; + parameters->rsiz = OPJ_PROFILE_CINEMA_2K; + parameters->max_comp_size = OPJ_CINEMA_48_COMP; + parameters->max_cs_size = OPJ_CINEMA_48_CS; }else { fprintf(stderr,"Incorrect value!! must be 24 or 48\n"); return 1; @@ -985,7 +989,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param case 'y': /* Digital Cinema 4K profile compliance*/ { - parameters->cp_cinema = OPJ_CINEMA4K_24; + parameters->rsiz = OPJ_PROFILE_CINEMA_4K; fprintf(stdout,"CINEMA 4K profile activated\n" "Other options specified could be overriden\n"); } |
