OPT2("level", "level-idc")
表示编码复杂度水平,对应着一组参数。默认不设置-1.
const x264_level_t x264_levels[] =
{
{ 10, 1485, 99, 396, 64, 175, 64, 64, 0, 2, 0, 0, 1 },
{ 9, 1485, 99, 396, 128, 350, 64, 64, 0, 2, 0, 0, 1 }, /* "1b" */
{ 11, 3000, 396, 900, 192, 500, 128, 64, 0, 2, 0, 0, 1 },
{ 12, 6000, 396, 2376, 384, 1000, 128, 64, 0, 2, 0, 0, 1 },
{ 13, 11880, 396, 2376, 768, 2000, 128, 64, 0, 2, 0, 0, 1 },
{ 20, 11880, 396, 2376, 2000, 2000, 128, 64, 0, 2, 0, 0, 1 },
{ 21, 19800, 792, 4752, 4000, 4000, 256, 64, 0, 2, 0, 0, 0 },
{ 22, 20250, 1620, 8100, 4000, 4000, 256, 64, 0, 2, 0, 0, 0 },
{ 30, 40500, 1620, 8100, 10000, 10000, 256, 32, 22, 2, 0, 1, 0 },
{ 31, 108000, 3600, 18000, 14000, 14000, 512, 16, 60, 4, 1, 1, 0 },
{ 32, 216000, 5120, 20480, 20000, 20000, 512, 16, 60, 4, 1, 1, 0 },
{ 40, 245760, 8192, 32768, 20000, 25000, 512, 16, 60, 4, 1, 1, 0 },
{ 41, 245760, 8192, 32768, 50000, 62500, 512, 16, 24, 2, 1, 1, 0 },
{ 42, 522240, 8704, 34816, 50000, 62500, 512, 16, 24, 2, 1, 1, 1 },
{ 50, 589824, 22080, 110400, 135000, 135000, 512, 16, 24, 2, 1, 1, 1 },
{ 51, 983040, 36864, 184320, 240000, 240000, 512, 16, 24, 2, 1, 1, 1 },
{ 52, 2073600, 36864, 184320, 240000, 240000, 512, 16, 24, 2, 1, 1, 1 },
{ 60, 4177920, 139264, 696320, 240000, 240000, 8192, 16, 24, 2, 1, 1, 1 },
{ 61, 8355840, 139264, 696320, 480000, 480000, 8192, 16, 24, 2, 1, 1, 1 },
{ 62, 16711680, 139264, 696320, 800000, 800000, 8192, 16, 24, 2, 1, 1, 1 },
{ 0 }
};
参数组数组。
typedef struct x264_level_t
{
uint8_t level_idc;
uint32_t mbps; /* max macroblock processing rate (macroblocks/sec) */
uint32_t frame_size; /* max frame size (macroblocks) */
uint32_t dpb; /* max decoded picture buffer (mbs) */
uint32_t bitrate; /* max bitrate (kbit/sec) */
uint32_t cpb; /* max vbv buffer (kbit) */
uint16_t mv_range; /* max vertical mv component range (pixels) */
uint8_t mvs_per_2mb; /* max mvs per 2 consecutive mbs. */
uint8_t slice_rate; /* ?? */
uint8_t mincr; /* min compression ratio */
uint8_t bipred8x8; /* limit bipred to >=8x8 */
uint8_t direct8x8; /* limit b_direct to >=8x8 */
uint8_t frame_only; /* forbid interlacing */
} x264_level_t;
对应的参数结构体