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.

 Doom9's Forum MVTools, Depan, DepanEstimate for VapourSynth
 Register FAQ Calendar Search Today's Posts Mark Forums Read

21st August 2016, 15:41   #401  |  Link
feisty2
I'm Siri

Join Date: Oct 2012
Location: Providence, RI
Posts: 2,275
Quote:
 Originally Posted by jackoneill Any reason why I shouldn't just remove the SATD functions entirely?
because they are the components from avisynth mvtools..?

well, SATD transforms the difference to frequency domain(Hadamard Transform = Discrete Fourier Transform mathematically on a 2^n * 2^n square block) and it helps with shimmering and fading sometimes like dct=1, but much faster than that
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

 21st August 2016, 15:48 #402  |  Link Myrsloik Professional Code Monkey     Join Date: Jun 2003 Location: Ikea Chair Posts: 2,141 I have a simple question. Has anyone ever tried SAD but with the average value of the input blocks adjusted? I mean the main point of this exercise is to reduce the whole block average into a single coefficient to reduce its influence a lot. There should be some faster but still good for 90% of the times trick. And saying it's in avisynth is a bad excuse. Temporalsoften is in avisynth and that's nothing to be proud of. __________________ VapourSynth - proving that scripting languages and video processing isn't dead yet
 21st August 2016, 15:57 #403  |  Link feisty2 I'm Siri     Join Date: Oct 2012 Location: Providence, RI Posts: 2,275 more specific? adjusted how, and mode 6-10 are hybrid SAD/SATD modes, and faster than mode 5(100% SATD) __________________ If I got new ideas, will post here: https://github.com/IFeelBloated
 23rd August 2016, 11:54 #404  |  Link VS_Fan Registered User   Join Date: Jan 2016 Posts: 91 I was trying to remember what's the purpose of using SATD in mvtools, so I googled a little, and found: SATD allows mvtools to better track motion when there are rapidly changing levels of brightness https://www.svp-team.com/wiki/Plugins:_SVPflow Use SATD function instead of SAD on finest level. Extremely slow, do not use it! Use SATD function instead of SAD on every coarse level, improves motion vector estimation at luma flicker and fades. I couldn't find much more. And then I thought: if people at VideoLAN / MulltiCoreWare implemented the asm functions for SATD for x265? Could they be used? As I’m not a developer, I can't answer that question. Is this a possibility? In the search I saw things like: [x265] [PATCH] primitives: asm: update: implementation of satd(sse2) [x265] [PATCH] primitives: asm: satd: fix for 32 bit issue Could those be used for mvtools-VapourSynth ???
 23rd August 2016, 12:30 #405  |  Link feisty2 I'm Siri     Join Date: Oct 2012 Location: Providence, RI Posts: 2,275 No, because stupid asm fixed SATD to a certain bitdepth(say, 8bits) That's exactly why asm SATD functions from avisynth mvtools are useless __________________ If I got new ideas, will post here: https://github.com/IFeelBloated
 23rd August 2016, 14:16 #406  |  Link feisty2 I'm Siri     Join Date: Oct 2012 Location: Providence, RI Posts: 2,275 Code: `I was trying to remember what's the purpose of using SATD in mvtools` there are several approaches available to calculate the difference between 2 macroblocks. 1. SAD, sum of the absolute difference between each pair of samples 2. dct=1, transform both current block and the reference block to frequency domain, and calculate the sum of the absolute difference between each pair of transformed samples 3. SATD, get the difference block between 2 macroblocks, and transform that difference block to frequency domain and calculate the sum of the absolute value of each sample in that transformed difference block basically, dct=5(SATD) is the compromise between dct=0(SAD) and dct=1(frequency domain SAD) __________________ If I got new ideas, will post here: https://github.com/IFeelBloated
 23rd August 2016, 20:19 #407  |  Link VS_Fan Registered User   Join Date: Jan 2016 Posts: 91 Let me rephrase my thought: In the same search at videolan, I though I saw 8, 10 (may be 12) bit_depth sse2 and/or avx optimizations for SATD calculation. My question is then: No matter what the original video clip bit_depth is, could you use a “simplified” 8, 10 or 12 bit temporary version of the clip for the motion estimation? (reusing the x265 SATD asm optimizations) Edit: By the way, thanks for the explanation Last edited by VS_Fan; 23rd August 2016 at 20:32.
 23rd August 2016, 20:22 #408  |  Link Nevilne Registered User   Join Date: Aug 2010 Posts: 134 You will actually get more useful motion estimation from even blurring the search clip. Doesn't stop people here from doing stuff like nnedi for subpixel clips.
23rd August 2016, 20:33   #409  |  Link
jackoneill
unsigned int

Join Date: Oct 2012
Location: 🇪🇺
Posts: 732
Quote:
 Originally Posted by VS_Fan Let me rephrase my thought: In the same search at videolan, I though I saw 8, 10 (may be 12) bit_depth sse2 and/or avx optimizations for SATD calculation. My question is then: No matter what the original video clip bit_depth is, could you use a “simplified” 8, 10 or 12 bit temporary version of the clip for the motion estimation? (reusing the x265 SATD asm optimizations)
