FFmpeg  4.4.9
Macros | Functions
encode.h File Reference
#include "libavutil/frame.h"
#include "avcodec.h"
#include "packet.h"

Go to the source code of this file.

Macros

#define FF_MATRIX_TYPE_INTRA   (1U << 0)
 Check if the elements of codec context matrices (intra_matrix, inter_matrix or chroma_intra_matrix) are within the specified range. More...
 
#define FF_MATRIX_TYPE_INTER   (1U << 1)
 
#define FF_MATRIX_TYPE_CHROMA_INTRA   (1U << 2)
 

Functions

int ff_encode_get_frame (AVCodecContext *avctx, AVFrame *frame)
 Called by encoders to get the next frame for encoding. More...
 
int ff_get_encode_buffer (AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
 Get a buffer for a packet. More...
 
int ff_encode_preinit (AVCodecContext *avctx)
 
int ff_check_codec_matrices (AVCodecContext *avctx, unsigned types, uint16_t min, uint16_t max)
 

Macro Definition Documentation

◆ FF_MATRIX_TYPE_INTRA

#define FF_MATRIX_TYPE_INTRA   (1U << 0)

Check if the elements of codec context matrices (intra_matrix, inter_matrix or chroma_intra_matrix) are within the specified range.

Definition at line 57 of file encode.h.

◆ FF_MATRIX_TYPE_INTER

#define FF_MATRIX_TYPE_INTER   (1U << 1)

Definition at line 58 of file encode.h.

◆ FF_MATRIX_TYPE_CHROMA_INTRA

#define FF_MATRIX_TYPE_CHROMA_INTRA   (1U << 2)

Definition at line 59 of file encode.h.

Function Documentation

◆ ff_encode_get_frame()

int ff_encode_get_frame ( AVCodecContext *  avctx,
AVFrame *  frame 
)

Called by encoders to get the next frame for encoding.

Parameters
frameAn empty frame to be filled with data.
Returns
0 if a new reference has been successfully written to frame AVERROR(EAGAIN) if no data is currently available AVERROR_EOF if end of stream has been reached, so no more data will be available

Definition at line 162 of file encode.c.

Referenced by eb_receive_packet(), encode_simple_internal(), ff_amf_receive_packet(), ff_nvenc_receive_packet(), ff_vaapi_encode_receive_packet(), librav1e_receive_packet(), mf_receive_packet(), and v4l2_receive_packet().

◆ ff_get_encode_buffer()

int ff_get_encode_buffer ( AVCodecContext *  avctx,
AVPacket *  avpkt,
int64_t  size,
int  flags 
)

Get a buffer for a packet.

This is a wrapper around AVCodecContext.get_encode_buffer() and should be used instead calling get_encode_buffer() directly.

Definition at line 82 of file encode.c.

Referenced by amf_copy_buffer(), librav1e_receive_packet(), mf_sample_to_avpacket(), process_output_surface(), and vaapi_encode_output().

◆ ff_encode_preinit()

int ff_encode_preinit ( AVCodecContext *  avctx)

Definition at line 546 of file encode.c.

Referenced by avcodec_open2().

◆ ff_check_codec_matrices()

int ff_check_codec_matrices ( AVCodecContext *  avctx,
unsigned  types,
uint16_t  min,
uint16_t  max 
)

Definition at line 703 of file encode.c.

Referenced by encode_picture(), and ff_mpv_encode_init().