View Single Post
Old 17th February 2012, 18:11   #1007  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 693
Code:
AudioDub(Blankclip(),NicDtsSource("test.dts"))
b = (IsAudioFloat==true) ? String(" float") : String(" int")
Subtitle(String(AudioBits) + "bit" + b)
- "32bit float" indeed. Didn't know that.

- I've read about it, yes. Though I believe everyone does it anyway, right?

- BeSweet doesn't have PhaseShift settings either I believe. It's only the Downmix AC3/DTS to DPL2 plugin for Foobar, so I guess it's not that important.

- I'll certainly give it a try.
Btw, I just came to realize; you mentioned "downmix matrix"...

Lt = 1.0*L + 0.7071*C + 0.7071*LFE - 0.8165*Ls - 0.5774*Rs
Rt = 1.0*R + 0.7071*C + 0.7071*LFE + 0.5774*Ls + 0.8165*Rs


Lt = 0.2626*L + 0.1857*C + 0.1857*LFE - 0.2144*Ls - 0.1516*Rs
Rt = 0.2626*R + 0.1857*C + 0.1857*LFE + 0.1516*Ls + 0.2144*Rs


Then the first one is probably called "upmix matrix"?

======================================================

Something different (again)...
Yesterday I noticed that for PAL,NTSC conversions BeHappy uses (AudioRate()*1001+480)/960) instead of the imo more obvious (AudioRate()*1001/24000)*25), so I (again) did some testing:
Code:
#NicDtsSource("test.dts") #48000Hz 6ch 1536kbps, 32bit float | NTSC->PAL, 2:00.075s->1:55.157s

#AssumeSampleRate(last, (AudioRate()*1001/24000)*25).SSRC(AudioRate(last))	#48000->50050.0000 | 50050 (1:55.157s)
#AssumeSampleRate(last, (AudioRate()*1001+480)/960).SSRC(AudioRate(last))	#48000->50050.5000 | 50050 (1:55.157s)


#NicAc3Source("test.ac3") #48000Hz 6ch 448kbps, 32bit float | PAL->NTSC, 2:00.000s->2:05.125s

#SSRC(last, (AudioRate()*1001/24000)*25).AssumeSampleRate(AudioRate(last))	#48000->50050.0000 | 50050 (2:05.125s)
#SSRC(last, (AudioRate()*1001+480)/960).AssumeSampleRate(AudioRate(last))	#48000->50050.5000 | 50050 (2:05.125s)


#WavSource("test_dts.wav") #44100Hz 2ch 1411kbps, 16bit int | NTSC->PAL, 2:00.075s->1:55.157s

#AssumeSampleRate(last, (AudioRate()*1001/24000)*25).SSRC(AudioRate(last))	#44100->45983.4375 | 45975 (1:55.178s)
#AssumeSampleRate(last, (AudioRate()*1001+480)/960).SSRC(AudioRate(last))	#44100->45983.9375 | 45983 (1:55.158s)


WavSource("test_ac3.wav") #44100Hz 2ch 1411kbps, 16bit int | PAL->NTSC, 2:00.000s->2:05.125s ¹
ConvertAudioToFloat()
#SSRC(last, (AudioRate()*1001/24000)*25).AssumeSampleRate(AudioRate(last))	#44100->45983.4375 ² | 45975 (2:05.102s) ³
SSRC(last, (AudioRate()*1001+480)/960).AssumeSampleRate(AudioRate(last))	#44100->45983.9375 | 45983 (2:05.124s)
¹ <original length> -> <length it should be after conversion>
² <original frequency> -> <frequency it should be after conversion, without SSRC()>
³ <reported frequency> <reported length> (by Foobar and foo_input_avs)

Both formulas produce the same result for DTS and AC3, but for 44.1kHz 2ch 1411kbps WAV it's a whole different story!
Both aren't millisecond accurate, not even (AudioRate()*1001+480)/960), but I really don't understand the reported 45975Hz in the first place! At first I thought the 16bit int could be the reason, but inserting a ConvertAudioToFloat() didn't make a difference.
Is this some Avisynth shortcoming? And if so, how did you even come up with (AudioRate()*1001+480)/960)?!
__________________
My hobby website
Reino is offline   Reply With Quote