YomikoR / GetFnative

A script that help find the native fractional resolution of upscaled material (mostly anime)
GNU Lesser General Public License v2.1
14 stars 3 forks source link

asymmetrical descales #2

Open motbob opened 1 year ago

motbob commented 1 year ago

Someone asked me to do a writeup of how I determined an annoying descale for early episodes of the anime Sangatsu no Lion and make an issue so that the feasibility of implementing the process, (or some other, better process) into getfnative could be examined. The problem with that show was that the descale was "asymmetrical," so to speak, meaning that src_top was not (some_integer - src_height) / 2, like it normally is. So the traditional getfnative tools didn't work for it.

I used an annoying and manual process to get the descale that I am not sure can be automated. First, I made rough guesses for the src_top, src_height, src_left, and src_width values based on getfnative's output. Then, for a given src_height, I tested a lot of src_top values and observed the minimum error. Then I changed src_height and tested a lot of src_top values again to see if I could get a lower minimum error. I kept changing src_top until I was confident that I had the minimum possible error and thus the correct values for src_top and src_height. Then I repeated the process for src_left and src_width.

This was annoying, but it allowed me to get the correct descale: core.descale.Debilinear(frame, width=1280, height=720, src_top = 0.1, src_height = 719.1, src_width=1279, src_left=0.15).

YomikoR commented 1 year ago

Thanks for sharing the skills to fine tune the annoying examples. I have heard about a few 719.x examples but I never took time to check if that is more reasonable than 720p.

As for get(f)native. It would be painful to exhaustively search for even more dimensions, so let's see if one day we have any clue about why these shifts are formed.