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

help to implement h.264 encoder using intel ipp

suchethanswaroop
Beginner
1,841 Views
hi all,

I know how to implement the h.264 codec in JM software. I wanted to run it using intel ipp h.264 to check how optimised it is compared to other softwares. I am not able to figure out the configuration file to give inputs. Could someone please guide me as to how to implement the encoder ?I have integrated intel ipp compiler to visual C++.

Thanks
Suchethan
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
1,841 Views
Hello,

ddraw.lib is Microsoft DirectX Direct Draw library, which is available in Direct X SDK. IPP media sample readme file has mention what version of DX SDK is needed in order to build the sample. Please check that you have one installed correctly on your development system.

Regards,
Vladimir

View solution in original post

0 Kudos
10 Replies
Ying_H_Intel
Employee
1,841 Views
hi all,

I know how to implement the h.264 codec in JM software. I wanted to run it using intel ipp h.264 to check how optimised it is compared to other softwares. I am not able to figure out the configuration file to give inputs. Could someone please guide me as to how to implement the encoder ?I have integrated intel ipp compiler to visual C++.

Thanks
Suchethan

Hello Suchethan,

Nore sure which steps you are on,
1. you may run the h264 sample provided by IPP firstly.
You may have know, IPP provide h264 encoder sample (including MSVC solution) in ipp-samplesaudio-video-codecsapplicationumc_video_enc_con, and it has a readme.htm file. please read it, which may help you understand howuse it to encode a YUV file to h264 stream.

You can download the sample from

http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-code-samples/

build the sample audio-video-codecs, for example, using command line >build32.bat cl8.

Then if everything goes fine, you will see a executale file umc_video_enc_con.exe. you can try it to encode a YUV file to h264 stream.

2. Second, intergate the h264 encoder to your application, then it is another topic, you may read the articles like,
Setting H.264 encoding parameters in Intel IPP media processing samples
and
Getting Started with Intel IPP Unified Media Classes Sample :
http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/

at IPP knowledge base
http://software.intel.com/en-us/articles/intel-ipp-kb/all/1/

Hope it helps,
Regards,
Ying H.








0 Kudos
suchethanswaroop
Beginner
1,841 Views
Quoting - Ying H (Intel)

Hello Suchethan,

Nore sure which steps you are on,
1. you may run the h264 sample provided by IPP firstly.
You may have know, IPP provide h264 encoder sample (including MSVC solution) in ipp-samplesaudio-video-codecsapplicationumc_video_enc_con, and it has a readme.htm file. please read it, which may help you understand howuse it to encode a YUV file to h264 stream.

You can download the sample from

http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-code-samples/

build the sample audio-video-codecs, for example, using command line >build32.bat cl8.

Then if everything goes fine, you will see a executale file umc_video_enc_con.exe. you can try it to encode a YUV file to h264 stream.

2. Second, intergate the h264 encoder to your application, then it is another topic, you may read the articles like,
Setting H.264 encoding parameters in Intel IPP media processing samples
and
Getting Started with Intel IPP Unified Media Classes Sample :
http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/

at IPP knowledge base
http://software.intel.com/en-us/articles/intel-ipp-kb/all/1/

Hope it helps,
Regards,
Ying H.

Thanks a hell lot for this valuable piece of information Ying. Will try it and surely get back to you if I get stuck. Thank you :)

Warm regards,
Suchethan







0 Kudos
suchethanswaroop
Beginner
1,841 Views

hi all,
I downloaded the sample from http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-code-samples andbuilt the sample audio-video-codecs using command line > build32.bat cl8. The following ones failed.
pipelineumc_pipeline
ioaudio_renders
iovideo_renders
applicationsimple_player
applicationumc_h264_dec_con
I got the executale file umc_video_enc_con.exe. and i tried to encode a YUV file to h264 stream and it worked. There are 2 things i want to know .
1. I gave my inputs in commandline. ie ... "umc_video_enc_con.exe h264 -i missam.yuv -f 25 -w 176 -h 144 -n 150 -b 1280000 -o missambit1.h264" . I wish to know how to give the h264.par file (the file where we give our input parameters ) through command line .. It would be gr8 if the command is mentioned.

2. I am not able to decode the sequence as my build failed for the h264 decoder. I found this message in the file " umc_video_enc_con" placed at _logwin32_icl111application
LINK : fatal error LNK1181: cannot open input file 'ddraw.lib'
NMAKE : fatal error U1077: '"C:Program FilesMicrosoft Visual Studio 8VCBINlink.exe"' : return code '0x49d'
Stop.
Please let me know how to overcome this error and the commands to run the decoder in command line.

Thanks and warm regards,
Suchethan

0 Kudos
Vladimir_Dudnik
Employee
1,842 Views
Hello,

ddraw.lib is Microsoft DirectX Direct Draw library, which is available in Direct X SDK. IPP media sample readme file has mention what version of DX SDK is needed in order to build the sample. Please check that you have one installed correctly on your development system.

Regards,
Vladimir

0 Kudos
suchethanswaroop
Beginner
1,841 Views
Hi all,

