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 15th June 2020, 14:42   #21  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
I'm not sure but it seems that the filter is processing (width*height) bytes of input, instead of (pitch*height) bytes?

Avisynth internally works with 64-byte alignment, and provides buffers as such. The structures passed to the filter contain pitch and even a modulo (pitch-rowwidth) number.

Artifacts on top of RGB32 means that the last X bytes are left unprocessed (packed RGB is top-bottom)
pinterf is offline   Reply With Quote
Old 15th June 2020, 14:54   #22  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
It does though work in x64 Vdub2 [EDIT: direct load of AVI]


EDIT: I've given Shekh a poke, maybe he enlightens us soon.

EDIT: I've also tried with AVs script
Code:
AviSource("D:\Parade.avi")
ConvertToRGB32
VDub2 x64 and still no problem.

EDIT:
Quote:
I'm not sure but it seems that the filter is processing (width*height) bytes of input, instead of (pitch*height) bytes?
More specific than prev given snippet, so above statement looks correct.
Code:
# FIX VDubFilter.dll Weird BUG, but not the x64 bug
# XMOD=16 YMOD=1   # OK
XMOD=1 YMOD=16 # BAD, Prob in XMOD

Crop(0,0,Width/XMOD*XMOD,height/YMOD*YMOD)
__________________
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; 15th June 2020 at 15:32.
StainlessS is offline   Reply With Quote
Old 15th June 2020, 15:23   #23  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
It's just a feeling, I see that depending on the horizontal crop (starting from mod16, then crop(0,0,-1,0) .. crop(0,0,-15,0) filter is giving bigger and bigger unprocessed area at the frame end (visible on top).
Note that -1 is 4 bytes, and a horizontal crop of -15 is 60 bytes.
VDub filter can hint that it requires a buffer with a specific minimum alignment, which request is surely fulfilled by avisynth by having 64 byte aligned NewVideoFrame.
Can you test it with avs 2.6 and width -1, -2 and -3 crop values (it has 16 bytes alignment)?
pinterf is offline   Reply With Quote
Old 15th June 2020, 15:38   #24  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Can you test it with avs 2.6 and width -1, -2 and -3 crop values (it has 16 bytes alignment)?
Clarify, Avisynth 2.60 standard x64 ?
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 15th June 2020, 15:42   #25  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
32 bit. I can see the problem with 32 bit version as well. No difference between 32 or 64 bit versions with my AviSynth+, both have black (total and partially filled) lines.
pinterf is offline   Reply With Quote
Old 15th June 2020, 15:51   #26  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hmmm, 32 bit looks ok here.

This is weird [AVS std 2.60 x86]
Code:
# 64 bit VDF fails with error 0xC1, but filter works OK in VDUB2 x64, possible AVS+ VDubFilter.dll problem.

# VDub GUI "Show Noise" and "Disable" args not available external to VDUB, ie not usable in Avisynth.
# VDF accepts only RGB32
Function VD_CCD(clip clip, int "threshold", bool "multithreading",bool "ShowNoise",Bool "Amp",Int "preroll") {
    threshold      = Default(threshold,30)                                      # Default 30 as in Vdub
    multithreading = Default(multithreading,true)                               # Default true
    ShowNoise      = Default(ShowNoise,False)                                   # Simulated
    Amp            = Default(Amp,True)                                          # Amplify if ShowNoise
    preroll        = Default(preroll,1)                                         # We've given default of 1 frames pre-rolled, maybe only 0 needed.
    Assert(clip.IsRGB32,"VD_CCD: Need RGB32")
    LoadVirtualdubPlugin("D:\VDUB\ccd_32bit.vdf", "_VD_CCD", preroll)           # Change Path to VDF
#   LoadVirtualdubPlugin("D:\VDUB\ccd_64bit.vdf", "_VD_CCD", preroll)           # Change Path to VDF   ## Getting Error OXC1 for 64 bit VDF plugin
    result = clip._VD_CCD(threshold,multithreading?1:0)
    return (!ShowNoise) ? result : (!amp) ? result.Subtract(clip) : result.Subtract(clip).Levels(126-8,1.0,126+8,0,255,coring=false)
}

THRESHOLD=30
SHOWNOISE=false
AMP      =false

AviSource("D:\parade.avi")

ConvertToRGB32(matrix="rec601")

# FIX VDubFilter.dll Weird BUG, but not the x64 bug
#XMOD=16 YMOD=1 # OK
#XMOD=1 YMOD=16 # BAD
#Crop(0,0,Width/XMOD*XMOD,height/YMOD*YMOD)

# Here, 488x360

Crop(0,0,-1,0)  # FINAL result still shows 488x360 ???  [EDIT Oops, 488 not 448]


VD_CCD(threshold=THRESHOLD,shownoise=SHOWNOISE,amp=AMP)

info
I have to leave very soon, got to hit the shop before it shuts.

EDIT: If Switch on SHOWNOISE, then fails at subtract due to different size frames.

EDIT: Avs+ v3.61 test 8 x86 returns width 487 as it should, so looks like Avs 2.60 std has bug in VDFilter.
__________________
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; 15th June 2020 at 16:08.
StainlessS is offline   Reply With Quote
Old 16th June 2020, 08:56   #27  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by StainlessS View Post
EDIT: I've given Shekh a poke, maybe he enlightens us soon.
Not sure what you expect, surely a filter can have bugs. We dont know if x64 version was built from same source
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 16th June 2020, 10:20   #28  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK Shekh, was hoping that you might have some magic words to say, thanks for taking a look.

