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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 11th December 2016, 23:01   #2681  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
New week, new build, new adventures.
This time I had to remove the script array feature that has caused me and you headaches.
http://www.mediafire.com/file/gbpdu5...splus-r2343.7z

20161211 r2343dev
  • Overlay: use y offset when greymask=true (fix)
  • Fix DV chroma positioning (UV swapped), interlaced parameter check for 4:2:0
    (fix by IanB in classic Avisynth)
  • BitBlt in 32 bit Avisynth:
    for processors with AVX or better ignore tricky isse memcpy replacement, trust in memcpy (test)
    (x64 is O.K., it always used memcpy)
  • Merge: use stream_load for AVX2
  • VDubFilter.dll (now bundled):
    convert 'd' double and 'l' long typed parameters to 'f' float and 'i' int for poor AviSynth, thus allowing the usage of such virtualdub filters
  • remove script array (new AVSValue schema) feature, cannot make it compatible with Invoke from v2.5 plugins until I figure out a workaround or such plugins would slowly distinct. <sniff> <sniff>
that fix the problem of PAL DV
__________________
See My Avisynth Stuff
real.finder is offline  
Old 12th December 2016, 02:03   #2682  |  Link
fAy01
Registered User
 
Join Date: Jun 2010
Posts: 91
Quote:
Originally Posted by pinterf View Post
New week, new build, new adventures.
This time I had to remove the script array feature that has caused me and you headaches.
http://www.mediafire.com/file/gbpdu5...splus-r2343.7z

20161211 r2343dev
  • Overlay: use y offset when greymask=true (fix)
  • Fix DV chroma positioning (UV swapped), interlaced parameter check for 4:2:0
    (fix by IanB in classic Avisynth)
  • BitBlt in 32 bit Avisynth:
    for processors with AVX or better ignore tricky isse memcpy replacement, trust in memcpy (test)
    (x64 is O.K., it always used memcpy)
  • Merge: use stream_load for AVX2
  • VDubFilter.dll (now bundled):
    convert 'd' double and 'l' long typed parameters to 'f' float and 'i' int for poor AviSynth, thus allowing the usage of such virtualdub filters
  • remove script array (new AVSValue schema) feature, cannot make it compatible with Invoke from v2.5 plugins until I figure out a workaround or such plugins would slowly distinct. <sniff> <sniff>
FFms2 is still not working with the new avs+ build. Avspmod still cannot display the video. Whereas, yatta throws this error when I try to open any 10bit h264 ffms2 indexed stream: http://i.imgur.com/anIgSP9.png

Last edited by fAy01; 12th December 2016 at 02:09.
fAy01 is offline  
Old 12th December 2016, 07:36   #2683  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
As the error says. Ffms2 opens the video in native 10 bits. Use ConvertBits(8) after ffms2 or specify a 8 bit format if your filter chain is 8 bit only. Or when using avspmod.
pinterf is offline  
Old 12th December 2016, 08:54   #2684  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by ajp_anton View Post
Suggestion to CombinePlanes: if source clip only has a Y plane and "source_planes" is not set, use the Y plane.
Also, if "planes" is set, why do we need "pixel_type"? Can't "pixel_type" be figured out automatically, or am I missing some case when it can't?
You don't need that.
From my earlier post:

CombinePlanes(clip1 [,clip2, clip3, clip4], string planes [, string source_planes, string pixel_type, string sample_clip])

Combines planes of source clip(s) into a target clip

If sample_clip is given, target clip properties are copied from that clip
If no sample_clip is provided, then clip1 provides the template for target clip
An optional pixel_type string (e.g."YV24", "YUV420PS", "RGBP8") can override the base video format.
pinterf is offline  
Old 12th December 2016, 14:30   #2685  |  Link
mcjordan
Registered User
 
Join Date: Nov 2010
Posts: 123
Compilation break issue:

8> merge_avx2.cpp
8>C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(75): error C2664: '__m128i _mm_stream_load_si128(__m128i *)': cannot convert argument 1 from 'const __m128i *' to '__m128i *'
8> C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(75): note: Conversion loses qualifiers
8> C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(98): note: see reference to function template instantiation 'void average_plane_avx2<uint8_t>(BYTE *,const BYTE *,int,int,int,int)' being compiled

Help?
mcjordan is offline  
Old 12th December 2016, 14:54   #2686  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by mcjordan View Post
Compilation break issue:

