summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2016-08-27 07:03:02 -0700
committerMark Harris <mark.hsj@gmail.com>2016-08-27 07:03:02 -0700
commit3421f6d2baebd064ed42d7ee5814b511be11c105 (patch)
tree66aa24ea96b0cceaab09bf92ef46b968a9fe6b93
parent9f3883a955d8d7a7110aa1b5973b041f5374b76a (diff)
downloadopus-3421f6d2baebd064ed42d7ee5814b511be11c105.tar.gz
Correct analysis downmix scaling factor
Divide by the actual number of channels mixed
-rw-r--r--src/opus_encoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index d1784e74..f484b0a4 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -811,9 +811,9 @@ void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, in
#else
scale = 1.f;
#endif
- if (C==-2)
+ if (c2==-2)
scale /= C;
- else
+ else if (c2>-1)
scale /= 2;
for (j=0;j<subframe;j++)
sub[j] *= scale;
@@ -846,9 +846,9 @@ void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int
#else
scale = 1.f/32768;
#endif
- if (C==-2)
+ if (c2==-2)
scale /= C;
- else
+ else if (c2>-1)
scale /= 2;
for (j=0;j<subframe;j++)
sub[j] *= scale;