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 23rd June 2020, 03:31   #1  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Request for SoxFilter 64 bits

Please, someone can make the 64 bits version of this plugin?

32 bits and sources here https://forum.doom9.org/showthread.p...154#post761154

The author sh0dan is retired in 2016.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 23rd June 2020, 05:30   #2  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
I managed to get some binary, but it crashes the moment I load AVS. Need some debug time I guess.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 23rd June 2020, 05:41   #3  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
https://down.7086.in/soxfilter_64_r0.zip Try this.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 23rd June 2020, 11:07   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Tanks! Seems work fine.

SoxFilter have many options and I can test all. Also sh0dan say than there are some issues and we never know.

I test a simple filter than crash Avs+ 32 r2772 and work fine, also work the 32 bits, I'm using Avs+ r3106 (32 and 64)

Also work a compand function than I need to replace the Audiolimiter plugin (without sources) to make downmix 7.1 -> 5.1 in MeGUI 64.

BTW seems than the 32 bits version is fast, but no problem for me. Thanks.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 23rd June 2020, 12:31   #5  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
If you wonder why 32bit is fast, it's because it uses inline asm that I have removed when test compiling 64bit. Please add ConvertAudioTo32bit() before calling soxfilter and see if speed improves.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 23rd June 2020, 12:39   #6  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Nevermind. AVS+ doesn't have 64bit SIMD as well, so it'll be as fast (slow) as the internal conversion.

Maybe someone would one day improve that piece of code.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 23rd June 2020, 12:50   #7  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
You are right, now is fast than 32 bits version even when the conversion to 32 int and return to 32 float.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 25th June 2020, 23:08   #8  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
does the r0 has update the Sox library https://forum.doom9.org/showthread.p...29#post1733929 ?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 25th June 2020, 23:27   #9  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Not yet. To make sure it compiles, I used the very same binary to eliminate potential problems. I might clean it up and recompile a r1.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 1st July 2020, 14:21   #10  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
@MeteorRain
About this plugin and your improvements in audio formats conversion, maybe you want read the VapourSynth Audio thread and how AviSynth must work with audio data.

Lossy functions (Amplify..., Resamples..., Filters...) must work always in float format, and the conversion must be automatic, it doesn't make sense work in 16 bit int with the risk of overflow and clip and 0 advantages.

Comments like was make in old Avs+ thread and behaviour like:
Quote:
TimeStretch()

Source clip. Audio is always converted to Float.
AVS+ no conversion is performed. Accepts Float audio only.
and
Quote:
SSRC()

Source clip. Audio is always converted to Float.
AVS+ no conversion is performed. Accepts Float audio only.
show how Avs+ developers don't understand audio management.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 1st July 2020, 20:13   #11  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Any reason why the conversion must be automatic?
I always believe the user should have the ultimate power to do whatever they want instead of being told what to do, and should always be aware of what's being done.
If user sincerely wants to run lossy functions on 16 bit, I would rather do it then converting it to float without telling the user.

But anyway that's just my personal opinion.

For now I think a bigger concern is that no one is working on improving the audio part. Current code base still have lots of MMX code that I'd love to delete asap. And I'd hope someone would take time to rewrite it to proper intrinsics. (I've done a bit but I don't have time yet to verify the result and debug that.)
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 1st July 2020, 21:40   #12  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
The lossy operations involve audio data and float coeficients, if we operate between integers and float values we obtain float values.
If you do a automatic restore to the int audio format can obtain overflow and clip. Here you do a automatic, and dangerous now, conversion.
Convert to float is 100% safe, operate between floats is safe.

