View Single Post
Old 17th February 2012, 20:15   #1008  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by CoRoNe View Post
Then the first one is probably called "upmix matrix"?
Both are "downmix matrix" -> the output have less channels than input.

The first one is a "not-normalized" matrix and the second one is a "normalized" matrix (the output can't have values greater than 1.0)

If you use float values, and after normalize, you can use both.
But the function must work also with integer values, then you need use the "normalized matrix" to avoid clip.

Quote:
And if so, how did you even come up with (AudioRate()*1001+480)/960)?!
The SSRC function only support integer values, then the operations are truncatted to int values.

Like: 25/ (24000/1001) = 1001 * (25/24000)= 1001 * (1/960) = 1001/960

Is more exact let the division to last operation, (instead multiply the error by 25):

(AudioRate()*1001)/960

And the '+ 480' factor (480/960 = 0.5) is to round to the next integer
int(45983.4 +0.5) -> 45983
int(45983.6 +0.5) -> 45984

For instance:

(44100*1001/24000)*25 = (1839) * 25 = 45975
far of 45983.4375

(44100*1001+480)/960 = 45983
near to 45983.4375
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 18th February 2012 at 10:10.
tebasuna51 is offline   Reply With Quote