rigaya / QSVEnc

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

Using Luma in unsharp #142

Closed quamt closed 1 year ago

quamt commented 1 year ago

Hello @rigaya,

I want to check for the --vpp-unsharp option. I see the following option in the options list.

--vpp-unsharp [<param1>=<value1>[,<param2>=<value2>]...]
unsharp filter, for edge and detail enhancement.

Parameters

radius=<int> (default=3, 1-9)
radius of edge / detail detection.

weight=<float> (default=0.5, 0-10)
Strength of edge and detail emphasis. Larger value will result stronger effect.

threshold=<float> (default=10.0, 0-255)
Threshold for edge and detail detection.

Is it possible to implement Luma for unsharp, or is it there, and I do not see it?

rigaya commented 1 year ago

There is no luma option supported in QSVEnc.

Please let me know the details of the algorithms and the usefullness of luma option discussed here, so I can figure out if it could be implemented or not.

quamt commented 1 year ago

The luma values in FFmpeg's unsharp filter specifically target the brightness information in the video. When it comes to parameters, the unsharp filter in FFmpeg accepts two sets of parameters: one for the luma (Y) and one for chroma (C).

It should have a lesser impact on producing artefacts than chroma usage in unsharp.

EDIT: Found the following information: https://ffmpeg.org/ffmpeg-filters.html#unsharp-1

rigaya commented 1 year ago

Although the filter name is the same, implementation in ffmpeg is different compared to the one in qsvencc, for example qsvencc does not have matrix stuff but has radius, weight and threshold. Therefore, the parameters cannot be copied in to qsvencc.

What kind of problem do you have now for the filter, and why do you need separate settings for luma and chroma?

quamt commented 1 year ago

Multiplying the original colour by a sharpening value will make it sharper but can cause some colour fringe artefacts.

Luma sharpening splits the brightness part (the luma) from the colour part (the chroma) and then only applies it to the Luma before recombining them again.

This gets rid of any colour artefacts. Luma mode is of higher quality.

rigaya commented 1 year ago

I'm sorry but I don't seem to be able to add support for this.

quamt commented 1 year ago

@rigaya What is the option here that mentions Luma Key? https://github.com/intel/media-driver/#video-processing-features