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
afa61290
Commit
afa61290
authored
Mar 22, 2012
by
Michael Niedermayer
Committed by
Diego Biurrun
Mar 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zerocodec: factorize loop
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
4094fc99
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
32 deletions
+13
-32
zerocodec.c
libavcodec/zerocodec.c
+13
-32
No files found.
libavcodec/zerocodec.c
View file @
afa61290
...
...
@@ -62,50 +62,31 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
*/
if
(
avpkt
->
flags
&
AV_PKT_FLAG_KEY
)
{
pic
->
key_frame
=
1
;
pic
->
pict_type
=
AV_PICTURE_TYPE_I
;
for
(
i
=
0
;
i
<
avctx
->
height
;
i
++
)
{
zstream
->
next_out
=
dst
;
zstream
->
avail_out
=
avctx
->
width
<<
1
;
zret
=
inflate
(
zstream
,
Z_SYNC_FLUSH
);
if
(
zret
!=
Z_OK
&&
zret
!=
Z_STREAM_END
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate failed with return code: %d
\n
"
,
zret
);
return
AVERROR
(
EINVAL
);
}
dst
+=
pic
->
linesize
[
0
];
}
}
else
{
pic
->
key_frame
=
0
;
pic
->
pict_type
=
AV_PICTURE_TYPE_P
;
}
for
(
i
=
0
;
i
<
avctx
->
height
;
i
++
)
{
zstream
->
next_out
=
dst
;
zstream
->
avail_out
=
avctx
->
width
<<
1
;
zret
=
inflate
(
zstream
,
Z_SYNC_FLUSH
);
if
(
zret
!=
Z_OK
&&
zret
!=
Z_STREAM_END
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate failed with return code: %d
\n
"
,
zret
);
return
AVERROR
(
EINVAL
);
}
if
(
!
(
avpkt
->
flags
&
AV_PKT_FLAG_KEY
))
for
(
j
=
0
;
j
<
avctx
->
width
<<
1
;
j
++
)
dst
[
j
]
+=
prev
[
j
]
&
-!
dst
[
j
];
prev
+=
prev_pic
->
linesize
[
0
];
dst
+=
pic
->
linesize
[
0
];
}
}
/* Release the previous buffer if need be */
if
(
prev_pic
->
data
[
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