Add support for ROCJPEG_OUTPUT_RGB_PLANAR output format (#15)

* Add support for ROCJPEG_OUTPUT_RGB_PLANAR output format

* update the jpegdecode sample based on the review comments

* use make_float3 when it's possible

[ROCm/rocjpeg commit: c591c342aa]
This commit is contained in:
Aryan Salmanpour
2024-04-16 18:27:22 -04:00
committed by GitHub
parent 61df754d42
commit bd5af8b66c
10 changed files with 937 additions and 224 deletions
@@ -224,9 +224,14 @@ RocJpegStatus RocJpegVappiDecoder::SubmitDecode(const JpegStreamParameters *jpeg
// If RGB output format is requested, and the HW JPEG decoder has a built-in format conversion,
// set the RGB surface format and attributes to obtain the RGB output directly from the JPEG HW decoder.
// otherwise set the appropriate surface format and attributes based on the chroma subsampling of the image.
if (output_format == ROCJPEG_OUTPUT_RGB && current_vcn_jpeg_spec_.can_convert_to_rgb) {
surface_format = VA_RT_FORMAT_RGB32;
surface_attrib.value.value.i = VA_FOURCC_RGBA;
if ((output_format == ROCJPEG_OUTPUT_RGB || output_format == ROCJPEG_OUTPUT_RGB_PLANAR) && current_vcn_jpeg_spec_.can_convert_to_rgb) {
if (output_format == ROCJPEG_OUTPUT_RGB) {
surface_format = VA_RT_FORMAT_RGB32;
surface_attrib.value.value.i = VA_FOURCC_RGBA;
} else if (output_format == ROCJPEG_OUTPUT_RGB_PLANAR) {
surface_format = VA_RT_FORMAT_RGBP;
surface_attrib.value.value.i = VA_FOURCC_RGBP;
}
} else {
switch (jpeg_stream_params->chroma_subsampling) {
case CSS_444: