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
f78172b2
Commit
f78172b2
authored
May 21, 2019
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libdav1d: add support for RGB streams
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
7458fa11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
libdav1d.c
libavcodec/libdav1d.c
+12
-1
No files found.
libavcodec/libdav1d.c
View file @
f78172b2
...
...
@@ -49,6 +49,10 @@ static const enum AVPixelFormat pix_fmt[][3] = {
[
DAV1D_PIXEL_LAYOUT_I444
]
=
{
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUV444P10
,
AV_PIX_FMT_YUV444P12
},
};
static
const
enum
AVPixelFormat
pix_fmt_rgb
[
3
]
=
{
AV_PIX_FMT_GBRP
,
AV_PIX_FMT_GBRP10
,
AV_PIX_FMT_GBRP12
,
};
static
void
libdav1d_log_callback
(
void
*
opaque
,
const
char
*
fmt
,
va_list
vl
)
{
AVCodecContext
*
c
=
opaque
;
...
...
@@ -225,7 +229,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
c
->
profile
=
p
->
seq_hdr
->
profile
;
c
->
level
=
((
p
->
seq_hdr
->
operating_points
[
0
].
major_level
-
2
)
<<
2
)
|
p
->
seq_hdr
->
operating_points
[
0
].
minor_level
;
frame
->
format
=
c
->
pix_fmt
=
pix_fmt
[
p
->
p
.
layout
][
p
->
seq_hdr
->
hbd
];
frame
->
width
=
p
->
p
.
w
;
frame
->
height
=
p
->
p
.
h
;
if
(
c
->
width
!=
p
->
p
.
w
||
c
->
height
!=
p
->
p
.
h
)
{
...
...
@@ -247,6 +250,14 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
frame
->
color_trc
=
c
->
color_trc
=
(
enum
AVColorTransferCharacteristic
)
p
->
seq_hdr
->
trc
;
frame
->
color_range
=
c
->
color_range
=
p
->
seq_hdr
->
color_range
?
AVCOL_RANGE_JPEG
:
AVCOL_RANGE_MPEG
;
if
(
p
->
p
.
layout
==
DAV1D_PIXEL_LAYOUT_I444
&&
p
->
seq_hdr
->
mtrx
==
DAV1D_MC_IDENTITY
&&
p
->
seq_hdr
->
pri
==
DAV1D_COLOR_PRI_BT709
&&
p
->
seq_hdr
->
trc
==
DAV1D_TRC_SRGB
)
frame
->
format
=
c
->
pix_fmt
=
pix_fmt_rgb
[
p
->
seq_hdr
->
hbd
];
else
frame
->
format
=
c
->
pix_fmt
=
pix_fmt
[
p
->
p
.
layout
][
p
->
seq_hdr
->
hbd
];
// match timestamps and packet size
frame
->
pts
=
frame
->
best_effort_timestamp
=
p
->
m
.
timestamp
;
#if FF_API_PKT_PTS
...
...
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