51 #define OFFSET(x) offsetof(ShowInfoContext, x)
52 #define VF AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
64 double yaw, pitch, roll;
67 if (sd->
size <
sizeof(*spherical)) {
83 yaw = ((double)spherical->
yaw) / (1 << 16);
84 pitch = ((double)spherical->
pitch) / (1 << 16);
85 roll = ((double)spherical->
roll) / (1 << 16);
105 if (sd->
size <
sizeof(*stereo)) {
120 const uint32_t *
tc = (
const uint32_t *)sd->
data;
122 if ((sd->
size !=
sizeof(uint32_t) * 4) || (
tc[0] > 3)) {
127 for (
int j = 1; j <=
tc[0]; j++) {
142 if (!roi_size || sd->
size % roi_size != 0) {
146 nb_rois = sd->
size / roi_size;
149 for (
int i = 0;
i < nb_rois;
i++) {
161 if (sd->
size <
sizeof(*mastering_display)) {
169 "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
170 "min_luminance=%f, max_luminance=%f",
187 if (sd->
size <
sizeof(*hdr_plus)) {
239 for (
int i = 0;
i < 3;
i++) {
287 "MaxCLL=%d, MaxFALL=%d",
301 int delta_qp = par->
delta_qp[plane][acdc];
304 plane, acdc, delta_qp);
312 const int uuid_size = 16;
316 if (sd->
size < uuid_size) {
323 for (
i = 0;
i < uuid_size;
i++) {
325 if (
i == 3 ||
i == 5 ||
i == 7 ||
i == 9)
331 for (;
i < sd->
size;
i++) {
374 for (
i = 0;
i <
len;
i++) {
382 const uint16_t *
src1 = (
const uint16_t *)
src;
385 for (
i = 0;
i <
len / 2;
i++) {
391 *sum2 += (uint32_t)
src1[
i] * (uint32_t)
src1[
i];
409 uint32_t plane_checksum[4] = {0},
checksum = 0;
410 int64_t sum[4] = {0}, sum2[4] = {0};
412 int bitdepth =
desc->comp[0].depth;
414 int i, plane, vsub =
desc->log2_chroma_h;
416 for (plane = 0; plane < 4 &&
s->calculate_checksums &&
frame->
data[plane] &&
frame->
linesize[plane]; plane++) {
420 int width = linesize >> (bitdepth > 8);
425 for (
i = 0;
i <
h;
i++) {
430 pixelcount[plane] +=
width;
436 "n:%4"PRId64
" pts:%7s pts_time:%-7s pos:%9"PRId64
" "
437 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c ",
448 if (
s->calculate_checksums) {
450 "checksum:%08"PRIX32
" plane_checksum:[%08"PRIX32,
461 sqrt((sum2[plane] - sum[plane]*(
double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
536 is_out ?
"out" :
"in",
580 .priv_class = &showinfo_class,
Public header for Adler-32 hash function implementation.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
static int FUNC() user_data(CodedBitstreamContext *ctx, RWContext *rw, MPEG2RawUserData *current)
#define AV_CEIL_RSHIFT(a, b)
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigned int len)
Calculate the Adler32 checksum of a buffer.
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
@ AV_FRAME_DATA_SPHERICAL
The data represents the AVSphericalMapping structure defined in libavutil/spherical....
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AV_FRAME_DATA_PANSCAN
The data is the AVPanScan struct defined in libavcodec.
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
@ AV_FRAME_DATA_VIDEO_ENC_PARAMS
Encoding parameters for a video frame, as described by AVVideoEncParams.
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
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.
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
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.
@ AV_SPHERICAL_EQUIRECTANGULAR
Video represents a sphere mapped on a flat surface using equirectangular projection.
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_range_name(enum AVColorRange range)
const char * av_color_space_name(enum AVColorSpace space)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
@ AVCOL_RANGE_UNSPECIFIED
#define FF_ARRAY_ELEMS(a)
Describe the class of an AVClass context structure.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
unsigned MaxFALL
Max average light level per frame (cd/m^2).
unsigned MaxCLL
Max content light level (cd/m^2).
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
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.
uint8_t num_cols_targeted_system_display_actual_peak_luminance
The number of columns in the targeted_system_display_actual_peak_luminance array.
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.
AVHDRPlusColorTransformParams params[3]
The color transform parameters for every processing window.
uint8_t num_rows_targeted_system_display_actual_peak_luminance
The number of rows in the targeted system_display_actual_peak_luminance array.
uint8_t application_version
Application version in the application defining document in ST-2094 suite.
AVRational targeted_system_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the targeted system display.
uint8_t num_cols_mastering_display_actual_peak_luminance
The number of columns in the mastering_display_actual_peak_luminance array.
AVRational mastering_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the mastering display used for mastering the image essence.
uint8_t num_windows
The number of processing windows.
uint8_t num_rows_mastering_display_actual_peak_luminance
The number of rows in the mastering_display_actual_peak_luminance array.
AVFilterLink ** outputs
array of pointers to output links
A link between two filters.
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
Structure to hold side data for an AVFrame.
enum AVFrameSideDataType type
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int key_frame
1 -> keyframe, 0-> not
int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
AVFrameSideData ** side_data
enum AVColorPrimaries color_primaries
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
int top_field_first
If the content is interlaced, is top field displayed first.
int interlaced_frame
The content of the picture is interlaced.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorSpace colorspace
YUV colorspace type.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
enum AVColorTransferCharacteristic color_trc
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
enum AVPictureType pict_type
Picture type of the frame.
AVRational percentile
The linearized maxRGB value at a specific percentile in the processing window in the scene.
uint8_t percentage
The percentage value corresponding to a specific percentile linearized RGB value in the processing wi...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Rational number (pair of numerator and denominator).
Structure describing a single Region Of Interest.
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
AVRational qoffset
Quantisation offset.
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
This structure describes how to handle spherical videos, outlining information about projection,...
enum AVSphericalProjection projection
Projection type.
int32_t pitch
Rotation around the right vector [-90, 90].
int32_t roll
Rotation around the forward vector [-180, 180].
int32_t yaw
Rotation around the up vector [-180, 180].
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
enum AVStereo3DType type
How views are packed within the video.
int flags
Additional information about the frame packing.
Video encoding parameters for a given frame.
int32_t delta_qp[4][2]
Quantisation parameter offset from the base (per-frame) qp for a given plane (first index) and AC/DC ...
enum AVVideoEncParamsType type
Type of the parameters (the codec they are used with).
unsigned int nb_blocks
Number of blocks in the array.
int32_t qp
Base quantisation parameter for the frame.
static volatile int checksum
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).
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.
#define AV_TIMECODE_STR_SIZE
timestamp utils, mostly useful for debugging/logging purposes
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static const AVFilterPad avfilter_vf_showinfo_outputs[]
static void dump_roi(AVFilterContext *ctx, const AVFrameSideData *sd)
static void dump_content_light_metadata(AVFilterContext *ctx, AVFrameSideData *sd)
static void dump_spherical(AVFilterContext *ctx, AVFrame *frame, const AVFrameSideData *sd)
static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSideData *sd)
static void dump_color_property(AVFilterContext *ctx, AVFrame *frame)
static const AVOption showinfo_options[]
static void update_sample_stats_16(int be, const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
static int config_props_in(AVFilterLink *link)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static void dump_s12m_timecode(AVFilterContext *ctx, AVRational frame_rate, const AVFrameSideData *sd)
static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
static void update_sample_stats(int depth, int be, const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
static void update_sample_stats_8(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
static const AVFilterPad avfilter_vf_showinfo_inputs[]
static void dump_stereo3d(AVFilterContext *ctx, const AVFrameSideData *sd)
static int config_props_out(AVFilterLink *link)
static int config_props(AVFilterContext *ctx, AVFilterLink *link, int is_out)
AVFILTER_DEFINE_CLASS(showinfo)
static void dump_video_enc_params(AVFilterContext *ctx, const AVFrameSideData *sd)
static void dump_mastering_display(AVFilterContext *ctx, const AVFrameSideData *sd)