Quote:
Originally Posted by CoRoNe
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