Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Is H264 baseline supported on Linux?

llx
Beginner
582 Views

According to readme.htm, the valid values of profile are 77(main) and 100(high) only. When I tried put 66, the output is 100. How do I configure to baseline? Thanks.

0 Kudos
8 Replies
llx
Beginner
582 Views

Hi Nikolay,

Thanks for the answer. What are the parameters need to adjust to avoid changing the profile to high? thanks.

llx

0 Kudos
llx
Beginner
582 Views

Hi Nikolay,

It works, thank you.But the speed is very slow.

intel/ipp/5.3.1.062/ipp-samples/audio-video-codecs/_bin/linuxem64t_gcc3> ./umc_video_enc_con h264 -i videocif.yuv -w
352 -h 288 -f 15 -n 100 -b 32000 h264_3.par videocif_ipp_3_32k.264

Starting H264 encoding videocif.yuv to file videocif_ipp_3_32k.264
Source video width = 352, height = 288, frameRate = 15.00
Max frames to encode = 100
Encoding bit rate = 32000 bits per second
0.10.20.30.40.50.60.70.80.90.100.
Summary:
Num frames encoded = 100
Encoding Time = 2.65 sec, 37.68 fps
Overall Time = 2.68 sec, 37.27 fps
Average CPU usage = 0.00%
Encoded Size = 833202 bytes
Compression Ratio = 18.25
EncodedSize/ExpectedSize = 31.25
-------------------------

How may I adjust the parameters to speed it up? My par file is as below:

/* CommentLine: H.264 Sequence.*/
stream.yuv /* name of source files */
231 /* number of frames to encode */
1 200 0 /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
0 0 /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
1 1 0 /* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
66 20 /* profile_idc (77-main, 100-high); level_idc (set 0 for automatic selection) (check that num_ref_frames and frame size are in accordance with the level) */
352 /* horizontal_size */
288 /* vertical_size */
1 /* frame_rate_code [0,8] (0-30 fps,1-15 fps,2-24 fps,3-25 fps,4-30 fps,5-30 fps,6-50 fps,7-60 fps,8-60 fps)*/
1 8 8 /* High profile: chroma_format_idc (0 - monochrom, 1 - 420, 2 - 422), bit_depth_luma [8,12], bit_depth_chroma [8,12] */
0 8 0 0 0 /* High profile: aux_format_idc: [0,3], bit_depth_aux: [8,12], alpha_incr_flag: 0, 1; alpha_opaque_value: [0, 2^(bit_depth_aux + 9) -1]; alpha_transparent_value: [0, 2^(bit_depth_aux + 9) - 1] */
0 0 0 30 32000 /* RC method(0 - quant_codes, 1 - CBR MBwise, 2 - CBR framewise, 3 - Debug); start qp values for I, P, B slices; bitrate (bits per second) */
2 1 8 8 /* ME method (1-6), subblock split, search x,search_y */
0 0 0 /* weighted prediction, weighted biprediction implicit weighted biprediction (not supported!)*/
1 0&nbs p; /* direct type (0 - temporal 1 - spatial 2 - auto); direct_inference_flag */
0 0 0 /* disable_deblocking_idc: 1-- off, 0 - on, 2 -- on(without crossing slice boundaries); deblocking_filter_alpha, deblocking_filter_beta */
0 0 0 /* High profile: transform_8x8_mode: 0 -- off, 1 - on; 0 -- use standard, 1 -- use default scaling matrices for 8x8 quantization; qpprime_y_zero_transform_bypass_flag: (0, 1) */
352 /* display_horizontal_size */
288 /* display_vertical_size */
0 0 /* entropy coding mode (0-cavlc,1-cabac); cabac_init_idc (0,1,2) */
0 /* picture coding type (0 - only FRM, 1 - only FLD , 2 - only AFRM, 3 - pure PicAFF(no MBAFF) 4 PicAFF + MBAFF). Only 0 (FRM) is supported! */
1 sample.log /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); log file name (unused) */

Are there any suggestion that can increase the speed? Thanks again.

0 Kudos
llx
Beginner
582 Views

Hi Nikolay,

It works, thank you.But the speed is very slow.

intel/ipp/5.3.1.062/ipp-samples/audio-video-codecs/_bin/linuxem64t_gcc3> ./umc_video_enc_con h264 -i videocif.yuv -w
352 -h 288 -f 15 -n 100 -b 32000 h264_3.par videocif_ipp_3_32k.264

Starting H264 encoding videocif.yuv to file videocif_ipp_3_32k.264
Source video width = 352, height = 288, frameRate = 15.00
Max frames to encode = 100
Encoding bit rate = 32000 bits per second
0.10.20.30.40.50.60.70.80.90.100.
Summary:
Num frames encoded = 100
Encoding Time = 2.65 sec, 37.68 fps
Overall Time = 2.68 sec, 37.27 fps
Average CPU usage = 0.00%
Encoded Size = 833202 bytes
Compression Ratio = 18.25
EncodedSize/ExpectedSize = 31.25
-------------------------

How may I adjust the parameters to speed it up? My par file is as below:

