@ -550,6 +550,12 @@ typedef struct MpegEncContext {
AVFrame * tmp_frames [ MAX_B_FRAMES + 2 ] ;
int b_frame_strategy ;
int b_sensitivity ;
/* frame skip options for encoding */
int frame_skip_threshold ;
int frame_skip_factor ;
int frame_skip_exp ;
int frame_skip_cmp ;
} MpegEncContext ;
/* mpegvideo_enc common options */
@ -566,11 +572,28 @@ enum rc_strategy {
NB_MPV_RC_STRATEGY
} ;
# define FF_MPV_OPT_CMP_FUNC \
{ " sad " , " Sum of absolute differences, fast " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_SAD } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " sse " , " Sum of squared errors " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_SSE } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " satd " , " Sum of absolute Hadamard transformed differences " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_SATD } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " dct " , " Sum of absolute DCT transformed differences " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_DCT } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " psnr " , " Sum of squared quantization errors, low quality " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_PSNR } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " bit " , " Number of bits needed for the block " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_BIT } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " rd " , " Rate distortion optimal, slow " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_RD } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " zero " , " Zero " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_ZERO } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " vsad " , " Sum of absolute vertical differences " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_VSAD } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " vsse " , " Sum of squared vertical differences " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_VSSE } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " nsse " , " Noise preserving sum of squared differences " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_NSSE } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " dct264 " , NULL , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_DCT264 } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " dctmax " , NULL , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_DCTMAX } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
{ " chroma " , NULL , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_CMP_CHROMA } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " }
# ifndef FF_MPV_OFFSET
# define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
# endif
# define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
# define FF_MPV_COMMON_OPTS \
FF_MPV_OPT_CMP_FUNC , \
{ " mpv_flags " , " Flags common for all mpegvideo-based encoders. " , FF_MPV_OFFSET ( mpv_flags ) , AV_OPT_TYPE_FLAGS , { . i64 = 0 } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " mpv_flags " } , \
{ " skip_rd " , " RD optimal MB level residual skipping " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_MPV_FLAG_SKIP_RD } , 0 , 0 , FF_MPV_OPT_FLAGS , " mpv_flags " } , \
{ " strict_gop " , " Strictly enforce gop size " , 0 , AV_OPT_TYPE_CONST , { . i64 = FF_MPV_FLAG_STRICT_GOP } , 0 , 0 , FF_MPV_OPT_FLAGS , " mpv_flags " } , \
@ -612,6 +635,10 @@ enum rc_strategy {
{ " b_strategy " , " Strategy to choose between I/P/B-frames " , FF_MPV_OFFSET ( b_frame_strategy ) , AV_OPT_TYPE_INT , { . i64 = 0 } , 0 , 2 , FF_MPV_OPT_FLAGS } , \
{ " b_sensitivity " , " Adjust sensitivity of b_frame_strategy 1 " , FF_MPV_OFFSET ( b_sensitivity ) , AV_OPT_TYPE_INT , { . i64 = 40 } , 1 , INT_MAX , FF_MPV_OPT_FLAGS } , \
{ " brd_scale " , " Downscale frames for dynamic B-frame decision " , FF_MPV_OFFSET ( brd_scale ) , AV_OPT_TYPE_INT , { . i64 = 0 } , 0 , 3 , FF_MPV_OPT_FLAGS } , \
{ " skip_threshold " , " Frame skip threshold " , FF_MPV_OFFSET ( frame_skip_threshold ) , AV_OPT_TYPE_INT , { . i64 = 0 } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS } , \
{ " skip_factor " , " Frame skip factor " , FF_MPV_OFFSET ( frame_skip_factor ) , AV_OPT_TYPE_INT , { . i64 = 0 } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS } , \
{ " skip_exp " , " Frame skip exponent " , FF_MPV_OFFSET ( frame_skip_exp ) , AV_OPT_TYPE_INT , { . i64 = 0 } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS } , \
{ " skip_cmp " , " Frame skip compare function " , FF_MPV_OFFSET ( frame_skip_cmp ) , AV_OPT_TYPE_INT , { . i64 = FF_CMP_DCTMAX } , INT_MIN , INT_MAX , FF_MPV_OPT_FLAGS , " cmp_func " } , \
extern const AVOption ff_mpv_generic_options [ ] ;