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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st November 2018, 19:26   #1  |  Link
HappyLee
Registered User
 
Join Date: Mar 2013
Posts: 27
Why isn't there a GeneralConvolution filter on YV12 or Y8?

Hi. I'm applying a 5×5 matrix convolution on the Y plane of an YV12 video, but I have trouble finding the perfect filter that does this very simple task.

GeneralConvolution can do what I want, but it only works on an RGB32 clip, so I have to use:
ConverttoY8(matrix="PC.601").ConverttoRGB32(matrix="PC.601").GeneralConvolution(matrix="...").ConverttoY8(matrix="PC.601")
I find it a waste of CPU time and memory, since it calculates R, G & B planes while I only need it to calculate the Y plane.

mt_convolution from MaskTools2 seems like a better solution for YV12 convolution, but it doesn't seem to support a fully customized matrix. It only supports Horizontal × Vertical and I can't apply my full 5×5 matrix like I can with GeneralConvolution.

So I can't help but asking, since convolution is so important, why isn't there a convolution filter that works on YV12 or Y8 like mt_convolution but supports a full matrix like GeneralConvolution? Thanks.
HappyLee is offline   Reply With Quote
Old 21st November 2018, 23:36   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
Because these calculations only work in 4:4:4, i.e. same full resolution for every component, no subsampled input data ?
Of course it would be possible to integrate an input resampler.
But then the convolution would inherit and analyse the resizer kernel's frequency patterns and this is what you want to avoid.
That damage has to be done externally with the user knowing its/his reasons.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 25th February 2021 at 23:23.
Emulgator is offline   Reply With Quote
Old 22nd November 2018, 00:58   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
you can specify the affected plane(s) with vapoursynth's convolution , maybe someone could port it to avisynth
http://www.vapoursynth.com/doc/funct...nvolution.html
poisondeathray is offline   Reply With Quote
Old 22nd November 2018, 19:23   #4  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Thanks for the idea, GeneralConvolution in Avisynth+ was not touched at all, now I realized that and updated it (they will appear in the next release)

- Allow 7x7 and 9x9 matrices (was: 3x3 and 5x5)
- All 8-32 bit formats (was: RGB32 only): YUY2 is converted to/from YV16, RGB24/32/48/64 are treated as planar RGB internally
Since 32 bit float input is now possible, matrix elements and bias parameter now are of float type.
When the clip is 8-16 bits, paarameters are converted to integer before use.
- Allow chroma subsampled formats to have their luma _or_ chroma processed. E.g. set chroma=false for a YV12 input.
- New parameters: boolean luma (true), boolean chroma(true), boolean alpha(true)
Default: process all planes. For RGB: luma and chroma parameters are ignored.
Unprocessed planes are copied. Using alpha=false makes RGB32 processing faster, usually A channel is not needed.
pinterf is offline   Reply With Quote
Old 22nd November 2018, 20:32   #5  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
Beautiful ! Many Thanks and "douze points" go to Hungary.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator 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 14:23.


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