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
1b092258
Commit
1b092258
authored
Jul 18, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/bink: add 'k' version support
parent
251329fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
bink.c
libavcodec/bink.c
+21
-0
No files found.
libavcodec/bink.c
View file @
1b092258
...
...
@@ -371,11 +371,19 @@ static const uint8_t bink_rlelens[4] = { 4, 8, 12, 32 };
static
int
read_block_types
(
AVCodecContext
*
avctx
,
GetBitContext
*
gb
,
Bundle
*
b
)
{
BinkContext
*
const
c
=
avctx
->
priv_data
;
int
t
,
v
;
int
last
=
0
;
const
uint8_t
*
dec_end
;
CHECK_READ_VAL
(
gb
,
b
,
t
);
if
(
c
->
version
==
'k'
)
{
t
^=
0xBBu
;
if
(
t
==
0
)
{
b
->
cur_dec
=
NULL
;
return
0
;
}
}
dec_end
=
b
->
cur_dec
+
t
;
if
(
dec_end
>
b
->
data_end
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Too many block type values
\n
"
);
...
...
@@ -994,6 +1002,17 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
int
bw
=
is_chroma
?
(
c
->
avctx
->
width
+
15
)
>>
4
:
(
c
->
avctx
->
width
+
7
)
>>
3
;
int
bh
=
is_chroma
?
(
c
->
avctx
->
height
+
15
)
>>
4
:
(
c
->
avctx
->
height
+
7
)
>>
3
;
int
width
=
c
->
avctx
->
width
>>
is_chroma
;
int
height
=
c
->
avctx
->
height
>>
is_chroma
;
if
(
c
->
version
==
'k'
&&
get_bits1
(
gb
))
{
int
fill
=
get_bits
(
gb
,
8
);
dst
=
frame
->
data
[
plane_idx
];
for
(
i
=
0
;
i
<
height
;
i
++
)
memset
(
dst
+
i
*
stride
,
fill
,
width
);
goto
end
;
}
init_lengths
(
c
,
FFMAX
(
width
,
8
),
bw
);
for
(
i
=
0
;
i
<
BINK_NB_SRC
;
i
++
)
...
...
@@ -1190,6 +1209,8 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
}
}
}
end:
if
(
get_bits_count
(
gb
)
&
0x1F
)
//next plane data starts at 32-bit boundary
skip_bits_long
(
gb
,
32
-
(
get_bits_count
(
gb
)
&
0x1F
));
...
...
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