Allow configuration of the number of guard bits when encoding.

This commit is contained in:
Carl Hetherington 2021-01-28 22:24:24 +01:00
parent 90481203a2
commit dc567e7753
3 changed files with 4 additions and 1 deletions

View File

@ -8202,7 +8202,7 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
tccp->qmfbid = parameters->irreversible ? 0 : 1;
tccp->qntsty = parameters->irreversible ? J2K_CCP_QNTSTY_SEQNT :
J2K_CCP_QNTSTY_NOQNT;
tccp->numgbits = 2;
tccp->numgbits = parameters->numgbits;
if ((OPJ_INT32)i == parameters->roi_compno) {
tccp->roishift = parameters->roi_shift;

View File

@ -762,6 +762,7 @@ void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t
parameters->cp_fixed_alloc = 0;
parameters->cp_fixed_quality = 0;
parameters->jpip_on = OPJ_FALSE;
parameters->numgbits = 2;
/* UniPG>> */
#ifdef USE_JPWL
parameters->jpwl_epc_on = OPJ_FALSE;

View File

@ -448,6 +448,8 @@ typedef struct opj_cparameters {
int prcw_init[OPJ_J2K_MAXRLVLS];
/** initial precinct height */
int prch_init[OPJ_J2K_MAXRLVLS];
/** number of guard bits */
int numgbits;
/**@name command line encoder parameters (not used inside the library) */
/*@{*/