API Parameters

wz4_enc_cfg_t

  • Reopen encoder : if update these parameters will cause encoder reopen it self internally. You can call wz4_encoder_update_config to reconfigure the parameters during encoding.

  • No : not safe or no effect

  • Yes : safe to update

The following table lists some important parameters,

Parameter Data Type {Value Range} Definition Can be modified by wz4_encoder_update_config Reopen encoder
preset string Encoding speed presets No Yes
tune string Tune for different use case No Yes
profile string Set specific profile (as defined by Annex A.2), for setting range refer to the array wz4_profile_names, and it can be NULL. No Yes
pass int, {0~2} Multi pass rate control, 1: First pass - creates stats file, 2: Second pass. No Yes
level_idc int, {0~62} Set specific level (as defined by Annex A.3). No Yes
bit_depth int, {8,10} Support 8bit and 10bit No Yes
csp int, {1~24} Input image format, for setting range refer to wz4_input_csp_e. No Yes
interlace_type int, {0~2} Input image interlaced type, for setting range refer to wz4_interlace_type_e. No Yes
width int, {1~16384} Frame Width No Yes
height int, {1~16384} Frame Height, which is twice the field height in interlaced encoding. No Yes
threads int Number of encoding threads No Yes
numa_mask int Specify NUMA nodes, where each bit represents one NUMA node No Yes
vfr_input int, {0~1} Variable frame rate, default is 0 No Yes
frame_rate_num int Frame rate numerator Yes No
frame_rate_den int Frame rate denominator, default is 1 Yes No
time_base_num int Time base numerator, default is 1 Yes No
time_base_den int Time base denominator, time scale of pts Yes No
duration float Duration of the video by seconds No Yes
rc_type int, {-1~2} Rate control modes No Yes
bitrate int, {0~2000000} Bitrate, in kbps Yes No
vbv_max_bitrate int, {0~2000000} Maximum average bitrate limit, in kbps Yes No
vbv_buffer_size int, {0~2000000} Rate control buffer size, in kbits Yes No
vbv_buffer_init float, {0~2000000} <=1: fraction of buffer_size. >1: kbit No No
strict_cbr int, {0~1} Use filler to achieve strict constant bitrate condition No No
quality float, {0~51} Set the encoding quality Yes No
rf_constant float, {0~51} Quality parameter for constant quality rate control mode. Yes No
rf_constant_max float, {0.1~51} Maximum quality parameter for constant quality rate control mode. Yes No
tempo_scalable int, {0~3} Temporal scalability No Yes
qp int, {0~51} Constant quantization parameter control mode quantization parameter, default is 30 Yes No
qpmin int, {0~51} Minimum quantization parameter for frame-level, default is 0 Yes No
qpmax int, {qpmin~51} Maximum quantization parameter for frame-level, default is 51 Yes No
ipratio float,{0.1~2.0} QP ratio between I and P frames No Yes
pbratio float,{0.1~2.0} QP ratio between P and B frames No Yes
aq_mode int, {0~5} PSY adaptive QP mode, default is 2 No Yes
keyint_max int,>0 Maximum key frame interval Yes No
keyint_min int,>0 Minimum key frame interval Yes No
repeat_headers int, {0~1} Put SPS/PPS before each key frame No Yes
cabac int, {0~1} Whether to enable cabac No Yes
annexb int, {0~1} 1: place start codes (4 bytes) before NAL units, 0: place size (4 bytes) before NAL units. Default is 1. No Yes
bframes int, {0~15} Number of B-frames between adjacent non-B-frames No Yes
lookahead int, {0~65} Number of frames for lookahead analysis, affects latency frame count No Yes
open_gop int, {0~1} Whether to enable open GOP No Yes
intra_refresh int, {0~1} Not supported yet! No Yes
me_method int, {0~9} Full-pixel motion estimation method No Yes
subpel_refine int, {0~10} Sub-pixel motion estimation method No Yes
visual_opt int, {0~2} Set visual optimize option, 0: Not enabled; 1-2 use different algorithms No Yes
image_region_num int, {0~3} Not supported yet! No Yes
region int Not supported yet! No Yes
vui wz4_vui_t VUI(Video usability information) No Yes
psnr int, {0~2} Calculate PSNR metrics, 0: Not enabled (default); 1: print sequence level PSNR values; 2: print frame level PSNR values. No Yes
ssim int, {0~2} Calculate SSIM metrics, 0: Not enabled (default); 1: print sequence level SSIM values; 2: print frame level SSIM values. No Yes
enc_time int, {0~2} Calculate consumed time in milliseconds, 0: do not print; 1: print maximum ; 2: print each frame No Yes
log_level int, {-1,3} Output log level, -1: debug; 0: info; 1: warn; 2: err; 3: fatal. Default is 0. No Yes
pf_print_log wz4_log_printf_func Callback function pointer for printing log No Yes
frame_output_nal_cb wz4_frame_output_nal_cb_func Callback function pointer for output frame nals No Yes
input_src_free_cb wz4_picture_free Callback to free input buffer, used when use_input_src equals to 1 No Yes
input_src_pri_ctx void * Private pointer to the context of buffer for input_src_free_cb, can be NULL No Yes
alternative_transfer int Alternative transfer characteristics SEI message No Yes
mastering_display_info wz4_mastering_display_colour_volume_sei Mastering display colour volume SEI message No Yes
mastering_display_present int, {0~1} Mastering display present No Yes
content_light_level wz4_content_light_level_info_sei Content light level information SEI message No Yes
content_light_level_present int, {0~1} Content light level present No Yes
ambient_view_environment wz4_ambient_viewing_environment_sei Ambient viewing environment SEI message No Yes
ambient_view_environment_present int, {0~1} Ambient view environment present No Yes
access_unit_delimiters_present int Access Unit Delimiter No Yes

