Go to the documentation of this file.
54 #define OFFSET(x) offsetof(ShowInfoContext, x)
55 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
67 double yaw, pitch, roll;
70 if (sd->
size <
sizeof(*spherical)) {
86 yaw = ((double)spherical->
yaw) / (1 << 16);
87 pitch = ((double)spherical->
pitch) / (1 << 16);
88 roll = ((double)spherical->
roll) / (1 << 16);
108 if (sd->
size <
sizeof(*stereo)) {
123 const uint32_t *
tc = (
const uint32_t *)sd->
data;
125 if ((sd->
size !=
sizeof(uint32_t) * 4) || (
tc[0] > 3)) {
130 for (
int j = 1; j <=
tc[0]; j++) {
145 if (!roi_size || sd->
size % roi_size != 0) {
149 nb_rois = sd->
size / roi_size;
152 for (
int i = 0;
i < nb_rois;
i++) {
166 nb_bboxes =
header->nb_bboxes;
170 for (
int i = 0;
i < nb_bboxes;
i++) {
172 av_log(
ctx,
AV_LOG_INFO,
"index: %d,\tregion: (%d, %d) -> (%d, %d), label: %s, confidence: %d/%d.\n",
173 i, bbox->
x, bbox->
y, bbox->
x + bbox->
w, bbox->
y + bbox->
h,
189 if (sd->
size <
sizeof(*mastering_display)) {
197 "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
198 "min_luminance=%f, max_luminance=%f",
215 if (sd->
size <
sizeof(*hdr_plus)) {
267 for (
int i = 0;
i < 3;
i++) {
315 "MaxCLL=%d, MaxFALL=%d",
329 int delta_qp = par->
delta_qp[plane][acdc];
332 plane, acdc, delta_qp);
340 const int uuid_size = 16;
344 if (sd->
size < uuid_size) {
346 "UUID(%d-bytes))\n", sd->
size, uuid_size);
352 for (
i = 0;
i < uuid_size;
i++) {
354 if (
i == 3 ||
i == 5 ||
i == 7 ||
i == 9)
360 for (;
i < sd->
size;
i++) {
369 const char *
const film_grain_type_names[] = {
398 av_log(
ctx,
AV_LOG_INFO,
"color_primaries=%s; ", color_primaries_str ? color_primaries_str :
"unknown");
404 for (
int c = 0;
c < 3;
c++)
412 for (
int c = 0;
c < 3;
c++) {
445 av_log(
ctx,
AV_LOG_INFO,
"chroma_resampling_explicit_filter_flag=%"PRIu8
"; ", hdr->chroma_resampling_explicit_filter_flag);
453 av_log(
ctx,
AV_LOG_INFO,
"spatial_resampling_filter_flag=%"PRIu8
"; ", hdr->spatial_resampling_filter_flag);
454 av_log(
ctx,
AV_LOG_INFO,
"el_spatial_resampling_filter_flag=%"PRIu8
"; ", hdr->el_spatial_resampling_filter_flag);
465 for (
int c = 0;
c < 3;
c++) {
495 for (
int j = 0; j < curve->
mmr_order[
i]; j++) {
496 for (
int k = 0; k < 7; k++)
516 for (
int i = 0;
i < 9;
i++)
519 for (
int i = 0;
i < 3;
i++)
522 for (
int i = 0;
i < 9;
i++)
574 for (
i = 0;
i <
len;
i++) {
582 const uint16_t *
src1 = (
const uint16_t *)
src;
585 for (
i = 0;
i <
len / 2;
i++) {
586 if ((HAVE_BIGENDIAN && !
be) || (!HAVE_BIGENDIAN &&
be)) {
591 *sum2 += (uint32_t)
src1[
i] * (uint32_t)
src1[
i];
609 uint32_t plane_checksum[4] = {0},
checksum = 0;
610 int64_t sum[4] = {0}, sum2[4] = {0};
612 int bitdepth =
desc->comp[0].depth;
614 int i, plane, vsub =
desc->log2_chroma_h;
616 for (plane = 0; plane < 4 &&
s->calculate_checksums &&
frame->data[plane] &&
frame->linesize[plane]; plane++) {
620 int width = linesize >> (bitdepth > 8);
625 for (
i = 0;
i <
h;
i++) {
630 pixelcount[plane] +=
width;
636 "n:%4"PRId64
" pts:%7s pts_time:%-7s pos:%9"PRId64
" "
637 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c ",
641 frame->sample_aspect_ratio.num,
frame->sample_aspect_ratio.den,
643 !
frame->interlaced_frame ?
'P' :
644 frame->top_field_first ?
'T' :
'B',
648 if (
s->calculate_checksums) {
650 "checksum:%08"PRIX32
" plane_checksum:[%08"PRIX32,
653 for (plane = 1; plane < 4 &&
frame->data[plane] &&
frame->linesize[plane]; plane++)
656 for (plane = 0; plane < 4 &&
frame->data[plane] &&
frame->linesize[plane]; plane++)
659 for (plane = 0; plane < 4 &&
frame->data[plane] &&
frame->linesize[plane]; plane++)
661 sqrt((sum2[plane] - sum[plane]*(
double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
666 for (
i = 0;
i <
frame->nb_side_data;
i++) {
746 is_out ?
"out" :
"in",
748 link->frame_rate.num,
link->frame_rate.den);
788 .priv_class = &showinfo_class,
int32_t qp
Base quantisation parameter for the frame.
static void dump_detection_bbox(AVFilterContext *ctx, const AVFrameSideData *sd)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it be(in the first position) for now. Options ------- Then comes the options array. This is what will define the user accessible options. For example
AVHDRPlusColorTransformParams params[3]
The color transform parameters for every processing window.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_TIMECODE_STR_SIZE
enum AVDOVINLQMethod nlq_method_idc
static void dump_spherical(AVFilterContext *ctx, AVFrame *frame, const AVFrameSideData *sd)
enum AVSphericalProjection projection
Projection type.
static void update_sample_stats(int depth, int be, const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
AVRational percentile
The linearized maxRGB value at a specific percentile in the processing window in the scene.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
enum AVColorSpace color_space
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
static int config_props_out(AVFilterLink *link)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
@ AV_FRAME_DATA_FILM_GRAIN_PARAMS
Film grain parameters for a frame, described by AVFilmGrainParams.
int blending_mode_id
Specifies the blending mode used to blend the simulated film grain with the decoded images.
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
unsigned MaxCLL
Max content light level (cd/m^2).
This structure describes decoded (raw) audio or video data.
static const AVFilterPad avfilter_vf_showinfo_inputs[]
int64_t mmr_coef[AV_DOVI_MAX_PIECES][3][7]
uint8_t num_cols_targeted_system_display_actual_peak_luminance
The number of columns in the targeted_system_display_actual_peak_luminance array.
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
enum AVDOVIMappingMethod mapping_idc[AV_DOVI_MAX_PIECES]
enum AVColorRange color_range
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
const char * name
Filter name.
uint8_t mapping_color_space
static void dump_color_property(AVFilterContext *ctx, AVFrame *frame)
@ AV_SPHERICAL_EQUIRECTANGULAR
Video represents a sphere mapped on a flat surface using equirectangular projection.
A link between two filters.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
const char * av_color_space_name(enum AVColorSpace space)
char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]
Detect result with confidence.
int32_t delta_qp[4][2]
Quantisation parameter offset from the base (per-frame) qp for a given plane (first index) and AC/DC ...
static void dump_s12m_timecode(AVFilterContext *ctx, AVRational frame_rate, const AVFrameSideData *sd)
Video encoding parameters for a given frame.
AVFILTER_DEFINE_CLASS(showinfo)
A filter pad used for either input or output.
uint8_t intensity_interval_upper_bound[3][256]
Specifies the upper bound of each intensity interval for which the set of model values applies for th...
int bit_depth_luma
Specifies the bit depth used for the luma component.
static av_always_inline AVDetectionBBox * av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
static int config_props_in(AVFilterLink *link)
Structure describing a single Region Of Interest.
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
uint8_t mmr_order[AV_DOVI_MAX_PIECES]
#define AV_CEIL_RSHIFT(a, b)
AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY]
static double av_q2d(AVRational a)
Convert an AVRational to a double.
AVRational targeted_system_display_maximum_luminance
The nominal maximum display luminance of the targeted system display, in units of 0....
uint8_t mastering_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bitstreams conforming to this version of this Specification.
enum AVVideoEncParamsType type
Type of the parameters (the codec they are used with).
static void dump_dovi_metadata(AVFilterContext *ctx, const AVFrameSideData *sd)
int16_t comp_model_value[3][256][6]
Specifies the model values for the component for each intensity interval.
@ AV_FILM_GRAIN_PARAMS_NONE
#define FILTER_INPUTS(array)
static void dump_mastering_display(AVFilterContext *ctx, const AVFrameSideData *sd)
uint8_t poly_order[AV_DOVI_MAX_PIECES]
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
int flags
Additional information about the frame packing.
uint8_t percentage
The percentage value corresponding to a specific percentile linearized RGB value in the processing wi...
int model_id
Specifies the film grain simulation mode.
uint64_t linear_deadzone_threshold
const char * av_color_range_name(enum AVColorRange range)
static int config_props(AVFilterContext *ctx, AVFilterLink *link, int is_out)
uint8_t application_version
Application version in the application defining document in ST-2094 suite.
@ AV_FRAME_DATA_SPHERICAL
The data represents the AVSphericalMapping structure defined in libavutil/spherical....
Describe the class of an AVClass context structure.
const AVFilter ff_vf_showinfo
Rational number (pair of numerator and denominator).
static void dump_roi(AVFilterContext *ctx, const AVFrameSideData *sd)
char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
static void dump_video_enc_params(AVFilterContext *ctx, const AVFrameSideData *sd)
static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSideData *sd)
int64_t mmr_constant[AV_DOVI_MAX_PIECES]
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AVCOL_RANGE_UNSPECIFIED
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
uint8_t num_rows_mastering_display_actual_peak_luminance
The number of rows in the mastering_display_actual_peak_luminance array.
static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_FRAME_DATA_PANSCAN
The data is the AVPanScan struct defined in libavcodec.
int component_model_present[3]
Indicates if the modelling of film grain for a given component is present.
uint8_t num_windows
The number of processing windows.
static const AVOption showinfo_options[]
AVRational mastering_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the mastering display used for mastering the image essence.
AVRational time_base
Time base for the timestamps in this frame.
This structure describes how to handle film grain synthesis in video for specific codecs.
static int FUNC() user_data(CodedBitstreamContext *ctx, RWContext *rw, MPEG2RawUserData *current)
unsigned int nb_blocks
Number of blocks in the array.
static const uint8_t header[24]
uint32_t padding
Number of pixels to pad from the edge of each cube face.
int64_t poly_coef[AV_DOVI_MAX_PIECES][3]
static void dump_sei_film_grain_params_metadata(AVFilterContext *ctx, const AVFrameSideData *sd)
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
static void update_sample_stats_16(int be, const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
#define AV_LOG_INFO
Standard information.
uint8_t num_rows_targeted_system_display_actual_peak_luminance
The number of rows in the targeted system_display_actual_peak_luminance array.
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
Compute the size of an image line with format pix_fmt and width width for the plane plane.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
int32_t roll
Rotation around the forward vector [-180, 180].
static void dump_content_light_metadata(AVFilterContext *ctx, AVFrameSideData *sd)
#define i(width, name, range_min, range_max)
char * av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
Get the timecode string from the SMPTE timecode format.
This structure describes how to handle film grain synthesis for codecs using the ITU-T H....
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
uint16_t num_intensity_intervals[3]
Specifies the number of intensity intervals for which a specific set of model values has been estimat...
uint32_t num_y_partitions
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
const char * name
Pad name.
Coefficients of the non-linear inverse quantization.
enum AVColorPrimaries color_primaries
static const AVFilterPad avfilter_vf_showinfo_outputs[]
uint8_t intensity_interval_lower_bound[3][256]
Specifies the lower ounds of each intensity interval for whichthe set of model values applies for the...
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
AVDOVIReshapingCurve curves[3]
uint64_t linear_deadzone_slope
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int32_t pitch
Rotation around the right vector [-90, 90].
enum AVStereo3DType type
How views are packed within the video.
static void dump_stereo3d(AVFilterContext *ctx, const AVFrameSideData *sd)
static volatile int checksum
AVRational detect_confidence
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
char * av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit)
Get the timecode string from the 25-bit timecode format (MPEG GOP format).
uint8_t mapping_chroma_format_idc
@ AV_FILM_GRAIN_PARAMS_H274
The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
uint8_t targeted_system_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bit streams conforming to this version of this Specification.
static void update_sample_stats_8(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
@ AV_FRAME_DATA_VIDEO_ENC_PARAMS
Encoding parameters for a video frame, as described by AVVideoEncParams.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
int x
Distance in pixels from the left/top edge of the frame, together with width and height,...
enum AVFrameSideDataType type
int log2_scale_factor
Specifies a scale factor used in the film grain characterization equations.
uint8_t num_model_values[3]
Specifies the number of model values present for each intensity interval in which the film grain has ...
enum AVColorTransferCharacteristic color_trc
Structure to hold side data for an AVFrame.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
unsigned MaxFALL
Max average light level per frame (cd/m^2).
uint16_t pivots[AV_DOVI_MAX_PIECES+1]
#define FILTER_OUTPUTS(array)
AVRational targeted_system_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the targeted system display.
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
#define flags(name, subs,...)
int bit_depth_chroma
Specifies the bit depth used for the chroma components.
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
AVRational qoffset
Quantisation offset.
Dolby Vision RPU data mapping parameters.
This structure describes how to handle spherical videos, outlining information about projection,...
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
int32_t yaw
Rotation around the up vector [-180, 180].
@ AV_FRAME_DATA_DETECTION_BBOXES
Bounding boxes for object detection and classification, as described by AVDetectionBBoxHeader.
uint8_t num_cols_mastering_display_actual_peak_luminance
The number of columns in the mastering_display_actual_peak_luminance array.
uint32_t num_x_partitions
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.