View Full Version : Another flexible and extensible way of multi channel audio encoding using Avisynth.
Rockaria
6th March 2006, 23:07
Of course, some players may have the spatial effects on any 2ch formats/speakers/headphones.
But the intended(surround effects on 2ch players) encoded signal would be the FFDShow's HRTF directly intended to the headphones.
The DPL (II) encoded stream also contains the intended signal, possibly for any intelligent 2ch players or receivers to reconstruct the (virtual) spatial effects(check boss's 2ch virtual speaker set, dolby headphone, dolby virtual speaker ;) ). But it is originally intended for 5.1ch DPL II decoder/speaker system through the limited 2ch carriers.
[edit] clarification : added dolby headphone & dolby virtual speaker
sjchmura
7th March 2006, 00:22
But iPOD like devices are NOT intelligent. Thus you MUST encode what you want INTO the stream with the assumption no benefit from teh hardware
Rockaria
7th March 2006, 00:48
But iPOD like devices are NOT intelligent. Thus you MUST encode what you want INTO the stream with the assumption no benefit from teh hardwareI have no iPOD! ;)
That reality only applies to people like you who has non-intelligent(precisely speaking, with no HRTF or dolby headphone DSP) portable players but wants such effects.
You must also consider the use of the contents other than the headphones.....
sjchmura
8th March 2006, 15:54
I think alot of people have iPODs. IN fact, NONE of the "play for sure devices" have the DSP or dolby built in.
Thus if 99% of the market for portable players do not have this capability I don't think a simple solution is out of hte question.
Of course at home you can just "play the DTS track" - agreed. But if you want ot cut it up and "hear it" through your MP3 player we must encode the HFRT into the stream
Rockaria
8th March 2006, 16:37
I agree in general.;)
My point was it depends on the needs.
Normally it will satisfy the headphone only use.
But what if an iPOD user wants to plug the HRTF DSP applied signal to a receiver or speaker set in a party place?
3dsnar
8th March 2006, 17:09
One issue should not be ommited.
When using HRTF, to achieve reliable results,
the filter characteristics should perfectly match
the individual's shoulders and head shape, to
simulate the sourround feeling.
Therefore some sort of averaged model (applicable for all),
which is usually used
is a sort of compromise...
In my opinion this compromise in most of the cases is not acceptable (i.e. not convincing for me at least)
3dsnar
8th March 2006, 17:10
There should be a software for tuning the filters for each individual.
I do not know is such exists...
Rockaria
8th March 2006, 18:45
That's a good point.
I will buy one like iPODs only when it supports :
. multi channel decoding
. the customization of the DSPs(including HRTF) for headphone or line/spdif out.
Until then, I will rely on my laptop(or possibly tablet) for portable use...
NorthPole
17th March 2006, 04:29
I am a bit confused ....
If we have a DTS 5.1 ripped (U2 live chicago say :) and want 2 channel with HFRT "3D" encoded INTO it so on say an iPOD it "sounds like" 5.1 can you not use FFDShow and AVIsynth to achieve this? I ant to "build in" the effect to the 2 Channel sound so ANY player gives the "effect"
I believe that in order to encode a 2 channel signal to playback and "sound like" the original 5.1 channel sound you would need to do something like the dolby encoding approach. I believe you can do that using various audio editors like cooledit or sound forge, but the process is somewhat involved.
I have thought about trying to speed up the process by using various command line tools such as sox, etc. but I have difficulty understanding how to create a 90 degree phase shift on the surround channels.
Does anybody know of a method other that an audio editor to perform such a function?
Rockaria
17th March 2006, 05:18
Does anybody know of a method other that an audio editor to perform such a function?
The issue is oiginally discussed here : http://forum.doom9.org/showthread.php?t=108090
Dark-Cracker
6th July 2006, 14:49
perhaps this thread could help you.
http://forum.doom9.org/showthread.php?t=101259
++
Rockaria
6th July 2006, 18:25
perhaps this thread could help you.
No, never! And I don't get the purpose of your post reasonably...:cool:
The DPL II encoding methos are fully examined here.
http://forum.doom9.org/showthread.php?t=112122
http://forum.doom9.org/showthread.php?t=111603
All the invert-only methods(including some of my models) are just partial incomplete implementations.
The full DPL II encoding requires the full-pass (frequencies) 90deg phase shifts in addition to the inverts.
If you are interested and cannot read all the related threads, I can include the links to explain why those approaches are misleading.
BTW, Avisynth is based on the streaming i/o. So in order to get the peak volume to use for Amplify(1.0) like other tools, it must scan the entire stream first, which is Normalize(1.0) : max gain with no clipping.
Also you will have to check if the Normalize() performs seperately(by each peak volume) on each channel. If it does, use the amplify(x) on all channels with the replaygain value x from other tool such as foobar2k.
NorthPole
22nd September 2006, 16:07
.
The full DPL II encoding requires the full-pass (frequencies) 90deg phase shifts in addition to the inverts.
I've read the above referenced posts. If I understand this correctly, you are using ffdshow to decode 5.1. I've never used ffdshow, can you use it to upmix to 5.1 from stereo?
I still have not found a avisynth filter capable of the 90 deg phase shift to use in a avisynth/bepipe script.
Rockaria
23rd September 2006, 02:09
Unfortunately, me neither yet..:rolleyes:
There are some VST(PhaseBug,) & winamp(Stereo Tool,) plugins which perform the 90 deg phase shift on cetrtain channel(s) that can possibly be used through avs::grf:: (DC-DSP or ffdshow::winamp) on rear channels to be aligned-mixed to the fronts before the DPL II mix.
But aligning the delay of the shifted channels would still be the problems unless we have more accurate contol on the phase shift algorithms.
I have found Csound has a c++ hilbert() and FMOD has a built-in DPL(II) mix function that can be reasonably integrated into a avisynth plugin. But unfortunately it's a long future plan for me(if I have to) because I am not into the development any longer(my fingers have lost the touches).
It just is strange why the relatively simple plugin is not integrated into avisynth yet. Maybe partially because it can only enhance the seperation quality to 10~30% over the invert-only model and can never be better than the current discrete multichannel encoding(DD, DTS, AAC...).
However, it's an intended(from multi channel sources) multichannel encoding differentiating itself from the artificial multi channel effects(any kind of upmix from 2ch sources) and still be applied to the higher channels as dpl IIx.
The ffdshow DSPs(including the upmix, downmix, hrtf, resample...but no decoding) can be used within the avs with ffavisynth.dll. But as the avisynth development has got complicated(with different branches), there seems to be some problems in the dynamic linking(probably because of different versions of interfaces used in the ffavisynth.dll. I remember avisynth v2.55 worked fine with some old versions of ffavisynth.dll) and cannot be used correctly as described in the avisynth manual.
Currently, the only way to use the ffdshow as a decoder & dsp container together is to use in a graphedit file(*.grf) included in a avs script with directshowsource("a.grf"). To reuse the GRF, copying the sources and renaming to the predefined ones will be the simplest way.
But I believe the avisynth having the very open architecture thus lots of types of plugins attachable, it's a matter of time than the technology.
Meanwhile, you can evaluate the true DPLII with lots of existing professional vst(or with phase shifts DSPs) enabled wav editors if it really satisfies the tastes as is tested in the mentioned link.
NorthPole
23rd September 2006, 14:34
@Rockaria
Thanks for the info, I'll post if I run across anything. Untill then, I think I may try the foobar approach with the ATsurround dsp plugin and the aften encoder.
Rockaria
23rd September 2006, 20:36
Yes, as I mentioned in the related thread(http://forum.doom9.org/showpost.php?p=867873&postcount=6),
the foobar2k+ATSurround+any-encoder solution seems to be the most economic DPL II encoding solution ATM.
They say in their forum, it does the 90deg phase shift. But when I inspected the image, it shows a bit altered but very close to the original.
So I suspect it might be doing the selective-freq(10k?) phase shift, at least producing the un-biased playback in general.
NorthPole
23rd September 2006, 22:35
the foobar2k+ATSurround+any-encoder solution seems to be the most economic DPL II encoding solution ATM.
Just curious about what the channel mixer is doing for your mix? (Note about LFE volume control?)
And I think you are use the hard limiter or the winamp dsp to do DRC?
I'm just using the ATsurround plugin on RG'd files.
Sorry, this is a bit off topic.
Rockaria
23rd September 2006, 23:27
No problem, it's related and also mentioned in this thread before.
The ATSurround with no ch-gaining control gave me too much LFE. I used the channel mixer to control the ch-gains from the 6ch source before feeding to the ATSurrounf DPL II encoding.
The DRC is compressing the bit depth, usually volume range reduced centered around the typical average sound patterns. The more application, the more distortion will be created.
The hard limiter is dealing with the upper area of the wave form to soften the clippings(over 0dB), simpler and better fidelity than just allowing the clippings or any DRC or DN(Dynamic Normalization) solutions. The RG application in decoding may cause the clippings and I believe any RG-enabled players are designed to prevent these clippings when decoding.(check the new foobar RG application options)
The same resoning goes to the AC3 coding. Even if we can encode the AC3 with proper dialnorm and DRC by freq-levels encoding without clippings, the decoder might encounter the situation to hard-limit the over-peak decoded(freq-summed) area(by the dialnorm application) especially if the user chose not to use the DRC(for more fidelity because of the quiet listening environment). In this case(with or without considering the DRC), the pre-attenuation or hardlimiting is considered necessary for the safer transcoding(to me).
[edit] some additions to ac3 dialnorm
The decoder will eventually make the dialnorm value to -31dB. So when given -1dB it will attenuate -30dB when decoding. And when given -31dB, it won't adjust the volume level. So theoretically, the decoded wave form should not exceed the original volume level(conservative than RG).
But practically it is known that the decoded wave form can exceed the 0dB by psychoacoustic processing and in case of originally clipped source, it is also observed the decoder is rebuilding the clipped area depending on the decoder logic.
So if we suppose those effects are less than 3dB, the dialnorm range -1dB ~ -28dB will be safe if there are no other decoder specific constraints.
However, in my case of DDLive, the -31dB of dialnorm delivers tranparent(equal) steady volume level regardless of clippings onto my two receivers.
[edit2]some remarks on AC3 DialNorm & DRC for transcoding
My problem is my output often has low volume and I was wondering why this is.
..
Im using ProCoder 2.0 which has built in filters for audio.
The filter Normalize has two options:
1. Normalize to mean RMS of sources
2. Normalize peak to specified DB level
..
use Dynamic Range Compression then(and after) normalize.
..
I don't like wide dynamic ranges (and the neighbourhood too :D )
The first often-low-volume is covered by Dolby's normalize-to-mean-rms(aka. dialnorm) which is designed to have the average preceived dialog levels(between the sources).
Secondly, the DRC in Dolby is applied in two steps :
. encoding time : average the dynamics with certain predefined patterns scanning inside : looks a bit closer to the mastering concept
. decoding(play/transcoding) time : the decoder mostly has the scanned DRC application level(0~1, the more the less fidelity) to personalize the listening environment(listener + neighborhood + devices), losing this flexibility(personalized) by transcoding.
So 'preferred DRC decoding level + normalize(-3dB) | RG(scan)+limiter' is expected for normal ac3 transcoding steps.
In case, 'RG(scan)+limiter' can be used for further average-boosting the perceived sound levels without touching the volume knob when switching between the sources.
A remind : Dolby's DialNorm mean RMS sound level is expected to be altered by the 'normalize(-3dB)' here.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.