Add support for rocJpegDecodeBatched API - part 1 of 2 (#31)

* Add initial support for batch decoding

* Add support for reading and parsing the images in batches and allocating the output buffers

* Add initial support for the rocJpegDecodeBatched API

* use recursive_mutex to allow DecodeBatched and Decode functions called concurrently

* code cleanup

* Add a CTEST for jpegdecodebatched

* modify the help message

* code clean up
Šī revīzija ir iekļauta:
Aryan Salmanpour
2024-06-13 14:04:53 -04:00
revīziju iesūtīja GitHub
vecāks 3a65ac9aea
revīzija c660aeab43
13 mainīti faili ar 429 papildinājumiem un 18 dzēšanām
+16 -1
Parādīt failu
@@ -84,6 +84,21 @@ public:
*/
RocJpegStatus Decode(RocJpegStreamHandle jpeg_stream, const RocJpegDecodeParams *decode_params, RocJpegImage *destination);
/**
* Decodes a batch of JPEG streams.
*
* This function decodes a batch of JPEG streams specified by `jpeg_streams` into a batch of destination images specified by `destinations`.
* The number of JPEG streams in the batch is specified by `batch_size`.
* The decoding parameters are specified by `decode_params`.
*
* @param jpeg_streams The array of JPEG stream handles.
* @param batch_size The number of JPEG streams in the batch.
* @param decode_params The decoding parameters.
* @param destinations The array of destination images.
* @return The status of the decoding operation.
*/
RocJpegStatus DecodeBatched(RocJpegStreamHandle *jpeg_streams, int batch_size, const RocJpegDecodeParams *decode_params, RocJpegImage *destinations);
private:
/**
* @brief Initializes the HIP framework.
@@ -156,7 +171,7 @@ private:
int device_id_; // ID of the device to be used
hipDeviceProp_t hip_dev_prop_; // HIP device properties
hipStream_t hip_stream_; // HIP stream
std::mutex mutex_; // Mutex for thread safety
std::recursive_mutex mutex_; // Mutex for thread safety
RocJpegBackend backend_; // RocJpeg backend
RocJpegVappiDecoder jpeg_vaapi_decoder_; // RocJpeg VAAPI decoder object
};