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
02aabd82
Commit
02aabd82
authored
Sep 25, 2011
by
Vitor Sessak
Committed by
Michael Niedermayer
Sep 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g729dec: avoid unnecessary struct copying
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
22dd24fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
g729dec.c
libavcodec/g729dec.c
+10
-10
No files found.
libavcodec/g729dec.c
View file @
02aabd82
...
...
@@ -380,7 +380,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int
buf_size
=
avpkt
->
size
;
int16_t
*
out_frame
=
data
;
GetBitContext
gb
;
G729FormatDescription
format
;
const
G729FormatDescription
*
format
;
int
frame_erasure
=
0
;
///< frame erasure detected during decoding
int
bad_pitch
=
0
;
///< parity check failed
int
i
;
...
...
@@ -408,14 +408,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if
(
buf_size
==
10
)
{
packet_type
=
FORMAT_G729_8K
;
format
=
format_g729_8k
;
format
=
&
format_g729_8k
;
//Reset voice decision
ctx
->
onset
=
0
;
ctx
->
voice_decision
=
DECISION_VOICE
;
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Packet type: %s
\n
"
,
"G.729 @ 8kbit/s"
);
}
else
if
(
buf_size
==
8
)
{
packet_type
=
FORMAT_G729D_6K4
;
format
=
format_g729d_6k4
;
format
=
&
format_g729d_6k4
;
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Packet type: %s
\n
"
,
"G.729D @ 6.4kbit/s"
);
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packet size %d is unknown.
\n
"
,
buf_size
);
...
...
@@ -463,13 +463,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
uint8_t
gc_1st_index
;
///< gain codebook (first stage) index
uint8_t
gc_2nd_index
;
///< gain codebook (second stage) index
ac_index
=
get_bits
(
&
gb
,
format
.
ac_index_bits
[
i
]);
if
(
!
i
&&
format
.
parity_bit
)
ac_index
=
get_bits
(
&
gb
,
format
->
ac_index_bits
[
i
]);
if
(
!
i
&&
format
->
parity_bit
)
bad_pitch
=
get_parity
(
ac_index
)
==
get_bits1
(
&
gb
);
fc_indexes
=
get_bits
(
&
gb
,
format
.
fc_indexes_bits
);
pulses_signs
=
get_bits
(
&
gb
,
format
.
fc_signs_bits
);
gc_1st_index
=
get_bits
(
&
gb
,
format
.
gc_1st_index_bits
);
gc_2nd_index
=
get_bits
(
&
gb
,
format
.
gc_2nd_index_bits
);
fc_indexes
=
get_bits
(
&
gb
,
format
->
fc_indexes_bits
);
pulses_signs
=
get_bits
(
&
gb
,
format
->
fc_signs_bits
);
gc_1st_index
=
get_bits
(
&
gb
,
format
->
gc_1st_index_bits
);
gc_2nd_index
=
get_bits
(
&
gb
,
format
->
gc_2nd_index_bits
);
if
(
frame_erasure
)
pitch_delay_3x
=
3
*
ctx
->
pitch_delay_int_prev
;
...
...
@@ -493,7 +493,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if
(
frame_erasure
)
{
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
fc_indexes
=
ctx
->
rand_value
&
((
1
<<
format
.
fc_indexes_bits
)
-
1
);
fc_indexes
=
ctx
->
rand_value
&
((
1
<<
format
->
fc_indexes_bits
)
-
1
);
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
pulses_signs
=
ctx
->
rand_value
;
...
...
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