Add comments for filter_width values

This commit is contained in:
Even Rouault 2017-08-21 12:25:38 +02:00
parent f87c5ef7eb
commit 17a7ac42d5
2 changed files with 13 additions and 0 deletions

View File

@ -1676,6 +1676,8 @@ static OPJ_BOOL opj_dwt_decode_partial_tile(opj_tcd_t *tcd,
opj_dwt_t h;
opj_dwt_t v;
OPJ_UINT32 resno;
/* This value matches the maximum left/right extension given in tables */
/* F.2 and F.3 of the standard. */
const OPJ_UINT32 filter_width = 2U;
opj_tcd_resolution_t* tr = tilec->resolutions;
@ -2255,6 +2257,9 @@ OPJ_BOOL opj_dwt_decode_partial_97(opj_tcd_t *tcd,
opj_v4dwt_t h;
opj_v4dwt_t v;
OPJ_UINT32 resno;
/* This value matches the maximum left/right extension given in tables */
/* F.2 and F.3 of the standard. Note: in opj_tcd_is_subband_area_of_interest() */
/* we currently use 3. */
const OPJ_UINT32 filter_width = 4U;
opj_tcd_resolution_t* tr = tilec->resolutions;

View File

@ -2381,6 +2381,14 @@ OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
OPJ_UINT32 band_x1,
OPJ_UINT32 band_y1)
{
/* Note: those values for filter_margin are in part the result of */
/* experimentation. The value 2 for QMFBID=1 (5x3 filter) can be linked */
/* to the maximum left/right extension given in tables F.2 and F.3 of the */
/* standard. The value 3 for QMFBID=0 (9x7 filter) is more suspicious, */
/* since F.2 and F.3 would lead to 4 instead, so the current 3 might be */
/* needed to be bumped to 4, in case inconsistencies are found while */
/* decoding parts of irreversible coded images. */
/* See opj_dwt_decode_partial_53 and opj_dwt_decode_partial_97 as well */
OPJ_UINT32 filter_margin = (tcd->tcp->tccps[compno].qmfbid == 1) ? 2 : 3;
opj_tcd_tilecomp_t *tilec = &(tcd->tcd_image->tiles->comps[compno]);
opj_image_comp_t* image_comp = &(tcd->image->comps[compno]);