wz264-params

The following table lists the encoding tools that can be configured on Aurora4 through wz264-params.

wz264-params DataType,{Value} Description
input-csp int, {1~24} Input image format, for setting range refer to wz4_input_csp_e.
frame-rate-num int Frame rate numerator
frame-rate-den int Frame rate denominator, default is 1
time-base-num int Time base numerator, default is 1
time-base-den int Time base denominator, time scale of pts
fps float Input frame rate
force-cfr int, {0~1} Force constant framerate, default is 1
pass int, {0~2} Multi pass rate control, 1: First pass - creates stats file, 2: Second pass.
stats string Filename (in UTF-8) of the 2pass stats file
dump-bs string Filename for dumping output info.
dump-src string Filename for dumping input info.
dump-rec string Filename for dumping reconstructed info.
bit-depth int, {8,10} Set specific bit depth
level char Set specific level (as defined by Annex A.3)
duration float Duration of the video by seconds
rc int, {-1~2} Rate control modes, -1: adaptive quality, 0: constant QP, 1: constant quality, 2: averaged bitrate
bitrate int, {0~2000000} Target bitrate in kbps
vbv-maxrate int, {0~2000000} Maximum average bitrate limit, in kbps
vbv-bufsize int, {0~2000000} Rate control buffer size, in kbits
crf float, {0~51} Quality parameter for constant quality rate control mode.
crf-max float, {0.1~51} Maximum quality parameter for constant quality rate control mode.
quality float, {0~51} Set the encoding quality
keyint int,>0 Maximum key frame interval
keyint-min int,>0 Minimum key frame interval
ipratio float,{0.1~2.0} QP ratio between I and P frames
pbratio float,{0.1~2.0} QP ratio between P and B frames
temp-svc int, {0~3} Temporal scalability
qp int, {0~51} Constant quantization parameter control mode quantization parameter, default is 30
qpmin int, {0~51} Minimum quantization parameter for frame-level, default is 0
qpmax int, {qpmin~51} Maximum quantization parameter for frame-level, default is 51
threads int Number of encoding threads
numa-mask string Specify NUMA nodes in binary format, where each bit represents one NUMA node
aq-mode int, {0~5} PSY adaptive QP mode, default is 2
repeat_headers int, {0~1} Put SPS/PPS before each key frame
cabac int, {0~1} Whether to enable cabac
annexb int, {0~1} 1: place start codes (4 bytes) before NAL units, 0: place size (4 bytes) before NAL units. Default is 1.
bframes int, {0~15} Number of B-frames between adjacent non-B-frames
rc-lookahead int, {0~65} Number of frames for lookahead analysis, affects latency frame count
open-gop int, {0~1} Whether to enable open GOP
intra-refresh int, {0~1} Not supported yet!
me int, {0~9} Full-pixel motion estimation method
subme int, {0~10} Sub-pixel motion estimation method
visual-opt int, {0~2} Set visual optimize option, 0: Not enabled; 1-2 use different algorithms
detail-opt int, {0~1} Maintain details, 0: Not enabled; 1: enabled.
sar string Should be set like Value1,Value2
vid-format string Support: "component", "pal", "ntsc", "secam", "mac", "undef"
full-range string Support: “off”, “on”
color-prim string Specify color primaries. Support: "bt709", "undef", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", "smpte428", "smpte431", "smpte432"
transfer string Specify transfer characteristics. Support: "bt709", "undef", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", "arib-std-b67"
col-matrix string Support: "GBR", "bt709", "undef", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo", "bt2020nc", "bt2020c", "smpte2085", "chroma-derived-nc", "chroma-derived-c", "ICtCp"
chroma-loc int, {0~5} Chroma sample location
alternative-transfer string Specify an alternative transfer characteristics. Support: "bt709", "undef", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", "bt2020-10", "bt2020-12", "smpte2084", "smpte428", "arib-std-b67"
master-display string Specify 'G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)' for primaries, white point, and display brightness. Should be set like G(Value1,Value2)B(Value3,Value4)R(Value5,Value6)WP(Value7,Value8)L(Value9,Value10)
max-cll string Specify 'max_content,max_frame_average' content light levels. Should be set like Value1,Value2
ave string Should be set like Value1,Value2,Value3
aud int, {0~1} Access unit delimiters
psnr int, {0~2} Calculate PSNR metrics, 0: Not enabled (default); 1: print sequence level PSNR values; 2: print frame level PSNR values.
ssim int, {0~2} Calculate SSIM metrics, 0: Not enabled (default); 1: print sequence level SSIM values; 2: print frame level SSIM values.
log int, {-1,3} Output log level, -1: debug; 0: info; 1: warn; 2: err; 3: fatal. Default is 0.
fpp int, [0,1] Whether to enable frame-level parallelism. Default is 1.
hpp int, [0,1] Hybrid parallel processing, 0: disable, 1:enable; default is 1.
slice int, [0,16] Slice multi-threading.
mbtree int, [0,1] Micro-block tree rate control. 0: disable, 1:enable; default is 0.
aq-strength float, [0,2.0] AQ strength. Reduces blocking and blurring in textured areas.
aq-smooth float, [0,2.0] AQ smooth. Reduces blocking and blurring in flat areas.
aq-weight float, [0,1] AQ weight. default is 0.4
b-adapt int, [0,2] Adaptive B-frame decision method; default is 1
scenecut int, [0,100] Sensitivity for scenecut detection to insert I-frames. Default is 40. To disable scenecut detection, set it to 0.
chroma-qp-offset int, [-12,12] Chroma-qp-offset; default is 0
psy-rd float,[0,10.0] Psy RD strength; default is 0.2
pref int, [1,8] Number of reference frames for P-frames.
bref int, [1,8] Number of reference frames per reference list for B-frames.
weightp int, [0,2] Weighted prediction for P-frames. 0: disable, 1:enable, 2:enable with duplicated refrence frame; default is 2
weightb int, [0,2] Weighted prediction for B-frames. 0: disable, 1:explicit mode, 2:implicit mode; default is 1
qcomp float, [0,1.0] Qcompress; default is 0.5
short-load int, [0,1] Whether to enable short load at the very beginning. Default is 0.
vbv-buffer-init float, [0,1] Initial VBV buffer occupancy, fraction of vbv buffer size
cae-maxrate int Maximum final averaged bitrate, in kbps. The implementation is different from vbv-maxrate, and it does not need to be used with vbv-bufsize, nor can it be used with vbv-maxrate at the same time!
max-pps int,[1,2] Limit the maximum number of PPS that can be encode
interlace int,[0,2] Interlaced Mdoe. 0:progressive,1:top filed first,2:bottom field first;default is 0

Note:

  • If a default value is not specified for certain parameters, the value will be determined automatically.
  • As the encoder continues to develop, certain parameters may change. If you have any questions, please feel free to contact us.