intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
664 stars 302 forks source link

va: limit to VAProfileAV1Profile2_420 #832

Closed davidwuAMD closed 16 hours ago

davidwuAMD commented 3 months ago

Some hardwares do not support a full set of AV1 profile2, in this case use a subset instead. At the moment, VAProfileAV1Profile2_420 is for supporting 12-bit 4:2:0.

davidwuAMD commented 3 months ago

this is to address the issue in https://github.com/intel/libva/pull/828

davidwuAMD commented 2 months ago

@XinfengZhang, any concern about this patch? please let me know I can take a look.

davidwuAMD commented 2 months ago

wondering if this change can be merged? Am I missing something?

XinfengZhang commented 2 months ago

I am ok to merge it , but still not understand why profile + vaSurfaceAttrib could not report the restriction, such as 12bit 422only could use profile2+P010 format. of course, it will be more complex than current solution.

davidwuAMD commented 2 months ago

OK - I will see if I can find something with profile + vaSurfaceAttrib. I think there could be a reporting issue (vainfo) as it cannot show 420only if we did not define a profile for it. (but I need to look into more details to be sure). When will be the next libva release? I'd like to see if we need to apply this merge or not before that.

XinfengZhang commented 2 months ago

suppose next release will happened by end of this year. I am ok to merge current change, because it is simpler than profile+vaSurfaceAttrib. application just need to query the profile list. of course, from other hand, if backend driver want to support both. they have to report both profile.

I am thinking whether there are similar problem with other codec, and whether we need to use "profile + surfaceAttrib" to keep behavior consistent.

just like AV1 profile0, how to clarify driver support monochrome or not? ho to differentiate driver support 444 8bit or 444 10bit for AV1 profile1? and suppose there are also some problem with VP9.

so, both solution is ok to me, feel free to ping me to merge current PR.

davidwuAMD commented 19 hours ago

Hi @XinfengZhang - either VAProfileAV1Profile2_420 or VAProfileAV1Profile2 should be OK for mesa or libva. The real issue is in ffmpeg which uses the best match profile/format to decode video. Once ffmpeg enables full set profile2 support then ffmpeg will use p012 to decode a YUV444 video clip even though it is not supported in mesa (only 12bit YUV420 is supported).

davidwuAMD commented 18 hours ago

we have a solution for ffmpeg so it won't do unexpected fallback. in this case - we can keep VAProfileAV1Profile2 - I can drop this MR -

davidwuAMD commented 16 hours ago

let me drop this PR as there is a solution in ffmpeg to check the RT format so it won't use an unexpected format to decode