Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
f5c48f5a
Commit
f5c48f5a
authored
Jun 29, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmavoice: use init_static_data
parent
04e9853a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
wmavoice.c
libavcodec/wmavoice.c
+25
-19
No files found.
libavcodec/wmavoice.c
View file @
f5c48f5a
...
@@ -304,6 +304,20 @@ typedef struct {
...
@@ -304,6 +304,20 @@ typedef struct {
* @return 0 on success, <0 on error.
* @return 0 on success, <0 on error.
*/
*/
static
av_cold
int
decode_vbmtree
(
GetBitContext
*
gb
,
int8_t
vbm_tree
[
25
])
static
av_cold
int
decode_vbmtree
(
GetBitContext
*
gb
,
int8_t
vbm_tree
[
25
])
{
int
cntr
[
8
]
=
{
0
},
n
,
res
;
memset
(
vbm_tree
,
0xff
,
sizeof
(
vbm_tree
[
0
])
*
25
);
for
(
n
=
0
;
n
<
17
;
n
++
)
{
res
=
get_bits
(
gb
,
3
);
if
(
cntr
[
res
]
>
3
)
// should be >= 3 + (res == 7))
return
-
1
;
vbm_tree
[
res
*
3
+
cntr
[
res
]
++
]
=
n
;
}
return
0
;
}
static
av_cold
void
wmavoice_init_static_data
(
AVCodec
*
codec
)
{
{
static
const
uint8_t
bits
[]
=
{
static
const
uint8_t
bits
[]
=
{
2
,
2
,
2
,
4
,
4
,
4
,
2
,
2
,
2
,
4
,
4
,
4
,
...
@@ -320,18 +334,9 @@ static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25])
...
@@ -320,18 +334,9 @@ static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25])
0x0ffc
,
0x0ffd
,
0x0ffe
,
// 1111111111+00/01/10
0x0ffc
,
0x0ffd
,
0x0ffe
,
// 1111111111+00/01/10
0x3ffc
,
0x3ffd
,
0x3ffe
,
0x3fff
// 111111111111+xx
0x3ffc
,
0x3ffd
,
0x3ffe
,
0x3fff
// 111111111111+xx
};
};
int
cntr
[
8
]
=
{
0
},
n
,
res
;
memset
(
vbm_tree
,
0xff
,
sizeof
(
vbm_tree
[
0
])
*
25
);
for
(
n
=
0
;
n
<
17
;
n
++
)
{
res
=
get_bits
(
gb
,
3
);
if
(
cntr
[
res
]
>
3
)
// should be >= 3 + (res == 7))
return
-
1
;
vbm_tree
[
res
*
3
+
cntr
[
res
]
++
]
=
n
;
}
INIT_VLC_STATIC
(
&
frame_type_vlc
,
VLC_NBITS
,
sizeof
(
bits
),
INIT_VLC_STATIC
(
&
frame_type_vlc
,
VLC_NBITS
,
sizeof
(
bits
),
bits
,
1
,
1
,
codes
,
2
,
2
,
132
);
bits
,
1
,
1
,
codes
,
2
,
2
,
132
);
return
0
;
}
}
/**
/**
...
@@ -2047,14 +2052,15 @@ static av_cold void wmavoice_flush(AVCodecContext *ctx)
...
@@ -2047,14 +2052,15 @@ static av_cold void wmavoice_flush(AVCodecContext *ctx)
}
}
AVCodec
ff_wmavoice_decoder
=
{
AVCodec
ff_wmavoice_decoder
=
{
.
name
=
"wmavoice"
,
.
name
=
"wmavoice"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
id
=
AV_CODEC_ID_WMAVOICE
,
.
id
=
AV_CODEC_ID_WMAVOICE
,
.
priv_data_size
=
sizeof
(
WMAVoiceContext
),
.
priv_data_size
=
sizeof
(
WMAVoiceContext
),
.
init
=
wmavoice_decode_init
,
.
init
=
wmavoice_decode_init
,
.
close
=
wmavoice_decode_end
,
.
init_static_data
=
wmavoice_init_static_data
,
.
decode
=
wmavoice_decode_packet
,
.
close
=
wmavoice_decode_end
,
.
capabilities
=
CODEC_CAP_SUBFRAMES
|
CODEC_CAP_DR1
,
.
decode
=
wmavoice_decode_packet
,
.
flush
=
wmavoice_flush
,
.
capabilities
=
CODEC_CAP_SUBFRAMES
|
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Windows Media Audio Voice"
),
.
flush
=
wmavoice_flush
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Windows Media Audio Voice"
),
};
};
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