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 Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th April 2017, 07:49   #21  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by CkJ View Post
Never heard about colors.exe program. Where do I can download it?
Bottom of first post.

EDIT: Ignore me, just downloaded zip from first post, not in there, no idea where to get it, sorry

Did a search on-site for "Colors.exe", just got the hits from this thread, nothing else.

Also seached
Code:
"colors.exe" site:forum.doom9.org
same again.
__________________
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; 20th April 2017 at 08:26.
StainlessS is offline   Reply With Quote
Old 22nd April 2017, 01:29   #22  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
The program colors is available at http://www.den4b.com/
jconklin is offline   Reply With Quote
Old 24th June 2017, 20:59   #23  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Any chance of getting an x64 build?
Gser is offline   Reply With Quote
Old 26th June 2017, 01:44   #24  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
I am working on it. I can cleanly build a simple test filter in win32 release and debug mode as well as x64 release and debug mode.
The win32 versions load and run nicely. The x64 versions won't load.
AviSynth+ 0.1(r2455, MT, i386). Got another step while writing this. AviSynth+ thinks the filter is not a valid Win32 application.
Getting the build system to work well is probably my least favorite thing about programming.
jconklin is offline   Reply With Quote
Old 16th August 2017, 08:39   #25  |  Link
Chyrka
Registered User
 
Join Date: Oct 2011
Location: Kyiv, Ukraine
Posts: 24
There is a small misprint in amDCTc.avs
Code:
sharpWAmt   = default( sharpTAmt,    0 )
should be
Code:
sharpTAmt   = default( sharpTAmt,    0 )
Chyrka is offline   Reply With Quote
Old 2nd March 2018, 00:38   #26  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
can you make it "interlaced safe" ? that would be awesome
Mounir is offline   Reply With Quote
Old 11th April 2018, 00:05   #27  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
Chyrka Thank you for finding the bug in amDCTc.avs. I have uploaded the corrected version.

Mouniir I am not sure what you mean by "interlaced safe".

Gser I want to get back to the x64 build. Unfortunately life intervened so haven't been able to spend time on it. I have a list of things I want to try at 64 bits.
jconklin is offline   Reply With Quote
Old 7th May 2018, 17:28   #28  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Quote:
Originally Posted by jconklin View Post
Chyrka Thank you for finding the bug in amDCTc.avs. I have uploaded the corrected version.

Mouniir I am not sure what you mean by "interlaced safe".

Gser I want to get back to the x64 build. Unfortunately life intervened so haven't been able to spend time on it. I have a list of things I want to try at 64 bits.
Well I'm guessing he means adding this kind of code straight into the script that can be triggered by an option
Code:
i=LAST
SeparateFields().PointResize(i.width,i.height)
amDCT().AssumeFrameBased()
GetParity(i) ? AssumeTFF() : AssumeBFF()
SeparateFields().SelectEvery(4,0,3).Weave()
Yeah there are some other updated things to consider like using avs+ headers and high bit depth support. But I suppose most high bit depth sources are from either codecs that have in-loop deblocking or from source material that is encoded in high enough bit rates to avoid compression issues.

Last edited by Gser; 7th May 2018 at 17:31.
Gser is offline   Reply With Quote
Old 30th November 2018, 09:49   #29  |  Link
0ther
Registered User
 
Join Date: Nov 2018
Posts: 2
When trying to use amDCT, I always get a pop up: "amDCT: out of memory".

I have already tried playing around with SetMemoryMax().

Have no problems with other plug-ins so far.

Any idea what I can do?
0ther is offline   Reply With Quote
Old 30th November 2018, 11:08   #30  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Just thought that I would point out that avisynth header VERSION 5 (in amDCT directory as avisynth.h.2.6.a5.new), is obsolete and would likely cause
major problems if it is used in your source, should change to avisynth VERSION 6 header (used since avs 2.60 standard Alpha 4, I think).
Prior to VERSION 6 header, used AvisynthPluginInit2 [also for v2.58] rather than AvisynthPluginInit3 of avs 2.60 FINAL and avs+.
VERSION 6 header of AVS+ is also the better choice and compatible with avs 2.60 standard VERSION 6 header.

Requires code something like this to support v2.58 and v2.6
Code:
#ifdef AVISYNTH_PLUGIN_25
	extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) {
#else
	// New 2.6 requirement!!! 
	// Declare and initialise server pointers static storage.

	const AVS_Linkage *AVS_linkage = 0;

	// New 2.6 requirement!!! 

	// DLL entry point called from LoadPlugin() to setup a user plugin.
	extern "C" __declspec(dllexport) const char* __stdcall
			AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) {

	// New 2.6 requirment!!!
	// Save the server pointers.
	AVS_linkage = vectors;
#endif

    env->AddFunction("ApparentFPS",
		"c[DupeThresh]f[FrameRate]f[Samples]i[ChromaWeight]f[Prefix]s[Show]b[Verbose]b[Debug]b[Mode]i[Matrix]i[BlkW]i[BlkH[i[oLapX]i[oLapY]i",
		Create_ApparentFPS, 0);

    return "`ApparentFPS' ApparentFPS plugin";
	// A freeform name of the plugin.
}
and for header inclusion something like this

Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

