Log in

View Full Version : amDCT "adaptive multifunction DCT", deblock, smooth, sharpen, range expansion filter.


Pages : 1 [2]

WaxCyl
4th September 2024, 01:09
You're welcome.

tormento
4th September 2024, 09:42
I'd like to try it, someone can suggest me some parameters to tweak to have good results and some examples?

WaxCyl
4th September 2024, 23:36
amDCT(adapt=31, shift=5, quality=3, quant=31, matrix=8, expand=10, sharpWAmt=31, qtype=11, ncpu=4)## qual= 3 not 4!
amDCTc(adapt=31, shift=5, quality=3, quant=31, matrix=8, expand=10, sharpWAmt=31, qtype=11, ncpu=4 )#
Sorry I can't vouch for any of the above settings!

WaxCyl
4th September 2024, 23:40
There is a PDF and DOC manual in the files
I linked to above

tormento
6th September 2024, 10:25
x64 build is really needed!

Anyone willing to compile it?

WaxCyl
6th September 2024, 11:15
Yes I would love a 64bit version too!

tormento
28th October 2024, 14:57
*bump* :p

pinterf
28th November 2024, 11:48
Challenge accepted. Try this one and report back.

(reuploaded with the fixed sharpTAmt in amDCTc.avs script)
https://drive.google.com/uc?export=download&id=1qNLoytjdwTPezL3kfyq5fJH3L1xhNtfq

## Changelog

- (20241127) v1.4.1

- project moved to github: https://github.com/pinterf/amDCT
(private until cleaned up)
- Built using Visual Studio 2022
- Changed to AVS 2.6 plugin interface
- 64 bit build for Avisynth+
- Added version resource to DLL
- Drop all inline MMX assembly, convert them to SIMD intrinsics, sometimes based on C code,
Since some rewritten parts require SSE4.1 this is the minimum processor requirement.
- external assembly (dct) temporarily removed
- source changes: some efforts made for future C-only (non-Intel) and Windows independent build, cleanup, etc.

- (20190705) v1.3_Testing
fixes freeing the same memory twice.

- (20190611) v1.2_Testing
Fixed the "Horrible anomalies", artifacts disappear when removing 'brightStart=205'

- (20190314) v1.1_Testing

- (20170318) v1.0 released

WaxCyl
28th November 2024, 13:09
Thanks @Pinterf!!!
Evaluate : operands of '<' and friends must be strings or numeric (amDCTc.AVSI, line 85)
I get this error when using amDCTc.avsi

pinterf
28th November 2024, 13:24
Thanks @Pinterf!!!

I get this error when using amDCTc.avsi
It must be a typo in the original avsi.

Edit lines 68-69:

sharpWAmt = default( sharpWAmt, 0 )
sharpWAmt = default( sharpTAmt, 0 )


Correct to

sharpWAmt = default( sharpWAmt, 0 )
sharpTAmt = default( sharpTAmt, 0 )

WaxCyl
28th November 2024, 13:41
It works! Thanks pinterf, greatly appreciated.
Edit: I have no found no other issues, I like what it does for the chroma as well.

tormento
28th November 2024, 16:46
Challenge accepted. Try this one and report back.
Great! Will test ASAP.

pinterf
28th November 2024, 17:58
Uploaded to Github as well. Code cleanup and further build enhancements: not now. :)

https://github.com/pinterf/amDCT

poisondeathray
28th November 2024, 18:30
Thanks for the early x-mas gift pinterf, nice to see you around !

anton_foy
28th November 2024, 23:53
Uploaded to Github as well. Code cleanup and further build enhancements: not now. :)

https://github.com/pinterf/amDCT

Awesome thanks!

tormento
29th November 2024, 13:45
Uploaded to Github as well. Code cleanup and further build enhancements: not now. :)
Would you please consider to switch/add Intel Compiler builds? The Community edition is completely free.

I find them faster, both on Intel and AMD.

pinterf
29th November 2024, 14:04
Would you please consider to switch/add Intel Compiler builds? The Community edition is completely free.

I find them faster, both on Intel and AMD.

Nth priority, but yes. I usually make abandoned sources to be compilable with gcc/clang/intel and support C-only non-Intel use cases.

tormento
3rd December 2024, 16:43
(20241127) v1.4.1
Would be of much effort to expand to hbd and rgb?

I am testing it in 8 bits but it hasn't the precision I would like to.

I have a small issue:

SetMemoryMax()
SetCacheMode(0)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("M:\In\Monster ~BDGE\1-1-01.dgi",ct=0,cb=0,cl=240,cr=240)
z_ConvertFormat(resample_filter="spline64", pixel_type="yuv420p16")
Resize8(720,540, kernel="z_Spline36Resize", noring=true, noring_c=true, fullc=true)
z_ConvertFormat(resample_filter="spline64",dither_type="error_diffusion",pixel_type="YUV420P16")
fmtc_bitdepth (bits=8,dmode=8)
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)
Prefetch(2,6)

Where I get:

amDCT: out of memory

pinterf
10th December 2024, 13:01
Would be of much effort to expand to hbd and rgb?

I am testing it in 8 bits but it hasn't the precision I would like to.

I have a small issue:

SetMemoryMax()
SetCacheMode(0)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("M:\In\Monster ~BDGE\1-1-01.dgi",ct=0,cb=0,cl=240,cr=240)
z_ConvertFormat(resample_filter="spline64", pixel_type="yuv420p16")
Resize8(720,540, kernel="z_Spline36Resize", noring=true, noring_c=true, fullc=true)
z_ConvertFormat(resample_filter="spline64",dither_type="error_diffusion",pixel_type="YUV420P16")
fmtc_bitdepth (bits=8,dmode=8)
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)
Prefetch(2,6)

