FFmpeg
Data Structures | Enumerations | Functions
video_hint.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "libavutil/avassert.h"
#include "libavutil/frame.h"

Go to the source code of this file.

Data Structures

struct  AVVideoRect
 Copyright 2023 Elias Carotti <eliascrt at amazon dot it> More...
 
struct  AVVideoHint
 

Enumerations

enum  AVVideoHintType { AV_VIDEO_HINT_TYPE_CONSTANT, AV_VIDEO_HINT_TYPE_CHANGED }
 

Functions

static av_always_inline AVVideoRectav_video_hint_rects (const AVVideoHint *hints)
 
static av_always_inline AVVideoRectav_video_hint_get_rect (const AVVideoHint *hints, size_t idx)
 
AVVideoHintav_video_hint_alloc (size_t nb_rects, size_t *out_size)
 Allocate memory for the AVVideoHint struct along with an nb_rects-sized arrays of AVVideoRect. More...
 
AVVideoHintav_video_hint_create_side_data (AVFrame *frame, size_t nb_rects)
 Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. More...
 

Enumeration Type Documentation

◆ AVVideoHintType

Enumerator
AV_VIDEO_HINT_TYPE_CONSTANT 
AV_VIDEO_HINT_TYPE_CHANGED 

Definition at line 34 of file video_hint.h.

Function Documentation

◆ av_video_hint_rects()

static av_always_inline AVVideoRect* av_video_hint_rects ( const AVVideoHint hints)
static

Definition at line 67 of file video_hint.h.

Referenced by setup_mb_info().

◆ av_video_hint_get_rect()

static av_always_inline AVVideoRect* av_video_hint_get_rect ( const AVVideoHint hints,
size_t  idx 
)
static

Definition at line 72 of file video_hint.h.

◆ av_video_hint_alloc()

AVVideoHint* av_video_hint_alloc ( size_t  nb_rects,
size_t *  out_size 
)

Allocate memory for the AVVideoHint struct along with an nb_rects-sized arrays of AVVideoRect.

The side data contains a list of rectangles for the portions of the frame which changed from the last encoded one (and the remainder are assumed to be changed), or, alternately (depending on the type parameter) the unchanged ones (and the remanining ones are those which changed). Macroblocks will thus be hinted either to be P_SKIP-ped or go through the regular encoding procedure.

It's responsibility of the caller to fill the AVRects accordingly, and to set the proper AVVideoHintType field.

Parameters
out_sizeif non-NULL, the size in bytes of the resulting data array is written here
Returns
newly allocated AVVideoHint struct (must be freed by the caller using av_free()) on success, NULL on memory allocation failure

Definition at line 29 of file video_hint.c.

Referenced by av_video_hint_create_side_data().

◆ av_video_hint_create_side_data()

AVVideoHint* av_video_hint_create_side_data ( AVFrame frame,
size_t  nb_rects 
)

Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame.

Definition at line 58 of file video_hint.c.