This code demonstrates how to pipeline the decoding of multiple JPEG 2000 images using the nvJPEG2000 library.
Image Decoding from nvJPEG2000 Library
SM 6.0 SM 6.1 SM 7.0 SM 7.2 SM 7.5 SM 8.0
Linux, Windows
x86_64
- Recent NVIDIA drivers.
- CUDA toolkit.
- CMake (3.17 or later).
- Install nvJPEG2000.
$ mkdir build
$
$ cd build
$
$ export CUDACXX=/usr/local/cuda/bin/nvcc
$
$ cmake .. -DCMAKE_BUILD_TYPE=Release
# Use -DNVJPEG2K_PATH, if nvJPEG2000 is not installed at the default location.
# example cmake .. -DCMAKE_BUILD_TYPE=Release -DNVJPEG2K_PATH=/opt/libnvjpeg_2k
#
$ make
./nvjpeg2k_dec_pipelined -h
Usage: ./nvjpeg2k_dec_pipelined -i images_dir [-b batch_size] [-t total_images] [-w warmup_iterations] [-o output_dir] Parameters:
images_dir : Path to single image or directory of images
batch_size : Decode images from input by batches of specified size
total_images : Decode these many images, if there are fewer images
in the input than total images, decoder will loop over the input
warmup_iterations: Run these many batches first without measuring performance
output_dir : Write decoded images in BMP/PGM format to this directory