* rocDecode: Set the correct surface format for high bit depths. (#339)

- No functional changes as surface format does not affect the actual allocation of the VA surface in this call due to IHV specific implementation. The app still needs to set the format correctly.

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>

[ROCm/rocdecode commit: 21ae1d010a]
Tento commit je obsažen v:
jeffqjiangNewaAryan Salmanpour authored and GitHub committed 2024-05-06 08:09:23 -04:00
1 rodič 7ea07e5477
revize 0ac8dd3bae
1 file changed
+8 -2
+8 -2
Zobrazit soubor
@@ -168,13 +168,19 @@ rocDecStatus VaapiVideoDecoder::CreateSurfaces() {
return ROCDEC_INVALID_PARAMETER;
}
va_surface_ids_.resize(decoder_create_info_.num_decode_surfaces);
uint8_t surface_format;
uint32_t surface_format;
switch (decoder_create_info_.chroma_format) {
case rocDecVideoChromaFormat_Monochrome:
surface_format = VA_RT_FORMAT_YUV400;
break;
case rocDecVideoChromaFormat_420:
surface_format = VA_RT_FORMAT_YUV420;
if (decoder_create_info_.bit_depth_minus_8 == 2) {
surface_format = VA_RT_FORMAT_YUV420_10;
} else if (decoder_create_info_.bit_depth_minus_8 == 4) {
surface_format = VA_RT_FORMAT_YUV420_12;
} else {
surface_format = VA_RT_FORMAT_YUV420;
}
break;
case rocDecVideoChromaFormat_422:
surface_format = VA_RT_FORMAT_YUV422;