Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
e995c31f
Commit
e995c31f
authored
Feb 26, 2008
by
Jean-Marc Valin
Browse files
Put the channel count outside of the energy calculation. Increased the allowed
range for the mono encoder.
parent
2fa8affd
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/bands.c
View file @
e995c31f
...
...
@@ -84,7 +84,7 @@ void compute_band_energies(const CELTMode *m, celt_sig_t *X, float *bank)
float
sum
=
1e-10
;
for
(
j
=
B
*
eBands
[
i
];
j
<
B
*
eBands
[
i
+
1
];
j
++
)
sum
+=
SIG_SCALING_1
*
SIG_SCALING_1
*
X
[
j
*
C
+
c
]
*
X
[
j
*
C
+
c
];
bank
[
i
*
C
+
c
]
=
sqrt
(
C
*
sum
);
bank
[
i
*
C
+
c
]
=
sqrt
(
sum
);
/*printf ("%f ", bank[i*C+c]);*/
}
}
...
...
@@ -103,7 +103,7 @@ void normalise_bands(const CELTMode *m, celt_sig_t *freq, celt_norm_t *X, float
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
{
int
j
;
float
g
=
1
.
f
/
(
1e-10
+
bank
[
i
*
C
+
c
]);
float
g
=
1
.
f
/
(
1e-10
+
bank
[
i
*
C
+
c
]
*
sqrt
(
C
)
);
for
(
j
=
B
*
eBands
[
i
];
j
<
B
*
eBands
[
i
+
1
];
j
++
)
X
[
j
*
C
+
c
]
=
NORM_SCALING
*
SIG_SCALING_1
*
freq
[
j
*
C
+
c
]
*
g
;
}
...
...
@@ -133,7 +133,7 @@ void denormalise_bands(const CELTMode *m, celt_norm_t *X, celt_sig_t *freq, floa
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
{
int
j
;
float
g
=
bank
[
i
*
C
+
c
];
float
g
=
sqrt
(
C
)
*
bank
[
i
*
C
+
c
];
for
(
j
=
B
*
eBands
[
i
];
j
<
B
*
eBands
[
i
+
1
];
j
++
)
freq
[
j
*
C
+
c
]
=
NORM_SCALING_1
*
SIG_SCALING
*
X
[
j
*
C
+
c
]
*
g
;
}
...
...
tools/celtenc.c
View file @
e995c31f
...
...
@@ -438,10 +438,10 @@ int main(int argc, char **argv)
{
if
(
bitrate
<
0
)
bitrate
=
64
;
if
(
bitrate
<
40
)
bitrate
=
40
;
if
(
bitrate
>
8
0
)
bitrate
=
8
0
;
if
(
bitrate
<
32
)
bitrate
=
32
;
if
(
bitrate
>
11
0
)
bitrate
=
11
0
;
}
else
if
(
chan
==
2
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment