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
4a64e679
Commit
4a64e679
authored
Oct 29, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flashsv: Refactor a little
parent
50aef03b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
flashsv.c
libavcodec/flashsv.c
+9
-5
No files found.
libavcodec/flashsv.c
View file @
4a64e679
...
...
@@ -197,12 +197,15 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
s
->
blocks
[
blk_idx
].
pos
=
s
->
keyframedata
+
(
get_bits_count
(
gb
)
/
8
);
s
->
blocks
[
blk_idx
].
size
=
block_size
;
}
y_pos
+=
s
->
diff_start
;
if
(
!
s
->
color_depth
)
{
/* Flash Screen Video stores the image upside down, so copy
* lines to destination in reverse order. */
for
(
k
=
1
;
k
<=
s
->
diff_height
;
k
++
)
{
memcpy
(
s
->
frame
.
data
[
0
]
+
x_pos
*
3
+
(
s
->
image_height
-
y_pos
-
s
->
diff_start
-
k
)
*
s
->
frame
.
linesize
[
0
],
(
s
->
image_height
-
y_pos
-
k
)
*
s
->
frame
.
linesize
[
0
],
line
,
width
*
3
);
/* advance source pointer to next line */
line
+=
width
*
3
;
...
...
@@ -210,7 +213,7 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
}
else
{
/* hybrid 15-bit/palette mode */
decode_hybrid
(
s
->
tmpblock
,
s
->
frame
.
data
[
0
],
s
->
image_height
-
(
y_pos
+
1
+
s
->
diff_
start
+
s
->
diff_
height
),
s
->
image_height
-
(
y_pos
+
1
+
s
->
diff_height
),
x_pos
,
s
->
diff_height
,
width
,
s
->
frame
.
linesize
[
0
],
s
->
pal
);
}
...
...
@@ -409,10 +412,11 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
int
k
;
int
off
=
(
s
->
image_height
-
y_pos
-
1
)
*
s
->
frame
.
linesize
[
0
];
for
(
k
=
0
;
k
<
cur_blk_height
;
k
++
)
memcpy
(
s
->
frame
.
data
[
0
]
+
off
-
k
*
s
->
frame
.
linesize
[
0
]
+
x_pos
*
3
,
s
->
keyframe
+
off
-
k
*
s
->
frame
.
linesize
[
0
]
+
x_pos
*
3
,
for
(
k
=
0
;
k
<
cur_blk_height
;
k
++
)
{
int
x
=
off
-
k
*
s
->
frame
.
linesize
[
0
]
+
x_pos
*
3
;
memcpy
(
s
->
frame
.
data
[
0
]
+
x
,
s
->
keyframe
+
x
,
cur_blk_width
*
3
);
}
}
/* skip unchanged blocks, which have size 0 */
...
...
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