#ifdef AVISYNTH_PLUGIN_25
	#include "avisynth25.h"
#else
	#include "avisynth.h"
#endif
EDIT: Here, IanB post introducing the removal of Baked Code, and new VERSION 6 header requirements [just prior to v2.60 Alpha 4].
https://forum.doom9.org/showthread.p...72#post1580772

Quote:
Originally Posted by IanB View Post
Dear All,

I have had a chance to review my first efforts, resolve a few issues and add functionality for host applications to establish the AVS_Linkage.

The good news.

I have tagged the main instance of the AVS_Linkage structure static and const and I have created a Dll exported const pointer to it, AVS_linkage. This provides a static means for applications that use Avisynth.dll functions to establish the AVS_Linkage. Also I have extended IScriptEnvironment:: with GetAVSLinkage() as a dynamic method to establish the AVS_Linkage. To use the static linkage method #define AVS_LINKAGE_DLLIMPORT immediately before your #include "avisynth.h". To use the dynamic method declare AVS_linkage as in a plugin and after creating env with the CreateScriptEnvironment() do AVS_linkage = env->GetAVSLinkage().

...

This of course breaks binary compatibility so any early API adopters will need to recompile to match this version. Hopefully no other nasties appear and break future binary compatibility.

Thoughts and comments please.
Code:
//------------------------
// USER_PLUGIN.cpp side
//------------------------
...
/* New 2.6 requirement!!! */
// Declare and initialise server pointers static storage.
const AVS_Linkage *AVS_linkage = 0;

/* New 2.6 requirement!!! */
// DLL entry point called from LoadPlugin() to setup a user plugin.
extern "C" __declspec(dllexport) const char* __stdcall
        AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) {

  /* New 2.6 requirment!!! */
  // Save the server pointers.
  AVS_linkage = vectors;

  // Add the name of our function
  env->AddFunction("Plugin", "c", Create_Plugin, 0);

  // Return plugin text identifier.
  return "Plugin";
}
__________________
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; 30th November 2018 at 12:50.
StainlessS is offline   Reply With Quote
Old 30th November 2018, 11:42   #31  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
What is a "local range expansion"? Is it like local contrast?
I remember back then I was subtracting binomialBlur from a chain of Blur(1.58)'s in order to sharpen the middle range of frequencies while avoiding both the high-range noise and low-range edges.
Seedmanc is offline   Reply With Quote
Old 5th December 2018, 00:29   #32  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
Other I will try recompiling my code with StainlessS and IanB suggestions and see if that works.
jconklin is offline   Reply With Quote
Old 5th December 2018, 00:34   #33  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
Quote:
Originally Posted by Seedmanc View Post
What is a "local range expansion"? Is it like local contrast?
I remember back then I was subtracting binomialBlur from a chain of Blur(1.58)'s in order to sharpen the middle range of frequencies while avoiding both the high-range noise and low-range edges.
Seedmanc local range expansion is a form of local contrast enhancement. It is done in the main quant dequant loop. See "How amDCT Works" page 2 of amDCT.pdf.

It works at the block level, 8x8 pixels, using an internal matrix designed to increase the amount of brightness change, of lines in any orientation that are 1 to 8 pixels wide and 1 to 8 pixels long, with thinner lines getting more change.

The amount of brightness change will be reduced for blocks that have a high blockiness value.
jconklin is offline   Reply With Quote
Old 19th December 2018, 01:30   #34  |  Link
0ther
Registered User
 
Join Date: Nov 2018
Posts: 2
Quote:
Originally Posted by 0ther View Post
When trying to use amDCT, I always get a pop up: "amDCT: out of memory".

I have already tried playing around with SetMemoryMax().

Have no problems with other plug-ins so far.

Any idea what I can do?
Can anybody help me with this?
0ther is offline   Reply With Quote
Old 19th January 2019, 07:17   #35  |  Link
WaxCyl
Registered User
 
Join Date: Mar 2016
Posts: 12
Quote:
Originally Posted by 0ther View Post
Can anybody help me with this?
I think the problem may be caused by the video pixel dimensions not being a whole multiple of 16
Say, for instance, your resolution is 1280 x 900
Code:
Lanczos4Resize(1280, 960)
amDCT()
Lanczos4Resize(1280, 900)
Or else you could add black bars on both sides.

I Hope this helps.

Last edited by WaxCyl; 19th January 2019 at 07:20. Reason: Typo
WaxCyl is offline   Reply With Quote
Old 24th January 2019, 22:10   #36  |  Link
jconklin
Registered User
 
Join Date: Mar 2006
Posts: 39
I have posted a new version of amDCT at https://sites.google.com/site/amdctfilter/
The new file is amDCT_v1.1_Testing.zip
The major difference is it uses the AviSynth Plus header files.
I have tested it on the following avs releases using setavs.bat to switch
between different versions and AVSMeter to confirm the AviSynth version.


