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
scaling incredibly slow if smpte2084 used as input transfer function #59
Comments
|
What version are you using? Inexact transfer functions were added in v2.3. If you are using the API, see zimg_filter_graph_params::allow_approximate_gamma (https://github.com/sekrit-twc/zimg/blob/master/src/zimg/api/zimg.h#L571). |
|
I'm using the git master head of this zimg repository from within ffmpeg (also git master head), via ffmpeg's "-vf zscale=" filter. It seems ffmpeg does not expose a flag to use inexact gamma. |
|
Surely you can report this to ffmpeg. Something like this will work: |
|
I changed libavfilter/vf_zscale.c to set allow_approximate_gamma=1, and yes, that makes a very big difference. Thanks a lot! Now I only need to solve the remaining issue of the bt709 result looking somewhat too dark or the highlights blown out when using a lower npl value, but that's a different topic. |
|
If you are converting from ST2084 to Rec.709, you are going to get clipping artifacts. HDR support in z.lib is only intended for HDR-to-HDR or SDR-to-HDR. |
|
(Created https://trac.ffmpeg.org/ticket/5980#ticket regarding parameter support in ffmpeg.) |
Scaling with zimg becomes incredibly slow (0.2 fps on a corei7) if smpte2084 is used as an input transfer function.
perf topreveals that the vast majority of CPU time is then spent inzimg::colorspace::st_2084_inverse_gammafor calls tozimg_x_powfcallingpowf:Wouldn't it be possible to just computs LUTs on initialization, not requiring such an expensive math function for every pixel?
The text was updated successfully, but these errors were encountered: