FFmpeg  4.3.7
Macros | Functions | Variables
qsvenc.c File Reference
#include <string.h>
#include <sys/types.h>
#include <mfx/mfxvideo.h>
#include "libavutil/common.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/mem.h"
#include "libavutil/log.h"
#include "libavutil/time.h"
#include "libavutil/imgutils.h"
#include "libavcodec/bytestream.h"
#include "avcodec.h"
#include "internal.h"
#include "packet_internal.h"
#include "qsv.h"
#include "qsv_internal.h"
#include "qsvenc.h"

Go to the source code of this file.

Macros

#define UNMATCH(x)   (param_out.mfx.x != q->param.mfx.x)
 

Functions

static const char * print_profile (mfxU16 profile)
 
static const char * print_ratecontrol (mfxU16 rc_mode)
 
static const char * print_threestate (mfxU16 val)
 
static void dump_video_param (AVCodecContext *avctx, QSVEncContext *q, mfxExtBuffer **coding_opts)
 
static int select_rc_mode (AVCodecContext *avctx, QSVEncContext *q)
 
static int check_enc_param (AVCodecContext *avctx, QSVEncContext *q)
 
static int init_video_param_jpeg (AVCodecContext *avctx, QSVEncContext *q)
 
static int init_video_param (AVCodecContext *avctx, QSVEncContext *q)
 
static int qsv_retrieve_enc_jpeg_params (AVCodecContext *avctx, QSVEncContext *q)
 
static int qsv_retrieve_enc_vp9_params (AVCodecContext *avctx, QSVEncContext *q)
 
static int qsv_retrieve_enc_params (AVCodecContext *avctx, QSVEncContext *q)
 
static int qsv_init_opaque_alloc (AVCodecContext *avctx, QSVEncContext *q)
 
static int qsvenc_init_session (AVCodecContext *avctx, QSVEncContext *q)
 
static unsigned int qsv_fifo_item_size (void)
 
static unsigned int qsv_fifo_size (const AVFifoBuffer *fifo)
 
int ff_qsv_enc_init (AVCodecContext *avctx, QSVEncContext *q)
 
static void free_encoder_ctrl_payloads (mfxEncodeCtrl *enc_ctrl)
 
static void clear_unused_frames (QSVEncContext *q)
 
static int get_free_frame (QSVEncContext *q, QSVFrame **f)
 
static int submit_frame (QSVEncContext *q, const AVFrame *frame, QSVFrame **new_frame)
 
static void print_interlace_msg (AVCodecContext *avctx, QSVEncContext *q)
 
static int encode_frame (AVCodecContext *avctx, QSVEncContext *q, const AVFrame *frame)
 