8> merge_avx2.cpp
8>C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(75): error C2664: '__m128i _mm_stream_load_si128(__m128i *)': cannot convert argument 1 from 'const __m128i *' to '__m128i *'
8> C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(75): note: Conversion loses qualifiers
8> C:\AviSynthPlus\avs_core\filters\merge_avx2.cpp(98): note: see reference to function template instantiation 'void average_plane_avx2<uint8_t>(BYTE *,const BYTE *,int,int,int,int)' being compiled

Help?
Comment on git copied here:
Strange, here
https://msdn.microsoft.com/en-us/lib...v=vs.120).aspx
__m128i _mm_stream_load_si128(__m128i *p);
is mentioned, and you are seeing that.

However, in my smmintrin.h I can see:
__m128i _mm_stream_load_si128(const __m128i*);

Maybe the header (smmintrin.h) has been changed since vs2013?

Try removing the 'const' from cast body.
pinterf is offline  
Old 12th December 2016, 14:56   #2687  |  Link
mcjordan
Registered User
 
Join Date: Nov 2010
Posts: 123
Thank you, pinterf. I'll try asap.
mcjordan is offline  
Old 12th December 2016, 19:42   #2688  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
Quote:
Originally Posted by pinterf View Post
You don't need that.
From my earlier post:

CombinePlanes(clip1 [,clip2, clip3, clip4], string planes [, string source_planes, string pixel_type, string sample_clip])

Combines planes of source clip(s) into a target clip

If sample_clip is given, target clip properties are copied from that clip
If no sample_clip is provided, then clip1 provides the template for target clip
An optional pixel_type string (e.g."YV24", "YUV420PS", "RGBP8") can override the base video format.
But for example if I want to join three Y8 clips into RGB, I have to specify "RGB" twice: planes="RGB", pixel_type="RGB".

This is how I'd imagine it working:
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB")
"CombinePlanes: too many target planes (3)! Target video plane count is 1!"
Why would the target have 1 plane, when I obviously want to map them into RGB?
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",pixel_type="RGB")
I know that just "RGB" is not a pixel type, but consequently there's no way to specify just "RGB". It has to be precise in both planar/packed as well as bits. If I write it wrong, the function won't convert it to what I wrote, it will just say it's wrong. Why ask me to specify it if it already knows what it's supposed to be?
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",pixel_type="RGBP8")
"Source has no such plane "U""
Why not use the only available plane as default, if I don't purposefully try to access an unexisting plane?
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",source_planes="YYY",pixel_type="RGBP8")
This I'm assuming is finally supposed to work, but it crashes both VirtualDub (filtermod) and x264, the two programs I have that can handle Avisynth. Anything I can do to help identify the cause? This is with r2343, both 32- and 64-bits.
ajp_anton is offline  
Old 12th December 2016, 20:11   #2689  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by ajp_anton View Post
But for example if I want to join three Y8 clips into RGB, I have to specify "RGB" twice: planes="RGB", pixel_type="RGB".

This is how I'd imagine it working:
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB")
"CombinePlanes: too many target planes (3)! Target video plane count is 1!"
Why would the target have 1 plane, when I obviously want to map them into RGB?

Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",pixel_type="RGBP8")
"Source has no such plane "U""
Why not use the only available plane as default, if I don't purposefully try to access an unexisting plane?
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",source_planes="YYY",pixel_type="RGBP8")
This I'm assuming is finally supposed to work, but it crashes both VirtualDub (filtermod) and x264, the two programs I have that can handle Avisynth. Anything I can do to help identify the cause? This is with r2343, both 32- and 64-bits.
Don't forget that RGBP8 is unknown for these softwares.
In order to make it work or get it shown in VirtualDub, you have to do a ConvertToRGB32().

As the special case when inputs are greyscale, it is indeed a good idea not defaulting source planes to YUV, your proposal is logical.

edit:
Quote:
Originally Posted by ajp_anton View Post
Code:
version.converttoy8
combineplanes(last,last,last,planes="RGB",pixel_type="RGB")
I know that just "RGB" is not a pixel type, but consequently there's no way to specify just "RGB". It has to be precise in both planar/packed as well as bits. If I write it wrong, the function won't convert it to what I wrote, it will just say it's wrong. Why ask me to specify it if it already knows what it's supposed to be?.
This is a very special rule: Wwen inputs are greyscale _and_ planes="RGB" (or RGBA) then the output could be planar RGB or RGBA, keeping the bit-depth of the input clips.

Last edited by pinterf; 12th December 2016 at 20:23.
pinterf is offline  
Old 12th December 2016, 21:31   #2690  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
Quote:
Originally Posted by pinterf View Post
Don't forget that RGBP8 is unknown for these softwares.
In order to make it work or get it shown in VirtualDub, you have to do a ConvertToRGB32().
Oh. And I could've sworn it crashed also with a ConvertToYV12, but now it doesn't. Nevermind then =).

