intel / intel/libva

Standardize the way of handling a resolution switch in non-keyframe

Open
#634 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
784
Forks
314
PR merge metrics
No merged PRs in 30d

Description

Traditionally, `vaCreateContext()` is called when a stream resolution is changed (i.e. a keyframe), setting the new resolution to the arguments of `vaCreateContext()`, `picture_width` and `picture_height`.

But a frame scaling in VP9 and AV1 enables changing a resolution in non-keyframe, and a frame can reference different resolution frames.
For example, the resolutions of frames in some VP9 stream are changed like 360p, 360p,.., 180p, 180p,.., 720p, 720p without any keyframe, and 180p can refer 360p frames and 720p can reference 180p frames.

If we recreate va context by `vaDestroyContext()` and `vaCreateContext()`, internal variables of referencing preceding frames may be destroyed ("may" because this is undefined in VA-API).

[Intel media driver](https://github.com/intel/media-driver) can handle a frame whose size is larger than the `picture_width`x`picture_height` configured in vaCreateContext().
The driver can decode the stream by not calling vaCreateContext() even though a resolution is changed.

On the other hand, [AMD mesa gallium driver](https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/gallium/frontends/va) cannot handle a frame whose size is larger than the size configured in vaCreateContext().
Therefore, there is no way of handling a resolution change in non-keyframe with the AMD driver.

We need to standardize the way of handling a resolution switch in non-keyframe.

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.