I got the executale files of encoder and decoder. i tried to encode a YUV file to h264 stream and it worked. The decoder is also working fine. This is how i gave the inputs of the yuv file ......

1. I gave my inputs in commandline. ie ... "umc_video_enc_con.exe h264 -i missam.yuv -f 25 -w 176 -h 144 -n 150 -b 1280000 -o missambit1.h264" . I wish to know how to give the h264.par file (the file where we give our input parameters ) through command line ..

It would be gr8 if the command is mentioned.


Thanks and warm regards,
Suchethan


0 Kudos
Ying_H_Intel
Employee
1,841 Views

Hello Suchethan,

There is onesampe H.264.par file is in the folder of audio-video-codecsapplicationumc_video_enc_con.
you can copy it to the same folder of your exe andedit it according to your input , for example

/* CommentLine: H.264 Sequence.*/
missam.yuv /* name of source files */
150 /* number of frames to encode */
1 100 1 /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
3 1 /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
4 1 0 /* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
100 0 /* 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) */
176 /* horizontal_size */
144 /* vertical_size */
5 /* 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] */
2 0 0 0 12800000 /* 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 /* 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 */
1 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) */
176 /* display_horizontal_size */
144 /* display_vertical_size */
1 2 /* 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 0 /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); OptimalQuantization (0, 1) */

Then the command is like
umc_video_enc_con.exe h264 h264.par missambit1.h264

Regards,
Ying
0 Kudos
suchethanswaroop
Beginner
1,841 Views
Quoting - Ying H (Intel)
Hi all,

Could some one please throw light on why intel ipp is so fast compared to JM software. Using the JM software, the encoding time for the test sequence i used was about 1000 sec but it is just 1.8 sec using intel ipp. Does this mean that the quality metrics interms of psnr, ssim, mse are being compromised compared to JM ? or does it scores better than JM even for these metrics ?

Suchethan

Hello Suchethan,

There is onesampe H.264.par file is in the folder of audio-video-codecsapplicationumc_video_enc_con.
you can copy it to the same folder of your exe andedit it according to your input , for example

/* CommentLine: H.264 Sequence.*/
missam.yuv /* name of source files */
150 /* number of frames to encode */
1 100 1 /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
3 1 /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
4 1 0 /* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
100 0 /* 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) */
176 /* horizontal_size */
144 /* vertical_size */
5 /* 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] */
2 0 0 0 12800000 /* 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 /* 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 */
1 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) */
176 /* display_horizontal_size */
144 /* display_vertical_size */
1 2 /* 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 0 /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); OptimalQuantization (0, 1) */

Then the command is like
umc_video_enc_con.exe h264 h264.par missambit1.h264

Regards,
Ying

0 Kudos
Vladimir_Dudnik
Employee
1,841 Views
H.264 encoder performance depend a lot on encoding parameters. Did you use the same parameters for encoding with IPP nad with JM software? For the same set of parameters there should not be compromize on encoding quality.

Regards,
Vladimir
0 Kudos
suchethanswaroop
Beginner
1,841 Views
I gave the same parameters in JM and intel ipp and intel ipp beats JM in all the parameters i measured.
1. Could some one please give me one good reason as to why is it almost 500 times faster , and better than JM output. What is making the compiler special ? Is motion estimation done in a different way in this encoder ?

2. what is this parameter "speed/quality grade [0,3] (0-maximum speed, 3-maximum quality) " all about ? what parameters are set to default when
a. 0,0 ( maximum speed, min quality ) is selected
b. 3,0 ( minimum speed , max quality ) is selected

Regards,
Suchethan
H.264 encoder performance depend a lot on encoding parameters. Did you use the same parameters for encoding with IPP nad with JM software? For the same set of parameters there should not be compromize on encoding quality.

Regards,
Vladimir

0 Kudos
Ying_H_Intel
Employee
1,841 Views



Just found a good article for discuss the problem. Attached here.
http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5442807&tag=1

Swaroop, K.V.S.; Rao, K.R.;

Dept. of Electr. Eng., Univ. of Texas at Arlington, Arlington, TX, USA

Abstract

Joint Model (JM) reference software is used for academic reference of H.264 and it was developed by JVT (Joint Video Team) of ISO/IEC MPEG & ITU-T VCEG (Video coding experts group). The Intel IPP (Integrated Performance Primitives) H.264 is a product of Intel which uses IPP libraries and SIMD instructions available on modern processors. The Intel IPP H.264 is multi-threaded and uses CPU optimized IPP routines. In this paper, JM 15.1 and Intel IPP H.264 codec are compared in terms of execution time and video quality of the output decoded sequence. The metrics used for comparison are SSIM (Structural Similarity Index Metric), PSNR (Peak-to-Peak Signal to Noise Ratio), MSE (Mean Square Error), motion estimation time, encoding time, decoding time and the compression ratio of the H.264 file size (encoded output). Intel IPP H.264 clearly emerges as the winner against JM 15.1 in all parameters except for the compression ratio of H.264 file size.

About thespeed/quality grade [0,3] (0-maximum speed, 3-maximum quality). You may see umc documentation and the artilce Setting H.264 encoding parameters in Intel IPP media processing samples

Regards,
Ying

0 Kudos
Reply