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
50ec1db6
Commit
50ec1db6
authored
Jun 05, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4xm: fold last_picture lazy allocation in decode_p_frame
parent
42d73f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
4xm.c
libavcodec/4xm.c
+11
-9
No files found.
libavcodec/4xm.c
View file @
50ec1db6
...
...
@@ -394,6 +394,17 @@ static int decode_p_frame(FourXContext *f, AVFrame *frame,
uint16_t
*
src
;
unsigned
int
bitstream_size
,
bytestream_size
,
wordstream_size
,
extra
,
bytestream_offset
,
wordstream_offset
;
int
ret
;
if
(
!
f
->
last_picture
->
data
[
0
])
{
if
((
ret
=
ff_get_buffer
(
f
->
avctx
,
f
->
last_picture
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
{
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
memset
(
f
->
last_picture
->
data
[
0
],
0
,
f
->
avctx
->
height
*
FFABS
(
f
->
last_picture
->
linesize
[
0
]));
}
src
=
(
uint16_t
*
)
f
->
last_picture
->
data
[
0
];
...
...
@@ -842,15 +853,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if
((
ret
=
decode_i_frame
(
f
,
picture
,
buf
,
frame_size
))
<
0
)
return
ret
;
}
else
if
(
frame_4cc
==
AV_RL32
(
"pfrm"
)
||
frame_4cc
==
AV_RL32
(
"pfr2"
))
{
if
(
!
f
->
last_picture
->
data
[
0
])
{
if
((
ret
=
ff_get_buffer
(
avctx
,
f
->
last_picture
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
memset
(
f
->
last_picture
->
data
[
0
],
0
,
avctx
->
height
*
FFABS
(
f
->
last_picture
->
linesize
[
0
]));
}
picture
->
pict_type
=
AV_PICTURE_TYPE_P
;
if
((
ret
=
decode_p_frame
(
f
,
picture
,
buf
,
frame_size
))
<
0
)
return
ret
;
...
...
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