Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bcc67dff
Commit
bcc67dff
authored
Mar 17, 2011
by
Mohamed Naufal Basheer
Committed by
Michael Niedermayer
Sep 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a shift parameter to celp_lp_synthesis_filter for reuse by the G.723.1 decoder
parent
ecf31a68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
celp_filters.c
libavcodec/celp_filters.c
+2
-2
celp_filters.h
libavcodec/celp_filters.h
+2
-1
g729dec.c
libavcodec/g729dec.c
+3
-0
g729postfilter.c
libavcodec/g729postfilter.c
+2
-2
ra144.c
libavcodec/ra144.c
+1
-1
No files found.
libavcodec/celp_filters.c
View file @
bcc67dff
...
@@ -58,7 +58,7 @@ void ff_celp_circ_addf(float *out, const float *in,
...
@@ -58,7 +58,7 @@ void ff_celp_circ_addf(float *out, const float *in,
int
ff_celp_lp_synthesis_filter
(
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
int
ff_celp_lp_synthesis_filter
(
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
const
int16_t
*
in
,
int
buffer_length
,
const
int16_t
*
in
,
int
buffer_length
,
int
filter_length
,
int
stop_on_overflow
,
int
filter_length
,
int
stop_on_overflow
,
int
rounder
)
int
shift
,
int
rounder
)
{
{
int
i
,
n
;
int
i
,
n
;
...
@@ -67,7 +67,7 @@ int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
...
@@ -67,7 +67,7 @@ int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
for
(
i
=
1
;
i
<=
filter_length
;
i
++
)
for
(
i
=
1
;
i
<=
filter_length
;
i
++
)
sum
-=
filter_coeffs
[
i
-
1
]
*
out
[
n
-
i
];
sum
-=
filter_coeffs
[
i
-
1
]
*
out
[
n
-
i
];
sum
=
(
sum
>>
12
)
+
in
[
n
]
;
sum
=
(
(
sum
>>
12
)
+
in
[
n
])
>>
shift
;
if
(
sum
+
0x8000
>
0xFFFFU
)
{
if
(
sum
+
0x8000
>
0xFFFFU
)
{
if
(
stop_on_overflow
)
if
(
stop_on_overflow
)
...
...
libavcodec/celp_filters.h
View file @
bcc67dff
...
@@ -63,6 +63,7 @@ void ff_celp_circ_addf(float *out, const float *in,
...
@@ -63,6 +63,7 @@ void ff_celp_circ_addf(float *out, const float *in,
* @param filter_length filter length (10 for 10th order LP filter)
* @param filter_length filter length (10 for 10th order LP filter)
* @param stop_on_overflow 1 - return immediately if overflow occurs
* @param stop_on_overflow 1 - return immediately if overflow occurs
* 0 - ignore overflows
* 0 - ignore overflows
* @param shift the result is shifted right by this value
* @param rounder the amount to add for rounding (usually 0x800 or 0xfff)
* @param rounder the amount to add for rounding (usually 0x800 or 0xfff)
*
*
* @return 1 if overflow occurred, 0 - otherwise
* @return 1 if overflow occurred, 0 - otherwise
...
@@ -75,7 +76,7 @@ void ff_celp_circ_addf(float *out, const float *in,
...
@@ -75,7 +76,7 @@ void ff_celp_circ_addf(float *out, const float *in,
int
ff_celp_lp_synthesis_filter
(
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
int
ff_celp_lp_synthesis_filter
(
int16_t
*
out
,
const
int16_t
*
filter_coeffs
,
const
int16_t
*
in
,
int
buffer_length
,
const
int16_t
*
in
,
int
buffer_length
,
int
filter_length
,
int
stop_on_overflow
,
int
filter_length
,
int
stop_on_overflow
,
int
rounder
);
int
shift
,
int
rounder
);
/**
/**
* LP synthesis filter.
* LP synthesis filter.
...
...
libavcodec/g729dec.c
View file @
bcc67dff
...
@@ -604,6 +604,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -604,6 +604,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
SUBFRAME_SIZE
,
SUBFRAME_SIZE
,
10
,
10
,
1
,
1
,
0
,
0x800
))
0x800
))
/* Overflow occured, downscale excitation signal... */
/* Overflow occured, downscale excitation signal... */
for
(
j
=
0
;
j
<
2
*
SUBFRAME_SIZE
+
PITCH_DELAY_MAX
+
INTERPOL_LEN
;
j
++
)
for
(
j
=
0
;
j
<
2
*
SUBFRAME_SIZE
+
PITCH_DELAY_MAX
+
INTERPOL_LEN
;
j
++
)
...
@@ -625,6 +626,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -625,6 +626,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
SUBFRAME_SIZE
,
SUBFRAME_SIZE
,
10
,
10
,
0
,
0
,
0
,
0x800
);
0x800
);
}
else
{
}
else
{
ff_celp_lp_synthesis_filter
(
ff_celp_lp_synthesis_filter
(
...
@@ -634,6 +636,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -634,6 +636,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
SUBFRAME_SIZE
,
SUBFRAME_SIZE
,
10
,
10
,
0
,
0
,
0
,
0x800
);
0x800
);
}
}
/* Save data (without postfilter) for use in next subframe. */
/* Save data (without postfilter) for use in next subframe. */
...
...
libavcodec/g729postfilter.c
View file @
bcc67dff
...
@@ -433,7 +433,7 @@ static int16_t get_tilt_comp(DSPContext *dsp, int16_t *lp_gn,
...
@@ -433,7 +433,7 @@ static int16_t get_tilt_comp(DSPContext *dsp, int16_t *lp_gn,
lp_gn
[
10
]
=
4096
;
//1.0 in (3.12)
lp_gn
[
10
]
=
4096
;
//1.0 in (3.12)
/* Apply 1/A(z/FORMANT_PP_FACTOR_DEN) filter to hf. */
/* Apply 1/A(z/FORMANT_PP_FACTOR_DEN) filter to hf. */
ff_celp_lp_synthesis_filter
(
lp_gn
+
11
,
lp_gd
+
1
,
lp_gn
+
11
,
22
,
10
,
0
,
0x800
);
ff_celp_lp_synthesis_filter
(
lp_gn
+
11
,
lp_gd
+
1
,
lp_gn
+
11
,
22
,
10
,
0
,
0
,
0
x800
);
/* Now lp_gn (starting with 10) contains impulse response
/* Now lp_gn (starting with 10) contains impulse response
of A(z/FORMANT_PP_FACTOR_NUM)/A(z/FORMANT_PP_FACTOR_DEN) filter. */
of A(z/FORMANT_PP_FACTOR_NUM)/A(z/FORMANT_PP_FACTOR_DEN) filter. */
...
@@ -554,7 +554,7 @@ void ff_g729_postfilter(DSPContext *dsp, int16_t* ht_prev_data, int* voicing,
...
@@ -554,7 +554,7 @@ void ff_g729_postfilter(DSPContext *dsp, int16_t* ht_prev_data, int* voicing,
/* Apply second half of short-term postfilter: 1/A(z/FORMANT_PP_FACTOR_DEN) */
/* Apply second half of short-term postfilter: 1/A(z/FORMANT_PP_FACTOR_DEN) */
ff_celp_lp_synthesis_filter
(
pos_filter_data
+
10
,
lp_gd
+
1
,
ff_celp_lp_synthesis_filter
(
pos_filter_data
+
10
,
lp_gd
+
1
,
residual_filt_buf
+
10
,
residual_filt_buf
+
10
,
subframe_size
,
10
,
0
,
0x800
);
subframe_size
,
10
,
0
,
0
,
0
x800
);
memcpy
(
pos_filter_data
,
pos_filter_data
+
subframe_size
,
10
*
sizeof
(
int16_t
));
memcpy
(
pos_filter_data
,
pos_filter_data
+
subframe_size
,
10
*
sizeof
(
int16_t
));
*
ht_prev_data
=
apply_tilt_comp
(
speech
,
pos_filter_data
+
10
,
tilt_comp_coeff
,
*
ht_prev_data
=
apply_tilt_comp
(
speech
,
pos_filter_data
+
10
,
tilt_comp_coeff
,
...
...
libavcodec/ra144.c
View file @
bcc67dff
...
@@ -1715,6 +1715,6 @@ void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
...
@@ -1715,6 +1715,6 @@ void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
10
*
sizeof
(
*
ractx
->
curr_sblock
));
10
*
sizeof
(
*
ractx
->
curr_sblock
));
if
(
ff_celp_lp_synthesis_filter
(
ractx
->
curr_sblock
+
10
,
lpc_coefs
,
if
(
ff_celp_lp_synthesis_filter
(
ractx
->
curr_sblock
+
10
,
lpc_coefs
,
block
,
BLOCKSIZE
,
10
,
1
,
0xfff
))
block
,
BLOCKSIZE
,
10
,
1
,
0
,
0
xfff
))
memset
(
ractx
->
curr_sblock
,
0
,
50
*
sizeof
(
*
ractx
->
curr_sblock
));
memset
(
ractx
->
curr_sblock
,
0
,
50
*
sizeof
(
*
ractx
->
curr_sblock
));
}
}
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