setavs . . . . . . . . . . . . AVSMeter 2.8.7 (x86) - Copyright (c) 2012-2018, Groucho2004
NAME. . . . . . . . . . . . . . . . . NAME
AVS260 . . . . . . . . . . . . . . AviSynth 2.60, build:Feb 20 2015 [03:16:45] (2.6.0.5)
AVS261_Alpha . . . . . . . . . AviSynth 2.60, build:Mar 31 2015 [16:38:54] (2.6.0.6)
VS260, AVS260MT . . . . . . AviSynth 2.61, build:May 17 2016 [16:06:18] VC2008Exp (2.6.1.0)
AVSPLUS_x86 . . . . . . . . . AviSynth+ 0.1 (r2728, MT, i386) (0.1.0.0)
AVSPLUS_x64 . . . . . . . . . AviSynth+ 0.1 (r2728, MT, x86_64) (0.1.0.0)

The new version of amDCT in amDCT_v1.1_Testing.zip is compiled as a 32 bit dll.
The next step is to get a simple 64 bit dll to build and run.

Last edited by jconklin; 25th January 2019 at 08:33.
jconklin is offline   Reply With Quote
Old 25th January 2019, 18:46   #37  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by ChaosKing View Post
Nice filter!

I get about 7.5fps on a 480p source i5 3570K@4.4Ghz with
Code:
amDCT(adapt=28, quant=9, expand=16, sharpWAmt=8, quality=4)
3fps more with quality=3.

Update with v1.1, tested on a Ryzen 1700 @ 3.65ghz
Now I get only 5.4fps with a 480p source (maybe 10% cpu). With Prefetch(8) it goes up to 37fps @50% cpu. Prefetch(16) almost 55fps 96% cpu.
quality=3 and Prefetch=16 -> 87fps.

So realtime on a DVD is easily achievable.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 25th January 2019 at 19:00.
ChaosKing is offline   Reply With Quote
Old 3rd May 2019, 09:25   #38  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
Fell in love with this filter when I tested it with short clips.

Now, it is a nightmare because most of the time I can't get it to work with anything longer than a few minutes without crashing.

Nothing like having a 6 hour job crash at 90%.

The most stable performance with short clips seems to be with ncpu=1 (the default) and the version 1.1 "testing" version posted in January, with 2 x264 encode threads and 4 Avisynth MT threads. Even with this is still crashes occassionally.

This is with amDCT as the only Avisynth filter.

REALLY needs a 64 bit version for Vapoursynth!

Code:
LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\ffms2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\amDCT.dll")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:\USER\Test\Test.mp4
#  input color sampling YV12
#  input luminance scale tv
FFVideoSource("E:\USER\Test\Test.mp4")
# current resolution: 1920x1080
# deblocking
# deblocking using amDCT
# padding to mod16 for speed
# Current resilution: 1936x1088
AddBorders(8,4,8,4)
amDCT(adapt=31,shift=5,quality=4,quant=9,matrix=8,expand=16,sharpWpos=6,sharpTpos=7,sharpWAmt=24,sharpTAmt=31,brightStart=205,brightAmt=30)
# removing mod16 padding
Crop(8,4,-8,-4)
PreFetch(4)
return last

Last edited by Treaties Of Warp; 5th May 2019 at 20:22.
Treaties Of Warp is offline   Reply With Quote
Old 5th May 2019, 19:11   #39  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
Horrible anomalies

I have so far gotten the most stable performance of amDCT by using Hybrid, with LWLibavVideoSource, aus2yuv.exe, 2 x264 threads, and 4 Avisynth threads.

Despite that, this filter sometimes produces HORRIBLE anomalies. I've included below a 15 second clip that produces these anomalies with the author's settings from above:

Code:
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\amDCT.dll")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:\USER\temp_dvd\Video\Test\cut_orig.mp4
#  input color sampling YV12
#  input luminance scale tv
LWLibavVideoSource("E:\USER\temp_dvd\Video\Test\cut_orig.mp4",cache=false,stacked=true,format="YUV420P8",repeat=true)
# current resolution: 1920x1080
# deblocking
# deblocking using amDCT
# padding to mod16 for speed
# Current resilution: 1936x1088
AddBorders(8,4,8,4)
amDCT(adapt=31,shift=5,quality=4,quant=9,matrix=8,expand=16,sharpWpos=6,sharpTpos=7,sharpWAmt=24,sharpTAmt=31,brightStart=205,brightAmt=30)
# removing mod16 padding
Crop(8,4,-8,-4)
PreFetch(4)
return last
https://i.imgur.com/HxxTs1S.mp4

I tried both amDCT_v1.0 and amDCT_v1.1_Testing... same behavior in both of them.

I don't trust this filter.

Here's the original (unprocessed) clip: https://bit.ly/2ZXH4Gp

Last edited by Treaties Of Warp; 5th May 2019 at 19:14.
Treaties Of Warp is offline   Reply With Quote
Old 7th May 2019, 16:31   #40  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
produces HORRIBLE anomalies.
as a side note: those artifacts disappear when removing 'brightStart=205'
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply


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 19:59.


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