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
388b4cf8
Commit
388b4cf8
authored
Feb 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vc1: factor read_bfraction() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f4b288a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
vc1.c
libavcodec/vc1.c
+14
-8
No files found.
libavcodec/vc1.c
View file @
388b4cf8
...
...
@@ -613,6 +613,12 @@ static void rotate_luts(VC1Context *v)
*
v
->
curr_use_ic
=
0
;
}
static
int
read_bfraction
(
VC1Context
*
v
,
GetBitContext
*
gb
)
{
v
->
bfraction_lut_index
=
get_vlc2
(
gb
,
ff_vc1_bfraction_vlc
.
table
,
VC1_BFRACTION_VLC_BITS
,
1
);
v
->
bfraction
=
ff_vc1_bfraction_lut
[
v
->
bfraction_lut_index
];
return
0
;
}
int
ff_vc1_parse_frame_header
(
VC1Context
*
v
,
GetBitContext
*
gb
)
{
int
pqindex
,
lowquant
,
status
;
...
...
@@ -644,8 +650,8 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v
->
bi_type
=
0
;
if
(
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_B
)
{
v
->
bfraction_lut_index
=
get_vlc2
(
gb
,
ff_vc1_bfraction_vlc
.
table
,
VC1_BFRACTION_VLC_BITS
,
1
);
v
->
bfraction
=
ff_vc1_bfraction_lut
[
v
->
bfraction_lut_index
]
;
if
(
read_bfraction
(
v
,
gb
)
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
v
->
bfraction
==
0
)
{
v
->
s
.
pict_type
=
AV_PICTURE_TYPE_BI
;
}
...
...
@@ -928,8 +934,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v
->
refdist
+=
get_unary
(
gb
,
0
,
16
);
}
if
((
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_B
)
||
(
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_BI
))
{
v
->
bfraction_lut_index
=
get_vlc2
(
gb
,
ff_vc1_bfraction_vlc
.
table
,
VC1_BFRACTION_VLC_BITS
,
1
);
v
->
bfraction
=
ff_vc1_bfraction_lut
[
v
->
bfraction_lut_index
]
;
if
(
read_bfraction
(
v
,
gb
)
<
0
)
return
AVERROR_INVALIDDATA
;
v
->
frfd
=
(
v
->
bfraction
*
v
->
refdist
)
>>
8
;
v
->
brfd
=
v
->
refdist
-
v
->
frfd
-
1
;
if
(
v
->
brfd
<
0
)
...
...
@@ -941,8 +947,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if
(
v
->
finterpflag
)
v
->
interpfrm
=
get_bits1
(
gb
);
if
(
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_B
)
{
v
->
bfraction_lut_index
=
get_vlc2
(
gb
,
ff_vc1_bfraction_vlc
.
table
,
VC1_BFRACTION_VLC_BITS
,
1
);
v
->
bfraction
=
ff_vc1_bfraction_lut
[
v
->
bfraction_lut_index
]
;
if
(
read_bfraction
(
v
,
gb
)
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
v
->
bfraction
==
0
)
{
v
->
s
.
pict_type
=
AV_PICTURE_TYPE_BI
;
/* XXX: should not happen here */
}
...
...
@@ -1186,8 +1192,8 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
break
;
case
AV_PICTURE_TYPE_B
:
if
(
v
->
fcm
==
ILACE_FRAME
)
{
v
->
bfraction_lut_index
=
get_vlc2
(
gb
,
ff_vc1_bfraction_vlc
.
table
,
VC1_BFRACTION_VLC_BITS
,
1
);
v
->
bfraction
=
ff_vc1_bfraction_lut
[
v
->
bfraction_lut_index
]
;
if
(
read_bfraction
(
v
,
gb
)
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
v
->
bfraction
==
0
)
{
return
-
1
;
}
...
...
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