__________________
Buy me a "coffee" and/or hire me to write code!

23rd August 2016, 20:43   #410  |  Link
feisty2
I'm Siri

Join Date: Oct 2012
Location: Providence, RI
Posts: 2,275
Quote:
 Originally Posted by VS_Fan Let me rephrase my thought: In the same search at videolan, I though I saw 8, 10 (may be 12) bit_depth sse2 and/or avx optimizations for SATD calculation. My question is then: No matter what the original video clip bit_depth is, could you use a “simplified” 8, 10 or 12 bit temporary version of the clip for the motion estimation? (reusing the x265 SATD asm optimizations) Edit: By the way, thanks for the explanation
SATD is a pretty simple transform and not hard to program at all...
Why not just re-program it in c/c++ like I did and it would be generic to all sample types
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

23rd August 2016, 21:24   #411  |  Link
VS_Fan
Registered User

Join Date: Jan 2016
Posts: 91
Quote:
 Originally Posted by cretindesalpes Don’t waste your time at this, moreover it would be misleading. We can explicitly convert the high-bitdepth clips to 8 bits for analysis. Anyway, I think there is a definite benefit to run the analysis on 10–12 bits. I often remap the luma channel to increase the contrast is some specific ranges (generally the dark parts), and keeping 8 bits crunches other ranges, reducing the accuracy of the analysis on fine textures.
I hope you can come up with a neat strategy to deal with SATD.

I congratulate and thank you all for the VapourSynth's 5th birthday!!! 2 days in advance

 25th August 2016, 16:45 #412  |  Link kolak Registered User   Join Date: Nov 2004 Location: Poland Posts: 2,461 Would anyone consider making mvtools faster and better as a paid project?
25th August 2016, 16:57   #413  |  Link
feisty2
I'm Siri

Join Date: Oct 2012
Location: Providence, RI
Posts: 2,275
Quote:
 Originally Posted by kolak Would anyone consider making mvtools faster and better as a paid project?

Quote:
 jackoneill's wishlist
edit:typo
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

Last edited by feisty2; 25th August 2016 at 17:08.

 25th August 2016, 17:26 #414  |  Link kolak Registered User   Join Date: Nov 2004 Location: Poland Posts: 2,461 Are these ebooks? I will buy all of them+ many more
25th August 2016, 17:33   #415  |  Link
jackoneill
unsigned int

Join Date: Oct 2012
Location: 🇪🇺
Posts: 732
Quote:
 Originally Posted by kolak Would anyone consider making mvtools faster and better as a paid project?
Which parts faster? Which parts better? Better in what way?

Yes, ebooks.
__________________
Buy me a "coffee" and/or hire me to write code!

Last edited by jackoneill; 25th August 2016 at 17:36.

 26th August 2016, 00:31 #416  |  Link kolak Registered User   Join Date: Nov 2004 Location: Poland Posts: 2,461 I'm mainly interested in frame rate interpolation part. There would be quite specific problems to "solve" as well as speeding up whole conversion process, ideally by about 2x. I will send you pm.
17th September 2016, 09:43   #417  |  Link
jackoneill
unsigned int

Join Date: Oct 2012
Location: 🇪🇺
Posts: 732
Quote:
 Originally Posted by feisty2 good news and bad news here
__________________
Buy me a "coffee" and/or hire me to write code!

 17th September 2016, 14:02 #418  |  Link feisty2 I'm Siri     Join Date: Oct 2012 Location: Providence, RI Posts: 2,275 it works, but the result looks slightly different from my implementation mine looks closer to dct=1, and yours closer to dct=0 (set thSAD to 10000 in MDeGrain and you will see the difference) not sure why.. __________________ If I got new ideas, will post here: https://github.com/IFeelBloated
17th September 2016, 16:00   #419  |  Link
jackoneill
unsigned int

Join Date: Oct 2012
Location: 🇪🇺
Posts: 732
Quote:
 Originally Posted by feisty2 it works, but the result looks slightly different from my implementation mine looks closer to dct=1, and yours closer to dct=0 (set thSAD to 10000 in MDeGrain and you will see the difference) not sure why..
It's the same code used by MVTools for Avisynth and x264.
__________________
Buy me a "coffee" and/or hire me to write code!

 23rd October 2016, 14:47 #420  |  Link jackoneill unsigned int     Join Date: Oct 2012 Location: 🇪🇺 Posts: 732 v17 brings more speed for certain configurations, larger blocks, and a bug fix or two: https://github.com/dubhater/vapoursy...leases/tag/v17 Code: ``` * Analyse, Recalculate: Fix bug that broke 16 bit processing (patches by feisty2). * Analyse, Recalculate: Support block sizes of 64x32, 64x64, 128x64, and 128x128. * Analyse, Recalculate: Make dct=1..4 a bit faster on x86. * FlowFPS, FlowInter: Add AVX2 code. * Analyse, Recalculate: Fix SATD functions used when dct=5..10 and the input is 16 bit. * Analyse, Recalculate: Allow dct=5..10 with blocks larger than 16x16.``` __________________ Buy me a "coffee" and/or hire me to write code!