Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions projects/rocjpeg/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
Documentation for rocJPEG is available at
[https://rocm.docs.amd.com/projects/rocJPEG/en/latest/](https://rocm.docs.amd.com/projects/rocJPEG/en/latest/)

## (unreleased) rocJPEG 1.11.0
## (unreleased) rocJPEG 1.12.0

### Changed
### Added

* Changed the HIP YUV-to-RGB color conversion kernels from the BT.709 standard to BT.601 for color space conversion.
* Added HIP-based color conversion kernels to the batched decode path, improving batched decoding performance.

### Added
## rocJPEG 1.11.0

* Added HIP color-conversion kernels in the batched decode path
### Changed

* Changed the HIP YUV-to-RGB color conversion kernels from the BT.709 standard to BT.601 for color space conversion.

## rocJPEG 1.9.0

Expand Down
2 changes: 1 addition & 1 deletion projects/rocjpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ endif()

# rocjpeg Version
# NOTE: package version and rocjpeg_version.h is generated with this version
set(VERSION "1.11.0")
set(VERSION "1.12.0")

# Set Project Version and Language
project(rocjpeg VERSION ${VERSION} LANGUAGES CXX)
Expand Down
334 changes: 13 additions & 321 deletions projects/rocjpeg/src/rocjpeg_decoder.cpp

Large diffs are not rendered by default.

53 changes: 7 additions & 46 deletions projects/rocjpeg/src/rocjpeg_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ class RocJpegDecoder {
RocJpegStatus InitHIP(int device_id);

/**
* @brief Waits for a submitted surface and copies/converts the decoded output.
* @brief Waits for the submitted surfaces and copies/converts the decoded output.
*
* This is the only finalize path; the single-image decoders call it with a batch size of one.
*/
RocJpegStatus FinalizeDecode(VASurfaceID surface_id, const JpegStreamParameters *jpeg_stream_params, const RocJpegDecodeParams *decode_params, RocJpegImage *destination);
RocJpegStatus FinalizeDecodeBatched(const VASurfaceID *surface_ids, const JpegStreamParameters *jpeg_stream_params, const RocJpegDecodeParams *decode_params, RocJpegImage *destinations, int batch_size);

/**
Expand All @@ -228,50 +229,10 @@ class RocJpegDecoder {
*/
RocJpegStatus CopyChannel(HipInteropDeviceMem& hip_interop, uint16_t channel_width, uint16_t channel_height, uint8_t channel_index, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);

/**
* @brief Converts the image to RGB color space.
* @param hip_interop The HIP interop device memory.
* @param picture_width The width of the picture.
* @param picture_height The height of the picture.
* @param destination Pointer to the destination image.
* @return The status of the operation.
*/
RocJpegStatus ColorConvertToRGB(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);

/**
* @brief Converts the image to RGB planar color space.
* @param hip_interop The HIP interop device memory.
* @param picture_width The width of the picture.
* @param picture_height The height of the picture.
* @param destination Pointer to the destination image.
* @return The status of the operation.
*/
RocJpegStatus ColorConvertToRGBPlanar(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);

/**
* @brief Retrieves the output format for planar YUV images.
* @param hip_interop The HIP interop device memory.
* @param picture_width The width of the picture.
* @param picture_height The height of the picture.
* @param chroma_height The height of the chroma channel.
* @param destination Pointer to the destination image.
* @return The status of the operation.
*/
RocJpegStatus GetPlanarYUVOutputFormat(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, uint16_t chroma_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);

/**
* @brief Retrieves the output format for Y images.
* @param hip_interop The HIP interop device memory.
* @param picture_width The width of the picture.
* @param picture_height The height of the picture.
* @param destination Pointer to the destination image.
* @return The status of the operation.
*/
RocJpegStatus GetYOutputFormat(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);

// Batched-path accumulators: mirror the per-image color-convert/output helpers above,
// but instead of launching a kernel per image they append params to the per-kernel
// scratch buffers below. Memcpy-only work (CopyChannel) is still issued inline.
// Per-image output producers for the group loop in FinalizeDecodeBatched. Instead of
// launching a kernel per image, they append params to the per-kernel scratch buffers
// below, which LaunchBatchedParams then issues in one launch each. Memcpy-only work
// (CopyChannel) is still issued inline.
RocJpegStatus AccumulateColorConvertToRGB(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);
RocJpegStatus AccumulateColorConvertToRGBPlanar(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);
RocJpegStatus AccumulatePlanarYUVOutputFormat(HipInteropDeviceMem& hip_interop, uint32_t picture_width, uint32_t picture_height, uint16_t chroma_height, RocJpegImage *destination, const RocJpegDecodeParams *decode_params, bool is_roi_valid);
Expand Down
Loading