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
12461636
Commit
12461636
authored
Dec 26, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/magicyuv: export colorspace and color_range for YUV
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
67db4ff3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
magicyuv.c
libavcodec/magicyuv.c
+16
-2
No files found.
libavcodec/magicyuv.c
View file @
12461636
...
...
@@ -57,6 +57,8 @@ typedef struct MagicYUVContext {
int
nb_slices
;
int
planes
;
// number of encoded planes in bitstream
int
decorrelate
;
// postprocessing work
int
color_matrix
;
// video color matrix
int
flags
;
int
interlaced
;
// video is interlaced
uint8_t
*
buf
;
// pointer to AVPacket->data
int
hshift
[
4
];
...
...
@@ -568,8 +570,10 @@ static int magy_decode_frame(AVCodecContext *avctx, void *data,
}
s
->
planes
=
av_pix_fmt_count_planes
(
avctx
->
pix_fmt
);
bytestream2_skip
(
&
gbyte
,
2
);
s
->
interlaced
=
!!
(
bytestream2_get_byte
(
&
gbyte
)
&
2
);
bytestream2_skip
(
&
gbyte
,
1
);
s
->
color_matrix
=
bytestream2_get_byte
(
&
gbyte
);
s
->
flags
=
bytestream2_get_byte
(
&
gbyte
);
s
->
interlaced
=
!!
(
s
->
flags
&
2
);
bytestream2_skip
(
&
gbyte
,
3
);
width
=
bytestream2_get_le32
(
&
gbyte
);
...
...
@@ -659,6 +663,16 @@ static int magy_decode_frame(AVCodecContext *avctx, void *data,
avctx
->
pix_fmt
==
AV_PIX_FMT_GBRAP10
)
{
FFSWAP
(
uint8_t
*
,
p
->
data
[
0
],
p
->
data
[
1
]);
FFSWAP
(
int
,
p
->
linesize
[
0
],
p
->
linesize
[
1
]);
}
else
{
switch
(
s
->
color_matrix
)
{
case
1
:
p
->
colorspace
=
AVCOL_SPC_BT470BG
;
break
;
case
2
:
p
->
colorspace
=
AVCOL_SPC_BT709
;
break
;
}
p
->
color_range
=
(
s
->
flags
&
4
)
?
AVCOL_RANGE_JPEG
:
AVCOL_RANGE_MPEG
;
}
*
got_frame
=
1
;
...
...
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