intel / intel/vpl-gpu-rt

[Bug]: Min/Max QPI/P/B not in documented 1..51 range

Open
#297 10 comments 0 reactions 2 assignees Claimed by @bai-isaac View on GitHub
Encode HEVC
Dominant language
C++
Stars
157
Forks
104
PR merge metrics
No merged PRs in 30d

Description

### Which component impacted?

Encode

### Is it regression? Good in old configuration?

No, this issue exist a long time

### What happened?

VPL and MSDK documentation states Min/Max QPI/P/B valid range is 1..51 (0 for default).
However, the runtime returns ranges outside of the documented range depending on the codec, bitdepth, and/or VME vs. VDENC mode.

* https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption2
* https://spec.oneapi.io/onevpl/2.5.0/API_ref/VPL_structs_encode.html#mfxextcodingoption2

Using ffmpeg-qsv , we can observe the ranges returned by the runtime as:

1. encode 8bit hevc VME returns `MinQPI: 1; MaxQPI: 51; MinQPP: 1; MaxQPP: 51; MinQPB: 1; MaxQPB: 51`
1. encode 8bit hevc VDENC returns `MinQPI: 10; MaxQPI: 51; MinQPP: 10; MaxQPP: 51; MinQPB: 10; MaxQPB: 51`
1. encode 10bit hevc VME returns `MinQPI: 12; MaxQPI: 63; MinQPP: 12; MaxQPP: 63; MinQPB: 12; MaxQPB: 63`
1. encode 10bit hevc VDENC returns `MinQPI: 22; MaxQPI: 63; MinQPP: 22; MaxQPP: 63; MinQPB: 22; MaxQPB: 63`
1. encode 12bit hevc VME return `MinQPI: 24; MaxQPI: 75; MinQPP: 24; MaxQPP: 75; MinQPB: 24; MaxQPB: 75`

Unfortunately, VPL/MSDK will clamp any user value outside of these ranges. Additionally, ffmpeg-qsv also clamps any value outside of 1..51 range. So even though user can pass any value to ffmpeg-qsv, the effective honored range will only be [MinQPI/P/B, 51]. Apart from being confusing to the end-user, this means the ffmpeg end-user is unable to take advantage of the full underlying QP range that is achievable by the runtime.

From the middleware (ffmpeg, gstreamer) perspective, the end-user should not have to know about these internal/runtime nuances. Thus, the runtime should map it's documented standard 1..51 range to its underlying actual range.

### What's the usage scenario when you are seeing the problem?

Transcode for media delivery

### What impacted?

gstreamer, ffmpeg, other user apps/middleware. Compression levels may appear low for default values in apps/middleware.

### Debug Information

Verified issue on TGL

### Do you want to contribute a patch to fix the issue?

None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.