Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
6792559f
Commit
6792559f
authored
Nov 09, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vc1: use the AVFrame API properly.
parent
042aec41
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
vc1.h
libavcodec/vc1.h
+1
-1
vc1dec.c
libavcodec/vc1dec.c
+10
-6
No files found.
libavcodec/vc1.h
View file @
6792559f
...
...
@@ -380,7 +380,7 @@ typedef struct VC1Context{
//@{
int
new_sprite
;
int
two_sprites
;
AVFrame
sprite_output_frame
;
AVFrame
*
sprite_output_frame
;
int
output_width
,
output_height
,
sprite_width
,
sprite_height
;
uint8_t
*
sr_rows
[
2
][
2
];
///< Sprite resizer line cache
//@}
...
...
libavcodec/vc1dec.c
View file @
6792559f
...
...
@@ -5364,8 +5364,8 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
int
width
=
v
->
output_width
>>!!
plane
;
for
(
row
=
0
;
row
<
v
->
output_height
>>!!
plane
;
row
++
)
{
uint8_t
*
dst
=
v
->
sprite_output_frame
.
data
[
plane
]
+
v
->
sprite_output_frame
.
linesize
[
plane
]
*
row
;
uint8_t
*
dst
=
v
->
sprite_output_frame
->
data
[
plane
]
+
v
->
sprite_output_frame
->
linesize
[
plane
]
*
row
;
for
(
sprite
=
0
;
sprite
<=
v
->
two_sprites
;
sprite
++
)
{
uint8_t
*
iplane
=
s
->
current_picture
.
f
.
data
[
plane
];
...
...
@@ -5455,8 +5455,8 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
v
->
two_sprites
=
0
;
}
av_frame_unref
(
&
v
->
sprite_output_frame
);
if
(
ff_get_buffer
(
avctx
,
&
v
->
sprite_output_frame
,
0
)
<
0
)
{
av_frame_unref
(
v
->
sprite_output_frame
);
if
(
ff_get_buffer
(
avctx
,
v
->
sprite_output_frame
,
0
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
}
...
...
@@ -5673,6 +5673,10 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
v
->
res_sprite
=
(
avctx
->
codec_id
==
AV_CODEC_ID_VC1IMAGE
);
}
v
->
sprite_output_frame
=
av_frame_alloc
();
if
(
!
v
->
sprite_output_frame
)
return
AVERROR
(
ENOMEM
);
avctx
->
profile
=
v
->
profile
;
if
(
v
->
profile
==
PROFILE_ADVANCED
)
avctx
->
level
=
v
->
level
;
...
...
@@ -5714,7 +5718,7 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
VC1Context
*
v
=
avctx
->
priv_data
;
int
i
;
av_frame_
unref
(
&
v
->
sprite_output_frame
);
av_frame_
free
(
&
v
->
sprite_output_frame
);
for
(
i
=
0
;
i
<
4
;
i
++
)
av_freep
(
&
v
->
sr_rows
[
i
>>
1
][
i
&
1
]);
...
...
@@ -6085,7 +6089,7 @@ image:
if
(
vc1_decode_sprites
(
v
,
&
s
->
gb
))
goto
err
;
#endif
if
((
ret
=
av_frame_ref
(
pict
,
&
v
->
sprite_output_frame
))
<
0
)
if
((
ret
=
av_frame_ref
(
pict
,
v
->
sprite_output_frame
))
<
0
)
goto
err
;
*
got_frame
=
1
;
}
else
{
...
...
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