FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
qsvenc.h File Reference
#include <stdint.h>
#include <sys/types.h>
#include <mfx/mfxvideo.h>
#include "libavutil/avutil.h"
#include "libavutil/fifo.h"
#include "avcodec.h"
#include "qsv_internal.h"

Go to the source code of this file.

Data Structures

struct  QSVEncContext
 

Macros

#define QSV_HAVE_CO2   QSV_VERSION_ATLEAST(1, 6)
 
#define QSV_HAVE_CO3   QSV_VERSION_ATLEAST(1, 11)
 
#define QSV_HAVE_TRELLIS   QSV_VERSION_ATLEAST(1, 8)
 
#define QSV_HAVE_MAX_SLICE_SIZE   QSV_VERSION_ATLEAST(1, 9)
 
#define QSV_HAVE_BREF_TYPE   QSV_VERSION_ATLEAST(1, 8)
 
#define QSV_HAVE_LA   QSV_VERSION_ATLEAST(1, 7)
 
#define QSV_HAVE_LA_DS   QSV_VERSION_ATLEAST(1, 8)
 
#define QSV_HAVE_LA_HRD   QSV_VERSION_ATLEAST(1, 11)
 
#define QSV_HAVE_AVBR   0
 
#define QSV_HAVE_ICQ   0
 
#define QSV_HAVE_VCM   0
 
#define QSV_HAVE_QVBR   0
 
#define QSV_HAVE_MF   QSV_VERSION_ATLEAST(1, 25)
 
#define MFX_LOOKAHEAD_DS_UNKNOWN   0
 
#define MFX_LOOKAHEAD_DS_OFF   0
 
#define MFX_LOOKAHEAD_DS_2x   0
 
#define MFX_LOOKAHEAD_DS_4x   0
 
#define QSV_COMMON_OPTS
 

Typedefs

typedef int SetEncodeCtrlCB (AVCodecContext *avctx, const AVFrame *frame, mfxEncodeCtrl *enc_ctrl)
 

Functions

int ff_qsv_enc_init (AVCodecContext *avctx, QSVEncContext *q)
 
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)
 

Macro Definition Documentation

#define QSV_HAVE_CO2   QSV_VERSION_ATLEAST(1, 6)

Definition at line 37 of file qsvenc.h.

Referenced by init_video_param().

#define QSV_HAVE_CO3   QSV_VERSION_ATLEAST(1, 11)

Definition at line 38 of file qsvenc.h.

#define QSV_HAVE_TRELLIS   QSV_VERSION_ATLEAST(1, 8)

Definition at line 40 of file qsvenc.h.

#define QSV_HAVE_MAX_SLICE_SIZE   QSV_VERSION_ATLEAST(1, 9)

Definition at line 41 of file qsvenc.h.

#define QSV_HAVE_BREF_TYPE   QSV_VERSION_ATLEAST(1, 8)

Definition at line 42 of file qsvenc.h.

#define QSV_HAVE_LA   QSV_VERSION_ATLEAST(1, 7)

Definition at line 44 of file qsvenc.h.

Referenced by select_rc_mode().

#define QSV_HAVE_LA_DS   QSV_VERSION_ATLEAST(1, 8)

Definition at line 45 of file qsvenc.h.

#define QSV_HAVE_LA_HRD   QSV_VERSION_ATLEAST(1, 11)

Definition at line 46 of file qsvenc.h.

Referenced by dump_video_param().

#define QSV_HAVE_AVBR   0

Definition at line 55 of file qsvenc.h.

#define QSV_HAVE_ICQ   0

Definition at line 56 of file qsvenc.h.

Referenced by select_rc_mode().

#define QSV_HAVE_VCM   0

Definition at line 57 of file qsvenc.h.

Referenced by dump_video_param(), and select_rc_mode().

#define QSV_HAVE_QVBR   0

Definition at line 58 of file qsvenc.h.

#define QSV_HAVE_MF   QSV_VERSION_ATLEAST(1, 25)

Definition at line 59 of file qsvenc.h.

#define MFX_LOOKAHEAD_DS_UNKNOWN   0

Definition at line 63 of file qsvenc.h.

#define MFX_LOOKAHEAD_DS_OFF   0

Definition at line 64 of file qsvenc.h.

Referenced by dump_video_param().

#define MFX_LOOKAHEAD_DS_2x   0

Definition at line 65 of file qsvenc.h.

Referenced by dump_video_param().

#define MFX_LOOKAHEAD_DS_4x   0

Definition at line 66 of file qsvenc.h.

Referenced by dump_video_param().

#define QSV_COMMON_OPTS
Value:
{ "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE }, \
{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, \
{ "avbr_convergence", "Convergence of the AVBR ratecontrol", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, \
{ "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, MFX_TARGETUSAGE_BEST_QUALITY, MFX_TARGETUSAGE_BEST_SPEED, VE, "preset" }, \
{ "veryfast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "faster", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_6 }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_5 }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_3 }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "slower", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_2 }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "veryslow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" }, \
{ "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "max_frame_size", "Maximum encoded frame size in bytes", OFFSET(qsv.max_frame_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, \
{ "max_slice_size", "Maximum encoded slice size in bytes", OFFSET(qsv.max_slice_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, \
{ "bitrate_limit", "Toggle bitrate limitations", OFFSET(qsv.bitrate_limit), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "mbbrc", "MB level bitrate control", OFFSET(qsv.mbbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "extbrc", "Extended bitrate control", OFFSET(qsv.extbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
#define NULL
Definition: coverity.c:32
#define VE
Definition: amfenc_h264.c:26
#define ASYNC_DEPTH_DEFAULT
Definition: qsv_internal.h:33
#define OFFSET(x)
Definition: ffmpeg_opt.c:3323

Definition at line 69 of file qsvenc.h.

Typedef Documentation

typedef int SetEncodeCtrlCB(AVCodecContext *avctx, const AVFrame *frame, mfxEncodeCtrl *enc_ctrl)

Definition at line 91 of file qsvenc.h.

Function Documentation

int ff_qsv_enc_init ( AVCodecContext avctx,
QSVEncContext q 
)

Definition at line 886 of file qsvenc.c.

Referenced by qsv_enc_init().

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

Definition at line 1291 of file qsvenc.c.

Referenced by qsv_enc_frame().

int ff_qsv_enc_close ( AVCodecContext avctx,
QSVEncContext q 
)

Definition at line 1377 of file qsvenc.c.

Referenced by qsv_enc_close(), and qsv_enc_init().