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
33329c6e
Commit
33329c6e
authored
Nov 09, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avs: use the AVFrame API properly.
parent
6139f481
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
avs.c
libavcodec/avs.c
+13
-8
No files found.
libavcodec/avs.c
View file @
33329c6e
...
...
@@ -25,7 +25,7 @@
typedef
struct
{
AVFrame
pictur
e
;
AVFrame
*
fram
e
;
}
AvsContext
;
typedef
enum
{
...
...
@@ -52,7 +52,7 @@ avs_decode_frame(AVCodecContext * avctx,
int
buf_size
=
avpkt
->
size
;
AvsContext
*
const
avs
=
avctx
->
priv_data
;
AVFrame
*
picture
=
data
;
AVFrame
*
const
p
=
&
avs
->
pictur
e
;
AVFrame
*
const
p
=
avs
->
fram
e
;
const
uint8_t
*
table
,
*
vect
;
uint8_t
*
out
;
int
i
,
j
,
x
,
y
,
stride
,
ret
,
vect_w
=
3
,
vect_h
=
3
;
...
...
@@ -67,8 +67,8 @@ avs_decode_frame(AVCodecContext * avctx,
p
->
pict_type
=
AV_PICTURE_TYPE_P
;
p
->
key_frame
=
0
;
out
=
avs
->
picture
.
data
[
0
];
stride
=
avs
->
picture
.
linesize
[
0
];
out
=
p
->
data
[
0
];
stride
=
p
->
linesize
[
0
];
if
(
buf_end
-
buf
<
4
)
return
AVERROR_INVALIDDATA
;
...
...
@@ -78,7 +78,7 @@ avs_decode_frame(AVCodecContext * avctx,
if
(
type
==
AVS_PALETTE
)
{
int
first
,
last
;
uint32_t
*
pal
=
(
uint32_t
*
)
avs
->
picture
.
data
[
1
];
uint32_t
*
pal
=
(
uint32_t
*
)
p
->
data
[
1
];
first
=
AV_RL16
(
buf
);
last
=
first
+
AV_RL16
(
buf
+
2
);
...
...
@@ -149,7 +149,7 @@ avs_decode_frame(AVCodecContext * avctx,
align_get_bits
(
&
change_map
);
}
if
((
ret
=
av_frame_ref
(
picture
,
&
avs
->
picture
))
<
0
)
if
((
ret
=
av_frame_ref
(
picture
,
p
))
<
0
)
return
ret
;
*
got_frame
=
1
;
...
...
@@ -159,16 +159,21 @@ avs_decode_frame(AVCodecContext * avctx,
static
av_cold
int
avs_decode_init
(
AVCodecContext
*
avctx
)
{
AvsContext
*
s
=
avctx
->
priv_data
;
s
->
frame
=
av_frame_alloc
();
if
(
!
s
->
frame
)
return
AVERROR
(
ENOMEM
);
avctx
->
pix_fmt
=
AV_PIX_FMT_PAL8
;
ff_set_dimensions
(
avctx
,
318
,
198
);
avcodec_get_frame_defaults
(
&
s
->
picture
);
return
0
;
}
static
av_cold
int
avs_decode_end
(
AVCodecContext
*
avctx
)
{
AvsContext
*
s
=
avctx
->
priv_data
;
av_frame_
unref
(
&
s
->
pictur
e
);
av_frame_
free
(
&
s
->
fram
e
);
return
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