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
087bc8d7
Commit
087bc8d7
authored
Apr 13, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Nov 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sipr: Convert to the new bitstream reader
parent
f26cbb55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
sipr.c
libavcodec/sipr.c
+12
-12
No files found.
libavcodec/sipr.c
View file @
087bc8d7
...
...
@@ -31,7 +31,7 @@
#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
#include "internal.h"
#include "lsp.h"
#include "acelp_vectors.h"
...
...
@@ -188,28 +188,28 @@ static void pitch_sharpening(int pitch_lag_int, float beta,
/**
* Extract decoding parameters from the input bitstream.
* @param parms parameters structure
* @param
pgb pointer to initialized GetBit
Context structure
* @param
bc pointer to initialized Bitstream
Context structure
*/
static
void
decode_parameters
(
SiprParameters
*
parms
,
GetBitContext
*
pgb
,
static
void
decode_parameters
(
SiprParameters
*
parms
,
BitstreamContext
*
bc
,
const
SiprModeParam
*
p
)
{
int
i
,
j
;
if
(
p
->
ma_predictor_bits
)
parms
->
ma_pred_switch
=
get_bits
(
pgb
,
p
->
ma_predictor_bits
);
parms
->
ma_pred_switch
=
bitstream_read
(
bc
,
p
->
ma_predictor_bits
);
for
(
i
=
0
;
i
<
5
;
i
++
)
parms
->
vq_indexes
[
i
]
=
get_bits
(
pgb
,
p
->
vq_indexes_bits
[
i
]);
parms
->
vq_indexes
[
i
]
=
bitstream_read
(
bc
,
p
->
vq_indexes_bits
[
i
]);
for
(
i
=
0
;
i
<
p
->
subframe_count
;
i
++
)
{
parms
->
pitch_delay
[
i
]
=
get_bits
(
pgb
,
p
->
pitch_delay_bits
[
i
]);
parms
->
pitch_delay
[
i
]
=
bitstream_read
(
bc
,
p
->
pitch_delay_bits
[
i
]);
if
(
p
->
gp_index_bits
)
parms
->
gp_index
[
i
]
=
get_bits
(
pgb
,
p
->
gp_index_bits
);
parms
->
gp_index
[
i
]
=
bitstream_read
(
bc
,
p
->
gp_index_bits
);
for
(
j
=
0
;
j
<
p
->
number_of_fc_indexes
;
j
++
)
parms
->
fc_indexes
[
i
][
j
]
=
get_bits
(
pgb
,
p
->
fc_index_bits
[
j
]);
parms
->
fc_indexes
[
i
][
j
]
=
bitstream_read
(
bc
,
p
->
fc_index_bits
[
j
]);
parms
->
gc_index
[
i
]
=
get_bits
(
pgb
,
p
->
gc_index_bits
);
parms
->
gc_index
[
i
]
=
bitstream_read
(
bc
,
p
->
gc_index_bits
);
}
}
...
...
@@ -527,7 +527,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *data,
const
uint8_t
*
buf
=
avpkt
->
data
;
SiprParameters
parm
;
const
SiprModeParam
*
mode_par
=
&
modes
[
ctx
->
mode
];
GetBitContext
gb
;
BitstreamContext
bc
;
float
*
samples
;
int
subframe_size
=
ctx
->
mode
==
MODE_16k
?
L_SUBFR_16k
:
SUBFR_SIZE
;
int
i
,
ret
;
...
...
@@ -549,10 +549,10 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *data,
}
samples
=
(
float
*
)
frame
->
data
[
0
];
init_get_bits
(
&
gb
,
buf
,
mode_par
->
bits_per_frame
);
bitstream_init
(
&
bc
,
buf
,
mode_par
->
bits_per_frame
);
for
(
i
=
0
;
i
<
mode_par
->
frames_per_packet
;
i
++
)
{
decode_parameters
(
&
parm
,
&
gb
,
mode_par
);
decode_parameters
(
&
parm
,
&
bc
,
mode_par
);
ctx
->
decode_frame
(
ctx
,
&
parm
,
samples
);
...
...
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