typedef struct x264_param_t
{
????CPU 標志位
???unsigned int cpu;
???int????????i_threads;???????并行編碼多幀
???int????????b_deterministic; 是否允許非確定性時線程優化
???int????????i_sync_lookahead;? 線程超前緩沖
????視頻屬性
???int????????i_width;? 寬度
???int????????i_height;? 高度
???int????????i_csp;??編碼比特流的CSP,僅支持i420,色彩空間設置
???int????????i_level_idc;? level值的設置
???int????????i_frame_total;? 編碼幀的總數, 默認 0
Vui參數集視頻可用性信息視頻標準化選項
???struct
???{
????????they will be reduced to be 0 < x <=65535 and prime
???????int????????i_sar_height;
???????int????????i_sar_width;? 設置長寬比
???????int????????i_overscan;????0=undef, 1=no overscan, 2=overscan過掃描線,默認"undef"(不設置),可選項:show(觀看)/crop(去除)
???????見以下的值h264附件E
???????Int??????i_vidformat; 視頻格式,默認"undef",component/pal/ntsc/secam/mac/undef
???????int??????b_fullrange; Specify full range samplessetting,默認"off",可選項:off/on
???????int??????i_colorprim;原始色度格式,默認"undef",可選項:undef/bt709/bt470m/bt470bg,smpte170m/smpte240m/film
???????int?? i_transfer;轉換方式,默認"undef",可選項:undef/bt709/bt470m/bt470bg/linear,log100/log316/smpte170m/smpte240m
???????int? i_colmatrix;色度矩陣設置,默認"undef",undef/bt709/fcc/bt470bg,smpte170m/smpte240m/GBR/YCgCo
???????int????????i_chroma_loc;????both top & bottom色度樣本指定,范圍0~5,默認0
???} vui;
???int????????i_fps_num;
???int????????i_fps_den;
這兩個參數是由fps幀率確定的,賦值的過程見下:
{???????floatfps;??????
?if( sscanf( value, "%d/%d",&p->i_fps_num,&p->i_fps_den ) == 2 )
???????????;
???????else if( sscanf( value, "%f", &fps ) )
???????{
???????????p->i_fps_num = (int)(fps * 1000 + .5);
???????????p->i_fps_den = 1000;
???????}
???????else
???????????b_error = 1;
???}
Value的值就是fps。
???流參數
???int????????i_frame_reference;??參考幀最大數目
???int????????i_keyint_max;???????在此間隔設置IDR關鍵幀
???int????????i_keyint_min;???????場景切換少于次值編碼位I, 而不是 IDR.
???int????????i_scenecut_threshold; 如何積極地插入額外的I幀// // 畫面動態變化限,當超出此值時插入I幀,默認40
???int????????i_bframe;??兩個相關圖像間P幀的數目
???int????????i_bframe_adaptive; 自適應B幀判定
???int????????i_bframe_bias; 控制插入B幀判定,范圍-100~+100,越高越容易插入B幀,默認0
???int????????b_bframe_pyramid;??允許部分B為參考幀
去塊濾波器需要的參數
???int????????b_deblocking_filter;去塊效應相關
???int????????i_deblocking_filter_alphac0;????[-6, 6] -6 light filter, 6 strong
???int????????i_deblocking_filter_beta;???????[-6, 6]? idem
?? 熵編碼
???int????????b_cabac;
???int????????i_cabac_init_idc;
???int????????b_interlaced;? 隔行掃描
???量化
???int????????i_cqm_preset;????????自定義量化矩陣(CQM),初始化量化模式為flat
???char???????*psz_cqm_file;??????JM format讀取JM格式的外部量化矩陣文件,自動忽略其他—cqm 選項
???uint8_t????cqm_4iy[16];????????used only if i_cqm_preset == X264_CQM_CUSTOM
???uint8_t????cqm_4ic[16];
???uint8_t????cqm_4py[16];
???uint8_t????cqm_4pc[16];
???uint8_t????cqm_8iy[64];
???uint8_t????cqm_8py[64];
????日志
???void???????(*pf_log)( void *, int i_level, const char *psz, va_list );
???void???????*p_log_private;
???int????????i_log_level;
???int????????b_visualize;
???char???????*psz_dump_yuv;??重建幀的名字
????編碼分析參數
???struct
???{
???????unsigned intintra;?????幀間分區
???????unsigned intinter;?????幀內分區
???????int?????????b_transform_8x8;? 幀間分區
???????int?????????b_weighted_bipred; 為b幀隱式加權
???????int?????????i_direct_mv_pred; 時間空間隊運動預測
???????int?????????i_chroma_qp_offset; 色度量化步長偏移量
???????int?????????i_me_method;? 運動估計算法 (X264_ME_*)
???????int?????????i_me_range;? 整像素運動估計搜索范圍 (from predictedmv)
???????int?????????i_mv_range;? 運動矢量最大長度(in pixels). -1 =auto, based on level
???????int?????????i_mv_range_thread;? 線程之間的最小空間. -1 = auto,based on number of threads.
???????int?????????i_subpel_refine;? 亞像素運動估計質量
???????int?????????b_chroma_me;? 亞像素色度運動估計和P幀的模式選擇
???????int?????????b_mixed_references; 允許每個宏塊的分區在P幀有它自己的參考號
???????int?????????i_trellis;??Trellis量化,對每個8x8的塊尋找合適的量化值,需要CABAC,默認0 0:關閉1:只在最后編碼時使用2:一直使用
???????int?????????b_fast_pskip; 快速P幀跳過檢測
???????int?????????b_dct_decimate; 在P-frames轉換參數域
???????int?????????i_noise_reduction; 自適應偽盲區
???????float???????f_psy_rd;? Psy RD strength
???????float???????f_psy_trellis;? Psy trellis strength
???????int?????????b_psy;? Toggle all psy optimizations
???????亮度量化中使用的無效區大小
???????int?????????i_luma_deadzone[2];? {幀間, 幀內}
???????int?????????b_psnr;????計算和打印PSNR信息
???????int?????????b_ssim;???計算和打印SSIM信息
???} analyse;
????碼率控制參數
???struct
???{
???????int????????i_rc_method;????X264_RC_*
???????int????????i_qp_constant;??0-51
???????int????????i_qp_min;??????允許的最小量化值
???????int????????i_qp_max;??????允許的最大量化值
???????int????????i_qp_step;?????幀間最大量化步長
???????int????????i_bitrate;? 設置平均碼率
???????float??????f_rf_constant;??1pass VBR, nominal QP
???????float??????f_rate_tolerance;
???????int????????i_vbv_max_bitrate; 平均碼率模式下,最大瞬時碼率,默認0(與-B設置相同)
???????int????????i_vbv_buffer_size; 碼率控制緩沖區的大小,單位kbit,默認0
???????float??????f_vbv_buffer_init;? <=1:fraction of buffer_size. >1:kbit碼率控制緩沖區數據保留的最大數據量與緩沖區大小之比,范圍0~1.0,默認0.9
???????float??????f_ip_factor;
???????float??????f_pb_factor;
???????int????????i_aq_mode;??????psy adaptive QP. (X264_AQ_*)
???????float??????f_aq_strength;
???????int????????b_mb_tree;??????Macroblock-tree ratecontrol.
???????int????????i_lookahead;
????????2pass 多次壓縮碼率控制
???????int????????b_stat_write;??Enable stat writing in psz_stat_out
???????char???????*psz_stat_out;
???????int????????b_stat_read;????Read stat from psz_stat_in and use it
???????char???????*psz_stat_in;
????????2pass params (same as ffmpeg ones)
???????float??????f_qcompress;????0.0 => cbr, 1.0 => constant qp
???????float??????f_qblur;???????時間上模糊量化
???????float??????f_complexity_blur;? 時間上模糊復雜性
???????x264_zone_t*zones;?????????碼率控制覆蓋
???????int????????i_zones;????????number of zone_t's
???????char???????*psz_zones;????指定區的另一種方法
???} rc;
????Muxing parameters
???intb_aud;?????????????????生成訪問單元分隔符
???intb_repeat_headers;???????在每個關鍵幀前放置SPS/PPS
???inti_sps_id;???????????????SPS 和 PPS id 號
???切片(像條)參數
???inti_slice_max_size;????每片字節的最大數,包括預計的NAL開銷.
???inti_slice_max_mbs;?????每片宏塊的最大數,重寫 i_slice_count
???inti_slice_count;???????每幀的像條數目: 設置矩形像條.
????Optional callback for freeing this x264_param_t when it is donebeing used.
?????Only used when the x264_param_t sits in memory for an indefiniteperiod of time,
?????i.e. when an x264_param_t is passed to x264_t in an x264_picture_tor in zones.
?????Not used when x264_encoder_reconfig is called directly.
???void (*param_free)( void* );
} x264_param_t;
?