rigaya / QSVEnc

QSVによる高速エンコードの性能実験
http://rigaya34589.blog135.fc2.com/blog-category-10.html
Other
313 stars 28 forks source link

SampleAdaptiveOffset #65

Closed mikk9 closed 10 months ago

mikk9 commented 3 years ago

There is a confusion about SampleAdaptiveOffset. According to feature check it's not supported, but in the log (from Tigerlake) it says "sao: all" which suggests it's enabled. We can't disable it though, same for tskip by the way.

Ext. Features WeightP WeightB QPOffset tskip ctu:64 sao:all

There is also a hevcehw_g12_sao.h on github: https://github.com/Intel-Media-SDK/MediaSDK/blob/510d19dcace1d8c57567fdd40b557155ab11ab8e/_studio/mfx_lib/encode_hw/hevc/agnostic/g12/hevcehw_g12_sao.h

pHEVC->SampleAdaptiveOffset , mfxU16(MFX_SAO_UNKNOWN) , mfxU16(MFX_SAO_DISABLE) , mfxU16(!bNoSAO MFX_SAO_ENABLE_LUMA) , mfxU16(!bNoSAO MFX_SAO_ENABLE_CHROMA) , mfxU16(!bNoSAO * (MFX_SAO_ENABLE_LUMA | MFX_SAO_ENABLE_CHROMA)));

For grainy video content it can be beneficial to disable SAO because it tends to smooth things out, sometimes it's not needed.

rigaya commented 3 years ago

The parameters in the log is acquired by calling MFXVideoENCODE_GetVideoParam and somehow it is always returning tskip:on, ctu:64, sao:all, even if I set "--sao none" or "--ctu 16"...

I'm not sure the cause of this (whether my implementation is wrong or the driver error), but as the other parameters are returned correctly, I think there are some problem specific to these parameters (ctu, tskip and sao).

As feature check shows it is not supported, I think that it is not enabled in actual encoding.

I will remove printing these parameters from the next version, as it shows confusing results as you have mentioned.

mikk9 commented 3 years ago

On Kabylake Gen9 it didn't show tskip and sao in the encoding log. CTU seems correct also, ctu 32 for Gen9 hardware which is correct and ctu 64 for Gen12, so I would guess tskip+sao is enabled on Gen12 hardware but for whatever reason it can't be enabled/disabled and properly detected from the feature check.

Mister-XY commented 3 years ago

I can confirm that I cannot deactivate SAO on the 12th generation.

rigaya commented 3 years ago

Gen12 graphics seems to have problem with ctu, tskip and sao. These will be not shown from QSVEnc 6.00 as it is rather confusing.

mikk9 commented 2 years ago

I've tried QSVEnc 7.05 with newest driver and it works now, I can disable/enable SAO. I can also enable/disable tskip. I can say SAO and tskip were enabled from the beginning, the parameter in the log were correct. I think you can re-enable the tskip, SAO, ctu log parameter.

https://abload.de/img/saocgka0.png