From 19d91ae2c5d58d6ae3796f3d6c47b1ab426cd0ba Mon Sep 17 00:00:00 2001 From: Shaofeng Tang Date: Fri, 12 Jul 2024 15:37:56 +0800 Subject: [PATCH] Add max resolution for MPEG2 on Gen12 Max resolution of MPEG2 is 2K. assigning 2048x2048 for MPEG2 attributies fixes: #1830 --- .../linux/gen12/ddi/media_libva_caps_g12.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp b/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp index 9f001a8458..a72be068d3 100644 --- a/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp +++ b/media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp @@ -466,6 +466,10 @@ VAStatus MediaLibvaCapsG12::GetPlatformSpecificAttrib(VAProfile profile, { *value = CODEC_4K_MAX_PIC_WIDTH; } + else if(IsMpeg2Profile(profile)) + { + *value = CODEC_2K_MAX_PIC_WIDTH; + } else { *value = CODEC_MAX_PIC_WIDTH; @@ -490,6 +494,10 @@ VAStatus MediaLibvaCapsG12::GetPlatformSpecificAttrib(VAProfile profile, { *value = CODEC_4K_MAX_PIC_HEIGHT; } + else if(IsMpeg2Profile(profile)) + { + *value = CODEC_2K_MAX_PIC_HEIGHT; + } else { *value = CODEC_MAX_PIC_HEIGHT; @@ -2356,7 +2364,7 @@ VAStatus MediaLibvaCapsG12::CreateDecAttributes( { attrib.value = ENCODE_JPEG_MAX_PIC_WIDTH; } - if(IsVc1Profile(profile)) + if(IsVc1Profile(profile) || IsMpeg2Profile(profile)) { attrib.value = CODEC_2K_MAX_PIC_WIDTH; } @@ -2380,7 +2388,7 @@ VAStatus MediaLibvaCapsG12::CreateDecAttributes( { attrib.value = ENCODE_JPEG_MAX_PIC_HEIGHT; } - if(IsVc1Profile(profile)) + if(IsVc1Profile(profile) || IsMpeg2Profile(profile)) { attrib.value = CODEC_2K_MAX_PIC_HEIGHT; }