int ff_qsv_encode (AVCodecContext *avctx, QSVEncContext *q, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
int ff_qsv_enc_close (AVCodecContext *avctx, QSVEncContext *q)
 

Variables

struct {
   mfxU16   profile
 
   const char *   name
 
profile_names []
 
struct {
   mfxU16   rc_mode
 
   const char *   name
 
rc_names []
 
const AVCodecHWConfigInternalff_qsv_enc_hw_configs []
 

Macro Definition Documentation

◆ UNMATCH

#define UNMATCH (   x)    (param_out.mfx.x != q->param.mfx.x)

Referenced by check_enc_param().

Function Documentation

◆ print_profile()

static const char* print_profile ( mfxU16  profile)
static

Definition at line 74 of file qsvenc.c.

Referenced by dump_video_param().

◆ print_ratecontrol()

static const char* print_ratecontrol ( mfxU16  rc_mode)
static

Definition at line 114 of file qsvenc.c.

Referenced by dump_video_param().

◆ print_threestate()

static const char* print_threestate ( mfxU16  val)
static

Definition at line 123 of file qsvenc.c.

Referenced by dump_video_param().

◆ dump_video_param()

static void dump_video_param ( AVCodecContext avctx,
QSVEncContext q,
mfxExtBuffer **  coding_opts 
)
static

Definition at line 132 of file qsvenc.c.

Referenced by qsv_retrieve_enc_params().

◆ select_rc_mode()

static int select_rc_mode ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 300 of file qsvenc.c.

Referenced by init_video_param().

◆ check_enc_param()

static int check_enc_param ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 389 of file qsvenc.c.

Referenced by init_video_param().

◆ init_video_param_jpeg()

static int init_video_param_jpeg ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 420 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ init_video_param()

static int init_video_param ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 484 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsv_retrieve_enc_jpeg_params()

static int qsv_retrieve_enc_jpeg_params ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 818 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsv_retrieve_enc_vp9_params()

static int qsv_retrieve_enc_vp9_params ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 836 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsv_retrieve_enc_params()

static int qsv_retrieve_enc_params ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 885 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsv_init_opaque_alloc()

static int qsv_init_opaque_alloc ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 1012 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsvenc_init_session()

static int qsvenc_init_session ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 1049 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

◆ qsv_fifo_item_size()

static unsigned int qsv_fifo_item_size ( void  )
inlinestatic

Definition at line 1091 of file qsvenc.c.

Referenced by ff_qsv_enc_init(), and qsv_fifo_size().

◆ qsv_fifo_size()

static unsigned int qsv_fifo_size ( const AVFifoBuffer fifo)
inlinestatic

Definition at line 1096 of file qsvenc.c.

Referenced by ff_qsv_encode().

◆ ff_qsv_enc_init()

int ff_qsv_enc_init ( AVCodecContext avctx,
QSVEncContext q 
)

Definition at line 1101 of file qsvenc.c.

Referenced by qsv_enc_init().

◆ free_encoder_ctrl_payloads()

static void free_encoder_ctrl_payloads ( mfxEncodeCtrl *  enc_ctrl)
static

Definition at line 1236 of file qsvenc.c.

Referenced by clear_unused_frames().

◆ clear_unused_frames()

static void clear_unused_frames ( QSVEncContext q)
static

Definition at line 1247 of file qsvenc.c.

Referenced by get_free_frame().

◆ get_free_frame()

static int get_free_frame ( QSVEncContext q,
QSVFrame **  f 
)
static

Definition at line 1262 of file qsvenc.c.

Referenced by submit_frame().

◆ submit_frame()

static int submit_frame ( QSVEncContext q,
const AVFrame frame,
QSVFrame **  new_frame 
)
static

Definition at line 1302 of file qsvenc.c.

Referenced by encode_frame().

◆ print_interlace_msg()

static void print_interlace_msg ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 1381 of file qsvenc.c.

Referenced by encode_frame().

◆ encode_frame()

static int encode_frame ( AVCodecContext avctx,
QSVEncContext q,
const AVFrame frame 
)
static

Definition at line 1393 of file qsvenc.c.

Referenced by ff_qsv_encode().

◆ ff_qsv_encode()

int ff_qsv_encode ( AVCodecContext avctx,
QSVEncContext q,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)

Definition at line 1521 of file qsvenc.c.

Referenced by qsv_enc_frame().

◆ ff_qsv_enc_close()

int ff_qsv_enc_close ( AVCodecContext avctx,
QSVEncContext q 
)

Definition at line 1613 of file qsvenc.c.

Referenced by qsv_enc_close(), and qsv_enc_init().

Variable Documentation

◆ profile

mfxU16 profile

◆ name

const char* name
Examples:
ffhash.c.

Definition at line 46 of file qsvenc.c.

Referenced by add_input_streams(), add_video_device(), apply_filter(), asf_read_ext_content_desc(), asf_read_marker(), asf_read_metadata(), audio_frame_cksum(), av_dump_format(), av_get_colorspace_name(), av_isxdigit(), av_opt_next(), av_parse_video_rate(), av_pix_fmt_swap_endianness(), avf_read_header(), avi_read_nikon(), check_idct_multiple(), checkasm_check_h264pred(), choose_implementation(), choose_pix_fmts(), color_table_compare(), config_output(), configure_input_audio_filter(), configure_input_video_filter(), configure_output_audio_filter(), configure_output_video_filter(), create_filter(), decode_info_header(), eval_function(), exif_decode_tag(), ff_alsa_get_device_list(), ff_alsa_open(), ff_AMediaCodec_getName(), ff_AMediaCodecList_getCodecNameByType(), ff_ass_split_dialog2(), ff_attributes_dump(), ff_audio_data_alloc(), ff_audio_data_init(), ff_cbs_trace_syntax_element(), ff_guid_str_buf(), ff_jni_exception_get_summary(), ff_jni_init_jfields(), ff_rm_read_mdpr_codecdata(), ff_rtsp_open_transport_ctx(), ff_vk_add_descriptor_set(), ff_vk_init_shader(), find_option(), gdigrab_read_header(), get_geokey_name(), graph_insert_fifos(), graticule16_column(), graticule16_row(), graticule_column(), graticule_row(), hw_device_default_name(), hw_device_free_all(), hw_device_init_from_string(), hw_device_init_from_type(), init(), init_out(), insert_trim(), libopus_check_vorbis_layout(), libvorbis_setup(), list_voices(), main(), matroska_convert_tag(), modplug_load_metadata(), movie_common_init(), mxf_free_metadataset(), nvenc_check_device(), opt_loglevel(), parse_cookie(), parse_device_name(), parse_filter(), parse_inputs(), parse_link_name(), parse_outputs(), parse_set_cookie(), print_pkt_side_data(), read_sm_data(), read_table(), sdt_cb(), set_codec_from_probe_data(), show_colors(), show_formats_devices(), show_frame(), show_help_muxer(), show_layouts(), show_protocols(), split_commandline(), test_device_type(), usage(), write_chapter(), write_ctoc(), and wtvfile_open2().

◆ profile_names

const { ... } profile_names[]
Initial value:
= {
{ MFX_PROFILE_AVC_BASELINE, "baseline" },
{ MFX_PROFILE_AVC_MAIN, "main" },
{ MFX_PROFILE_AVC_EXTENDED, "extended" },
{ MFX_PROFILE_AVC_HIGH, "high" },
{ MFX_PROFILE_MPEG2_SIMPLE, "simple" },
{ MFX_PROFILE_MPEG2_MAIN, "main" },
{ MFX_PROFILE_MPEG2_HIGH, "high" },
{ MFX_PROFILE_VC1_SIMPLE, "simple" },
{ MFX_PROFILE_VC1_MAIN, "main" },
{ MFX_PROFILE_VC1_ADVANCED, "advanced" },
}

Referenced by print_profile().

◆ rc_mode

mfxU16 rc_mode

Definition at line 84 of file qsvenc.c.

Referenced by select_rc_mode(), and vaapi_encode_init_rate_control().

◆ rc_names

const { ... } rc_names[]
Initial value:
= {
{ MFX_RATECONTROL_CBR, "CBR" },
{ MFX_RATECONTROL_VBR, "VBR" },
{ MFX_RATECONTROL_CQP, "CQP" },
}

Referenced by print_ratecontrol().

◆ ff_qsv_enc_hw_configs

const AVCodecHWConfigInternal* ff_qsv_enc_hw_configs[]
Initial value:
= {
}
#define NULL
Definition: coverity.c:32
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_)
Definition: hwconfig.h:99
#define HW_CONFIG_ENCODER_DEVICE(format, device_type_)
Definition: hwconfig.h:96

Definition at line 1659 of file qsvenc.c.