ECC-303: patch for parameters.numresolution

This commit is contained in:
Shahram Najm 2016-07-28 13:00:58 +01:00
parent d372840ea0
commit fc309590d2
1 changed files with 11 additions and 1 deletions

View File

@ -342,9 +342,19 @@ int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper)
parameters.tcp_numlayers = 1;
parameters.cp_disto_alloc = 1;
parameters.numresolution = 1;
/* parameters.numresolution = 1; */
parameters.tcp_rates[0] = helper->compression;
/* By default numresolution = 6 (must be between 1 and 32)
* This may be too large for some of our datasets, eg. 1xn, so adjust ...
*/
parameters.numresolution = 6;
while ( (helper->width < (OPJ_UINT32) (1 << (parameters.numresolution - 1U)) ) ||
(helper->height < (OPJ_UINT32) (1 << (parameters.numresolution - 1U)) ))
{
parameters.numresolution--;
}
/* initialize image component */
cmptparm.prec = helper->bits_per_value;
cmptparm.bpp = helper->bits_per_value; /* Not sure about this one and the previous. What is the difference? */