Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
695ab700
Commit
695ab700
authored
Jun 07, 2009
by
Jean-Marc Valin
Browse files
Minor simplification to the fine energy code
parent
d8dcd244
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/quant_bands.c
View file @
695ab700
...
...
@@ -151,14 +151,14 @@ static void quant_fine_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_
{
int
q2
;
celt_int16_t
frac
=
1
<<
fine_quant
[
i
];
celt_word16_t
offset
=
(
error
[
i
]
+
QCONST16
(.
5
f
,
8
))
*
frac
;
celt_word16_t
offset
;
if
(
fine_quant
[
i
]
<=
0
)
continue
;
#ifdef FIXED_POINT
/* Has to be without rounding */
q2
=
offset
>>
8
;
q2
=
(
error
[
i
]
+
QCONST16
(.
5
f
,
8
))
>>
(
8
-
fine_quant
[
i
])
;
#else
q2
=
(
int
)
floor
(
offset
);
q2
=
(
int
)
floor
(
(
error
[
i
]
+
.
5
)
*
frac
);
#endif
if
(
q2
>
frac
-
1
)
q2
=
frac
-
1
;
...
...
@@ -168,7 +168,7 @@ static void quant_fine_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_
#else
offset
=
(
q2
+
.
5
f
)
*
(
1
<<
(
14
-
fine_quant
[
i
]))
*
(
1
.
f
/
16384
)
-
.
5
f
;
#endif
oldEBands
[
i
]
+=
PSHR32
(
MULT16_16
(
DB_SCALING
,
offset
),
8
)
;
oldEBands
[
i
]
+=
offset
;
/*printf ("%f ", error[i] - offset);*/
}
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
...
...
@@ -234,7 +234,7 @@ static void unquant_fine_energy_mono(const CELTMode *m, celt_ener_t *eBands, cel
#else
offset
=
(
q2
+
.
5
f
)
*
(
1
<<
(
14
-
fine_quant
[
i
]))
*
(
1
.
f
/
16384
)
-
.
5
f
;
#endif
oldEBands
[
i
]
+=
PSHR32
(
MULT16_16
(
DB_SCALING
,
offset
),
8
)
;
oldEBands
[
i
]
+=
offset
;
}
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
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