PDA

View Full Version : How to get x264-settings from SPS/PPS-NALUs


LessThanJake
2nd August 2008, 21:19
Hello,

x264 stores the settings, used for encoding, in the Userdata_unregistered_SEI - NALU, so it is no problem to get them with most analyzing-tools. But other H264-Encoder donīt do this.

So is it possible to extract the whole correlating x264-settings from SPS/PPS-NALUs?

I encoded a few seconds from a DVB-Stream with x264 and tried to reproduce the settings from the SPS/PPS, but I have some problems to match the settings with the things h264parse (MPEG4IP-Tools) throws out.

Here is an example:

My x264-parameters:
cabac=1, ref=8, deblock=1:0:0, analyse=0x3:0x133, me=tesa, subme=7, psy_rd=1.000000, brdo=1, mixed_ref=1, me_range=32, chroma_me=1, trellis=0, 8x8dct=1, cqm=0, deadzone=21,11, chroma_qp_offset=0, threads=1, nr=0, decimate=1, mbaff=0, bframes=15, b_pyramid=1, b_adapt=1, b_bias=0, direct=3, wpredb=1, bime=1, keyint=250, keyint_min=25, scenecut=40, rc=crf, crf=18.0, rceq='blurCplx^(1-qComp)', qcomp=1.00, qpmin=10, qpmax=51, qpstep=4, ip_ratio=1.40, pb_ratio=1.30, aq=2:1.00


corresponding SPS/PPS NALUs
SPS
profile: 100
constaint_set0_flag: 0
constaint_set1_flag: 0
constaint_set2_flag: 0
constaint_set3_flag: 0
level_idc: 51
seq parameter set id: 0
chroma format idx: 1 --no-chroma-me (set)
bit depth luma minus8: 0
bit depth chroma minus8: 0
Qpprime Y Zero Transform Bypass flag: 0
Seq Scaling Matrix Present Flag: 0
log2_max_frame_num_minus4: 5
pic_order_cnt_type: 0
log2_max_pic_order_cnt_lsb_minus4: 6
num_ref_frames: 8 --ref 8
gaps_in_frame_num_value_allowed_flag: 0
pic_width_in_mbs_minus1: 44 (720)
pic_height_in_map_minus1: 24
frame_mbs_only_flag: 1
derived height: 400
direct_8x8_inference_flag: 1 --direct-8x8
frame_cropping_flag: 0
vui_parameters_present_flag: 1
aspect_ratio_info_present_flag: 0
overscan_info_present_flag: 0
video_signal_info_present_flag: 1
video_format: 5
video_full_range_flag: 1 --fullrange on
colour_description_present_flag: 0
chroma_loc_info_present_flag: 0
timing_info_present_flag: 1
num_units_in_tick: 1001
time_scale: 48000
fixed_frame_scale: 1
nal_hrd_parameters_present_flag: 0 --nal-hrd (not set)
vcl_hrd_parameters_present_flag: 0
pic_struct_present_flag: 0
motion_vectors_over_pic_boundaries_flag: 1
max_bytes_per_pic_denom: 0
max_bits_per_mb_denom: 0
log2_max_mv_length_horizontal: 11
log2_max_mv_length_vertical: 11
num_reorder_frames: 2
max_dec_frame_buffering: 8

PPS
pic_parameter_set_id: 0
seq_parameter_set_id: 0
entropy_coding_mode_flag: 1
pic_order_present_flag: 0
num_slice_groups_minus1: 0
num_ref_idx_l0_active_minus1: 0
num_ref_idx_l1_active_minus1: 0
weighted_pred_flag: 0
weighted_bipred_idc: 2
pic_init_qp_minus26: -8
pic_init_qs_minus26: 0
chroma_qp_index_offset: 0
deblocking_filter_control_present_flag: 1
constrained_intra_pred_flag: 0
redundant_pic_cnt_present_flag: 0
transform_8x8_mode_flag: 1 --8x8dct
pic_scaling_matrix_present_flag: 0
second_chroma_qp_index_offset: 0

Those ones I found out are bold (hope it is right)

Can somebody help me with this?
Thanks,

LTJ

Dark Shikari
2nd August 2008, 21:23
chroma format idx: 1 --no-chroma-me (set)Chroma ME is an analysis option. You can't tell from the header whether its used or not.

LessThanJake
3rd August 2008, 20:57
Oh dear, probably I have to read half of the ITU-T H264 recommendation to relate the SPS/PPS entrys to the different x264 parameters. As I see it, some, unless most of the x264-parameters affect more than one entry in the SPS/PPS.

OK, let me get this right, on the one hand there are x264 options which can improve quality such as motion search (chroma/luma), b-frame-decision parameters, AQ and so on (let me call it Group I) but after get "best" values it is saved and is not needed anymore for decoding and on the other hand those options (Group II) that also have to be told to the decoder (via sps/pps) so that it is able to decode the bitstream accurately, such as MB partitioning, Ref-Frames and so on.
Is it something like that?

Would you be so kind to help me separating the x264-options into this two groups, if procurable?

greets
LTJ