If the user want a final int output must Normalize (or check maxvalue, I don't know how in AviSynth) to avoid clip converting float values > 1.0 to int.

Sorry, I can't help you converting MMX to proper intrinsics.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 1st July 2020, 22:58   #13  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
I see, that would make sense. Yea in AVS we have normalization filter to avoid clipping.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 1st July 2020, 23:57   #14  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Lossy functions (Amplify..., Resamples..., Filters...) must work always in float format, and the conversion must be automatic, it doesn't make sense work in 16 bit int with the risk of overflow and clip and 0 advantages.
If there is overflow or clip in the resulting audio file, it implies that the audio filter contains a bug. That's no different than with video. I would be surprised if there is an automatic 'restore' to int in one of these audio filters you listed.
Wilbert is offline   Reply With Quote
Old 2nd July 2020, 01:33   #15  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by Wilbert View Post
If there is overflow or clip in the resulting audio file, it implies that the audio filter contains a bug.
Nope, the filter obey the user.

If you put Amplify(2.0) over a int you can obtain overflow (clip) for all volumes over 50%, over float values you can obtain values until 2.0 and after can be Normalized without lose info.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 3rd July 2020, 16:59   #16  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Do you know if there's any updated version of this available somewhere? I noticed huge structure change in later version of sox, and I'm getting lost on what / how to properly process audio data.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 3rd July 2020, 19:48   #17  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Does not exist other version.

I will see the later sox version, but I doubt I can help you.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 3rd July 2020, 22:08   #18  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
I'd give up if I can't figure out how to rewrite the code against the later version. It'll then stay with sox 12.17.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 6th July 2020, 22:21   #19  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Originally Posted by tebasuna51 View Post
Nope, the filter obey the user.

If you put Amplify(2.0) over a int you can obtain overflow (clip) for all volumes over 50%, over float values you can obtain values until 2.0 and after can be Normalized without lose info.
Ok good point. I agree with this.
Wilbert is offline   Reply With Quote
Old 7th July 2020, 00:07   #20  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by MeteorRain View Post
I noticed huge structure change in later version of sox, and I'm getting lost on what / how to properly process audio data.
Quote:
Originally Posted by MeteorRain View Post
I'd give up if I can't figure out how to rewrite the code against the later version. It'll then stay with sox 12.17.
No problem for me, of course there are improvements in last version 14.4.2 but nothing important for AviSynth plugin.

Still work internally with int32 samples with the same clip problem than in 12.17.9, for instance:
Code:
//Native SoX audio sample type (alias for sox_int32_t).
typedef sox_int32_t sox_sample_t;

//Max value for sox_sample_t = 0x7FFFFFFF.
#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)

//Min value for sox_sample_t = 0x80000000.
#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)

#define SOX_SAMPLE_CLIP_COUNT(samp, clips) \
  do { \
    if (samp > SOX_SAMPLE_MAX) \
      { samp = SOX_SAMPLE_MAX; clips++; } \
    else if (samp < SOX_SAMPLE_MIN) \
      { samp = SOX_SAMPLE_MIN; clips++; } \
  } while (0)
...
   sample = gain * *ibuf++;
   SOX_SAMPLE_CLIP_COUNT(sample, effp->clips);
   *obuf++ = sample;
The samples are clipped without the posibility of recover the float value.

I checked some filters and I obtain bit-identical values with Soxfilter.dll (32 or 64 based in sox 12.17.9) and with sox.exe v14.4.2

We can supply the 32int audio format and soxfilter don't need use the old ASM in Convertaudio.cpp.

I see also some limits in soxfilter:
Quote:
sprintf(err, "SoxFilter: (%s) Cannot run filters that change the number of channels.", arg_str);

sprintf(err, "SoxFilter: (%s) Cannot run filters that changes the samplerate.", arg_str);
Seems only modify values but not create a new audio with different properties.

There are also:
Quote:
AVSValue __cdecl Create_SoxFilter(AVSValue args, void* user_data, IScriptEnvironment* env)
{
PClip clip = new SoxFilter(args[0].AsClip(), args, env);
AVSValue Ia[1] = { clip };
return env->Invoke("EnsureVBRMp3Sync", AVSValue(Ia, 1));
}
Seems call a internal Avisynth function, I supose this can't work with VapourShynt.

To finish, for me is enough like is now, don't waste time if don't like it.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 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 05:07.


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