Quote:
Originally Posted by pinterf View Post
This is a very special rule: Wwen inputs are greyscale _and_ planes="RGB" (or RGBA) then the output could be planar RGB or RGBA, keeping the bit-depth of the input clips.
Do we need a special rule here? If planes has any permutation of RGB or RGBA, there's only one thing to do: combine the inputs. Throw an error if bitdepths or resolutions don't match.
If it has any permutation of YUV or YUVA, same thing, except also check if the U/V resolutions match 4:2:2 or 4:2:0 before throwing an error.

Also, I would go even further by making source_planes always default to Y if the source clip is YUV(A), because that's what you're usually processing before combining them, and that's what you're actually seeing when previewing anything. If there's at least one RGB source, then require the source_planes string.

Last edited by ajp_anton; 12th December 2016 at 21:33.
ajp_anton is offline  
Old 12th December 2016, 21:49   #2691  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
RGBA and YUVA permutations are working already.
But this latter idea can be confusing, e.g. you can specify only one YUV clip, and the default source plane order is YUV, which is good enough I think.
There is a rule that you can specify less input clips, and if no more clips found in the list, but there are still planes to process, the last one will be automatically used further on.

Last edited by pinterf; 12th December 2016 at 21:53. Reason: addition
pinterf is offline  
Old 13th December 2016, 04:26   #2692  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
Quote:
Originally Posted by pinterf View Post
RGBA and YUVA permutations are working already.
How so? Or did you misunderstand?
If planes="RGB" or "BARG" or "AVYU" (weird examples), why does it need pixel_type? There's only one string that's ever going to be accepted by the filter anyway, why not use that? Does there exist a scenario where the user can actually choose between two different pixel_type strings?
ajp_anton is offline  
Old 13th December 2016, 07:51   #2693  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Sorry, I mean they are working because meanwhile I have done it. Specify planes=RRG or GBRA, it will map to planar rgb. pixel_type is good only when single Y or A target is specified or want a target with alpha plane but not filling all 4 planes.
pinterf is offline  
Old 14th December 2016, 04:16   #2694  |  Link
fAy01
Registered User
 
Join Date: Jun 2010
Posts: 91
Quote:
Originally Posted by pinterf View Post
As the error says. Ffms2 opens the video in native 10 bits. Use ConvertBits(8) after ffms2 or specify a 8 bit format if your filter chain is 8 bit only. Or when using avspmod.
Why do I have to convert my encode from 10bit to 8bit? It worked fine before. Please help
fAy01 is offline  
Old 14th December 2016, 05:34   #2695  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
re did same test here http://forum.doom9.org/showthread.ph...mc#post1745799 but with MP_Pipeline and after edit this http://publishwith.me/ep/pad/view/ro.rDkwcdWn4k9/latest
Code:
MP_Pipeline("""
### platform: win64
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
Prefetch(12)
### ###
""")
and get ~38 fps
__________________
See My Avisynth Stuff
real.finder is offline  
Old 14th December 2016, 08:52   #2696  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
I note that GScriptClip is incompatible with avs+ mt, with mode 2 not work at all and with mode 3 gave random scriptcilp errors
__________________
See My Avisynth Stuff

Last edited by real.finder; 14th December 2016 at 08:57.
real.finder is offline  
Old 14th December 2016, 10:07   #2697  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
If Prefetch is used in a script, is it possible in a plugin to retrieve the value used?
If yes:
- how?
- Is this value allready avaible when AvisynthPluginInit3 is called, or should i have to wait to be within the Create_xxxx to have the value?
jpsdr is offline  
Old 14th December 2016, 10:28   #2698  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by jpsdr View Post
If Prefetch is used in a script, is it possible in a plugin to retrieve the value used?
If yes:
- how?
- Is this value allready avaible when AvisynthPluginInit3 is called, or should i have to wait to be within the Create_xxxx to have the value?
See here and here.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 14th December 2016, 12:02   #2699  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
This answer half... But i still can make tests, to chek if using GetProperty(AEP_FILTERCHAIN_THREADS) inside AvisynthPluginInit3 will allready give me the correct value.
jpsdr is offline  
Old 14th December 2016, 12:14   #2700  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by jpsdr View Post
This answer half... But i still can make tests, to chek if using GetProperty(AEP_FILTERCHAIN_THREADS) inside AvisynthPluginInit3 will allready give me the correct value.
GetProperty() is part of IScriptEnvironment2 and not supported by IScriptEnvironment as far as I know. That should answer your second question.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 18:00.


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