Quote:
Clarify, Avisynth 2.60 standard x64 ?
I guess I got myself a bit confused there, thats what happens when you are bout 12 hours past your bedtime and are attempting to do bout 17 things at once.
I had to go back and read thread from start to figure out what the problem was/problems were.
The 64 bit problem that I am having is that I cannot load x64 plugin, with error 0xC1.
x86 problem is the weird stuff at top of frame.
Also, I had gotten it into my head that VDFilter.dll calls VDub/VDub2 when it just has some kind of emulation layer for VD.

Anyways, had some sleep now and hopefully have un-confused myself, a bit.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 16th June 2020, 10:40   #29  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Anyway, without seeing the filter's source code it's waste of our time.
pinterf is offline   Reply With Quote
Old 16th June 2020, 10:51   #30  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Also found out why I had problems with x64, I was trying to load x64 plug into x86 app,

Anyways, tried
Code:
THRESHOLD=30
SHOWNOISE=false
AMP      =false

AviSource("D:\parade.avi")
ConvertToRGB32(matrix="rec601")
# Here, 488x360
Crop(0,0,-1,0)    # Now 487x360
VD_CCD(threshold=THRESHOLD,shownoise=SHOWNOISE,amp=AMP)
info  # FINAL result still shows 488x360 ???
With avs standard v2.58, v2.60, v2.61, and all of them have problem in VDFilter showing width as 488 when we have cropped 1 pixel from RHS, should show 487.

Quote:
Anyway, without seeing the filter's source code it's waste of our time.
OK.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 16th June 2020, 11:05   #31  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
With avs standard v2.58, v2.60, v2.61, and all of them have problem in VDFilter showing width as 488 when we have cropped 1 pixel from RHS, should show 487.
If I remember well from my quick debug session, this filter reports that it supports v14 interface, while classic Avisynth only supports up to v6 (?). But I don't know what different behaviour it means.
Can you load Avisynth+'s vdubfilter dll into classic Avisynth?
pinterf is offline   Reply With Quote
Old 16th June 2020, 11:31   #32  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Can you load Avisynth+'s vdubfilter dll into classic Avisynth?
v2.58, "Not a v2.5 avisynth filter" [or words to that effect].
v2.60,2.61, Seems to Work OK, prev error script returns 487x360 as it should. [and also same rubbish at top of frame for the bugged vdf filter].
So in v2.60/2.61 standard, LoadPlugin on Avs+ VDFilter.dll, Installs AVS+ LoadVirtualDubPlugin() and fixes the erroneous 488x360 bug [produces correct 487x360], and seems to work just fine.
__________________
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 June 2020 at 12:13.
StainlessS is offline   Reply With Quote
Old 17th June 2020, 08:50   #33  |  Link
zybex
Registered User
 
zybex's Avatar
 
Join Date: Apr 2007
Posts: 33
I talked with the author of the filter, informed him that we were going to create a remake of this filter under AVISynth+, and asked him to share the filter’s algorithm and / or sources, he said that he would send me some specific information in a couple of days when he returned from the trip.
zybex is offline   Reply With Quote
Old 18th June 2020, 09:04   #34  |  Link
zybex
Registered User
 
zybex's Avatar
 
Join Date: Apr 2007
Posts: 33
Here are the filter sources:

[URL deleted]

The author of this filter Sergey Stolyarevsky kindly provided them to us.

And he promised to join our discussion on this topic in a few days.

==================
Updated fixed version here:
https://forum.doom9.org/showthread.p...25#post1916925

Last edited by zybex; 27th June 2020 at 19:10.
zybex is offline   Reply With Quote
Old 18th June 2020, 10:24   #35  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by zybex View Post
Here are the filter sources:

https://mega.nz/file/uxxXCYwT#CthrV9...SbFJhPTbuDsNw8

The author of this filter Sergey Stolyarevsky kindly provided them to us.

And he promised to join our discussion on this topic in a few days.
Good. After having a quick look into the source I noticed that pixels are addressed as (y*width + x) and not (y * pitch + x) which explains why passing a buffer with an (64 byte) aligned pitch will not be processed entirely. So - if I'm right - Sergey can fix it quickly.
pinterf is offline   Reply With Quote
Old 27th June 2020, 19:09   #36  |  Link
zybex
Registered User
 
zybex's Avatar
 
Join Date: Apr 2007
Posts: 33
Updated fixed version CCD V1.9 (Sources + Binaries)

https://mega.nz/file/GsYlQayQ#LO7qq8...KuQRCamtUe0lO4
zybex is offline   Reply With Quote
Old 27th June 2020, 20:05   #37  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Cheers Sergey Stolyarevsky and Zybex.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 1st July 2020, 08:39   #38  |  Link
Sergey 1400
Registered User
 
Join Date: Jun 2020
Posts: 1
Hello! I am Sergey Stolyarevsky, the author of the filter. Version 1.9 solved the problems?
Sergey 1400 is offline   Reply With Quote
Old 1st July 2020, 09:51   #39  |  Link
zybex
Registered User
 
zybex's Avatar
 
Join Date: Apr 2007
Posts: 33
Quote:
Originally Posted by Sergey 1400 View Post
Version 1.9 solved the problems?
Hi, Sergey.
Glad to see you on the forum.

pinterf now on vacation until about July 11:
https://forum.doom9.org/showthread.p...64#post1916864
zybex is offline   Reply With Quote
Old 1st July 2020, 15:50   #40  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hello and welcome to the forum Sergey 1400
__________________
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 ???
StainlessS 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 04:52.


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