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
cabc2938
Commit
cabc2938
authored
Jun 29, 2011
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flashsv: cosmetics: drop some unnecessary parentheses
parent
f28aaae1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
flashsv.c
libavcodec/flashsv.c
+11
-11
No files found.
libavcodec/flashsv.c
View file @
cabc2938
...
@@ -71,7 +71,7 @@ static void copy_region(uint8_t *sptr, uint8_t *dptr,
...
@@ -71,7 +71,7 @@ static void copy_region(uint8_t *sptr, uint8_t *dptr,
int
i
;
int
i
;
for
(
i
=
dx
+
h
;
i
>
dx
;
i
--
)
{
for
(
i
=
dx
+
h
;
i
>
dx
;
i
--
)
{
memcpy
(
dptr
+
(
i
*
stride
)
+
dy
*
3
,
sptr
,
w
*
3
);
memcpy
(
dptr
+
i
*
stride
+
dy
*
3
,
sptr
,
w
*
3
);
sptr
+=
w
*
3
;
sptr
+=
w
*
3
;
}
}
}
}
...
@@ -86,7 +86,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
...
@@ -86,7 +86,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
s
->
zstream
.
zalloc
=
Z_NULL
;
s
->
zstream
.
zalloc
=
Z_NULL
;
s
->
zstream
.
zfree
=
Z_NULL
;
s
->
zstream
.
zfree
=
Z_NULL
;
s
->
zstream
.
opaque
=
Z_NULL
;
s
->
zstream
.
opaque
=
Z_NULL
;
zret
=
inflateInit
(
&
(
s
->
zstream
)
);
zret
=
inflateInit
(
&
s
->
zstream
);
if
(
zret
!=
Z_OK
)
{
if
(
zret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate init error: %d
\n
"
,
zret
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate init error: %d
\n
"
,
zret
);
return
1
;
return
1
;
...
@@ -139,13 +139,13 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -139,13 +139,13 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
s
->
block_size
=
s
->
block_width
*
s
->
block_height
;
s
->
block_size
=
s
->
block_width
*
s
->
block_height
;
/* init the image size once */
/* init the image size once */
if
(
(
avctx
->
width
==
0
)
&&
(
avctx
->
height
==
0
)
)
{
if
(
avctx
->
width
==
0
&&
avctx
->
height
==
0
)
{
avctx
->
width
=
s
->
image_width
;
avctx
->
width
=
s
->
image_width
;
avctx
->
height
=
s
->
image_height
;
avctx
->
height
=
s
->
image_height
;
}
}
/* check for changes of image width and image height */
/* check for changes of image width and image height */
if
(
(
avctx
->
width
!=
s
->
image_width
)
||
(
avctx
->
height
!=
s
->
image_height
)
)
{
if
(
avctx
->
width
!=
s
->
image_width
||
avctx
->
height
!=
s
->
image_height
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Frame width or height differs from first frames!
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Frame width or height differs from first frames!
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"fh = %d, fv %d vs ch = %d, cv = %d
\n
"
,
avctx
->
height
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"fh = %d, fv %d vs ch = %d, cv = %d
\n
"
,
avctx
->
height
,
avctx
->
width
,
s
->
image_height
,
s
->
image_width
);
avctx
->
width
,
s
->
image_height
,
s
->
image_width
);
...
@@ -187,23 +187,23 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -187,23 +187,23 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
/* no change, don't do anything */
/* no change, don't do anything */
}
else
{
}
else
{
/* decompress block */
/* decompress block */
int
ret
=
inflateReset
(
&
(
s
->
zstream
)
);
int
ret
=
inflateReset
(
&
s
->
zstream
);
if
(
ret
!=
Z_OK
)
{
if
(
ret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"error in decompression (reset) of block %dx%d
\n
"
,
i
,
j
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"error in decompression (reset) of block %dx%d
\n
"
,
i
,
j
);
/* return -1; */
/* return -1; */
}
}
s
->
zstream
.
next_in
=
buf
+
(
get_bits_count
(
&
gb
)
/
8
)
;
s
->
zstream
.
next_in
=
buf
+
get_bits_count
(
&
gb
)
/
8
;
s
->
zstream
.
avail_in
=
size
;
s
->
zstream
.
avail_in
=
size
;
s
->
zstream
.
next_out
=
s
->
tmpblock
;
s
->
zstream
.
next_out
=
s
->
tmpblock
;
s
->
zstream
.
avail_out
=
s
->
block_size
*
3
;
s
->
zstream
.
avail_out
=
s
->
block_size
*
3
;
ret
=
inflate
(
&
(
s
->
zstream
)
,
Z_FINISH
);
ret
=
inflate
(
&
s
->
zstream
,
Z_FINISH
);
if
(
ret
==
Z_DATA_ERROR
)
{
if
(
ret
==
Z_DATA_ERROR
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Zlib resync occurred
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Zlib resync occurred
\n
"
);
inflateSync
(
&
(
s
->
zstream
)
);
inflateSync
(
&
s
->
zstream
);
ret
=
inflate
(
&
(
s
->
zstream
)
,
Z_FINISH
);
ret
=
inflate
(
&
s
->
zstream
,
Z_FINISH
);
}
}
if
(
(
ret
!=
Z_OK
)
&&
(
ret
!=
Z_STREAM_END
)
)
{
if
(
ret
!=
Z_OK
&&
ret
!=
Z_STREAM_END
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"error in decompression of block %dx%d: %d
\n
"
,
i
,
j
,
ret
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"error in decompression of block %dx%d: %d
\n
"
,
i
,
j
,
ret
);
/* return -1; */
/* return -1; */
}
}
...
@@ -229,7 +229,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -229,7 +229,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
static
av_cold
int
flashsv_decode_end
(
AVCodecContext
*
avctx
)
static
av_cold
int
flashsv_decode_end
(
AVCodecContext
*
avctx
)
{
{
FlashSVContext
*
s
=
avctx
->
priv_data
;
FlashSVContext
*
s
=
avctx
->
priv_data
;
inflateEnd
(
&
(
s
->
zstream
)
);
inflateEnd
(
&
s
->
zstream
);
/* release the frame if needed */
/* release the frame if needed */
if
(
s
->
frame
.
data
[
0
])
if
(
s
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
...
...
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