Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Samuel Mira
ffmpeg
Commits
3c16f9eb
Commit
3c16f9eb
authored
2 years ago
by
Paul B Mahol
Browse files
Options
Downloads
Patches
Plain Diff
avcodec/qoidec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
parent
f21899db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/qoidec.c
+8
-5
8 additions, 5 deletions
libavcodec/qoidec.c
with
8 additions
and
5 deletions
libavcodec/qoidec.c
+
8
−
5
View file @
3c16f9eb
...
@@ -28,19 +28,18 @@
...
@@ -28,19 +28,18 @@
static
int
qoi_decode_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
static
int
qoi_decode_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
int
*
got_frame
,
AVPacket
*
avpkt
)
int
*
got_frame
,
AVPacket
*
avpkt
)
{
{
const
uint8_t
*
buf
=
avpkt
->
data
;
int
ret
,
buf_size
=
avpkt
->
size
;
int
width
,
height
,
channels
,
space
,
run
=
0
;
int
width
,
height
,
channels
,
space
,
run
=
0
;
uint8_t
index
[
64
][
4
]
=
{
0
};
uint8_t
index
[
64
][
4
]
=
{
0
};
uint8_t
px
[
4
]
=
{
0
,
0
,
0
,
255
};
uint8_t
px
[
4
]
=
{
0
,
0
,
0
,
255
};
GetByteContext
gb
;
GetByteContext
gb
;
uint8_t
*
dst
;
uint8_t
*
dst
;
uint64_t
len
;
uint64_t
len
;
int
ret
;
if
(
buf_
size
<
20
)
if
(
avpkt
->
size
<
20
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
bytestream2_init
(
&
gb
,
buf
,
buf_
size
);
bytestream2_init
(
&
gb
,
avpkt
->
data
,
avpkt
->
size
);
bytestream2_skip
(
&
gb
,
4
);
bytestream2_skip
(
&
gb
,
4
);
width
=
bytestream2_get_be32
(
&
gb
);
width
=
bytestream2_get_be32
(
&
gb
);
height
=
bytestream2_get_be32
(
&
gb
);
height
=
bytestream2_get_be32
(
&
gb
);
...
@@ -61,6 +60,9 @@ static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p,
...
@@ -61,6 +60,9 @@ static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p,
default:
return
AVERROR_INVALIDDATA
;
default:
return
AVERROR_INVALIDDATA
;
}
}
if
(
avctx
->
skip_frame
>=
AVDISCARD_ALL
)
return
avpkt
->
size
;
if
((
ret
=
ff_thread_get_buffer
(
avctx
,
p
,
0
))
<
0
)
if
((
ret
=
ff_thread_get_buffer
(
avctx
,
p
,
0
))
<
0
)
return
ret
;
return
ret
;
...
@@ -109,7 +111,7 @@ static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p,
...
@@ -109,7 +111,7 @@ static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p,
*
got_frame
=
1
;
*
got_frame
=
1
;
return
buf_
size
;
return
avpkt
->
size
;
}
}
const
FFCodec
ff_qoi_decoder
=
{
const
FFCodec
ff_qoi_decoder
=
{
...
@@ -118,5 +120,6 @@ const FFCodec ff_qoi_decoder = {
...
@@ -118,5 +120,6 @@ const FFCodec ff_qoi_decoder = {
.
p
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
p
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
p
.
id
=
AV_CODEC_ID_QOI
,
.
p
.
id
=
AV_CODEC_ID_QOI
,
.
p
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_FRAME_THREADS
,
.
p
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_FRAME_THREADS
,
.
caps_internal
=
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
,
FF_CODEC_DECODE_CB
(
qoi_decode_frame
),
FF_CODEC_DECODE_CB
(
qoi_decode_frame
),
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment