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. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st November 2018, 19:26 | #1 | Link |
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. |
21st November 2018, 23:36 | #2 | Link |
Big Bit Savings Now !
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. |
22nd November 2018, 00:58 | #3 | Link |
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 |
22nd November 2018, 19:23 | #4 | Link |
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. |
22nd November 2018, 20:32 | #5 | Link |
Big Bit Savings Now !
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..." |
Thread Tools | Search this Thread |
Display Modes | |
|
|