Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd February 2020, 07:51   #1  |  Link
Sakura
Registered User
 
Sakura's Avatar
 
Join Date: Feb 2020
Posts: 6
AreaResize

Hello! I port AreaResize to VapourSynth, based on the original AviSynth verison by Chikuzen and the modified AviSynth version by Aktan.

AreaResize is an area average downscale resizer:
  • Support 8-16 bit and 32 bit sample type.
  • Support YUV and RGB color family.
  • Downscaling in 8-16 bit RGB with gamma corrected.

Usage
Code:
core.area.AreaResize(clip clip, int width, int height[, float gamma=2.2])

# Parameter "gamma" is for gamma corrected, only using for 8-16 bit RGB input
Github: https://github.com/Kiyamou/VapourSynth-AreaResize
Download: https://github.com/Kiyamou/VapourSyn...esize/releases

There is known bug for special target size, such as 1920x1080 -> 1200x700 for 8~16bit YUV and 8bit RGB.
__________________
a C++ beginner | My Github

Last edited by Sakura; 21st March 2020 at 09:04.
Sakura is offline   Reply With Quote
Old 24th February 2020, 02:29   #2  |  Link
Lypheo
Registered User
 
Join Date: Sep 2018
Posts: 14
Could you perhaps explain the algorithm behind this? How does it differ from conventional convolution-based resizers?
Lypheo is offline   Reply With Quote
Old 25th February 2020, 15:05   #3  |  Link
Sakura
Registered User
 
Sakura's Avatar
 
Join Date: Feb 2020
Posts: 6
Quote:
Originally Posted by Lypheo View Post
Could you perhaps explain the algorithm behind this? How does it differ from conventional convolution-based resizers?
I have something, causing me reply slowly.

This algorithm is simple, just calculating the average of pixel. (So it is fast.)
For example, 1080p->720p, greatest common divisor: (1920,1280)=640, 1920/640=3, 1280/640=2.
So calculate the value of dst like this:
Code:
y_dst[0] = (y_src[0] + y_src[0] + y_src[1]) / 3
y_dst[1] = (y_src[1] + y_src[2] + y_src[2]) / 3
...
After calculating, the width of clip is changed from 1920 to 1280. And then use the same method to calcuate for height.

Compared other conventional convolution-based resizers, firstly it can be only used to downscale.
From the aspect of effect, I think AreaResize is better than Bicubic, while Spline and Lanczos is better than AreaResize.
__________________
a C++ beginner | My Github

Last edited by Sakura; 21st March 2020 at 09:04.
Sakura is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.