diff --git a/tests/encode_samples.json b/tests/encode_samples.json index 5cacfdbb..ed399492 100644 --- a/tests/encode_samples.json +++ b/tests/encode_samples.json @@ -172,7 +172,9 @@ "profile": "main10", "extra_args": [ "--inputBpp", - "10" + "10", + "--msbShift", + "6" ], "description": "Test H.265 Main10 profile encoding", "width": 352, @@ -251,7 +253,9 @@ "profile": "main", "extra_args": [ "--inputBpp", - "10" + "10", + "--msbShift", + "6" ], "description": "Test AV1 Main profile 10-bit encoding", "width": 352, diff --git a/vk_video_encoder/libs/VkVideoEncoder/VkEncoderConfig.cpp b/vk_video_encoder/libs/VkVideoEncoder/VkEncoderConfig.cpp index 9b2e0eb0..249fee96 100644 --- a/vk_video_encoder/libs/VkVideoEncoder/VkEncoderConfig.cpp +++ b/vk_video_encoder/libs/VkVideoEncoder/VkEncoderConfig.cpp @@ -663,6 +663,10 @@ int EncoderConfig::ParseArguments(int argc, const char *argv[]) return -1; } + if (input.msbShift < 0 && input.bpp > 8) { + input.msbShift = static_cast(16 - input.bpp); + } + frameCount = inputFileHandler.GetFrameCount(input.width, input.height, input.bpp, input.chromaSubsampling); if (numFrames == 0 || numFrames > frameCount) {