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
12e9bf3e
Commit
12e9bf3e
authored
Jul 15, 2011
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flashsvenc: merge variable declarations and initializations
parent
b88523c2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
flashsvenc.c
libavcodec/flashsvenc.c
+3
-10
No files found.
libavcodec/flashsvenc.c
View file @
12e9bf3e
...
@@ -164,9 +164,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
...
@@ -164,9 +164,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
int
wp
=
i
*
block_width
;
// vertical position in frame
int
wp
=
i
*
block_width
;
// vertical position in frame
int
ws
=
(
i
<
h_blocks
)
?
block_width
:
h_part
;
// size of block
int
ws
=
(
i
<
h_blocks
)
?
block_width
:
h_part
;
// size of block
int
ret
=
Z_OK
;
int
ret
=
Z_OK
;
uint8_t
*
ptr
;
uint8_t
*
ptr
=
buf
+
buf_pos
;
ptr
=
buf
+
buf_pos
;
/* copy the block to the temp buffer before compression
/* copy the block to the temp buffer before compression
* (if it differs from the previous frame's block) */
* (if it differs from the previous frame's block) */
...
@@ -175,11 +173,9 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
...
@@ -175,11 +173,9 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
wp
,
hs
,
ws
,
p
->
linesize
[
0
],
previous_frame
);
wp
,
hs
,
ws
,
p
->
linesize
[
0
],
previous_frame
);
if
(
res
||
*
I_frame
)
{
if
(
res
||
*
I_frame
)
{
unsigned
long
zsize
;
unsigned
long
zsize
=
3
*
block_width
*
block_height
;
zsize
=
3
*
block_width
*
block_height
;
ret
=
compress2
(
ptr
+
2
,
&
zsize
,
s
->
tmpblock
,
3
*
ws
*
hs
,
9
);
ret
=
compress2
(
ptr
+
2
,
&
zsize
,
s
->
tmpblock
,
3
*
ws
*
hs
,
9
);
//ret = deflateReset(&s->zstream);
//ret = deflateReset(&s->zstream);
if
(
ret
!=
Z_OK
)
if
(
ret
!=
Z_OK
)
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
...
@@ -214,7 +210,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
...
@@ -214,7 +210,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
uint8_t
*
pfptr
;
uint8_t
*
pfptr
;
int
res
;
int
res
;
int
I_frame
=
0
;
int
I_frame
=
0
;
int
opt_w
,
opt_h
;
int
opt_w
=
4
,
opt_h
=
4
;
*
p
=
*
pict
;
*
p
=
*
pict
;
...
@@ -240,9 +236,6 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
...
@@ -240,9 +236,6 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
}
}
}
}
opt_w
=
4
;
opt_h
=
4
;
if
(
buf_size
<
s
->
image_width
*
s
->
image_height
*
3
)
{
if
(
buf_size
<
s
->
image_width
*
s
->
image_height
*
3
)
{
//Conservative upper bound check for compressed data
//Conservative upper bound check for compressed data
av_log
(
avctx
,
AV_LOG_ERROR
,
"buf_size %d < %d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"buf_size %d < %d
\n
"
,
...
...
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