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. |
1st November 2017, 08:52 | #3701 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
|
|
1st November 2017, 11:06 | #3702 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Since we're on the subject of changes. Why was the return type of GetCPUFlags() changed from long to int? That one makes absolutely no sense to me.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
6th November 2017, 12:38 | #3703 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
"Standardize some type usage to prevent confusion of devs with GCC background." https://github.com/AviSynth/AviSynth...dd60d203ea9504 |
|
6th November 2017, 13:26 | #3705 | Link | ||
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Current x264 is one of such programs, it fails, because it reads zero pitches (strides). Code:
x264 [error]: Input picture width (640) is greater than stride (0) x264 [error]: x264_encoder_encode failed It fails because when we change the type of offset-like variables from int (32 bits) to size_t (64 bits on x64), the positions of fields in AVS_VideoFrame are shifted and a "baked" reference to the "pitch" now becomes the higher 32 bits of "offset", which is usually zero. And that's only for x264. Anyway, when I'll make a test build, I will provide this "offsets are size_t instead of int" version as a separate test version. If it could be changed it may work for current (int) and future (size_t) version of avisynth. Maybe it was inlined purposely, because older avisynth versions did not support avs_get_read_ptr_p through C interface (did not have time to dig into its history)? To tell the truth, I had a look at the current avisynth_c.h from avs+ project, and although this specific call is O.K. in current version, there are two other problematic functions, namely avs_get_row_size and avs_get_height (the ones without a "plane" parameter) so they apply on plane 0 (PLANAR_Y). These functions are still directly accessing the AVS_VideoFrame contrary to the big warning "DO NOT USE THIS STRUCTURE DIRECTLY", so c interface header in avs+ is still inconsistent, at least for AVS_VideoFrame. |
||
7th November 2017, 02:06 | #3707 | Link | |
Registered User
Join Date: May 2007
Posts: 53
|
Quote:
Rgb>yv12 Rgb>yv16 |
|
7th November 2017, 12:10 | #3709 | Link |
Registered User
Join Date: May 2007
Posts: 53
|
Code:
SetFilterMTMode("AVISource", x) #2or3 AVISource("Path to frameserve file.avi").ConvertToYv12() #12 or 16 bob() Prefetch (4) Take out bob, they both look the same. |
7th November 2017, 13:09 | #3710 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
RGB->YV12 conversion is a two-phase conversion. First comes RGB->YV24, then YV24->YV12. This latter needs the hint that the clip is an interlaced one. (remark: parameter "interlaced" is used only in conversions where yv12 is involved either as source or target) |
|
8th November 2017, 22:45 | #3715 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
It appears that Prefetch cannot be used in a script which uses Return.
Here is my test. The following script runs at the same speed with, or without, the Prefetch statement. It is clear that multi-threading is NOT being used. Code:
LoadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\Film Restoration\Script_and_Plugins\RemoveGrainSSE2.dll") source=AVISource("E:\fs.avi").killaudio().ConvertToYV12() output=MDegrain2i2(source,8,4,400,0) return output Prefetch(5) If I re-code so the script ends with the implied "last," as shown below, I get a 4x speedup (i.e., multi-threading is working), and don't get an error message. In other words, this works. However, it is a PITA to have to re-write scripts to avoid the return statement because I often want to do comparisons between the initial and final states of a denoising script, so it is useful to have a final "output" variable. Is there a way to get Prefetch to work with Return, or I have I just found the only way? Code:
LoadPlugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\Film Restoration\Script_and_Plugins\RemoveGrainSSE2.dll") source=AVISource("E:\fs.avi").killaudio().ConvertToYV12() MDegrain2i2(source,8,4,400,0) Prefetch(5) |
9th November 2017, 00:19 | #3716 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Quote:
eg. Code:
source = whateversource() A = source().filter1() B = source().filter2() #source A #B prefetch(5) |
|
9th November 2017, 00:28 | #3717 | Link | |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Quote:
|
|
9th November 2017, 00:44 | #3719 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
AviSynth (plus as well as legacy) internally uses a clip variable "last" where an explicit assignment is omitted (and an implicit "return last" where any return was omitted). Explicitly, this would act like:
Code:
source = whateversource() A = source().filter1() B = source().filter2() #source last = A #last = B last.prefetch(5) return last Last edited by LigH; 9th November 2017 at 00:47. |
9th November 2017, 00:52 | #3720 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I nearly suggested same as Fluffy, but as I've never used MT/Avs+, thought it might be daft.
Perhaps docs could be updated to reflect that Prefetch takes a [EDIT: compulsory] clip arg (if indeed it does), docs as given on Avisynth.org/Avs+ below. Quote:
Code:
# This line causes all filters that don't have an MT mode explicitly use mode 2 by default. # Mode 2 is a relatively safe choice until you don't know most of your calls to be either mode 1 or 3. # Compared with mode 1, mode 2 trades memory for MT-safety, but only a select few filters will work with mode 1. SetFilterMTMode("DEFAULT_MT_MODE", 2) or SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE) # FFVideoSource(), like most of all source filters, needs MT mode 3. # Note: starting with AviSynth+ r2069, it will now automatically recognize source filters. # If it sees a source filter which has no MT-mode specified at all, it will automatically use # mode 3 instead of the default MT mode. SetFilterMTMode("FFVideoSource", 3) or SetFilterMTMode("FFVideoSource", MT_SERIALIZED) # Now comes your script as usual FFVideoSource(...) Trim(...) QTGMC(...) ... # Enable MT! Prefetch(4)
__________________
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; 9th November 2017 at 01:09. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|