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. |
15th August 2018, 19:12 | #4221 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Are you serious?
MT_SERIALIZED equals Mode 3. And if I understand this correctly then Mode 3 is not single threaded. Yes I do know what parallel and serial means, but specifying Mode 3 is certainly not the same as disabling MT. From the AVS+ Wiki: Quote:
The quoted note said that he tried mode 1, 2 and 3 and none worked. It only worked if MultiThreading was not enabled. So my question remains: How do I force ColorMatrix to run single threaded without removing the Prefetch(x) command which would make my whole script run single threaded? Last edited by manolito; 15th August 2018 at 19:32. |
|
15th August 2018, 19:51 | #4222 | Link | |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
Yeah, colormatrix is just too broken, so I'd like to suggest you dithertools instead:
Quote:
|
|
15th August 2018, 21:45 | #4224 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
I have a hard time to believe that tritical has ever published something that is "just too broken"...
Anyhow, DitherTools is not an option for me. First of all I have no use for this high bitdepth stuff, and secondly DitherTools requires a SSE2 capable CPU which one of my computers does not have (and I want identical AviSynth configurations on all of my machines). I just found that ColorMatrix has a "Threads" parameter: Quote:
If I really cannot get ColorMatrix to work reliably with AVS+ multithreading then I am already tempted to revert back to classic AVS 2.60. Most of my AVS scripts (HD to SD conversions) use ColorMatrix, this needs to be absolutely reliable for me. Since I do not use the expanded bit depths and color formats of AVS+ all I really care for is the speed gain from multitasking. And my tests so far (using only filters which are not too complex) only showed a very moderate speed gain. Nothing I would trade for the risk of introducing artifacts which I might only detect much later. Cheers manolito |
|
15th August 2018, 22:26 | #4225 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Anyway, I don't see the problem using MT_SERIALIZED with ColorMatrix. I just ran a few tests and the performance hit is virtually zero, even if I put the ColorMatrix call near the end of the script.
__________________
Groucho's Avisynth Stuff |
|
15th August 2018, 22:53 | #4226 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Quote:
http://publishwith.me/ep/pad/view/ro.rDkwcdWn4k9/latest What really turned on the red lights for me was the note in this AVSI that modes 1, 2 and 3 all caused artifacts. What should I make of this contradicting information? Is MT_SERIALIZED really safer? The reason I am a little touchy on this subject is that I already had some bad experiences with ColorMatrix in the past. It was an older version which caused random artifacts on random sources, no error messages. It took me a while to find out that the newer version 2.5 had fixed the issues, but it was too late. After I finally detected the artifacts I did no longer have access to the source files. Cheers manolito |
|
16th August 2018, 00:20 | #4227 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Methinks that you squeal long before you are bitten.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
16th August 2018, 01:38 | #4228 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
I'm pretty sure it works without issues in current Avs+ because this is the first thing I hear about artifacts and I know a lot of people use it with multithreading enabled in Avs+. However, there is really no reason to keep using ColorMatrix in 2018, since we have significantly better tools today. I'd suggest zimg (also referred to as "avsresize"). Last edited by TheFluff; 16th August 2018 at 02:00. |
|
16th August 2018, 01:54 | #4229 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Fluffy, I'm always quite amazed at the depth of understanding you have of other peoples plugs,
I'm wondering if you could find the time to correct triticals 'not so good' decisions, I'm quite sure many people would like a more robust and well more fluffy version of same.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
16th August 2018, 02:07 | #4230 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
Note though that I don't have anything personal against tritical and I definitely don't deny that many of the plugins he wrote have been extremely influential and useful. As a professional software engineer though, his coding habits are deeply offensive to my sense of craftsmanship. Last edited by TheFluff; 16th August 2018 at 02:12. |
|
16th August 2018, 02:13 | #4231 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
EDIT: Not everyone uses Vapoursynth, although as I understand it, some do.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th August 2018 at 02:16. |
|
16th August 2018, 02:17 | #4232 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
If you want improved tritical plugins for Avisynth it'd be far, far easier to backport the Vapoursynth reimplementations than to try to fix the original code. Last edited by TheFluff; 16th August 2018 at 02:22. |
|
16th August 2018, 02:25 | #4233 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
OK, got ya.
I once tried figure out the AutoCrop thing by Gary (something beginning with B), and it was hell, real nasty stuff, and that was only C/CPP, I guess that big T's efforts could be well more cryptic, Kassandro (not sure if I spelt right) was well clever guy but also was a bit peculiar and somewhat messy and a little too secretive (undoc'ed functions and such). Anyways, thanx for your answer, much appreciated. EDIT: Just saw this Quote:
EDIT: I know that I have been accused of writing "Machine Code" style C/CPP (by Feisty2), I really hope that Feisty was/is just a little bit exaggerant in such accusation, I would hate to think that no-one at all could understand my code, (well at least another C coder should be able to figure out what it was doing).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th August 2018 at 02:48. |
|
16th August 2018, 11:11 | #4234 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Quote:
Thanks for the hint that AVS+ MT was improved a lot during the last years, so Colormatrix may not be any problem today. I just saw that the note about Colormatrix was already present in this "obscure" AVSI in the first versions from 2015, so probably noone took the time to have another look at it recently. I did comment out the line which specifies MT_NICE_FILTER for Colormatrix, so it will use the default MT_MULTI_INSTANCE now. Good idea or not? StainlessS: Quote:
I have been bitten by an older version of Colormatrix before, and it was painful. Cheers manolito Last edited by manolito; 16th August 2018 at 12:38. |
||
16th August 2018, 14:02 | #4235 | Link | ||
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
Quote:
All that being said, I took a brief glance at the code again and I'd bet a fair sum that the reason it misbehaves (or used to misbehave) is extensive use of env->Invoke, especially in interlaced mode where it invokes InternalCache (which Avs+ (ab)uses a lot for its multithreading IIRC). Adding to the problem, the filters it invokes are invoked from the main thread, but when Avs+ then calls GetFrame the processing is actually done in a different thread inside ColorMatrix and I bet that has potential for interesting results - as far as I can remember Avs+ utilizes thread-local storage quite a bit. Still though, pinterf has done significant improvements to the robustness of the multithreading code over the last few years, especially when it comes to this kind of runtime shenanigans, so it may very well actually work now. Who knows, though! Really though, don't use ColorMatrix. Why on earth would you invoke Limiter() instead of tacking on a simple min/max clamp to your pixel math? In the asm version it would literally be two instructions! Jeez. zimg/avsresize works on ARM, so it should definitely work on a CPU without SSE2 too. No excuses. Last edited by TheFluff; 16th August 2018 at 14:05. |
||
16th August 2018, 16:36 | #4236 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
|
Quote:
The zimg library might work without SSE2, the AVS wrapper DLL certainly does not. The other excuse would be that the avsresize download package comes without any proper documentation for AVS users who have never touched VapourSynth (or are no diehard developers). The HD to SD AVS script I use so far goes like this: Code:
Source Filter ColorMatrix(mode="Rec.709->Rec.601") ConvertToYV12() Spline36Resize(704,396) Looks like I would need to use the VS compatible calls. From the doc: Code:
colorspace_op: colorspace operation description Format is "matS[:transS[:primS[:rangeS]]]=>matD[:transD[:primD[:rangeD]]]" Cheers manolito Last edited by manolito; 16th August 2018 at 16:47. |
|
16th August 2018, 17:21 | #4237 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
One difference in notation "170m" or "470bg" for sd matrix instead of "Rec601"; "709" instead of "Rec.709" Code:
Source Filter z_ConvertFormat(704,396, "YV12", colorspace_op="709=>170m", resample_filter="spline36") Another difference Fluffy alluded to is colormatrix clips (it doesn't "clamp", which implies "squishing", not hard clipping), unless you use clamp=0 (normally in avisynth classic I would use mode="Rec.709->Rec.601", clamp=0) . zlib/avsresize doesn't clip data |
|
16th August 2018, 17:35 | #4238 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Code:
colorspace_op="709=>470bg" e: poisondeathray got there first |
16th August 2018, 20:56 | #4239 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Is this expected/deliberate behaviour?
Code:
function _flipit(clip c) { # note the underscore return c.flipvertical } function flipit(clip c) { return c.fliphorizontal } version._flipit # note the underscore |
16th August 2018, 21:23 | #4240 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,783
|
It is probably related to the function syntax {DllFileName}_{FunctionName} to select a function provided by a specific DLL when several DLLs in the range of loaded plugins (especially with a full auto-load directory) provide functions of the same name. An empty DLL name may match the AviSynth core.
You may prefer a function like flipit(clip c, bool vertical) instead. Last edited by LigH; 16th August 2018 at 21:26. |
|
|