Skip to content
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

Do not downscale if self.scale_factor == 1 #2809

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

redzic
Copy link
Collaborator

@redzic redzic commented Sep 16, 2021

This removes unnecessary allocations and overhead.

@redzic redzic force-pushed the no-unnecessary-downscale branch 3 times, most recently from 27d7722 to 5e8f198 Compare September 17, 2021 00:24
@coveralls
Copy link
Collaborator

coveralls commented Sep 17, 2021

Coverage Status

Coverage decreased (-0.4%) to 83.213% when pulling 5e8f198 on redzic:no-unnecessary-downscale into 0c066cb on xiph:master.

@redzic
Copy link
Collaborator Author

redzic commented Sep 17, 2021

This makes fast scenecut significantly faster on clips that use a downscale factor of 1, as it completely avoids the overhead of downscaling.

Tested on 240x240 resolution clip:

Performance of fast_scenecut on the clip before this change:

image

Performance of fast_scenecut on the clip after this change:

image

So it is about 17x faster on that clip. There shouldn't be any change in awcy.

Copy link
Collaborator

@tdaede tdaede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK.

On a side note, we use halfres and qres frames for the motion search prepasses later on. It would be nice if we could reuse the frames scaled here, which would make the downscales "free"

@master-of-zen
Copy link
Collaborator

LGTM, great work @redzic 👍

@shssoichiro shssoichiro merged commit 4104f43 into xiph:master Sep 22, 2021
@redzic redzic deleted the no-unnecessary-downscale branch September 23, 2021 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants