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

TDecimate(hybrid=3) blending with wrong frame #46

Closed
flossy83 opened this issue Jan 24, 2024 · 2 comments
Closed

TDecimate(hybrid=3) blending with wrong frame #46

flossy83 opened this issue Jan 24, 2024 · 2 comments

Comments

@flossy83
Copy link
Contributor

Just bumping this pull request in case it wasn't notified.

Explanation: hybrid=3 uses CalcBlendRatios2 to set which frames get blended and by how much (frame1, frame2, amount1, amount2). Frame1 & frame2 are calculated based on the values inside lutf which is created using the 3 for loops in CalcBlendRatios2. Since the blend is spilling over into the next frame I tried offsetting the cycleS[tart] and cycleE[nd] by 1 unit to the right by swapping the >= for a > and the < for a <=. According to the test pattern and real world content this works and correct frames are now blended (see doom9 post for test pattern & code example).

@pinterf
Copy link
Owner

pinterf commented Jan 24, 2024

I have just written a question :)

@flossy83
Copy link
Contributor Author

flossy83 commented Jan 26, 2024

In Visual Studio I searched the entire solution for calls to CalcBlendRatios2 and it looks like it's only called twice inside TDecimate.cpp and both times from within a if (hybrid==3){} block so if you wanted to save on redundant ternaries you could get rid of the ternary altogether. For a 30fps video that's probably 90 redundant ternaries per second which wouldn't have any meaningful impact on performance wise but just thought I'd mention it for OCD reasons mostly

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

No branches or pull requests

2 participants