TASEmulators / TASEncodingPackage

http://tasvideos.org/EncodingGuide/PublicationManual.html
MIT License
4 stars 3 forks source link

Fix for multisegment import not working properly with new SD format #12

Closed despoa closed 2 years ago

despoa commented 2 years ago

This should fix the issue with multisegment importing for SD encodes making them look blurry. The downside is that due the use of traditional conditional constucts, the script now requires AviSynth+.

vadosnaprimer commented 2 years ago

Would you mind also changing the recursion to a for loop, while you still have this messy function in you mind?

despoa commented 2 years ago

Done. Now there's a higher limit to the number of clips that can be added.

vadosnaprimer commented 2 years ago

Thanks!

Regarding MS resizing. I think it would fit our purpose best to upscale by 2 or whatever factor is used for SD, and then resize directly to sample res. That way we won't need to specify hd, instead just deciding by the factor (can be 0 for hd not to confuse with proper values). Basically just send prescale factor that will always use point, and then resize to sample res with lanczos if factor is > 0, and directly to sample res with point if factor is 0.

Zinfidel commented 2 years ago

I don't think it's a big ask to have AVS+ as a requirement. It comes with some other very useful things like first class functions that I would like to use as well at some point.

I feel like there's probably a way to collapse the two very similar chunks of code into a single loop, but I really can't be bothered to think about it right now so I don't think it's a problem.

Anyway, I think with feos' suggestions this looks good.

vadosnaprimer commented 2 years ago

Yeah AVS+ is trivial to rely on, you just download and install it lol. I don't remember any reasons not to use it.

despoa commented 2 years ago

The "scaler" variable basically works the same as the prescaleFactor variable. I just took into account the possibility that the sample height may not be an integer multiple of the height of one of the segments. With that possibility in mind, there might be a quality difference between point resizing by a non-integer factor, then Lanczos resizing and point resizing by an integer factor, then lanczos resizing. And then you have the possibility that one of the segment heights may have an integer factor of the sample height that's different from what was in the prescaleFactor variable.