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
8e4cadea
Commit
8e4cadea
authored
Apr 14, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Nov 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truespeech: Convert to the new bitstream reader
parent
0ac07d0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
43 deletions
+45
-43
truespeech.c
libavcodec/truespeech.c
+45
-43
No files found.
libavcodec/truespeech.c
View file @
8e4cadea
...
@@ -21,12 +21,14 @@
...
@@ -21,12 +21,14 @@
#include "libavutil/channel_layout.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "avcodec.h"
#include "bitstream.h"
#include "bswapdsp.h"
#include "bswapdsp.h"
#include "get_bits.h"
#include "internal.h"
#include "internal.h"
#include "truespeech_data.h"
#include "truespeech_data.h"
/**
/**
* @file
* @file
* TrueSpeech decoder.
* TrueSpeech decoder.
...
@@ -77,50 +79,50 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
...
@@ -77,50 +79,50 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
static
void
truespeech_read_frame
(
TSContext
*
dec
,
const
uint8_t
*
input
)
static
void
truespeech_read_frame
(
TSContext
*
dec
,
const
uint8_t
*
input
)
{
{
GetBitContext
gb
;
BitstreamContext
bc
;
dec
->
bdsp
.
bswap_buf
((
uint32_t
*
)
dec
->
buffer
,
(
const
uint32_t
*
)
input
,
8
);
dec
->
bdsp
.
bswap_buf
((
uint32_t
*
)
dec
->
buffer
,
(
const
uint32_t
*
)
input
,
8
);
init_get_bits
(
&
gb
,
dec
->
buffer
,
32
*
8
);
bitstream_init
(
&
bc
,
dec
->
buffer
,
32
*
8
);
dec
->
vector
[
7
]
=
ts_codebook
[
7
][
get_bits
(
&
gb
,
3
)];
dec
->
vector
[
7
]
=
ts_codebook
[
7
][
bitstream_read
(
&
bc
,
3
)];
dec
->
vector
[
6
]
=
ts_codebook
[
6
][
get_bits
(
&
gb
,
3
)];
dec
->
vector
[
6
]
=
ts_codebook
[
6
][
bitstream_read
(
&
bc
,
3
)];
dec
->
vector
[
5
]
=
ts_codebook
[
5
][
get_bits
(
&
gb
,
3
)];
dec
->
vector
[
5
]
=
ts_codebook
[
5
][
bitstream_read
(
&
bc
,
3
)];
dec
->
vector
[
4
]
=
ts_codebook
[
4
][
get_bits
(
&
gb
,
4
)];
dec
->
vector
[
4
]
=
ts_codebook
[
4
][
bitstream_read
(
&
bc
,
4
)];
dec
->
vector
[
3
]
=
ts_codebook
[
3
][
get_bits
(
&
gb
,
4
)];
dec
->
vector
[
3
]
=
ts_codebook
[
3
][
bitstream_read
(
&
bc
,
4
)];
dec
->
vector
[
2
]
=
ts_codebook
[
2
][
get_bits
(
&
gb
,
4
)];
dec
->
vector
[
2
]
=
ts_codebook
[
2
][
bitstream_read
(
&
bc
,
4
)];
dec
->
vector
[
1
]
=
ts_codebook
[
1
][
get_bits
(
&
gb
,
5
)];
dec
->
vector
[
1
]
=
ts_codebook
[
1
][
bitstream_read
(
&
bc
,
5
)];
dec
->
vector
[
0
]
=
ts_codebook
[
0
][
get_bits
(
&
gb
,
5
)];
dec
->
vector
[
0
]
=
ts_codebook
[
0
][
bitstream_read
(
&
bc
,
5
)];
dec
->
flag
=
get_bits1
(
&
gb
);
dec
->
flag
=
bitstream_read_bit
(
&
bc
);
dec
->
offset1
[
0
]
=
get_bits
(
&
gb
,
4
)
<<
4
;
dec
->
offset1
[
0
]
=
bitstream_read
(
&
bc
,
4
)
<<
4
;
dec
->
offset2
[
3
]
=
get_bits
(
&
gb
,
7
);
dec
->
offset2
[
3
]
=
bitstream_read
(
&
bc
,
7
);
dec
->
offset2
[
2
]
=
get_bits
(
&
gb
,
7
);
dec
->
offset2
[
2
]
=
bitstream_read
(
&
bc
,
7
);
dec
->
offset2
[
1
]
=
get_bits
(
&
gb
,
7
);
dec
->
offset2
[
1
]
=
bitstream_read
(
&
bc
,
7
);
dec
->
offset2
[
0
]
=
get_bits
(
&
gb
,
7
);
dec
->
offset2
[
0
]
=
bitstream_read
(
&
bc
,
7
);
dec
->
offset1
[
1
]
=
get_bits
(
&
gb
,
4
);
dec
->
offset1
[
1
]
=
bitstream_read
(
&
bc
,
4
);
dec
->
pulseval
[
1
]
=
get_bits
(
&
gb
,
14
);
dec
->
pulseval
[
1
]
=
bitstream_read
(
&
bc
,
14
);
dec
->
pulseval
[
0
]
=
get_bits
(
&
gb
,
14
);
dec
->
pulseval
[
0
]
=
bitstream_read
(
&
bc
,
14
);
dec
->
offset1
[
1
]
|=
get_bits
(
&
gb
,
4
)
<<
4
;
dec
->
offset1
[
1
]
|=
bitstream_read
(
&
bc
,
4
)
<<
4
;
dec
->
pulseval
[
3
]
=
get_bits
(
&
gb
,
14
);
dec
->
pulseval
[
3
]
=
bitstream_read
(
&
bc
,
14
);
dec
->
pulseval
[
2
]
=
get_bits
(
&
gb
,
14
);
dec
->
pulseval
[
2
]
=
bitstream_read
(
&
bc
,
14
);
dec
->
offset1
[
0
]
|=
get_bits1
(
&
gb
);
dec
->
offset1
[
0
]
|=
bitstream_read_bit
(
&
bc
);
dec
->
pulsepos
[
0
]
=
get_bits_long
(
&
gb
,
27
);
dec
->
pulsepos
[
0
]
=
bitstream_read
(
&
bc
,
27
);
dec
->
pulseoff
[
0
]
=
get_bits
(
&
gb
,
4
);
dec
->
pulseoff
[
0
]
=
bitstream_read
(
&
bc
,
4
);
dec
->
offset1
[
0
]
|=
get_bits1
(
&
gb
)
<<
1
;
dec
->
offset1
[
0
]
|=
bitstream_read_bit
(
&
bc
)
<<
1
;
dec
->
pulsepos
[
1
]
=
get_bits_long
(
&
gb
,
27
);
dec
->
pulsepos
[
1
]
=
bitstream_read
(
&
bc
,
27
);
dec
->
pulseoff
[
1
]
=
get_bits
(
&
gb
,
4
);
dec
->
pulseoff
[
1
]
=
bitstream_read
(
&
bc
,
4
);
dec
->
offset1
[
0
]
|=
get_bits1
(
&
gb
)
<<
2
;
dec
->
offset1
[
0
]
|=
bitstream_read_bit
(
&
bc
)
<<
2
;
dec
->
pulsepos
[
2
]
=
get_bits_long
(
&
gb
,
27
);
dec
->
pulsepos
[
2
]
=
bitstream_read
(
&
bc
,
27
);
dec
->
pulseoff
[
2
]
=
get_bits
(
&
gb
,
4
);
dec
->
pulseoff
[
2
]
=
bitstream_read
(
&
bc
,
4
);
dec
->
offset1
[
0
]
|=
get_bits1
(
&
gb
)
<<
3
;
dec
->
offset1
[
0
]
|=
bitstream_read_bit
(
&
bc
)
<<
3
;
dec
->
pulsepos
[
3
]
=
get_bits_long
(
&
gb
,
27
);
dec
->
pulsepos
[
3
]
=
bitstream_read
(
&
bc
,
27
);
dec
->
pulseoff
[
3
]
=
get_bits
(
&
gb
,
4
);
dec
->
pulseoff
[
3
]
=
bitstream_read
(
&
bc
,
4
);
}
}
static
void
truespeech_correlate_filter
(
TSContext
*
dec
)
static
void
truespeech_correlate_filter
(
TSContext
*
dec
)
...
...
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