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
b3441350
Commit
b3441350
authored
Apr 12, 2016
by
Alexandra Hájková
Committed by
Anton Khirnov
Nov 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opus: Convert to the new bitstream reader
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
6f94a64b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
opus.h
libavcodec/opus.h
+3
-3
opusdec.c
libavcodec/opusdec.c
+3
-3
No files found.
libavcodec/opus.h
View file @
b3441350
...
...
@@ -32,7 +32,7 @@
#include "libavresample/avresample.h"
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
#define MAX_FRAME_SIZE 1275
#define MAX_FRAMES 48
...
...
@@ -92,7 +92,7 @@ typedef struct RawBitsContext {
}
RawBitsContext
;
typedef
struct
OpusRangeCoder
{
GetBitContext
gb
;
BitstreamContext
bc
;
RawBitsContext
rb
;
unsigned
int
range
;
unsigned
int
value
;
...
...
@@ -196,7 +196,7 @@ typedef struct OpusContext {
static
av_always_inline
void
opus_rc_normalize
(
OpusRangeCoder
*
rc
)
{
while
(
rc
->
range
<=
1
<<
23
)
{
rc
->
value
=
((
rc
->
value
<<
8
)
|
(
get_bits
(
&
rc
->
gb
,
8
)
^
0xFF
))
&
((
1u
<<
31
)
-
1
);
rc
->
value
=
((
rc
->
value
<<
8
)
|
(
bitstream_read
(
&
rc
->
bc
,
8
)
^
0xFF
))
&
((
1u
<<
31
)
-
1
);
rc
->
range
<<=
8
;
rc
->
total_read_bits
+=
8
;
}
...
...
libavcodec/opusdec.c
View file @
b3441350
...
...
@@ -43,9 +43,9 @@
#include "libavresample/avresample.h"
#include "avcodec.h"
#include "bitstream.h"
#include "celp_filters.h"
#include "fft.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "opus.h"
...
...
@@ -80,12 +80,12 @@ static int get_silk_samplerate(int config)
*/
static
int
opus_rc_init
(
OpusRangeCoder
*
rc
,
const
uint8_t
*
data
,
int
size
)
{
int
ret
=
init_get_bits8
(
&
rc
->
gb
,
data
,
size
);
int
ret
=
bitstream_init8
(
&
rc
->
bc
,
data
,
size
);
if
(
ret
<
0
)
return
ret
;
rc
->
range
=
128
;
rc
->
value
=
127
-
get_bits
(
&
rc
->
gb
,
7
);
rc
->
value
=
127
-
bitstream_read
(
&
rc
->
bc
,
7
);
rc
->
total_read_bits
=
9
;
opus_rc_normalize
(
rc
);
...
...
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