Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
d3441694
Commit
d3441694
authored
Feb 28, 2022
by
Limin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: support for CUVA HDR Vivid metadata
Signed-off-by:
Limin Wang
<
lance.lmwang@gmail.com
>
parent
5cd3c83a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
vf_showinfo.c
libavfilter/vf_showinfo.c
+87
-0
No files found.
libavfilter/vf_showinfo.c
View file @
d3441694
...
...
@@ -32,6 +32,7 @@
#include "libavutil/internal.h"
#include "libavutil/film_grain_params.h"
#include "libavutil/hdr_dynamic_metadata.h"
#include "libavutil/hdr_dynamic_vivid_metadata.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/spherical.h"
...
...
@@ -307,6 +308,89 @@ static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
}
}
static
void
dump_dynamic_hdr_vivid
(
AVFilterContext
*
ctx
,
AVFrameSideData
*
sd
)
{
AVDynamicHDRVivid
*
hdr_vivid
;
av_log
(
ctx
,
AV_LOG_INFO
,
"HDR Vivid metadata: "
);
if
(
sd
->
size
<
sizeof
(
*
hdr_vivid
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"invalid hdr vivid data
\n
"
);
return
;
}
hdr_vivid
=
(
AVDynamicHDRVivid
*
)
sd
->
data
;
av_log
(
ctx
,
AV_LOG_INFO
,
"system_start_code: %d, "
,
hdr_vivid
->
system_start_code
);
av_log
(
ctx
,
AV_LOG_INFO
,
"num_windows: %d, "
,
hdr_vivid
->
num_windows
);
for
(
int
w
=
0
;
w
<
hdr_vivid
->
num_windows
;
w
++
)
{
const
AVHDRVividColorTransformParams
*
params
=
&
hdr_vivid
->
params
[
w
];
av_log
(
ctx
,
AV_LOG_INFO
,
"minimum_maxrgb[%d]: %.4f, "
,
w
,
av_q2d
(
params
->
minimum_maxrgb
));
av_log
(
ctx
,
AV_LOG_INFO
,
"average_maxrgb[%d]: %.4f, "
,
w
,
av_q2d
(
params
->
average_maxrgb
));
av_log
(
ctx
,
AV_LOG_INFO
,
"variance_maxrgb[%d]:%.4f, "
,
w
,
av_q2d
(
params
->
variance_maxrgb
));
av_log
(
ctx
,
AV_LOG_INFO
,
"maximum_maxrgb[%d]: %.4f, "
,
w
,
av_q2d
(
params
->
maximum_maxrgb
));
}
for
(
int
w
=
0
;
w
<
hdr_vivid
->
num_windows
;
w
++
)
{
const
AVHDRVividColorTransformParams
*
params
=
&
hdr_vivid
->
params
[
w
];
av_log
(
ctx
,
AV_LOG_INFO
,
"tone_mapping_mode_flag[%d]: %d, "
,
w
,
params
->
tone_mapping_mode_flag
);
av_log
(
ctx
,
AV_LOG_INFO
,
"tone_mapping_param_num[%d]: %d, "
,
w
,
params
->
tone_mapping_param_num
);
if
(
params
->
tone_mapping_mode_flag
)
{
for
(
int
i
=
0
;
i
<
params
->
tone_mapping_param_num
;
i
++
)
{
const
AVHDRVividColorToneMappingParams
*
tm_params
=
&
params
->
tm_params
[
i
];
av_log
(
ctx
,
AV_LOG_INFO
,
"targeted_system_display_maximum_luminance[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
targeted_system_display_maximum_luminance
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_enable_flag[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
base_enable_flag
);
if
(
tm_params
->
base_enable_flag
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_m_p[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_m_p
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_m_m[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_m_m
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_m_a[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_m_a
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_m_b[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_m_b
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_m_n[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_m_n
));
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_k1[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
base_param_k1
);
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_k2[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
base_param_k2
);
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_k3[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
base_param_k3
);
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_Delta_enable_mode[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
base_param_Delta_enable_mode
);
av_log
(
ctx
,
AV_LOG_INFO
,
"base_param_Delta[%d][%d]: %.4f, "
,
w
,
i
,
av_q2d
(
tm_params
->
base_param_Delta
));
}
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_enable_flag[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
three_Spline_enable_flag
);
if
(
tm_params
->
three_Spline_enable_flag
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_TH_mode[%d][%d]: %d, "
,
w
,
i
,
tm_params
->
three_Spline_TH_mode
);
for
(
int
j
=
0
;
j
<
tm_params
->
three_Spline_num
;
j
++
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_TH_enable_MB[%d][%d][%d]: %.4f, "
,
w
,
i
,
j
,
av_q2d
(
tm_params
->
three_Spline_TH_enable_MB
));
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_TH_enable[%d][%d][%d]: %.4f, "
,
w
,
i
,
j
,
av_q2d
(
tm_params
->
three_Spline_TH_enable
));
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_TH_Delta1[%d][%d][%d]: %.4f, "
,
w
,
i
,
j
,
av_q2d
(
tm_params
->
three_Spline_TH_Delta1
));
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_TH_Delta2[%d][%d][%d]: %.4f, "
,
w
,
i
,
j
,
av_q2d
(
tm_params
->
three_Spline_TH_Delta2
));
av_log
(
ctx
,
AV_LOG_INFO
,
"3Spline_enable_Strength[%d][%d][%d]: %.4f, "
,
w
,
i
,
j
,
av_q2d
(
tm_params
->
three_Spline_enable_Strength
));
}
}
}
}
av_log
(
ctx
,
AV_LOG_INFO
,
"color_saturation_mapping_flag[%d]: %d"
,
w
,
params
->
color_saturation_mapping_flag
);
if
(
params
->
color_saturation_mapping_flag
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
", color_saturation_num[%d]: %d"
,
w
,
params
->
color_saturation_num
);
for
(
int
i
=
0
;
i
<
params
->
color_saturation_num
;
i
++
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
", color_saturation_gain[%d][%d]: %.4f"
,
w
,
i
,
av_q2d
(
params
->
color_saturation_gain
[
i
]));
}
}
}
}
static
void
dump_content_light_metadata
(
AVFilterContext
*
ctx
,
AVFrameSideData
*
sd
)
{
const
AVContentLightMetadata
*
metadata
=
(
const
AVContentLightMetadata
*
)
sd
->
data
;
...
...
@@ -704,6 +788,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
case
AV_FRAME_DATA_DYNAMIC_HDR_PLUS
:
dump_dynamic_hdr_plus
(
ctx
,
sd
);
break
;
case
AV_FRAME_DATA_DYNAMIC_HDR_VIVID
:
dump_dynamic_hdr_vivid
(
ctx
,
sd
);
break
;
case
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
:
dump_content_light_metadata
(
ctx
,
sd
);
break
;
...
...
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