26 #define OFFSET(x) offsetof(NvencContext, x) 
   27 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 
   46     { 
"level",        
"Set the encoding level restriction", 
OFFSET(
level),        
AV_OPT_TYPE_INT,   { .i64 = NV_ENC_LEVEL_AUTOSELECT }, NV_ENC_LEVEL_AUTOSELECT, NV_ENC_LEVEL_HEVC_62, 
VE, 
"level" },
 
   47     { 
"auto",         
"",                                   0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AUTOSELECT },  0, 0, 
VE,  
"level" },
 
   67     { 
"tier",         
"Set the encoding tier",              
OFFSET(tier),         
AV_OPT_TYPE_INT,   { .i64 = NV_ENC_TIER_HEVC_MAIN }, NV_ENC_TIER_HEVC_MAIN, NV_ENC_TIER_HEVC_HIGH, 
VE, 
"tier"},
 
   70     { 
"rc",           
"Override the preset rate-control",   
OFFSET(rc),           
AV_OPT_TYPE_INT,   { .i64 = -1 },                                  -1, INT_MAX, 
VE, 
"rc" },
 
   71     { 
"constqp",      
"Constant QP mode",                   0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CONSTQP },                   0, 0, 
VE, 
"rc" },
 
   72     { 
"vbr",          
"Variable bitrate mode",              0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR },                       0, 0, 
VE, 
"rc" },
 
   73     { 
"cbr",          
"Constant bitrate mode",              0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR },                       0, 0, 
VE, 
"rc" },
 
   74     { 
"vbr_minqp",    
"Variable bitrate mode with MinQP (deprecated)", 0,         
AV_OPT_TYPE_CONST, { .i64 = 
RCD(NV_ENC_PARAMS_RC_VBR_MINQP) },            0, 0, 
VE, 
"rc" },
 
   75     { 
"ll_2pass_quality", 
"Multi-pass optimized for image quality (deprecated)",
 
   77     { 
"ll_2pass_size", 
"Multi-pass optimized for constant frame size (deprecated)",
 
   79     { 
"vbr_2pass",    
"Multi-pass variable bitrate mode (deprecated)", 0,         
AV_OPT_TYPE_CONST, { .i64 = 
RCD(NV_ENC_PARAMS_RC_2_PASS_VBR) },           0, 0, 
VE, 
"rc" },
 
   80     { 
"cbr_ld_hq",    
"Constant bitrate low delay high quality mode", 0,          
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ },           0, 0, 
VE, 
"rc" },
 
   81     { 
"cbr_hq",       
"Constant bitrate high quality mode", 0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_HQ },                    0, 0, 
VE, 
"rc" },
 
   82     { 
"vbr_hq",       
"Variable bitrate high quality mode", 0,                    
AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR_HQ },                    0, 0, 
VE, 
"rc" },
 
   83     { 
"rc-lookahead", 
"Number of frames to look ahead for rate-control",
 
   88     { 
"gpu",          
"Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.",
 
   92     { 
"delay",        
"Delay frame output by the given amount of frames",
 
   94     { 
"no-scenecut",  
"When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts",
 
   96     { 
"forced-idr",   
"If forcing keyframes, force them as IDR frames.",
 
  100     { 
"zerolatency",  
"Set 1 to indicate zero latency operation (no reordering delay)",
 
  102     { 
"nonref_p",     
"Set this to 1 to enable automatic insertion of non-reference P-frames",
 
  104     { 
"strict_gop",   
"Set 1 to minimize GOP-to-GOP rate fluctuations",
 
  106     { 
"aq-strength",  
"When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)",
 
  108     { 
"cq",           
"Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control",
 
  111     { 
"bluray-compat", 
"Bluray compatibility workarounds",  
OFFSET(bluray_compat),
AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, 
VE },
 
  115     { 
"qp",           
"Constant quantization parameter rate control method",
 
  117     { 
"weighted_pred",
"Set 1 to enable weighted prediction",
 
  135 #if FF_API_NVENC_OLD_NAME 
  151     .
name           = 
"nvenc_hevc",
 
  161     .priv_class     = &nvenc_hevc_class,
 
  162     .defaults       = defaults,
 
  166     .wrapper_name   = 
"nvenc",
 
  179     .
name           = 
"hevc_nvenc",
 
  189     .priv_class     = &hevc_nvenc_class,
 
  190     .defaults       = defaults,
 
  194     .wrapper_name   = 
"nvenc",
 
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
 
av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
 
#define AV_LOG_WARNING
Something somehow does not look correct. 
 
#define LIBAVUTIL_VERSION_INT
 
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation. 
 
static const AVCodecDefault defaults[]
 
static av_cold int nvenc_old_init(AVCodecContext *avctx)
 
const char * av_default_item_name(void *ptr)
Return the context name. 
 
int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
 
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
 
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
 
enum AVPixelFormat ff_nvenc_pix_fmts[]
 
#define MAX_REGISTERED_FRAMES
 
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
 
static const AVClass hevc_nvenc_class
 
static const AVClass nvenc_hevc_class
 
const char * name
Name of the codec implementation. 
 
int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
 
AVCodec ff_hevc_nvenc_encoder
 
common internal API header 
 
av_cold int ff_nvenc_encode_init(AVCodecContext *avctx)
 
int ff_nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
Libavcodec external API header. 
 
main external API structure. 
 
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
 
Describe the class of an AVClass context structure. 
 
static enum AVPixelFormat pix_fmts[]
 
common internal api header. 
 
#define FF_PROFILE_HEVC_REXT
 
AVCodec ff_nvenc_hevc_encoder
 
static const AVOption options[]