Guest
Public paste!

Untitled

By: a guest | Feb 19th, 2010 | Syntax: C | Size: 2.53 KB | Hits: 114 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. /****************************************************************************
  2.  * Advanced parameter handling functions
  3.  ****************************************************************************/
  4.  
  5. /* These functions expose the full power of x264's preset-tune-profile system for
  6.  * easy adjustment of large numbers of internal parameters.
  7.  *
  8.  * In order to replicate x264CLI's option handling, these functions MUST be called
  9.  * in the following order:
  10.  * 1) x264_param_default_preset
  11.  * 2) Custom user options (via param_parse or directly assigned variables)
  12.  * 3) x264_param_apply_fastfirstpass
  13.  * 4) x264_param_apply_profile */
  14.  
  15. /* x264_param_default_preset:
  16.  *      The same as x264_param_default, but also use the passed preset and tune
  17.  *      to modify the default settings.
  18.  *      (either can be NULL, which implies no preset or no tune, respectively)
  19.  *
  20.  *      Currently available presets are:
  21.  *      ultrafast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo
  22.  *
  23.  *      Warning: the speed of these presets scales dramatically.  Ultrafast is a full
  24.  *      100 times faster than placebo!
  25.  *
  26.  *      Currently available tunings are:
  27.  *      film, animation, grain, psnr, ssim, fastdecode, zerolatency
  28.  *
  29.  *      Multiple tunings can be used if separated by a delimiter in ",./-+",
  30.  *      however multiple psy tunings cannot be used.
  31.  *      film, animation, grain, psnr, and ssim are psy tunings.
  32.  *
  33.  *      returns 0 on success, negative on failure (e.g. invalid preset/tune name). */
  34. int     x264_param_default_preset( x264_param_t *, const char *preset, const char *tune );
  35.  
  36. /* x264_param_apply_fastfirstpass:
  37.  *      If first-pass mode is set (rc.b_stat_read == 1, rc.b_stat_write == 0),
  38.  *      modify the encoder settings to disable options generally not useful on
  39.  *      the first pass. */
  40. void    x264_param_apply_fastfirstpass( x264_param_t * );
  41.  
  42. /* x264_param_apply_profile:
  43.  *      Applies the restrictions of the given profile.
  44.  *      Currently available profiles are: high, main, baseline
  45.  *      (can be NULL, in which case the function will do nothing)
  46.  *
  47.  *      Does NOT guarantee that the given profile will be used: if the restrictions
  48.  *      of "High" are applied to settings that are already Baseline-compatible, the
  49.  *      stream will remain baseline.  In short, it does not increase settings, only
  50.  *      decrease them.
  51.  *
  52.  *      returns 0 on success, negative on failure (e.g. invalid profile name). */
  53. int     x264_param_apply_profile( x264_param_t *, const char *profile );