@ -30,14 +30,18 @@
# define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options [ ] = {
{ " usage " , " Set the encoding usage " , OFFSET ( usage ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY , VE , . unit = " usage " } ,
{ " usage " , " Set the encoding usage " , OFFSET ( usage ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY_HIGH_QUALIT Y , VE , . unit = " usage " } ,
{ " transcoding " , " Generic Transcoding " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING } , 0 , 0 , VE , . unit = " usage " } ,
{ " ultralowlatency " , " ultra low latency trancoding " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_ULTRA_LOW_LATENCY } , 0 , 0 , VE , . unit = " usage " } ,
{ " lowlatency " , " Low latency usecase " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY } , 0 , 0 , VE , . unit = " usage " } ,
{ " webcam " , " Webcam " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_WEBCAM } , 0 , 0 , VE , . unit = " usage " } ,
{ " high_quality " , " high quality trancoding " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_HIGH_QUALITY } , 0 , 0 , VE , . unit = " usage " } ,
{ " lowlatency_high_quality " , " low latency yet high quality trancoding " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY_HIGH_QUALITY } , 0 , 0 , VE , . unit = " usage " } ,
{ " profile " , " Set the profile " , OFFSET ( profile ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN , VE , . unit = " profile " } ,
{ " profile " , " Set the profile " , OFFSET ( profile ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN , VE , . unit = " profile " } ,
{ " main " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN } , 0 , 0 , VE , . unit = " profile " } ,
{ " level " , " Set the encoding level (default auto) " , OFFSET ( level ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 , VE , . unit = " level " } ,
{ " level " , " Set the encoding level (default auto) " , OFFSET ( level ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 , VE , . unit = " level " } ,
{ " auto " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = - 1 } , 0 , 0 , VE , . unit = " level " } ,
{ " 2.0 " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_0 } , 0 , 0 , VE , . unit = " level " } ,
{ " 2.1 " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_1 } , 0 , 0 , VE , . unit = " level " } ,
@ -71,6 +75,12 @@ static const AVOption options[] = {
{ " balanced " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_BALANCED } , 0 , 0 , VE , . unit = " quality " } ,
{ " speed " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED } , 0 , 0 , VE , . unit = " quality " } ,
{ " latency " , " Set the encoding latency mode " , OFFSET ( latency ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_LOWEST_LATENCY , VE , . unit = " latency_mode " } ,
{ " none " , " No encoding latency requirement. " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_NONE } , 0 , 0 , VE , . unit = " latency_mode " } ,
{ " power_saving_real_time " , " Try the best to finish encoding a frame within 1/framerate sec. " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_POWER_SAVING_REAL_TIME } , 0 , 0 , VE , . unit = " latency_mode " } ,
{ " real_time " , " Try the best to finish encoding a frame within 1/(2 x framerate) sec. " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_REAL_TIME } , 0 , 0 , VE , . unit = " latency_mode " } ,
{ " lowest_latency " , " Encoding as fast as possible. This mode causes highest power consumption " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_LOWEST_LATENCY } , 0 , 0 , VE , . unit = " latency_mode " } ,
{ " rc " , " Set the rate control mode " , OFFSET ( rate_control_mode ) , AV_OPT_TYPE_INT , { . i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN } , AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN , AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR , VE , . unit = " rc " } ,
{ " cqp " , " Constant Quantization Parameter " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP } , 0 , 0 , VE , . unit = " rc " } ,
{ " vbr_latency " , " Latency Constrained Variable Bitrate " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR } , 0 , 0 , VE , . unit = " rc " } ,
@ -102,6 +112,11 @@ static const AVOption options[] = {
{ " qp_i " , " quantization parameter for I-frame " , OFFSET ( qp_i ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , 255 , VE } ,
{ " skip_frame " , " Rate Control Based Frame Skip " , OFFSET ( skip_frame ) , AV_OPT_TYPE_BOOL , { . i64 = - 1 } , - 1 , 1 , VE } ,
{ " aq_mode " , " adaptive quantization mode " , OFFSET ( aq_mode ) , AV_OPT_TYPE_INT , { . i64 = - 1 } , - 1 , AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ , VE , . unit = " adaptive_quantisation_mode " } ,
{ " none " , " no adaptive quantization " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_NONE } , 0 , 0 , VE , . unit = " adaptive_quantisation_mode " } ,
{ " caq " , " context adaptive quantization " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ } , 0 , 0 , VE , . unit = " adaptive_quantisation_mode " } ,
{ " align " , " alignment mode " , OFFSET ( align ) , AV_OPT_TYPE_INT , { . i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS } , AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY , AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS , VE , . unit = " align " } ,
{ " 64x16 " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY } , 0 , 0 , VE , . unit = " align " } ,
{ " 1080p " , " " , 0 , AV_OPT_TYPE_CONST , { . i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082 } , 0 , 0 , VE , . unit = " align " } ,
@ -365,6 +380,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
AMF_ASSIGN_PROPERTY_INT64 ( res , ctx - > encoder , AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE , ctx - > align ) ;
if ( ctx - > aq_mode ! = - 1 ) {
AMF_ASSIGN_PROPERTY_INT64 ( res , ctx - > encoder , AMF_VIDEO_ENCODER_AV1_AQ_MODE , ctx - > aq_mode ) ;
}
if ( ctx - > latency ! = - 1 ) {
AMF_ASSIGN_PROPERTY_INT64 ( res , ctx - > encoder , AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE , ctx - > latency ) ;
}
if ( ctx - > preanalysis ! = - 1 ) {
AMF_ASSIGN_PROPERTY_BOOL ( res , ctx - > encoder , AMF_VIDEO_ENCODER_AV1_PRE_ANALYSIS_ENABLE , ! ! ( ( ctx - > preanalysis = = 0 ) ? false : true ) ) ;
}