Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
55498543
Commit
55498543
authored
12 years ago
by
Diego Biurrun
Browse files
Options
Downloads
Patches
Plain Diff
celp_math: Move ff_cos() to the only place it is used
parent
8f7c26e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libavcodec/Makefile
+2
-2
2 additions, 2 deletions
libavcodec/Makefile
libavcodec/celp_math.c
+0
-25
0 additions, 25 deletions
libavcodec/celp_math.c
libavcodec/celp_math.h
+0
-8
0 additions, 8 deletions
libavcodec/celp_math.h
libavcodec/lsp.c
+24
-0
24 additions, 0 deletions
libavcodec/lsp.c
with
26 additions
and
35 deletions
libavcodec/Makefile
+
2
−
2
View file @
55498543
...
...
@@ -171,7 +171,7 @@ OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
OBJS-$(CONFIG_FRAPS_DECODER)
+=
fraps.o
OBJS-$(CONFIG_FRWU_DECODER)
+=
frwu.o
OBJS-$(CONFIG_G723_1_DECODER)
+=
g723_1.o acelp_vectors.o
\
celp_filters.o
celp_math.o
celp_filters.o
OBJS-$(CONFIG_GIF_DECODER)
+=
gifdec.o lzw.o
OBJS-$(CONFIG_GIF_ENCODER)
+=
gif.o lzwenc.o
OBJS-$(CONFIG_GSM_DECODER)
+=
gsmdec.o gsmdec_data.o msgsmdec.o
...
...
@@ -367,7 +367,7 @@ OBJS-$(CONFIG_TRUESPEECH_DECODER) += truespeech.o
OBJS-$(CONFIG_TSCC_DECODER)
+=
tscc.o msrledec.o
OBJS-$(CONFIG_TSCC2_DECODER)
+=
tscc2.o
OBJS-$(CONFIG_TTA_DECODER)
+=
tta.o
OBJS-$(CONFIG_TWINVQ_DECODER)
+=
twinvq.o
celp_math.o
OBJS-$(CONFIG_TWINVQ_DECODER)
+=
twinvq.o
OBJS-$(CONFIG_TXD_DECODER)
+=
txd.o s3tc.o
OBJS-$(CONFIG_ULTI_DECODER)
+=
ulti.o
OBJS-$(CONFIG_UTVIDEO_DECODER)
+=
utvideodec.o utvideo.o
...
...
This diff is collapsed.
Click to expand it.
libavcodec/celp_math.c
+
0
−
25
View file @
55498543
...
...
@@ -28,21 +28,6 @@
#include
"celp_math.h"
#include
"libavutil/common.h"
/**
* Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
*/
static
const
int16_t
tab_cos
[
65
]
=
{
32767
,
32738
,
32617
,
32421
,
32145
,
31793
,
31364
,
30860
,
30280
,
29629
,
28905
,
28113
,
27252
,
26326
,
25336
,
24285
,
23176
,
22011
,
20793
,
19525
,
18210
,
16851
,
15451
,
14014
,
12543
,
11043
,
9515
,
7965
,
6395
,
4810
,
3214
,
1609
,
1
,
-
1607
,
-
3211
,
-
4808
,
-
6393
,
-
7962
,
-
9513
,
-
11040
,
-
12541
,
-
14012
,
-
15449
,
-
16848
,
-
18207
,
-
19523
,
-
20791
,
-
22009
,
-
23174
,
-
24283
,
-
25334
,
-
26324
,
-
27250
,
-
28111
,
-
28904
,
-
29627
,
-
30279
,
-
30858
,
-
31363
,
-
31792
,
-
32144
,
-
32419
,
-
32616
,
-
32736
,
-
32768
,
};
static
const
uint16_t
exp2a
[]
=
{
0
,
1435
,
2901
,
4400
,
5931
,
7496
,
9096
,
10730
,
...
...
@@ -59,16 +44,6 @@ static const uint16_t exp2b[]=
17176
,
17898
,
18620
,
19343
,
20066
,
20790
,
21514
,
22238
,
};
int16_t
ff_cos
(
uint16_t
arg
)
{
uint8_t
offset
=
arg
;
uint8_t
ind
=
arg
>>
8
;
assert
(
arg
<=
0x3fff
);
return
tab_cos
[
ind
]
+
(
offset
*
(
tab_cos
[
ind
+
1
]
-
tab_cos
[
ind
])
>>
8
);
}
int
ff_exp2
(
uint16_t
power
)
{
unsigned
int
result
=
exp2a
[
power
>>
10
]
+
0x10000
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/celp_math.h
+
0
−
8
View file @
55498543
...
...
@@ -25,14 +25,6 @@
#include
<stdint.h>
/**
* fixed-point implementation of cosine in [0; PI) domain.
* @param arg fixed-point cosine argument, 0 <= arg < 0x4000
*
* @return value of (1<<15) * cos(arg * PI / (1<<14)), -0x8000 <= result <= 0x7fff
*/
int16_t
ff_cos
(
uint16_t
arg
);
/**
* fixed-point implementation of exp2(x) in [0; 1] domain.
* @param power argument to exp2, 0 <= power <= 0x7fff
...
...
This diff is collapsed.
Click to expand it.
libavcodec/lsp.c
+
24
−
0
View file @
55498543
...
...
@@ -55,6 +55,30 @@ void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size)
prev
=
lsf
[
i
]
=
FFMAX
(
lsf
[
i
],
prev
+
min_spacing
);
}
/* Cosine table: base_cos[i] = (1 << 15) * cos(i * PI / 64) */
static
const
int16_t
tab_cos
[
65
]
=
{
32767
,
32738
,
32617
,
32421
,
32145
,
31793
,
31364
,
30860
,
30280
,
29629
,
28905
,
28113
,
27252
,
26326
,
25336
,
24285
,
23176
,
22011
,
20793
,
19525
,
18210
,
16851
,
15451
,
14014
,
12543
,
11043
,
9515
,
7965
,
6395
,
4810
,
3214
,
1609
,
1
,
-
1607
,
-
3211
,
-
4808
,
-
6393
,
-
7962
,
-
9513
,
-
11040
,
-
12541
,
-
14012
,
-
15449
,
-
16848
,
-
18207
,
-
19523
,
-
20791
,
-
22009
,
-
23174
,
-
24283
,
-
25334
,
-
26324
,
-
27250
,
-
28111
,
-
28904
,
-
29627
,
-
30279
,
-
30858
,
-
31363
,
-
31792
,
-
32144
,
-
32419
,
-
32616
,
-
32736
,
-
32768
,
};
static
int16_t
ff_cos
(
uint16_t
arg
)
{
uint8_t
offset
=
arg
;
uint8_t
ind
=
arg
>>
8
;
assert
(
arg
<=
0x3fff
);
return
tab_cos
[
ind
]
+
(
offset
*
(
tab_cos
[
ind
+
1
]
-
tab_cos
[
ind
])
>>
8
);
}
void
ff_acelp_lsf2lsp
(
int16_t
*
lsp
,
const
int16_t
*
lsf
,
int
lp_order
)
{
int
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