+
+ /* Encoding settings */
+ int i_key_int;
+ int i_b_frames;
+ int i_vtolerance;
+ int i_qmin;
+ int i_qmax;
+ int i_hq;
+ bool b_strict_rc;
+ int i_rc_buffer_size;
+ float f_rc_buffer_aggressivity;
+ bool b_pre_me;
+ bool b_hurry_up;
+ bool b_interlace, b_interlace_me;
+ float f_i_quant_factor;
+ int i_noise_reduction;
+ bool b_mpeg4_matrix;
+ bool b_trellis;
+ int i_quality; /* for VBR */
+ float f_lumi_masking, f_dark_masking, f_p_masking, f_border_masking;
+ int i_luma_elim, i_chroma_elim;
+#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4)
+ int i_aac_profile; /* AAC profile to use.*/
+#endif
+ /* Used to work around stupid timestamping behaviour in libavcodec */
+ uint64_t i_framenum;
+ mtime_t pi_delay_pts[MAX_FRAME_DELAY];
+};
+
+static const char *ppsz_enc_options[] = {
+ "keyint", "bframes", "vt", "qmin", "qmax", "hq", "strict-rc",
+ "rc-buffer-size", "rc-buffer-aggressivity", "pre-me", "hurry-up",
+ "interlace", "i-quant-factor", "noise-reduction", "mpeg4-matrix",
+ "trellis", "qscale", "strict", "lumi-masking", "dark-masking",
+ "p-masking", "border-masking", "luma-elim-threshold",
+ "chroma-elim-threshold",
+#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4)
+ "aac-profile",
+#endif
+ NULL
+};
+
+static const uint16_t mpa_bitrate_tab[2][15] =
+{
+ {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384},
+ {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}
+};
+
+static const uint16_t mpa_freq_tab[6] =
+{ 44100, 48000, 32000, 22050, 24000, 16000 };
+
+static const uint16_t mpeg4_default_intra_matrix[64] = {
+ 8, 17, 18, 19, 21, 23, 25, 27,
+ 17, 18, 19, 21, 23, 25, 27, 28,
+ 20, 21, 22, 23, 24, 26, 28, 30,
+ 21, 22, 23, 24, 26, 28, 30, 32,
+ 22, 23, 24, 26, 28, 30, 32, 35,
+ 23, 24, 26, 28, 30, 32, 35, 38,
+ 25, 26, 28, 30, 32, 35, 38, 41,
+ 27, 28, 30, 32, 35, 38, 41, 45,
+};
+
+static const uint16_t mpeg4_default_non_intra_matrix[64] = {
+ 16, 17, 18, 19, 20, 21, 22, 23,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 18, 19, 20, 21, 22, 23, 24, 25,
+ 19, 20, 21, 22, 23, 24, 26, 27,
+ 20, 21, 22, 23, 25, 26, 27, 28,
+ 21, 22, 23, 24, 26, 27, 28, 30,
+ 22, 23, 24, 26, 27, 28, 30, 31,
+ 23, 24, 25, 27, 28, 30, 31, 33,