Skip to content

RB: Force SampleGridoModel.MATCH_EDGES descale and rescale calls#36

Open
LightArrowsEXE wants to merge 1 commit into
Vodes:masterfrom
Lights-Silly-Projects:sample-grid-model
Open

RB: Force SampleGridoModel.MATCH_EDGES descale and rescale calls#36
LightArrowsEXE wants to merge 1 commit into
Vodes:masterfrom
Lights-Silly-Projects:sample-grid-model

Conversation

@LightArrowsEXE

Copy link
Copy Markdown
Collaborator

Currently with the following code, sample_grid_model is effectively applied twice, which introduces additional shifts and other issues:

    edges = RescaleBuilder(clip).descale(
        Lanczos(2),
        1280,
        720,
    )
    centers = RescaleBuilder(clip).descale(
        Lanczos(2, sample_grid_model=SampleGridModel.MATCH_CENTERS),
        1280,
        720,
    )
Descaled clip Rescaled clip
MATCH_EDGES image image
MATCH_CENTERS image image

Since the descale/rescale calls in RescaleBuilder already obtain these values from ScalingArgs.from_args, we can apply MATCH_EDGES at these steps instead. Ideally we don't want to mutate the Kernel object though, so I simply added a private wrapper to deal with this for the time being. There's probably a better solution out there, which is what I hope to uncover through this PR too. CC: @Ichunjo

Note: This issue is possibly also a problem in vsscale's rescaling functions.

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.

1 participant