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. |
20th June 2017, 16:18 | #441 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I understand now why you rewrote this thing like, entirely...
the code was full of weird bullshit and insanely fucking stupid stuff.. I managed to upgrade FakeBlockData and FakePlaneOfBlocks to normal C++14 but got stuck at FakeGroupOfPlanes there's this bloody "update()" function throughout MVTools code, it's like Code:
void FakeBlockData::Update(const int *array) { vector.x = array[0]; vector.y = array[1]; vector.sad = array[2]; } Code:
auto Update(const VectorStructure *NewVectorPointer) { Vector = *NewVectorPointer; } Code:
void FakePlaneOfBlocks::Update(const int *array) { array += 0; for (int i = 0; i < nBlkCount; i++) { blocks[i].Update(array); array += N_PER_BLOCK; } } Code:
auto Update(const void *VectorStream) { auto StreamCursor = reinterpret_cast<const VectorStructure *>(VectorStream); for (auto i = 0; i < nBlkCount; ++i) { blocks[i].Update(StreamCursor); ++StreamCursor; } } and there's one in FakeGroupOfPlanes like Code:
void FakeGroupOfPlanes::Update(const int *array) { const int *pA = array; validity = GetValidity(array); pA += 2; for (int i = nLvCount_ - 1; i >= 0; i--) pA += pA[0]; pA++; pA = array; pA += 2; for (int i = nLvCount_ - 1; i >= 0; i--) { planes[i]->Update(pA + 1); pA += pA[0]; } } I guess you should know all about that wicked update() function cuz you once converted MVTools to C could you help me with this and explain that "FakeGroupOfPlanes::Update()", please? |
20th June 2017, 16:52 | #442 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
__________________
Buy me a "coffee" and/or hire me to write code! |
|
20th June 2017, 17:10 | #443 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
something I failed to understand
Code:
const int *pA = array + 2; and this, Code:
pA += pA[0]; Code:
constexpr auto StreamHeaderOffset = 2; auto pA = reinterpret_cast<const VectorStructure *>(array + StreamHeaderOffset); auto MoveOnToTheNextVector = [](auto &VectorPointer) { constexpr auto AbsoluteVectorSize = sizeof(std::decay_t<decltype(*VectorPointer)>); constexpr auto RelativeVectorSize = AbsoluteVectorSize / sizeof(int); auto ForwardDistance = VectorPointer->x / RelativeVectorSize; VectorPointer += ForwardDistance; }; MoveOnToTheNextVector(pA); and that's why I hate C and old C++ so much cuz it's like fucking deciphering assembly code, what's so hard about defining weird constants with constexpr variables with proper names and writing some nested closure functions to tell others what the hell you're doing exactly? Last edited by feisty2; 20th June 2017 at 17:36. |
20th June 2017, 18:06 | #444 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
Code:
int total_size; // Size of the entire thing, i.e. the last int you may access is array[total_size - 1] int validity; // 0 if the frame is too close to the beginning or end of the clip, otherwise 1 int first_level_size; VECTOR first_level_vectors[first_level_size]; int second_level_size; VECTOR second_level_vectors[second_level_size]; ... int last_level_size; VECTOR last_level_vectors[last_level_size]; int divided_extra_level_size; // may not exist VECTOR divided_extra_level_vectors[divided_extra_level_size]; //may not exist You may have noticed that all those size fields store numbers of ints, rather than numbers of bytes. This is probably because everything in there used to be an int (the sizes, validity, VECTOR's members, other things that used to be stored there). This is weird already, and it would have become weirder when I made the type of VECTOR::sad int64_t, so since v19 all these sizes store numbers of bytes.
__________________
Buy me a "coffee" and/or hire me to write code! |
|
20th June 2017, 20:00 | #445 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
thanks for the detailed explanation, I can now finally reshape that weird piece of shit into something readable...
Code:
auto Update(const std::int32_t *VectorStream) { constexpr auto StreamHeaderOffset = 2; auto StreamCursor = VectorStream + StreamHeaderOffset; auto GetValidity = [&]() { return VectorStream[1] == 1; }; auto UpdateVectorsForEachLevel = [&](auto Level) { constexpr auto LevelHeaderOffset = 1; auto LevelLength = StreamCursor[0]; auto CalibratedStreamCursor = reinterpret_cast<const VectorStructure *>(StreamCursor + LevelHeaderOffset); planes[Level]->Update(CalibratedStreamCursor); StreamCursor += LevelLength; }; validity = GetValidity(); for (auto Level = nLvCount_ - 1; Level >= 0; --Level) UpdateVectorsForEachLevel(Level); } just for comparison, this was the original version Code:
void FakeGroupOfPlanes::Update(const int *array) { const int *pA = array; validity = GetValidity(array); pA += 2; for (int i = nLvCount_ - 1; i >= 0; i--) pA += pA[0]; pA++; pA = array; pA += 2; for (int i = nLvCount_ - 1; i >= 0; i--) { planes[i]->Update(pA + 1); pA += pA[0]; } } |
9th July 2018, 12:35 | #446 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,730
|
Would it be possible to have the 'star' motion search method from x265 included in MVTools?
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
9th July 2018, 16:02 | #447 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
But instead here is v20 with a small bug fix. Code:
* Fix green edges in the output of FlowBlur, FlowFPS, BlockFPS when pelclip is used and pel=2 (bug introduced in v12).
__________________
Buy me a "coffee" and/or hire me to write code! |
|
9th July 2018, 16:25 | #448 | Link | |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,730
|
Quote:
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
|
31st July 2018, 06:32 | #450 | Link | |
Helenium(Easter)
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 99
|
Quote:
__________________
Monochrome Anomaly |
|
29th October 2018, 07:28 | #451 | Link |
Registered User
Join Date: Apr 2015
Posts: 84
|
vapoursynth mvtools v20
Code:
c_in = src sup_a = core.mv.Super(c_in, pel=2) sup = sup_a analyse_args_df = dict(blksize=16, overlap=8, search=5, searchparam=4, dct=5) bVec1 = core.mv.Analyse(sup_a, isb=True, delta=1, **analyse_args_df) fVec1 = core.mv.Analyse(sup_a, isb=False, delta=1, **analyse_args_df) bVec2 = core.mv.Analyse(sup_a, isb=True, delta=2, **analyse_args_df) fVec2 = core.mv.Analyse(sup_a, isb=False, delta=2, **analyse_args_df) bVec3 = core.mv.Analyse(sup_a, isb=True, delta=3, **analyse_args_df) fVec3 = core.mv.Analyse(sup_a, isb=False, delta=3, **analyse_args_df) compensate_args_df = dict(thsad=400) bc1 = core.mv.Compensate(c_in, sup, bVec1, **compensate_args_df) fc1 = core.mv.Compensate(c_in, sup, fVec1, **compensate_args_df) bc2 = core.mv.Compensate(c_in, sup, bVec2, **compensate_args_df) fc2 = core.mv.Compensate(c_in, sup, fVec2, **compensate_args_df) bc3 = core.mv.Compensate(c_in, sup, bVec3, **compensate_args_df) fc3 = core.mv.Compensate(c_in, sup, fVec3, **compensate_args_df) cmp = core.std.Interleave([bc3, bc2, bc1, c_in, fc1, fc2, fc3]) #cmp = core.std.Interleave([fc3, fc2, fc1, c_in, bc1, bc2, bc3]) AviSynth+ mvtools-2.7.33 Code:
c_in = last sup_a = c_in.MSuper(pel=2) sup = sup_a vec_norm = sup_a.MAnalyse(multi=true, delta=3, blksize=16, overlap=8, search=5, searchparam=4, DCT=5) cmp = c_in.MCompensate(sup, vec_norm, tr=3, thSAD=400) Code:
c_in = last sup_a = c_in.MSuper(pel=2) sup = sup_a #vec = sup_a.MAnalyse(multi=true, delta=3, blksize=16, overlap=8, search=5, searchparam=4, DCT=5) #cmp = c_in.MCompensate(sup, vec, tr=3, thSAD=400) bVec1 = MAnalyse(sup_a, isb=True, delta=1, blksize=16, overlap=8, search=5, searchparam=4, dct=5) fVec1 = MAnalyse(sup_a, isb=False, delta=1, blksize=16, overlap=8, search=5, searchparam=4, dct=5) bVec2 = MAnalyse(sup_a, isb=True, delta=2, blksize=16, overlap=8, search=5, searchparam=4, dct=5) fVec2 = MAnalyse(sup_a, isb=False, delta=2, blksize=16, overlap=8, search=5, searchparam=4, dct=5) bVec3 = MAnalyse(sup_a, isb=True, delta=3, blksize=16, overlap=8, search=5, searchparam=4, dct=5) fVec3 = MAnalyse(sup_a, isb=False, delta=3, blksize=16, overlap=8, search=5, searchparam=4, dct=5) bc1 = MCompensate(c_in, sup, bVec1, thsad=400) fc1 = MCompensate(c_in, sup, fVec1, thsad=400) bc2 = MCompensate(c_in, sup, bVec2, thsad=400) fc2 = MCompensate(c_in, sup, fVec2, thsad=400) bc3 = MCompensate(c_in, sup, bVec3, thsad=400) fc3 = MCompensate(c_in, sup, fVec3, thsad=400) cmp = Interleave(bc3, bc2, bc1, c_in, fc1, fc2, fc3) #cmp = Interleave(fc3, fc2, fc1, c_in, bc1, bc2, bc3) |
13th March 2019, 16:52 | #452 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
v21 fixes three bugs:
Code:
* BlockFPS, Flow, FlowFPS, FlowInter: Fix crash with certain blksize/overlapv ratios, like 8/2. Thanks to pinterf for finding the cause and the solution. * Flow, FlowBlur, FlowFPS, FlowInter: Fix crash due to motion vectors pointing outside the frame. Thanks to pinterf for finding the cause and the solution. * Analyse: Fix use of an uninitialised variable. Only dct modes 2, 6, and 9 were affected. The result was probably just nondeterministic output. This uninitialised variable was inherited from the Avisynth plugin, version 2.5.11.3.
__________________
Buy me a "coffee" and/or hire me to write code! |
13th March 2019, 17:03 | #453 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Awesome!
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
2nd November 2019, 10:02 | #454 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Isn't it time for a v22 - AVX2 booster edition?
Or at least a test build so we can test it?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
6th April 2020, 10:57 | #456 | Link |
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,574
|
Would you please add MDegrainN (up to 6, at least)?
I need it to run G41Fun.py on noisy material. I have tried MVTools single precision but it's simply too slow to have any use of it, at least the one without AVX2 requirement.
__________________
@turment on Telegram Last edited by tormento; 6th April 2020 at 11:04. |
4th May 2020, 21:44 | #458 | Link | |
Registered User
Join Date: May 2015
Posts: 18
|
Quote:
|
|
5th May 2020, 05:22 | #459 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,730
|
I'm getting quite strange results considering the possible speed increases on my Ryzen 3900X. I would have expected the new Zen generation to be able to utilize the AVX2 optimizations really well, because they did help the first gen one when I tested Stephen R. Savage's early builds.
The first 2500 frames using vspipe: v21 : 57.25 fps v22 : 55.14 fps Test script, normal Blu-ray source. Code:
clp = core.dgdecodenv.DGSource(r"test.dgi") degrain16 = core.fmtc.bitdepth(clp, bits=16) superanalyse8 = core.mv.Super(clp, pel=2, chroma=True, rfilter=4, sharp=1) supermdg16 = core.mv.Super(degrain16, pel=2, chroma=True, rfilter=4, levels=1, sharp=1) analyze_args = dict(blksize=16, overlap=8, search=5, searchparam=8, pelsearch=8, truemotion=False) degrain_args_16 = dict(thsad=200, thsadc=100, limit=1*256, limitc=2*256, thscd1=300, thscd2=80) bv1_8 = core.mv.Analyse(superanalyse8, isb=True, delta=1, **analyze_args) fv1_8 = core.mv.Analyse(superanalyse8, isb=False, delta=1, **analyze_args) finalclip8 = core.mv.Degrain1(degrain16, supermdg16, bv1_8, fv1_8, **degrain_args_16) finalclip8.set_output()
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... Last edited by Boulder; 5th May 2020 at 07:55. |
13th May 2020, 15:59 | #460 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,730
|
What does MFinest actually do? There's no real documentation anywhere to be found.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
Thread Tools | Search this Thread |
Display Modes | |
|
|