Commit f9d1eb3
authored
Wire JPEG (TIFF tag 7) into the GPU decode and encode pipelines.
When libnvjpeg.so is available, read_geotiff(gpu=True) and
write_geotiff(gpu=True, compression='jpeg') use nvJPEG for
hardware-accelerated JPEG on GPU. Falls back to Pillow on CPU
when nvJPEG is not installed.
Changes:
- _gpu_decode.py: Add _find_nvjpeg_lib/_get_nvjpeg lazy discovery,
_try_nvjpeg_batch_decode for GPU reads, _nvjpeg_batch_encode for
GPU writes. Hook tag 7 into gpu_decode_tiles and gpu_compress_tiles.
- _writer.py: Add 'jpeg' to _compression_tag map. Handle JPEG in
_write_tiled and _write_stripped (call jpeg_compress directly,
skip predictor). Validate uint8 dtype and 1/3 band constraint.
- __init__.py: Update docstrings with JPEG option.
- README.md: Add nvJPEG to GPU codecs list and JPEG write example.
- tests/test_jpeg.py: 13 tests covering codec round trips, tag
wiring, tiled/stripped write-read, public API, and dtype validation.
- tests/test_writer.py: Fix test_unsupported_compression (was using
'jpeg' as the unsupported example).
1 parent 819ee71 commit f9d1eb3
File tree
6 files changed
+533
-11
lines changed- xrspatial/geotiff
- tests
6 files changed
+533
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
| |||
756 | 759 | | |
757 | 760 | | |
758 | 761 | | |
759 | | - | |
| 762 | + | |
| 763 | + | |
760 | 764 | | |
761 | 765 | | |
762 | 766 | | |
| |||
0 commit comments