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
51222d10
Commit
51222d10
authored
15 years ago
by
Diego Biurrun
Browse files
Options
Downloads
Patches
Plain Diff
cosmetics: K&R style reformatting
Originally committed as revision 19088 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0e848977
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/acelp_filters.c
+12
-24
12 additions, 24 deletions
libavcodec/acelp_filters.c
libavcodec/acelp_filters.h
+5
-14
5 additions, 14 deletions
libavcodec/acelp_filters.h
with
17 additions
and
38 deletions
libavcodec/acelp_filters.c
+
12
−
24
View file @
51222d10
...
@@ -25,8 +25,7 @@
...
@@ -25,8 +25,7 @@
#include
"avcodec.h"
#include
"avcodec.h"
#include
"acelp_filters.h"
#include
"acelp_filters.h"
const
int16_t
ff_acelp_interp_filter
[
61
]
=
const
int16_t
ff_acelp_interp_filter
[
61
]
=
{
/* (0.15) */
{
/* (0.15) */
29443
,
28346
,
25207
,
20449
,
14701
,
8693
,
29443
,
28346
,
25207
,
20449
,
14701
,
8693
,
3143
,
-
1352
,
-
4402
,
-
5865
,
-
5850
,
-
4673
,
3143
,
-
1352
,
-
4402
,
-
5865
,
-
5850
,
-
4673
,
-
2783
,
-
672
,
1211
,
2536
,
3130
,
2991
,
-
2783
,
-
672
,
1211
,
2536
,
3130
,
2991
,
...
@@ -40,26 +39,19 @@ const int16_t ff_acelp_interp_filter[61] =
...
@@ -40,26 +39,19 @@ const int16_t ff_acelp_interp_filter[61] =
0
,
0
,
};
};
void
ff_acelp_interpolate
(
void
ff_acelp_interpolate
(
int16_t
*
out
,
const
int16_t
*
in
,
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
int
precision
,
const
int16_t
*
in
,
int
frac_pos
,
int
filter_length
,
int
length
)
const
int16_t
*
filter_coeffs
,
int
precision
,
int
frac_pos
,
int
filter_length
,
int
length
)
{
{
int
n
,
i
;
int
n
,
i
;
assert
(
pitch_delay_frac
>=
0
&&
pitch_delay_frac
<
precision
);
assert
(
pitch_delay_frac
>=
0
&&
pitch_delay_frac
<
precision
);
for
(
n
=
0
;
n
<
length
;
n
++
)
for
(
n
=
0
;
n
<
length
;
n
++
)
{
{
int
idx
=
0
;
int
idx
=
0
;
int
v
=
0x4000
;
int
v
=
0x4000
;
for
(
i
=
0
;
i
<
filter_length
;)
for
(
i
=
0
;
i
<
filter_length
;)
{
{
/* The reference G.729 and AMR fixed point code performs clipping after
/* The reference G.729 and AMR fixed point code performs clipping after
each of the two following accumulations.
each of the two following accumulations.
...
@@ -75,26 +67,22 @@ void ff_acelp_interpolate(
...
@@ -75,26 +67,22 @@ void ff_acelp_interpolate(
i
++
;
i
++
;
v
+=
in
[
n
-
i
]
*
filter_coeffs
[
idx
-
frac_pos
];
v
+=
in
[
n
-
i
]
*
filter_coeffs
[
idx
-
frac_pos
];
}
}
if
(
av_clip_int16
(
v
>>
15
)
!=
(
v
>>
15
))
if
(
av_clip_int16
(
v
>>
15
)
!=
(
v
>>
15
))
av_log
(
NULL
,
AV_LOG_WARNING
,
"overflow that would need cliping in ff_acelp_interpolate()
\n
"
);
av_log
(
NULL
,
AV_LOG_WARNING
,
"overflow that would need cliping in ff_acelp_interpolate()
\n
"
);
out
[
n
]
=
v
>>
15
;
out
[
n
]
=
v
>>
15
;
}
}
}
}
void
ff_acelp_high_pass_filter
(
void
ff_acelp_high_pass_filter
(
int16_t
*
out
,
int
hpf_f
[
2
],
int16_t
*
out
,
const
int16_t
*
in
,
int
length
)
int
hpf_f
[
2
],
const
int16_t
*
in
,
int
length
)
{
{
int
i
;
int
i
;
int
tmp
;
int
tmp
;
for
(
i
=
0
;
i
<
length
;
i
++
)
for
(
i
=
0
;
i
<
length
;
i
++
)
{
{
tmp
=
(
hpf_f
[
0
]
*
15836LL
)
>>
13
;
tmp
=
(
hpf_f
[
0
]
*
15836LL
)
>>
13
;
tmp
+=
(
hpf_f
[
1
]
*
-
7667LL
)
>>
13
;
tmp
+=
(
hpf_f
[
1
]
*
-
7667LL
)
>>
13
;
tmp
+=
7699
*
(
in
[
i
]
-
2
*
in
[
i
-
1
]
+
in
[
i
-
2
]);
tmp
+=
7699
*
(
in
[
i
]
-
2
*
in
[
i
-
1
]
+
in
[
i
-
2
]);
/* With "+0x800" rounding, clipping is needed
/* With "+0x800" rounding, clipping is needed
...
...
This diff is collapsed.
Click to expand it.
libavcodec/acelp_filters.h
+
5
−
14
View file @
51222d10
...
@@ -51,15 +51,9 @@ extern const int16_t ff_acelp_interp_filter[61];
...
@@ -51,15 +51,9 @@ extern const int16_t ff_acelp_interp_filter[61];
* See ff_acelp_interp_filter for an example.
* See ff_acelp_interp_filter for an example.
*
*
*/
*/
void
ff_acelp_interpolate
(
void
ff_acelp_interpolate
(
int16_t
*
out
,
const
int16_t
*
in
,
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
int
precision
,
const
int16_t
*
in
,
int
frac_pos
,
int
filter_length
,
int
length
);
const
int16_t
*
filter_coeffs
,
int
precision
,
int
frac_pos
,
int
filter_length
,
int
length
);
/**
/**
* high-pass filtering and upscaling (4.2.5 of G.729).
* high-pass filtering and upscaling (4.2.5 of G.729).
...
@@ -84,10 +78,7 @@ void ff_acelp_interpolate(
...
@@ -84,10 +78,7 @@ void ff_acelp_interpolate(
* fixed-point all coefficients are the same as in G.729. Thus this
* fixed-point all coefficients are the same as in G.729. Thus this
* routine can be used for the fixed-point AMR decoder, too.
* routine can be used for the fixed-point AMR decoder, too.
*/
*/
void
ff_acelp_high_pass_filter
(
void
ff_acelp_high_pass_filter
(
int16_t
*
out
,
int
hpf_f
[
2
],
int16_t
*
out
,
const
int16_t
*
in
,
int
length
);
int
hpf_f
[
2
],
const
int16_t
*
in
,
int
length
);
#endif
/* AVCODEC_ACELP_FILTERS_H */
#endif
/* AVCODEC_ACELP_FILTERS_H */
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