Where I get:

amDCT: out of memory

As responded on your github issue: the "out of memory" was a false error. your clip must have mod8 dimensions: width and height must be multiple of 8.

On the other hand, doesn't amDCT have to be the first filter in the chain, to be able to catch the original 8x8 blocks before any resize and other operation? Or you are not using this feature of the plugins where this counts?

pinterf
10th December 2024, 13:03
New release 1.4.2.
https://github.com/pinterf/amDCT/releases

This changeset was a hard and long process, mainly involving assembler rewrites and tests. And the many small items. It took about another 30-35 hours of work, so I'm just taking a rest now before the further cleanups.

## Changelog
- (20241210) v1.4.2
- Rewrite all external assembly codes (fdct, idct, h263 and mpeg quant-dequants) to Intel intrinsics.
It's now quicker - sometimes significantly - than the original.
- Source: changed Windows specific threading code into C 17 version.
- Source cleanup: removed lots of never used test codes from the source, rewrite some others. Move to cpp.
- Add ability to pass Avisynth+ frame properties
- Add support for any 8 bit planar YUV(A) or Y format (was: YV12 only)
- Copy A alpha plane as well, if exists. (The filter works only on luma channel, other planes are simply copied)
- Fix: add meaningful error message (Issue #2) for clips with non-mod8 width or height dimensions (was: out of memory)
- Add Clang-cl LLVM build option, make source Clang friendly
- Speedup examples:

| qtype | 32 bit clangcl | 32 bit msvc | 32 bit old 1.3 | 64 bit clangcl |
|-------|----------------|-------------|----------------|----------------|
| 1 | 6.12 fps | 5.49 fps | 5.40 fps | 6.56 fps |
| 2 | 6.67 fps | 5.93 fps | 5.28 fps | 7.08 fps |
| 3 | 4.09 fps | 3.61 fps | 3.22 fps | 4.29 fps |
| 4 | 6.66 fps | 5.98 fps | 5.29 fps | 7.16 fps |

WaxCyl
10th December 2024, 19:26
Thank you Pinterf. I can't thank
you enough!

Selur
11th December 2024, 14:52
Vapoursynth support would be cool. :)

FranceBB
26th January 2025, 19:25
i7 6700 4c/8th on Windows XP Professional x86

source: 1920x1080 FULL HD yv12 8bit planar BT709 SDR

Tortmento's settings:
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)

old version: 0.7fps
new version: 1.0fps


Looks like 1.4.2 rocks. :D
Thank you for supporting Windows XP with the "x86_from_2019" builds by the way.
It may only have up to SSE4.2 but it definitely feels it.

pinterf
27th January 2025, 11:04
Thank you for supporting Windows XP with the "x86_from_2019" builds by the way.
It may only have up to SSE4.2 but it definitely feels it.
Doesn't v1.4.2 work on XP out of box?

tormento
27th January 2025, 11:49
I think that a nice speed bump could come from a ICC build, that proved to be fine both on Intel and AMD cpus.

Jamaika
27th January 2025, 12:32
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)
What am I doing wrong?
Assertion failed: IsClip(), file interface.cpp, line 827

FranceBB
28th January 2025, 19:48
Doesn't v1.4.2 work on XP out of box?

nope, x86_from_2019 works just fine, however x86_msvc fails to load as it's missing the following kernel functions:

ReleaseSRWLockExclusive
ReleaseSRWLockShared
AcquireSRWLockExclusive
AcquireSRWLockShared
GetThreadId

https://i.imgur.com/5TIQ3eX.png


here's the x86_from_2019 build instead which shows everything as green and indeed loads just fine:

https://i.imgur.com/afLOXWi.png

pinterf
29th January 2025, 08:44
nope, x86_from_2019 works just fine, however x86_msvc fails to load as it's missing the following kernel functions:

ReleaseSRWLockExclusive
ReleaseSRWLockShared
AcquireSRWLockExclusive
AcquireSRWLockShared
GetThreadId

here's the x86_from_2019 build instead which shows everything as green and indeed loads just fine:


Ahh, yes, there is threading code in this plugin. I could have thought of that. I'm gonna add xp build.

EDIT:
Reuploded to github: package updated with WinXP builds. Let's hope the best.

FranceBB
29th January 2025, 17:57
Works like a charm! :D

real.finder
4th February 2025, 12:08
in case pinterf didn't receive github notifications https://github.com/pinterf/amDCT/issues/3

pinterf
4th February 2025, 14:05
in case pinterf didn't receive github notifications https://github.com/pinterf/amDCT/issues/3
I've received it :) but I'll read it after I finish some other (huge and time consuming) tasks.

tormento
9th December 2025, 20:01
Does it work for AVC/HEVC/other video encoders?

From what I read in the PDF, it seems to be very mpeg oriented, at least for the deblocking part.

DTL
10th December 2025, 10:00
Avc/hevc also mpegs and also blocks based. But from AVC internal deblocking working in decoder so additional external filters are less needed.

tormento
10th December 2025, 11:08
Avc/hevc also mpegs and also blocks based. But from AVC internal deblocking working in decoder so additional external filters are less needed.
There are BDs that are extremely starved and the decoder can do almost nothing. German BD of the Monster anime is an example.

If someone is willing to help, I could post some clips.

DTL
10th December 2025, 11:17
If you read that github link - there is BlindPP separate filter from Asd-g from summer 2025 https://github.com/Asd-g/avisynth-blindpp
You can try it.

Though block size of the new mpegs is variable and if filter only support old 8x8 it may not work as expected. Need testing.

tormento
22nd December 2025, 11:46
If you read that github link - there is BlindPP separate filter from Asd-g from summer 2025
I see no releases for it. Is there anyone who built it?