Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Traud
Opus
Commits
47ad4a09
Commit
47ad4a09
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Doing the log2Amp() just in one place
parent
ffe5061a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcelt/quant_bands.c
+18
-16
18 additions, 16 deletions
libcelt/quant_bands.c
with
18 additions
and
16 deletions
libcelt/quant_bands.c
+
18
−
16
View file @
47ad4a09
...
...
@@ -177,8 +177,6 @@ void quant_fine_energy(const CELTMode *m, int start, celt_ener *eBands, celt_wor
/*printf ("%f ", error[i] - offset);*/
}
while
(
++
c
<
C
);
}
for
(
i
=
start
;
i
<
C
*
m
->
nbEBands
;
i
++
)
eBands
[
i
]
=
log2Amp
(
oldEBands
[
i
]);
}
void
quant_energy_finalise
(
const
CELTMode
*
m
,
int
start
,
celt_ener
*
eBands
,
celt_word16
*
oldEBands
,
celt_word16
*
error
,
int
*
fine_quant
,
int
*
fine_priority
,
int
bits_left
,
ec_enc
*
enc
,
int
_C
)
...
...
@@ -205,16 +203,19 @@ void quant_energy_finalise(const CELTMode *m, int start, celt_ener *eBands, celt
offset
=
(
q2
-
.
5
f
)
*
(
1
<<
(
14
-
fine_quant
[
i
]
-
1
))
*
(
1
.
f
/
16384
);
#endif
oldEBands
[
i
+
c
*
m
->
nbEBands
]
+=
offset
;
eBands
[
i
+
c
*
m
->
nbEBands
]
=
log2Amp
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]);
bits_left
--
;
}
while
(
++
c
<
C
);
}
}
for
(
i
=
start
;
i
<
C
*
m
->
nbEBands
;
i
++
)
{
if
(
oldEBands
[
i
]
<
-
QCONST16
(
7
.
f
,
DB_SHIFT
))
oldEBands
[
i
]
=
-
QCONST16
(
7
.
f
,
DB_SHIFT
);
}
c
=
0
;
do
{
for
(
i
=
start
;
i
<
m
->
nbEBands
;
i
++
)
{
eBands
[
i
+
c
*
m
->
nbEBands
]
=
log2Amp
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]);
if
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]
<
-
QCONST16
(
7
.
f
,
DB_SHIFT
))
oldEBands
[
i
+
c
*
m
->
nbEBands
]
=
-
QCONST16
(
7
.
f
,
DB_SHIFT
);
}
}
while
(
++
c
<
C
);
}
void
unquant_coarse_energy
(
const
CELTMode
*
m
,
int
start
,
celt_ener
*
eBands
,
celt_word16
*
oldEBands
,
int
budget
,
int
intra
,
int
*
prob
,
ec_dec
*
dec
,
int
_C
)
...
...
@@ -277,8 +278,6 @@ void unquant_fine_energy(const CELTMode *m, int start, celt_ener *eBands, celt_w
oldEBands
[
i
+
c
*
m
->
nbEBands
]
+=
offset
;
}
while
(
++
c
<
C
);
}
for
(
i
=
start
;
i
<
C
*
m
->
nbEBands
;
i
++
)
eBands
[
i
]
=
log2Amp
(
oldEBands
[
i
]);
}
void
unquant_energy_finalise
(
const
CELTMode
*
m
,
int
start
,
celt_ener
*
eBands
,
celt_word16
*
oldEBands
,
int
*
fine_quant
,
int
*
fine_priority
,
int
bits_left
,
ec_dec
*
dec
,
int
_C
)
...
...
@@ -304,14 +303,17 @@ void unquant_energy_finalise(const CELTMode *m, int start, celt_ener *eBands, ce
offset
=
(
q2
-
.
5
f
)
*
(
1
<<
(
14
-
fine_quant
[
i
]
-
1
))
*
(
1
.
f
/
16384
);
#endif
oldEBands
[
i
+
c
*
m
->
nbEBands
]
+=
offset
;
eBands
[
i
+
c
*
m
->
nbEBands
]
=
log2Amp
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]);
bits_left
--
;
}
while
(
++
c
<
C
);
}
}
for
(
i
=
start
;
i
<
C
*
m
->
nbEBands
;
i
++
)
{
if
(
oldEBands
[
i
]
<
-
QCONST16
(
7
.
f
,
DB_SHIFT
))
oldEBands
[
i
]
=
-
QCONST16
(
7
.
f
,
DB_SHIFT
);
}
c
=
0
;
do
{
for
(
i
=
start
;
i
<
m
->
nbEBands
;
i
++
)
{
eBands
[
i
+
c
*
m
->
nbEBands
]
=
log2Amp
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]);
if
(
oldEBands
[
i
+
c
*
m
->
nbEBands
]
<
-
QCONST16
(
7
.
f
,
DB_SHIFT
))
oldEBands
[
i
+
c
*
m
->
nbEBands
]
=
-
QCONST16
(
7
.
f
,
DB_SHIFT
);
}
}
while
(
++
c
<
C
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment