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
d9909b11
Commit
d9909b11
authored
Jun 05, 2017
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_colorspace: Add support for gbr color space
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
18bca25a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
vf_colorspace.c
libavfilter/vf_colorspace.c
+12
-0
No files found.
libavfilter/vf_colorspace.c
View file @
d9909b11
...
@@ -183,6 +183,13 @@ static const double ycgco_matrix[3][3] =
...
@@ -183,6 +183,13 @@ static const double ycgco_matrix[3][3] =
{
0
.
5
,
0
,
-
0
.
5
},
{
0
.
5
,
0
,
-
0
.
5
},
};
};
static
const
double
gbr_matrix
[
3
][
3
]
=
{
{
0
,
1
,
0
},
{
0
,
-
0
.
5
,
0
.
5
},
{
0
.
5
,
-
0
.
5
,
0
},
};
/*
/*
* All constants explained in e.g. https://linuxtv.org/downloads/v4l-dvb-apis/ch02s06.html
* All constants explained in e.g. https://linuxtv.org/downloads/v4l-dvb-apis/ch02s06.html
* The older ones (bt470bg/m) are also explained in their respective ITU docs
* The older ones (bt470bg/m) are also explained in their respective ITU docs
...
@@ -196,6 +203,7 @@ static const struct LumaCoefficients luma_coefficients[AVCOL_SPC_NB] = {
...
@@ -196,6 +203,7 @@ static const struct LumaCoefficients luma_coefficients[AVCOL_SPC_NB] = {
[
AVCOL_SPC_BT709
]
=
{
0
.
2126
,
0
.
7152
,
0
.
0722
},
[
AVCOL_SPC_BT709
]
=
{
0
.
2126
,
0
.
7152
,
0
.
0722
},
[
AVCOL_SPC_SMPTE240M
]
=
{
0
.
212
,
0
.
701
,
0
.
087
},
[
AVCOL_SPC_SMPTE240M
]
=
{
0
.
212
,
0
.
701
,
0
.
087
},
[
AVCOL_SPC_YCOCG
]
=
{
0
.
25
,
0
.
5
,
0
.
25
},
[
AVCOL_SPC_YCOCG
]
=
{
0
.
25
,
0
.
5
,
0
.
25
},
[
AVCOL_SPC_RGB
]
=
{
1
,
1
,
1
},
[
AVCOL_SPC_BT2020_NCL
]
=
{
0
.
2627
,
0
.
6780
,
0
.
05
93
},
[
AVCOL_SPC_BT2020_NCL
]
=
{
0
.
2627
,
0
.
6780
,
0
.
05
93
},
[
AVCOL_SPC_BT2020_CL
]
=
{
0
.
2627
,
0
.
6780
,
0
.
05
93
},
[
AVCOL_SPC_BT2020_CL
]
=
{
0
.
2627
,
0
.
6780
,
0
.
05
93
},
};
};
...
@@ -222,6 +230,9 @@ static void fill_rgb2yuv_table(const struct LumaCoefficients *coeffs,
...
@@ -222,6 +230,9 @@ static void fill_rgb2yuv_table(const struct LumaCoefficients *coeffs,
if
(
coeffs
->
cr
==
0
.
25
&&
coeffs
->
cg
==
0
.
5
&&
coeffs
->
cb
==
0
.
25
)
{
if
(
coeffs
->
cr
==
0
.
25
&&
coeffs
->
cg
==
0
.
5
&&
coeffs
->
cb
==
0
.
25
)
{
memcpy
(
rgb2yuv
,
ycgco_matrix
,
sizeof
(
double
)
*
9
);
memcpy
(
rgb2yuv
,
ycgco_matrix
,
sizeof
(
double
)
*
9
);
return
;
return
;
}
else
if
(
coeffs
->
cr
==
1
&&
coeffs
->
cg
==
1
&&
coeffs
->
cb
==
1
)
{
memcpy
(
rgb2yuv
,
gbr_matrix
,
sizeof
(
double
)
*
9
);
return
;
}
}
rgb2yuv
[
0
][
0
]
=
coeffs
->
cr
;
rgb2yuv
[
0
][
0
]
=
coeffs
->
cr
;
...
@@ -1074,6 +1085,7 @@ static const AVOption colorspace_options[] = {
...
@@ -1074,6 +1085,7 @@ static const AVOption colorspace_options[] = {
ENUM
(
"smpte170m"
,
AVCOL_SPC_SMPTE170M
,
"csp"
),
ENUM
(
"smpte170m"
,
AVCOL_SPC_SMPTE170M
,
"csp"
),
ENUM
(
"smpte240m"
,
AVCOL_SPC_SMPTE240M
,
"csp"
),
ENUM
(
"smpte240m"
,
AVCOL_SPC_SMPTE240M
,
"csp"
),
ENUM
(
"ycgco"
,
AVCOL_SPC_YCGCO
,
"csp"
),
ENUM
(
"ycgco"
,
AVCOL_SPC_YCGCO
,
"csp"
),
ENUM
(
"gbr"
,
AVCOL_SPC_RGB
,
"csp"
),
ENUM
(
"bt2020ncl"
,
AVCOL_SPC_BT2020_NCL
,
"csp"
),
ENUM
(
"bt2020ncl"
,
AVCOL_SPC_BT2020_NCL
,
"csp"
),
{
"range"
,
"Output color range"
,
{
"range"
,
"Output color range"
,
...
...
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