+ /* x264 vbv-bufsize = 0 (default). if not provided set period
+ in seconds for local maximum bitrate (cache/bufsize) based
+ on average bitrate when use has told bitrate.
+ vbv-buffer size is set to bitrate * secods between keyframes */
+ if( !p_sys->param.rc.i_vbv_buffer_size &&
+ p_sys->param.rc.i_rc_method == X264_RC_ABR &&
+ p_sys->param.i_fps_num )
+ {
+ p_sys->param.rc.i_vbv_buffer_size = p_sys->param.rc.i_bitrate *
+ p_sys->param.i_fps_den;
+#if X264_BUILD >= 0x000e
+ p_sys->param.rc.i_vbv_buffer_size *= p_sys->param.i_keyint_max;
+#else
+ p_sys->param.rc.i_vbv_buffer_size *= p_sys->param.i_idrframe;
+#endif
+ p_sys->param.rc.i_vbv_buffer_size /= p_sys->param.i_fps_num;
+ }
+
+ /* Check if user has given some profile (baseline,main,high) to limit
+ * settings, and apply those*/
+ var_Get( p_enc, SOUT_CFG_PREFIX "profile", &val );
+ if( val.psz_string )
+ {
+ if( !strcasecmp( val.psz_string, "baseline" ) )
+ {
+ msg_Dbg( p_enc, "Limiting to baseline profile");
+ p_sys->param.analyse.b_transform_8x8 = 0;
+ p_sys->param.b_cabac = 0;
+ p_sys->param.i_bframe = 0;
+ }
+ else if (!strcasecmp( val.psz_string, "main" ) )
+ {
+ msg_Dbg( p_enc, "Limiting to main-profile");
+ p_sys->param.analyse.b_transform_8x8 = 0;
+ }
+ /* high profile don't restrict stuff*/
+ }
+ free( val.psz_string );
+
+