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. |
![]() |
#2561 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,246
|
Avisynth+ 3.7.3 test 11 (20230608 - r3996)
Change log (including test9 changes) Code:
20230608 3.7.3 WIP ------------------ **test11** - Add "bold"=true (linux/NO_WIN_GDI: false), "italic"=false, "noaa"=false parameters to "ShowFrameNumber", "ShowCRC32", "ShowSMPTE", "ShowTime" filters. As noted below, "italic" and "noaa" parameters are ineffective in NO_WIN_GDI builds (e.g. Linux) - Add "noaa" parameter to SubTitle and Info. Setting it true will disable antialiasing. Useful when someone would use "VCR OSD Mono" as-is, without beautifying the outlines, as it as mentioned in https://forum.doom9.org/showthread.php?t=184627 - Address #358, plus "noaa" - add "bold", "italic" and "noaa" boolean parameters to "SubTitle" and "Info" - add "italic" and "noaa" boolean parameter to "Text" ("bold" already existed) "italic" and "noaa" is provided only to match the parameter list with SubTitle. SubTitle: to mimic former working method, defaults are "bold"=true, "italic"=false, "noaa"=false Text: "bold"=false (as before); "italic" is not handled at all, either true or false, it does not affect output. "italic" and "noaa" parameters exist only because on non-Windows systems "Subtitle" is aliased to "Text" (Each Subtitle parameter must exist in "Text" as well) - Fix #360: plane fill wrongly assumed that pitch is rowsize, which is not the case after a Crop It would result in crash e.g. in HistogramRGBParade, when an aligned Crop was immediately followed by a GreyScale(). - Enhancement: much quicker YV24 to RGB32/RGB24 conversion when AVX2 instruction set is supported. (+50% fps at i7-11700) - UserDefined2Resize got an 's' parameter (to the existing b and c): support, default value = 2.3 (following DTL2020's addition in jpsdr's MT resizer repo, UserDefined2ResizeMT filter) Now, as we have already three variable parameters to the optional chroma resamplers in ConvertToXX converters, ConvertToXX family got a new float 'param3' parameter which is passed to UV resizer as 's', if "userdefined2" is specified as chroma resampler. If param3 is not used in a resizer but is defined, then it is simply ignored. Such as "ConvertToYV24" parameter signature: c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s[param1]f[param2]f[param3]f e.g.: ConvertToYV24(chromaresample="userdefined2", param1=126, param2=22, param3=2.25) see also description at **test6**, which was updated with this parameter as well. s (support) param - controls the 'support' of filter to use by resampler engine. Float value in valid range from 1.5 to 15. Default 2.3. It allows to fine tune resampling result between partially non-linear but more sharper and less residual ringing (at low b and c values) and more linear processing with wider 'peaking' used. Setting too high in common use cases (about > 5) may visibly degrade resampler performance (fps) without any visible output changes. Recommended adjustment range - between 2 and 3. Examples: b=126 c=22 - medium soft, almost no ringing. b=102 c=2 - sharper, small local peaking. b=70 c=-30 s=2 - sharper, thinner 'peaking'. b=70 c=-30 s=2.5 - a bit softer, more thick 'peaking'. b=82 c=20 - sharp but lots of far ringing. Not for using. - Fix #350 ConvertXXX to accept YV411 clip's frame property _ChromaLocation set to 'left' (and 'topleft' and 'bottomleft' which give the same result) instead of giving an error message. - Fix #348 bitrol/bitror functions return incorrect results when first argument is negative. Regression since the asm code of Avisynth 2.6 classic was ported to C in Avisynth+ project. - "Info": if channel mask exists, then - its friendly name - otherwise the number of channels and the channel combinations is displayed under "AudioLength: x". e.g. SetChannelMask("stereo") --> "Channel mask: stereo" SetChannelMask("stereo+LFE") --> "Channel mask: 2.1" because the combination resulted in another known channel combo name SetChannelMask("mono+LFE") --> "Channel mask: 2 channels (FC+LFE)" because the combination is unknown - Add SetChannel parameter: channel string syntax: (similar to ffmpeg) a channel number followed by "c" for getting the default layout for a given number of channels. E.g. SetChannelMask("3c") will set "2.1" because this is the default choice for 3 channels - Add SetChannel parameter: channel string syntax: a simple number is treated as the actual numeric mask. E.g. SetChannelMask("3") will set "stereo" because 3=1+2 that is "FL+FR" that is "stereo" - SetChannelMask string version: If string is other than "" then its set to known. It has a single string parameter. SetChannelMask("mono") -> mask is known: "mono" SetChannelMask("") -> mask is unknown - Add "speaker_all" to accepted layout mask strings - Fix possible crash of LLVM builds (clang-cl, Intel nextgen) on pre-AVX (SSE4-only) CPUs. (Prevent static initialization from avx2 source modules, which cause running AVX instructions on DLL load) - ConvertToMono, GetLeftChannel, GetRightChannel: sets channel layout AVS_SPEAKER_FRONT_CENTER (mono) - GetChannel, GetChannels, MergeChannels will set default channel layout if channel count is 1 to 8 For defaults see VfW section below - New Script function: SetChannelMask: string version. SetChannelMask(clip, string ChannelDescriptor) (parameters compulsory, no names must be set) (test10) Accepts predefined channel string or channel layout names or their combination, in ffmpeg style. Numerical indexes or channel counts are not allowed. String is case sensitive! E.g. "stereo+LFE+TC" or "FL+LR" or "5.1(side)" "mono", "stereo", "2.1", "3.0", "3.0(back)", "4.0", "quad", "quad(side)", "3.1", "5.0", "5.0(side)", "4.1", "5.1", "5.1(side)", "6.0", "6.0(front)", "hexagonal", "6.1", "6.1(back)", "6.1(front)", "7.0", "7.0(front)", "7.1", "7.1(wide)", "7.1(wide-side)", "7.1(top)", "octagonal", "cube" "speaker_all" Individual Speaker Channels: "FL", front left "FR", front right "FC", front center "LFE", low frequency "BL", back left "BR", back right "FLC", front left-of-center "FRC", front right-of-center "BC", back center "SL", side left "SR", side right "TC", top center "TFL", top front left "TFC", top front center "TFR", top front right "TBL", top back left "TBC", top back center "TBR", top back right - AudioDub will inherit channel layout setting from the audio clip. - VfW output channel guess (when ChannelMask is not specified) changed at some points. Default number of channels to channel layout guess was modified to match of ffmpeg 3 channels: Surround to 2.1 4 channels: Quad to 4.0 6 channels: 6.1(back) to 6.1 This follows ffmpeg defaults Present rules: const chnls name layout 0x00004 1 mono -- -- FC 0x00003 2 stereo FL FR 0x0000B 3 2.1 FL FR LFE 0x00107 4 4.0 FL FR FC -- -- -- -- -- BC 0x00037 5 5.0 FL FR FC -- BL BR 0x0003F 6 5.1 FL FR FC LFE BL BR 0x0070F 7 6.1 FL FR FC LFE -- -- -- -- BC SL SR 0x0063F 8 7.1 FL FR FC LFE BL BR -- -- -- SL SR **test9** - Add initial audio channel mask (channel layout) support (CPP and C interface, script function) It still belongs to V10 changes (there were only tests since then), but it can be discussed if not. Technically it is done by using another 18+2 bits in the Clip's VideoInfo.image_type field. Due to lack of enough bits in this VideoInfo field, the mapping between the original dwChannelMask and Avisynth's internal values are not 1:1, but all information is kept however. This is because not 32 but only 18 (strictly: 18+1) bits are defining speaker locations, so the remaining bits of our existing 'image_type' field can be used for this purpose. Thus 20 new bits are occupied. - 1 bit: marks if channel mask is valid or not - 18 bits for the actually defined WAVE_FORMAT_EXTENSIBLE dwChannelMask definitions (https://learn.microsoft.com/en-us/wi...rmatextensible) - 1 bit for the special SPEAKER_ALL value Programmers can check AvsChannelMask and AvsImageTypeFlags in avisynth.h and avisynth_c.h - new C++ interface functions - Check for existence: bool VideoInfo::IsChannelMaskKnown() - Setting: void VideoInfo::SetChannelMask(bool isChannelMaskKnown, unsigned int dwChannelMask) Re-maps and stores channel mask into image_type, sets the 'has channel mask' flag as well Note: this data can be set independently from the actual NumChannels number! - Retrieving: unsigned int VideoInfo::GetChannelMask() - new C interface functions bool avs_is_channel_mask_known(const AVS_VideoInfo * p); void avs_set_channel_mask(const AVS_VideoInfo * p, bool isChannelMaskKnown, unsigned int dwChannelMask); unsigned int avs_get_channel_mask(const AVS_VideoInfo * p); Like when establishing BFF, TFF and fieldbased flags from 'image_type', technically 'image_type' can be manipulated directly. See SetChannelMask and GetChannelMask in Avisynth source for image_type <-> dwChannelMask conversion. I guess once ffmpeg will support it, it will read (or not read) channel masks such a way. - new Script functions bool IsChannelMaskKnown(clip) int GetChannelMask(clip) SetChannelMask(clip, bool known, int dwChannelMask) (parameters are compulsory, dont't use parameter name) SetChannelMask(clip, string ChannelDescriptor) (test10) dwChannelMask must contain the combination of up to 18 positions or 0x80000000 for SPEAKER_ALL. VfW export rules (included the existing sequence) 1.) OPT_UseWaveExtensible global variable must be 'true' or *new*new*new* if VideoInfo::IsChannelMaskKnown is true, then fill WAVEFORMATEXTENSIBLE struct 2.) *new*new*new* Is channel mask defined in Avisynth's VideoInfo? (VideoInfo::IsChannelMaskKnown() is true) Yes -> return VideoInfo::GetChannelMask() 3.) No-> (Channel mask not defined in VideoInfo, guess it or set from variable) 3.1)Guess channel layout: For 0 to 8 channels there is a predefined 'guess map': #of channels dwChannelMask 0 0, 1 0x00004, // 1 -- -- Cf 2 0x00003, // 2 Lf Rf 3 0x00007, // 3 Lf Rf Cf 4 0x00033, // 4 Lf Rf -- -- Lr Rr 5 0x00037, // 5 Lf Rf Cf -- Lr Rr 6 0x0003F, // 5.1 Lf Rf Cf Sw Lr Rr 7 0x0013F, // 6.1 Lf Rf Cf Sw Lr Rr -- -- Cr 8 0x0063F, // 7.1 Lf Rf Cf Sw Lr Rr -- -- -- Ls Rs For 9-18 channels: sets first 9-18 bits in dwChannelMask Above: SPEAKER_ALL (dword msb bit is 1) 3.2) if OPT_dwChannelMask global variable is defined and is different from 0, then use it. E.g. VirtualDub2 is using VfW, so after opening the script, ended with SetChannelMask(true, $0063F), one can check the value File|File Info menu, under "compression" line (e.g.PCM, chmask 63f). SetChannels does not check against NumChannels, so you can set the 7.1 constant for a stereo if you wish. Microsoft's documentation mentions the cases of what an application can do with less or more than necessary defined speaker bits. - What to do about GetChannels, MixAudio, ConvertToMono? To be discussed. KillAudio will call SetChannelMask(false, 0), nevertheless. |
![]() |
![]() |
![]() |
#2563 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,806
|
Lotsa changes there, yeah dude, thanx P.
![]()
__________________
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 June 2023 at 04:05. |
![]() |
![]() |
![]() |
#2564 | Link | |
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 6,729
|
Thanks pinterf for your effort to manage audio in avs+.
I make some test with 4 ac3 samples: 4a301.ac3 MaskChannels : 15 (FL FR FC LF) 4s211.ac3 MaskChannels : 267 (FL FR LF BC) 4s220.ac3 MaskChannels : 1539 (FL FR SL SR) 4w310.ac3 MaskChannels : 263 (FL FR FC BC) (default for 4 channels) And a .avs like: Quote:
1) The decoders don't fill the MaskChannels and "Info" do not show it. Using the appropiate SetChannelMask the "Info" show it correctly. BestAudioSource say than a global variable BASCHANNEL_LAYOUT is created with the MaskChannels, how can use it to SetChannelMask? The same with FFAudioSource and FFCHANNEL_LAYOUT 2) With the SetChannelMask set manually I output correct WaveFormatExtensible files with VirtualDub2 but the ChannelMask is ignored with MeGUI, mpc-hc or ffmpeg: ffmpeg -i 4a301.avs 4a301.wav the output is always the default 263 (FL FR FC BC) for my 4 samples. EDIT: BeHappy crash with the SetChannelMask("15") active. Of course old soft like wavi/avspipemod ignore also the internal ChannelMask and put the header and the channelmask with the command line parameters. New versions needed.
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 11th June 2023 at 08:14. |
|
![]() |
![]() |
![]() |
#2565 | Link |
Registered User
Join Date: Jul 2018
Posts: 979
|
Found some temporal solution how to fix precision of PC.709 matrix when converting to narrow-RGB:
ColorBarsHD(640, 480, pixel_type="YV24") ColorYUV(cont_u=-6, cont_v=-6) ConvertToRGB32(matrix="PC.709") Now RGBs are Y 181,180,15 C 15,180,180 G 16,180,16 M 180,16,180 R 181,16,16 B 15,16,181 It looks internal coefficients for PC.709 matrix need adjustments. Same correction of UV gain (contrast from mid value) looks also required for PC.2020 matrix. Addition: Also looks like found the source of a bug - the Digital Y to Digital UV 219/224 additional multiplier (equal for all 3 IUT-R 601/709/2020) was missed at calculation of PC.x matrices. Hope it will be fixed in next build. Last edited by DTL; 12th June 2023 at 09:42. |
![]() |
![]() |
![]() |
#2566 | Link | |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,388
|
Quote:
https://www.mediafire.com/file/cdvae..._win64.7z/file |
|
![]() |
![]() |
![]() |
#2567 | Link |
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 6,729
|
Seems work fine, thanks qyot27.
EDIT: I found a problem, I think in avs+: The max maskchannel than run ok is 13839 (FL FR FC LFE SL SR TFL TFC) With 20543 (FL FR FC LFE BL BR TFL TFR) 7.1(top) the ChannelMask is truncated to 4159 (FL FR FC LF BL BR TFL ERROR: don't match with NumChan) ffmpeg show errors like: [pcm_f32le @ 000001f8a19d2010] Invalid PCM packet, data has size 20 but at least a size of 28 was expected VirtualDub2 output also a invalid wav
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 12th June 2023 at 09:35. |
![]() |
![]() |
![]() |
#2568 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,246
|
Oh, I didn't expect other softwares to use speaker bits so quickly. Finally a good feedback. Anyway, channel count and bit setting must match, this is the user's responsibility, maybe it must be checked more strictly by avisynth (aside from that there can be bugs on my side as well)
|
![]() |
![]() |
![]() |
#2569 | Link | ||
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,388
|
Quote:
https://github.com/qyot27/FFmpeg/com...47857f033c64fe Functionally, I was concerned about the note in readme_history: Quote:
The only real issue is that - because we have to have to protect it behind the get_version check, the version of the headers FFmpeg checks for needs to be raised when this goes upstream. And because the interface version bump was in the middle of the current dev cycle, getting the patch upstreamed will have to wait until after the official release of 3.7.3. |
||
![]() |
![]() |
![]() |
#2570 | Link |
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 6,729
|
Just to test this is a channel test encoded with Audition 2017 like 3/4(L R C LFE Ls Rs Vhl Vhr)
With SetChannelMask("22031") FL FR FC LFE SL SR TFL TFR 7.1(top-side) the oficial ffmpeg decode it correctly but like1599 (FL FR FC LF BL BR SL SR) 7.1 Virtualdub2 show that info: EDIT: 18 bits is enough for WAVE_FORMAT_EXTENSIBLE dwChannelMask definitions, but seems cut at 14 bits 16384
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 12th June 2023 at 20:31. |
![]() |
![]() |
![]() |
#2571 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,246
|
Quote:
(No test build from me yet, other things are under construction.) |
|
![]() |
![]() |
![]() |
#2573 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,246
|
Quote:
I don't know since when, but ffmpeg features a more sophisticated channel layout, which may superseed the 18 (+ "all channels") bits supported by WAVE_FORMAT_EXTENSIBLE. I was not able to stuff these extra exotic layout options into the available Avisynth VideoInfo bits. |
|
![]() |
![]() |
![]() |
#2574 | Link |
Registered User
Join Date: Jan 2018
Posts: 1,891
|
Avs+ asd-g's build r3996
https://gitlab.com/uvz/AviSynthPlus-Builds |
![]() |
![]() |
![]() |
#2575 | Link |
Registered User
Join Date: Jan 2018
Posts: 1,891
|
AviSynthPlus r4001
https://gitlab.com/uvz/AviSynthPlus-Builds |
![]() |
![]() |
![]() |
#2578 | Link |
Formally known as .......
Join Date: Sep 2021
Location: On a need to know basis.
Posts: 806
|
__________________
This can be Very "TeDiouS".. Long term RipBot264 user. Ryzen 9 7950X Intel i9-13900KF Ryzen 9 5950X Ryzen 9 5900X Ryzen 9 3950X Link to RB v1.27.0 |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|