forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify the logic of selection of overviews for non-nearest resampling…
…; add a GDAL_OVERVIEW_OVERSAMPLING_THRESHOLD config option (OSGeo#9040) The current logic reads: ``` * Some formats may efficiently implement decimation into a buffer by * reading from lower resolution overview images. The logic of the default * implementation in the base class GDALRasterBand is the following one. It * computes a target_downscaling_factor from the window of interest and buffer * size which is min(nXSize/nBufXSize, nYSize/nBufYSize). * It then walks through overviews and will select the first one whose * downscaling factor is greater than target_downscaling_factor / 1.2. * * Let's assume we have overviews at downscaling factors 2, 4 and 8. * The relationship between target_downscaling_factor and the select overview * level is the following one: * * target_downscaling_factor | selected_overview * ------------------------- | ----------------- * ]0, 2 / 1.2] | full resolution band * ]2 / 1.2, 4 / 1.2] | 2x downsampled band * ]4 / 1.2, 8 / 1.2] | 4x downsampled band * ]8 / 1.2, infinity[ | 8x downsampled band ``` With this PR, is is ammended with the following complement: ``` * Note that starting with GDAL 3.9, this 1.2 oversampling factor can be * modified by setting the GDAL_OVERVIEW_OVERSAMPLING_THRESHOLD configuration * option. Also note that starting with GDAL 3.9, when the resampling algorithm * specified in psExtraArg->eResampleAlg is different from GRIORA_NearestNeighbour, * this oversampling threshold defaults to 1. Consequently if there are overviews * of downscaling factor 2, 4 and 8, and that the desired downscaling factor is * 7.99, the overview of factor 4 will be selected for a non nearest resampling. ```
- Loading branch information
Showing
8 changed files
with
183 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters