Skip to content

va: Add encoding QP map parameters #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruijingdong
Copy link
Contributor

QP map is a way of controlling block
level QP(QI). Here it introduces two
modes, delta and absolute. Delta mode
will add/minus extra QP(QI) values
based on CQP/RC's QP result, while
absolute mode is directly using the QP
(QI) values from QP map whenever possible;
in absolute mode, since RC's adjustment
on QP values not working, it is only
valid in CQP mode, and RC adjustment
in fact is processed externally.

Adding this is to support some encoding
HWs, and provides a way of QP adjustment
in addition to HW internal RC modes.

This defines VAEncMiscParameterQPMap
structure and its corresponding attribute
VAConfigAttribValEncQPMap, also defines
the format of QP map element and buffer
specification.

In contrast with FEI, QP map is an
independent parameter set, and can be
applied to the needed profiles, only
with extra processing of the proposed
misc parameters.

QP map is a way of controlling block
level QP(QI). Here it introduces two
modes, delta and absolute. Delta mode
will add/minus extra QP(QI) values
based on CQP/RC's QP result, while
absolute mode is directly using the QP
(QI) values from QP map whenever possible;
in absolute mode, since RC's adjustment
on QP values not working, it is only
valid in CQP mode, and RC adjustment
in fact is processed externally.

Adding this is to support some encoding
HWs, and provides a way of QP adjustment
in addition to HW internal RC modes.

This defines VAEncMiscParameterQPMap
structure and its corresponding attribute
VAConfigAttribValEncQPMap, also defines
the format of QP map element and buffer
specification.

In contrast with FEI, QP map is an
independent parameter set, and can be
applied to the needed profiles, only
with extra processing of the proposed
misc parameters.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
@xhaihao xhaihao requested a review from XinfengZhang March 14, 2025 01:13
@ruijingdong
Copy link
Contributor Author

Hi @XinfengZhang,

I proposed a structure of QP map adjustment based on current AMD VCN implementation to VAAPI interface, this just provides an additional way to rate control, and to let external driver or application be able to handle rate control partially or totally. It is sharing the same logic as ROI in AMD driver stack, just QP map is more flexible, and it operates on the whole frame level.

Also, I have made some draft code changes below for testing.

Libva-utility test draft code
https://github.com/ruijingdong/libva-utils/commits/qp_map_test

Mesa draft code
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33778/commits

Let me know your comments.
Thanks,
Ruijing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant