Files
rocm-systems/samples/jpegDecodeMultiThreads
Pavel Tcherniaev b68b9ba8ea Roi decode feature (#48)
* implemented ROI for NATIVE, YUV_PLANAR, Y, RGB and RGB_PLANAR

* added the changes requested by Aryan in the PR

* prelim check in of ROI

* finished RGB and RGB_PLANAR ROI implementation and testing in rocjpeg_decoder.cpp, updated the versions to 0.6.0, updated jpegdecode.cpp and jpegdecodedbatched.cpp. Still need to modify jpegmultithreads.cpp. Need to run tests on JPEG 444 and 440. And need to add test to ctests and make test. Will update this PR when I've added everything mentioned here.

* changed new_offset and new_uv_offset to roi_offset and roi_uv_offset in rocjpeg_decoder.cpp. Added ROI handling in jpegdecodemultithreads sample. Still need to run tests on jpegdecodemultithreads and jpegdecodebatched.

* addressed all changes Aryan mentioned for PR 48 on August 12

* added tests to ctests and make tests and fixed conflict in jpegdecodemultithreads.cpp

* addressed latest change requests

* removed spaces after case VA_FOURCC_444P

* updated ctests and make tests

* fixed copy/paste error for ctests

* fixed typo with extra $

* added print statement for cropped image dimensions

* addressed latest change requests from Aryan. Ran make tests and ctests, all passed

* added workaround for YUV440 to RGB conversion
2024-08-13 21:30:26 -04:00
..

JPEG decode multi-threads sample

The jpeg decode multi-threads sample illustrates decoding JPEG images using rocJPEG library with multiple threads to get the individual decoded images in one of the supported output format (i.e., native, yuv, y, rgb, rgb_planar). This sample can be configured with a device ID and optionally able to dump the output to a file.

Prerequisites:

Build

mkdir jpeg_decode_threads_sample && cd jpeg_decode_threads_sample
cmake ../
make -j

Run

./jpegdecodemultithreads -i     <[input path] - input path to a single JPEG image or a directory containing JPEG images - [required]>
                         -be    <[backend] - select rocJPEG backend (0 for hardware-accelerated JPEG decoding using VCN,
                                                                     1 for hybrid JPEG decoding using CPU and GPU HIP kernels (currently not supported)) [optional - default: 0]>
                         -fmt   <[output format] - select rocJPEG output format for decoding, one of the [native, yuv, y, rgb, rgb_planar] [optional - default: native]>
                         -o     <[output path] - path to an output file or a path to a directory - write decoded images to a file or directory based on selected output format [optional]>
                         -d     <[device id] - specify the GPU device id for the desired device (use 0 for the first device, 1 for the second device, and so on) [optional - default: 0]>
                         -t     <[threads] - number of threads for parallel JPEG decoding [optional - default: 2]>