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
7adca0e6
Commit
7adca0e6
authored
17 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
optimisation: better indexing/looping in vq_index()
parent
f7cec83c
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_pitch.c
+8
-8
8 additions, 8 deletions
libcelt/quant_pitch.c
with
8 additions
and
8 deletions
libcelt/quant_pitch.c
+
8
−
8
View file @
7adca0e6
...
...
@@ -54,24 +54,24 @@
#define Q1515ONE MULT16_16(Q15ONE,Q15ONE)
/** Taken from Speex.Finds the index of the entry in a codebook that best matches the input*/
int
vq_index
(
celt_pgain_t
*
in
,
const
celt_uint16_t
*
codebook
,
int
len
,
int
entries
)
int
vq_index
(
const
celt_pgain_t
*
in
,
const
celt_uint16_t
*
codebook
,
int
len
,
int
entries
)
{
int
i
,
j
;
int
ind
=
0
;
celt_word32_t
min_dist
=
0
;
celt_word32_t
min_dist
=
VERY_LARGE32
;
int
best_index
=
0
;
for
(
i
=
0
;
i
<
entries
;
i
++
)
{
celt_word32_t
dist
=
0
;
for
(
j
=
0
;
j
<
len
>>
1
;
j
++
)
{
celt_pgain_t
tmp1
=
SHR16
(
SUB16
(
in
[
2
*
j
]
,
PGAIN_EVEN
(
codebook
,
ind
)),
1
);
celt_pgain_t
tmp2
=
SHR16
(
SUB16
(
in
[
2
*
j
+
1
]
,
PGAIN_ODD
(
codebook
,
ind
)),
1
);
const
celt_pgain_t
*
inp
=
in
;
j
=
0
;
do
{
celt_pgain_t
tmp1
=
SHR16
(
SUB16
(
*
in
p
++
,
PGAIN_EVEN
(
codebook
,
ind
)),
1
);
celt_pgain_t
tmp2
=
SHR16
(
SUB16
(
*
in
p
++
,
PGAIN_ODD
(
codebook
,
ind
)),
1
);
ind
++
;
dist
=
MAC16_16
(
dist
,
tmp1
,
tmp1
);
dist
=
MAC16_16
(
dist
,
tmp2
,
tmp2
);
}
if
(
i
==
0
||
dist
<
min_dist
)
}
while
(
++
j
<
len
>>
1
);
if
(
dist
<
min_dist
)
{
min_dist
=
dist
;
best_index
=
i
;
...
...
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