Page MenuHome

Fix T57397: Movies are blurred after sws_scale
ClosedPublic

Authored by Richard Antalik (ISS) on Jun 2 2021, 1:48 AM.

Details

Summary

Images with 4:2:2 and 4:4:4 chroma subsampling were blurred when
SWS_FAST_BILINEAR interpolation is set for anim->img_convert_ctx.

Use SWS_BILINEAR interpolation for all movies, as performance is
not impacted by this change.


I have found another resource (not sure if original author), where image is also scaled, so this is slightly different case.
https://blog.fearcat.in/a?ID=00150-2b119ba7-5986-43b4-87bd-dfbd426e8d1f

So perhaps in some cases it may be worth checking for subsampling and switching interpolation method. Perhaps this info could be left in comment, but I am not sure if my assumption is true.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D11457 (branched from master)
Build Status
Buildable 14894
Build 14894: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.Jun 2 2021, 1:48 AM
Richard Antalik (ISS) created this revision.

SWS_FAST_BILINEAR is faster than SWS_BILINEAR

Do you have some numbers about how much faster the SWS_FAST_BILINEAR is? And whether it is measurable in the overall frame processing (meaning, for example, even if SWS_FAST_BILINEAR is 2x faster than SWS_BILINEAR but the code takes 1% of the overall frame processing and is not measurable by artists we can always use more accurate interpolation)?

SWS_FAST_BILINEAR is faster than SWS_BILINEAR

Do you have some numbers about how much faster the SWS_FAST_BILINEAR is? And whether it is measurable in the overall frame processing (meaning, for example, even if SWS_FAST_BILINEAR is 2x faster than SWS_BILINEAR but the code takes 1% of the overall frame processing and is not measurable by artists we can always use more accurate interpolation)?

Initially I measured about 1.5x regression, but this was on 10 frame sample file. Testing again on lossless render with 4:4:4 subsampling I see no measurable decrease in performance. Same goes for original file played in loop, so I will change flag directly with no switching.

  • Remove interpolation method switching based on chroma subsampling.

Description needs an update :)
Otherwise think this is much better way to go.

Richard Antalik (ISS) edited the summary of this revision. (Show Details)Jun 2 2021, 2:55 PM
This revision is now accepted and ready to land.Jun 2 2021, 3:03 PM
Richard Antalik (ISS) edited the summary of this revision. (Show Details)Jun 2 2021, 3:12 PM