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
7fadc015
Commit
7fadc015
authored
Jun 05, 2009
by
Vladimir Voroshilov
Committed by
Michael Niedermayer
Sep 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Frame erasure support for fixed-codebook vectors
parent
9297c782
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
g729dec.c
libavcodec/g729dec.c
+13
-0
No files found.
libavcodec/g729dec.c
View file @
7fadc015
...
...
@@ -97,6 +97,7 @@ typedef struct {
int16_t
lsp_buf
[
2
][
10
];
///< (0.15) LSP coefficients (previous and current frames) (3.2.5)
int16_t
*
lsp
[
2
];
///< pointers to lsp_buf
uint16_t
rand_value
;
///< random number generator value (4.4.4)
int
ma_predictor_prev
;
///< switched MA predictor of LSP quantizer from last good frame
}
G729Context
;
...
...
@@ -224,6 +225,9 @@ static av_cold int decoder_init(AVCodecContext * avctx)
ctx
->
lsp
[
1
]
=
ctx
->
lsp_buf
[
1
];
memcpy
(
ctx
->
lsp
[
0
],
lsp_init
,
10
*
sizeof
(
int16_t
));
/* random seed initialization */
ctx
->
rand_value
=
21845
;
return
0
;
}
...
...
@@ -336,6 +340,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
pitch_delay_int
=
(
pitch_delay_3x
+
1
)
/
3
;
if
(
frame_erasure
)
{
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
fc_indexes
=
ctx
->
rand_value
&
((
1
<<
format
.
fc_indexes_bits
)
-
1
);
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
pulses_signs
=
ctx
->
rand_value
;
}
memset
(
fc
,
0
,
sizeof
(
int16_t
)
*
SUBFRAME_SIZE
);
switch
(
packet_type
)
{
case
FORMAT_G729_8K
:
...
...
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