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
51915cfa
Commit
51915cfa
authored
Jun 29, 2011
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flashsv: inline copy_region() into flashsv_decode_frame()
parent
49049956
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
flashsv.c
libavcodec/flashsv.c
+11
-16
No files found.
libavcodec/flashsv.c
View file @
51915cfa
...
@@ -49,18 +49,6 @@ typedef struct FlashSVContext {
...
@@ -49,18 +49,6 @@ typedef struct FlashSVContext {
}
FlashSVContext
;
}
FlashSVContext
;
static
void
copy_region
(
uint8_t
*
sptr
,
uint8_t
*
dptr
,
int
dx
,
int
dy
,
int
h
,
int
w
,
int
stride
)
{
int
i
;
for
(
i
=
dx
+
h
;
i
>
dx
;
i
--
)
{
memcpy
(
dptr
+
i
*
stride
+
dy
*
3
,
sptr
,
w
*
3
);
sptr
+=
w
*
3
;
}
}
static
av_cold
int
flashsv_decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
flashsv_decode_init
(
AVCodecContext
*
avctx
)
{
{
FlashSVContext
*
s
=
avctx
->
priv_data
;
FlashSVContext
*
s
=
avctx
->
priv_data
;
...
@@ -171,6 +159,8 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -171,6 +159,8 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
/* skip unchanged blocks, which have size 0 */
/* skip unchanged blocks, which have size 0 */
if
(
size
)
{
if
(
size
)
{
/* decompress block */
/* decompress block */
uint8_t
*
line
=
s
->
tmpblock
;
int
k
;
int
ret
=
inflateReset
(
&
s
->
zstream
);
int
ret
=
inflateReset
(
&
s
->
zstream
);
if
(
ret
!=
Z_OK
)
{
if
(
ret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
@@ -193,10 +183,15 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -193,10 +183,15 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
"error in decompression of block %dx%d: %d
\n
"
,
i
,
j
,
ret
);
"error in decompression of block %dx%d: %d
\n
"
,
i
,
j
,
ret
);
/* return -1; */
/* return -1; */
}
}
copy_region
(
s
->
tmpblock
,
s
->
frame
.
data
[
0
],
/* Flash Screen Video stores the image upside down, so copy
s
->
image_height
-
(
y_pos
+
cur_blk_height
+
1
),
* lines to destination in reverse order. */
x_pos
,
cur_blk_height
,
cur_blk_width
,
for
(
k
=
1
;
k
<=
cur_blk_height
;
k
++
)
{
s
->
frame
.
linesize
[
0
]);
memcpy
(
s
->
frame
.
data
[
0
]
+
x_pos
*
3
+
(
s
->
image_height
-
y_pos
-
k
)
*
s
->
frame
.
linesize
[
0
],
line
,
cur_blk_width
*
3
);
/* advance source pointer to next line */
line
+=
cur_blk_width
*
3
;
}
skip_bits_long
(
&
gb
,
8
*
size
);
/* skip the consumed bits */
skip_bits_long
(
&
gb
,
8
*
size
);
/* skip the consumed bits */
}
}
}
}
...
...
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