/* CommentLine: H.264 Sequence.*/
stream.yuv /* name of source files */
231 /* number of frames to encode */
1 200 0 /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
0 0 /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
1 1 0 /* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
66 20 /* profile_idc (77-main, 100-high); level_idc (set 0 for automatic selection) (check that num_ref_frames and frame size are in accordance with the level) */
352 /* horizontal_size */
288 /* vertical_size */
1 /* frame_rate_code [0,8] (0-30 fps,1-15 fps,2-24 fps,3-25 fps,4-30 fps,5-30 fps,6-50 fps,7-60 fps,8-60 fps)*/
1 8 8 /* High profile: chroma_format_idc (0 - monochrom, 1 - 420, 2 - 422), bit_depth_luma [8,12], bit_depth_chroma [8,12] */
0 8 0 0 0 /* High profile: aux_format_idc: [0,3], bit_depth_aux: [8,12], alpha_incr_flag: 0, 1; alpha_opaque_value: [0, 2^(bit_depth_aux + 9) -1]; alpha_transparent_value: [0, 2^(bit_depth_aux + 9) - 1] */
0 0 0 30 32000 /* RC method(0 - quant_codes, 1 - CBR MBwise, 2 - CBR framewise, 3 - Debug); start qp values for I, P, B slices; bitrate (bits per second) */
2 1 8 8 /* ME method (1-6), subblock split, search x,search_y */
0 0 0 /* weighted prediction, weighted biprediction implicit weighted biprediction (not supported!)*/
1 0&nbs p; /* direct type (0 - temporal 1 - spatial 2 - auto); direct_inference_flag */
0 0 0 /* disable_deblocking_idc: 1-- off, 0 - on, 2 -- on(without crossing slice boundaries); deblocking_filter_alpha, deblocking_filter_beta */
0 0 0 /* High profile: transform_8x8_mode: 0 -- off, 1 - on; 0 -- use standard, 1 -- use default scaling matrices for 8x8 quantization; qpprime_y_zero_transform_bypass_flag: (0, 1) */
352 /* display_horizontal_size */
288 /* display_vertical_size */
0 0 /* entropy coding mode (0-cavlc,1-cabac); cabac_init_idc (0,1,2) */
0 /* picture coding type (0 - only FRM, 1 - only FLD , 2 - only AFRM, 3 - pure PicAFF(no MBAFF) 4 PicAFF + MBAFF). Only 0 (FRM) is supported! */
1 sample.log /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); log file name (unused) */

Are there any suggestion that can increase the speed? Thanks again.

0 Kudos
llx
Beginner
582 Views

Hi Nikolay,

The improvement is significant, thanks.

This one is speed/quality grade =0. Is that possible to make itfaster while keeping speed/quality grade =0? Thanks again.

/intel/ipp/5.3.1.062/ipp-samples/audio-video-codecs/_bin/linuxem64t_gcc3> ./umc_video_enc_con h264 -i videocif.yuv -w
352 -h 288 -f 15 -b 32000 -n 100 h264_25.par videocif_ipp_25_32k.264

Starting H264 encoding videocif.yuv to file videocif_ipp_25_32k.264
Source video width = 352, height = 288, frameRate = 15.00
Max frames to encode = 100
Encoding bit rate = 32000 bits per second
0.10.20.30.40.50.60.70.80.90.100.
Summary:
Num frames encoded = 100
Encoding Time = 0.64 sec, 155.97 fps
Overall Time = 0.67 sec, 150.25 fps
Average CPU usage = 0.00%
Encoded Size = 27634 bytes
Compression Ratio = 550.28
EncodedSize/ExpectedSize = 1.04

llx

0 Kudos
llx
Beginner
582 Views

Hi Nikolay,

After replaced line 171 in umc_h264_core_enc.cpp, the decode frame fate improved from 145frames/s to 147frames/s.It took 0.68 second toencodea 100-frame sequence which is still very slow.

deblocking has already been disabled. If it was not disabled, it took 1.47 second to encode a 100-frame sequence.

Is this the limitation of 5.3?

THanks.

llx

0 Kudos
llx
Beginner
582 Views

Hi Nikolay,

It improved a little: from 0.69 second to 0.64 second in encoding a 100-frame sequence (15fps, 32kbps). The interesting thing is it will speed up upon increasing the frame rate. For the same yuv sequence,

if frame rate is 30, it takes 0.59 seconds

if frame rate is 15, it takes 0.64 seconds

if frame rate is 7.5, it takes 0.69 seconds

Thanks for your advice.

0 Kudos
gennadii_mog
Beginner
582 Views

Greetings,

I tried to found the lines that you specified for performance improvement. But I haven't found them in IPP samples of 6.1 version.

Can you please tell me in what source and where I have to make the identical changes for performance improvement?

Thanks,

Gennadii

0 Kudos
Chao_Y_Intel
Moderator
582 Views

Gennadii,

I think you are looking for some encoding paramters that can improve the performance. This article may be helpful:

http://software.intel.com/en-us/articles/setting-h264-encoding-parameters-in-intel-ipp-media-processing-samples/

Thanks,

Chao

0 Kudos
Reply