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. |
22nd February 2018, 15:08 | #3941 | Link | |||
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Quote:
Done. Did you know that in avs+ the hex string was in lowercase? Done. -1 bug was not present, probably the fix was pulled from classic avs Quote:
I'll look at the rest later. |
|||
22nd February 2018, 15:23 | #3942 | Link | |||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Yep, PopCnt looks familiar.
Quote:
Quote:
[EDIT: Almost obligatory to use uppercase for hex on M68K machines] Quote:
__________________
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; 22nd February 2018 at 15:26. |
|||
22nd February 2018, 15:34 | #3943 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
I have been working on some AVS+ enhancement routines for months without promoting it.
http://avisynth.nl/images/Utils-r41.avsi The more useful ones (they're essential, to me anyway) are listed below. The single most useful function (if I had to pick one) is MatchColorFormat - match color format to a template clip. Use this before splicing or stacking two clips when you're not sure of their current color formats. Code:
### MISCELLANEOUS FUNCTIONS ### return true if running in Avisynth+, false otherwise #@ function IsAvsPlus() ### return AVS+ build number, if present; else 0 #@ function VersionBuildNumber() ### return basic clip properties as a string ## Example | Assert(false, InfoString) ## show info about current Last variable #@ function InfoString(val C, string "label") ### STRING FUNCTIONS ### count the number of line breaks (for multi-line Subtitle(align=1|2|3) #@ function CountLines(string s, bool "lsp") ### Split long lines for [[Subtitle]] line wrap #@ function SplitLines(string s, int "lastcol", bool "reflow") ### trim spaces from both ends of string #@ function Trim(string s) ### trim spaces from left end of string #@ function TrimLeft(string s) ### Get part of a full path to right of last '\' #@ function GetNameFromPath(string path) ### Get part of a full path to left of last '\' #@ function GetParentFolder(string path) ### format seconds as hh:mm:ss.ddd #@ function FormatTime(float fsec, int "decimals") ### format hours/minutes/seconds as hh:mm:ss.ddd #@ function FormatTime(int t_hours, int t_mins, float t_secs, int "decimals") ### for bits==32, return "S", else return String(bits) #@ function BitsToPixelType(int bits) ### NUMERIC FUNCTIONS ### return argument 'f' as integer and ensure it is modulo 'm' #@ function modx(int m, float f, int "dir") ### Hex() with leading "0" if less than 2 chars long #@ function Hex2(int i) ### scale [[ColorYUV]]'s 'gain_x', 'gamma_x' & 'cont_x' ### to more intuitive values (like [[Tweak]]'s) #@ function f2c(float f) ### calculate new width, given height, for preserving aspect ratio #@ function CalcWidth(clip C, float fhgt, int "mod", int "lim") ### calculate new height, given width, for preserving aspect ratio #@ function CalcHeight(clip C, float fwid, int "mod", int "lim") ### DEEP COLOR ARGUMENT SCALING FUNCTIONS ### scale an 8-bit value for target clip 'T' #@ function sc8f(clip T, float f, bool "cx") ### scale an 8-bit value for target clip 'T'; clamp output #@ function sc8x(clip T, float f) ### scale an 8-bit value for target clip 'T'; string result #@ function sc8s(clip T, float f, int "decimals") ### UTILITY FILTERS ### Convert from anything to planar RGB(A) #@ function ToRGB(clip C, string "matrix", int "bits_out", val "A") ### Convert from anything to YUV(A)444 #@ function To444(clip C, string "matrix", int "bits_out", val "A") ### Convert from anything to YUV(A)422 #@ function To422(clip C, string "matrix", int "bits_out", val "A") ### Convert from anything to YUV(A)420 #@ function To420(clip C, string "matrix", int "bits_out", val "A") ### Convert from anything to best equivalent 16-bit version #@ function To16bit(clip C, clip "A") ### Convert from anything to best equivalent higher-bit-depth version #@ function ToHibit(clip C, int bits, clip "A") ### Convert from anything to best equivalent lower-bit-depth version #@ function ToLobit(clip C, int bits, bool "dither", clip "A") ### Convert from anything to 'best' (v2.6x compatible) equivalent 8-bit version #@ function To8bit(clip C, bool "dither") ### make changes needed to display on vdubFM (VirtualDub FilterMod) #@ function ToVdubFM(clip C, bool "dither") ### Match color format of source 'C' to template 'T' #@ function MatchColorFormat(clip C, clip T, string "matrix", bool "keepbits", bool "dither") ### Match audio properties of source 'C' to template 'T' #@ function MatchAudioFormat(clip C, clip T, bool "allowresample") ### convert levels from 'TV' (black=16d, white=235d) to 'PC' (black=0, white=255d) #@ function ToPC(clip C) ### convert levels from 'PC' (black=0, white=255d) to 'TV' (black=16d, white=235d) #@ function ToTV(clip C) ### 709->601 (less green, more red) #@ function To601(clip C) ### 601->709 (more green, less red) #@ function To709(clip C) ### remove sRGB gamma transfer function (if bit depth > 8) for linear-light processing ### ( used in [[#ScaleZoom]], [[#ScaleSize]] ) #@ function remove_gamma(clip C, bool "enable", string "matrix") ### apply standard gamma transfer function (if bit depth > 8) #@ function restore_gamma(clip C, bool "enable", string "matrix") ### COLOR AND OVERLAY FILTERS ### scale 0-255 [[Levels]] arguments to current bit depth #@ function Levelsc(clip C, ##\ float input_low, float gamma, float input_high, ##\ float output_low, float output_high, bool "coring", ##\ bool "dither", bool "chroma") ### Enhanced [[SGradation]]; semi-independent control of highlights & lowlights #@ function SGradation2D(clip C, ##\ float loBoost, float hiCut, ##\ float "bluSat", float "yelSat", ##\ float "redSat", float "grnSat", bool "tvrange") ### [[Layer]] with support for 'mask', 'opacity' and 'align' parameters #@ function LayerAligned(clip base, clip over, string "op", int "level", ##\ clip "mask", float "opacity", int "align") ### [[Overlay]] with support for 'align' parameter ### supports adding borders to, or letterboxing, inset clip #@ function OverlayAligned(clip base, clip over, ##\ int "x", int "y", clip "mask", float "opacity", string "mode", ##\ bool "greymask", string "output", bool "ignore_conditional", ##\ bool "pc_range", int "align", int "borderwidth", int "bordercolor") ### CROP, RESIZE AND TRANSFORM FILTERS ### alias for [[#Cropd]] with argument order: Left, Right, Top, Bottom #@ function CropLRTB(clip C, int left, int right, int top, int bottom, bool "align", int "mod") ### alias for [[#Cropd]] with argument order: Left, Top, Width, Height #@ function CropLTWH(clip C, int left, int top, int width, int height, bool "align", int "mod") ### show a helpful diagnostic string on [[Crop]] failure; optionally enforce [[Mod]] #@ function Cropd(clip C, int x, int y, int wid, int hgt, bool "align", int "mod") ### switch (or fade) between three [[Resize]] clips depending on scale factor ### (overridable with user-specified resizers e.g. nnedi3 etc) ### (ScaleZoom sizes by percent; ScaleSize by width and/or height) #@ function ScaleZoom(clip C, float factor, int mod, ##\ string "sm", string "med", string "lg", ##\ float "thrSm", float "thrLg", bool "fade", bool "ident", ##\ bool "gamma", bool "hibit") ### switch (or fade) between three [[Resize]] clips depending on scale factor ### (overridable with user-specified resizers e.g. nnedi3 etc) ### (ScaleZoom sizes by percent; ScaleSize by width and/or height) #@ function ScaleSize(clip C, float fwid, float fhgt, int mod, ##\ string "sm", string "med", string "lg", ##\ float "thrSm", float "thrLg", bool "fade", bool "ident", ##\ bool "gamma", bool "hibit") ### crop or expand a clip to ensure it is a certain size (symmetrically by default) #@ function CropEx(clip C, float wid, float hgt, int "mod", ##\ int "align", int "dx", int "dy", bool "debug") ### quick Gaussian blur #@ function QGaussBlur(clip C, float radx, float "rady") ### DEBUGGING FILTERS ### [[Eval]] a script snippet; show script & its return value (clip or nonclip) #@ function EvalShow(clip C, string s, string "font", float "size", ##\ int "text_color", int "halo_color", ##\ float "x", float "y", int "align", string "name") ### return color ramp clip w/ same specs as template clip 'T' #@ function ColorRampEx(clip T, int "left_color", int "right_color", int "height", ##\ bool "zigs", bool "stack", int "noise") ### return grayscale ramp clip w/ same specs as template clip 'T' #@ function Grayramp(clip T, int "height", bool "zigs", bool "stack", int "noise") ### YUV/RGB vectorscope (inverted so red is top-left and hue increases counter-clockwise) #@ function Vector2(clip C, string "matrix", bool "bottom") ### Classic [[Histogram]], waveform on top (or on bottom); supports RGB ### many little enhancements; accepts both YUV & RGB #@ function HistogramTurn(clip C, bool "parade", bool "shrink", bool "bottom") ### show video waveform + vectorscope; many little enhancements; accepts both YUV & RGB #@ function ScopeR(clip C, bool "shrink", bool "vector", string "matrix", bool "parade", bool "bottom") ### Simple waveform + vectorscope. Accepts 8-bit, YUV(A) only. #@ function ScopeY(clip C, bool "shrink", bool "vector", bool "levels", bool "bottom") ### print color channel statistics on the screen ### (auto switch between RGBAdjust(analyze=true) and ColorYUV(analyze=true) ### @ format - optional nicer formatting #@ function Analyze(clip C, bool "format") ### show original & 3 channels (Y, U, V or R, G, B) in quad split #@ function ShowChannels(clip C, bool "analyze", bool "uinvert", bool "chroffset") ### [[ShowFrameNumber]] with support for 'opacity' and 'align' #@ function ShowFrameNumberAligned( ##\ clip C, bool "scroll", int "offset", ##\ float "x", float "y", string "font", int "size", ##\ int "text_color", int "halo_color", ##\ float "font_width", float "font_angle", ##\ float "opacity", int "align") Last edited by raffriff42; 22nd February 2018 at 15:38. |
22nd February 2018, 15:47 | #3944 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
EDIT: https://forum.doom9.org/showthread.p...t=ShowChannels ShowChannels:- Code:
Typical output for a YUV clip:- --------------------------- 347 ] Frames Visited = 348 This Frame Accumulated Y U V Y U V Ave 77.00 125.52 125.42 70.91 125.87 125.78 Min 4 80 95 0 69 83 Max 255 177 165 255 190 174 ~Min 14 95 101 12 92 101 ~Max 234 167 148 235 167 151 --------------------------- where 'AVE' shows average for current frame and accumulated average for all visited frames. 'MIN' shows minimum value for a channel, this frame and accumulated. 'MAX' shows maximum value for a channel, this frame and accumulated. '~MIN' shows loose minimum value for a channel, this frame and accumulated. '~MAX' shows loose maximum value for a channel, this frame and accumulated. Loose minimum uses the filter arg float MinPerc, a percentage of total pixels to ignore when finding the loose minimum, allows to ignore extreme stray pixels (noise). Loose maximum uses the filter arg float MaxPerc, a percentage of total pixels to ignore when finding the loose maximum, allows to ignore extreme stray pixels (noise). The "loose" values are made to filter out very bright or very dark noise creating an artificially low or high minimum / maximum. The Accumulated Ave is a "Average of Averages", or "Average Mean" or "Mean Average", take your pick but accumulated seemed more appropriate considering that it was not restricted to describing just the averages. Accumulated Min is the minimum of all minimums so far, etc.
__________________
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; 22nd February 2018 at 15:52. |
|
22nd February 2018, 17:05 | #3945 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Note#1 Why do you need to ##HACK in function GBR2YUV(clip C, bool "yuva")? Packed RGB is upside down (unlike planar RGB), but you are flipping not all the three 'planes', why? Note#2 In restore_gamma (and where luts are used) you can use the Expr function for 32bit float case. Single 8-16bit lut is faster now with mt_lut, but for 32bit float would help (rare use case nowadays). In general I recommend using scalef and scaleb instead of @F @B, Expr supports only the word ones. Another comment: 255 @F (255 scalef) is better written as 'range_max' I'm planning to make Expr to automatically recognise fast (8-16 bit mt_lut and 8 bit mt_lutxy-like) cases and automatically turn them into real LUT working mode). Note#others.. later, too much new stuff for today |
|
22nd February 2018, 17:47 | #3946 | Link |
RipBot264 author
Join Date: May 2006
Location: Poland
Posts: 7,815
|
Sorry for interrupting but can somebody tell me why Prefetch does not like my subtitle rendering script on YUV420P10? Image flashes and eventually script crashes my player (MPC-HC).
If I remove video=Prefetch(video,8) then everything is ok. Test script (video.avs) http://www.mediafire.com/file/c9n8ml...ch%20issues.7z
__________________
Windows 7 Image Updater - SkyLake\KabyLake\CoffeLake\Ryzen Threadripper |
22nd February 2018, 21:05 | #3947 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
@StainlessS:
Would you consider providing a CHM documentation for a recent AviSynth+ state again if collecting all the differences to AviSynth 2.60 doesn't mean too much efforts? |
22nd February 2018, 21:25 | #3948 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
When using Trim(5000,..) the crash occurs at around frame 1400. I suspect something in the subtitle text around that spot. EDIT: debugging in avs+ (arrrgh, perhaps because the debug build is slower, it was the 5th run until it gave error, unlike the release build which crashed 100%) It stopped at frame = ChildFilters[env2->GetProperty(AEP_THREAD_ID)]->GetFrame(n, env); with message: Exception thrown at 0x00007FFCBBB6C909 (VSFilter.dll) in AVSMeter64.exe: 0xC0000005: Access violation writing location 0x0000000000000000. occurred Last edited by pinterf; 22nd February 2018 at 21:44. |
|
22nd February 2018, 21:41 | #3949 | Link |
RipBot264 author
Join Date: May 2006
Location: Poland
Posts: 7,815
|
Script won't crash if we use SetFilterMTMode("TextSub",MT_SERIALIZED) but this still does not fix flashing (frame corruption) of the whole frame.
It is more noticeable if you put real video instead of BlankClip
__________________
Windows 7 Image Updater - SkyLake\KabyLake\CoffeLake\Ryzen Threadripper Last edited by Atak_Snajpera; 22nd February 2018 at 21:52. |
22nd February 2018, 21:55 | #3951 | Link |
RipBot264 author
Join Date: May 2006
Location: Poland
Posts: 7,815
|
Here version 306
https://github.com/Cyberbeing/xy-VSF.../tag/3.0.0.306
__________________
Windows 7 Image Updater - SkyLake\KabyLake\CoffeLake\Ryzen Threadripper |
22nd February 2018, 21:57 | #3952 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Have you tried the newer betas? 3.1.0.746
https://forum.doom9.org/showthread.php?t=168282 Last edited by pinterf; 22nd February 2018 at 22:28. Reason: typo |
22nd February 2018, 22:00 | #3953 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Quote:
#1 Marked HACK, because not tested thoroughly. #2 Masktools stuff not updated to use Expr yet, will fix. Will start a new thread on this (soon) to avoid yet more hijacking of the current thread... Last edited by raffriff42; 22nd February 2018 at 22:16. |
|
22nd February 2018, 22:16 | #3954 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
There's probably a way to cram all that into an offline thingy, be it CHM or plain HTML although I prefer the online version since it always has the latest changes.
__________________
Groucho's Avisynth Stuff |
|
22nd February 2018, 22:28 | #3955 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Huh, it comes with a 2.5x avisynth header, and compiled to x64? Not a life insurance.
EDIT: I mean xy-vsfilter. Not an easy thing to recompile. Cannot find afx.h. One of the uglyest message a machine can say. Last edited by pinterf; 22nd February 2018 at 22:30. |
22nd February 2018, 22:31 | #3956 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Raff, did you see my prev post ? (#3944)
__________________
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 ??? |
|
22nd February 2018, 22:31 | #3957 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Yes, there is a 2.5 header floating around. I think it originates from SEt's (JoshyD's?) 2.5.8 x64 version.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 22nd February 2018 at 22:35. |
22nd February 2018, 22:56 | #3958 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Wow, MFC. It uses CString (and probably some other MFC stuff)!
__________________
Groucho's Avisynth Stuff |
23rd February 2018, 01:10 | #3960 | Link | |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Quote:
The benefit of moving the docs to Sphinx is that it can be easily edited (the source files are now virtually plain-text) and once rendered, it's searchable. Basically, whatever benefit CHM docs provide, I'm confident that Sphinx is superior to it in virtually every way. You can output to HTML, PDF, ePub, latex, and several other formats (I only did testing with HTML, though, so the nice formatting of the HTML output isn't guaranteed or even there for any of the others). |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|