FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "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_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 []
 

Macro Definition Documentation

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

Referenced by check_enc_param().

Function Documentation

static const char* print_profile ( mfxU16  profile)
static

Definition at line 72 of file qsvenc.c.

Referenced by dump_video_param().

static const char* print_ratecontrol ( mfxU16  rc_mode)
static

Definition at line 112 of file qsvenc.c.

Referenced by dump_video_param().

static const char* print_threestate ( mfxU16  val)
static

Definition at line 121 of file qsvenc.c.

Referenced by dump_video_param().

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

Definition at line 130 of file qsvenc.c.

Referenced by qsv_retrieve_enc_params().

static int select_rc_mode ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 268 of file qsvenc.c.

Referenced by init_video_param().

static int check_enc_param ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 351 of file qsvenc.c.

Referenced by init_video_param().

static int init_video_param_jpeg ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 382 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static int init_video_param ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 440 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static int qsv_retrieve_enc_jpeg_params ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 706 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static int qsv_retrieve_enc_params ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 724 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static int qsv_init_opaque_alloc ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 799 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static int qsvenc_init_session ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 836 of file qsvenc.c.

Referenced by ff_qsv_enc_init().

static unsigned int qsv_fifo_item_size ( void  )
inlinestatic

Definition at line 876 of file qsvenc.c.

Referenced by ff_qsv_enc_init(), and qsv_fifo_size().

static unsigned int qsv_fifo_size ( const AVFifoBuffer fifo)
inlinestatic

Definition at line 881 of file qsvenc.c.

Referenced by ff_qsv_encode().

int ff_qsv_enc_init ( AVCodecContext avctx,
QSVEncContext q 
)

Definition at line 886 of file qsvenc.c.

Referenced by qsv_enc_init().

static void free_encoder_ctrl_payloads ( mfxEncodeCtrl *  enc_ctrl)
static

Definition at line 1012 of file qsvenc.c.

Referenced by clear_unused_frames().

static void clear_unused_frames ( QSVEncContext q)
static

Definition at line 1023 of file qsvenc.c.

Referenced by get_free_frame().

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

Definition at line 1038 of file qsvenc.c.

Referenced by submit_frame().

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

Definition at line 1078 of file qsvenc.c.

Referenced by encode_frame().

static void print_interlace_msg ( AVCodecContext avctx,
QSVEncContext q 
)
static

Definition at line 1157 of file qsvenc.c.

Referenced by encode_frame().

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

Definition at line 1169 of file qsvenc.c.

Referenced by ff_qsv_encode().

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().

Variable Documentation

mfxU16 profile
const char* name

Definition at line 45 of file qsvenc.c.

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().

mfxU16 rc_mode

Definition at line 82 of file qsvenc.c.

Referenced by select_rc_mode().

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

Referenced by print_ratecontrol().