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

Why is happened the difference during H264 encoding?

nrson
Beginner
211 Views

Hi, All

I have a meet the problems during tesing H264 fielding coding on IPP(Ver.7.0.5.059).

I set the parameter for fielding as following:

    coding_type = 1;

But there is the difference a generated bitstream according to image.

one(A) is general H264 bitstream, other(B) is strange H264 bitstream.

The decoing result of A is good, but B's bitstream is as following and not decoding.

 00 00 00 01 21 B8 04 07 4B ED 4B 1D FF 9C 6F FC 16 B3 A1 AB C4 AB F9 9D EA BB 6E 39 48 56 F8 A4 C5 3B 3D 08 65 C9 75 00 F1 B1 18 0B 71 A2 80 8E 39 B9 E9 F9 96 4A B1 30 A4 83 59 A9 8C 60 63 5A 4E 2F 14 A0 5B 77 94 AA B3 A1 03 51 5A 2D A2 97~~~~

I think that SPS and PPS of B is wrong or fielding coding is incompletely.

How do I solve the problem or advice?

Best regards,

nrson

 

0 Kudos
1 Reply
Pavel_V_Intel
Employee
211 Views
Good day. There was a problem with missing SPS headers in field encoding. It was fixed in 7.1 However I must warn you what we have a bug in motion estimation in filed mode which can cause significant artifacts on P frames. Here is a fix for 7.0.5: umc_h264_gen_enc_tmpl.cpp.h line 593, add firstFieldClass variable [cpp] Status H264ENC_MAKE_NAME(H264CoreEncoder_CompressFrame)( void* state, EnumPicCodType& ePictureType, EnumPicClass& ePic_Class, MediaData* dst) { ... EnumPicClass firstFieldClass; [/cpp] line 618, store picture type for first field in firstFieldClass [cpp] // reencode frame loop for (;;) { brcRecode = false; core_enc->m_is_cur_pic_afrm = (Ipp32s)(core_enc->m_pCurrentFrame->m_PictureStructureForDec==AFRM_STRUCTURE); firstFieldClass = ePic_Class; [/cpp] line 953, replace this condition: [cpp] if (ePic_Class == IDR_PIC && (!core_enc->m_field_index)) { core_enc->m_SliceHeader.idr_pic_id--; core_enc->m_SliceHeader.idr_pic_id &= 0xff; //Restrict to 255 to reduce number of bits(max value 65535 in standard) } [/cpp] with this: [cpp] if(core_enc->m_field_index) { if(firstFieldClass == IDR_PIC) // restore IDR flag or SPS header will be lost { core_enc->m_SliceHeader.idr_pic_id--; ePic_Class = IDR_PIC; } core_enc->m_HeightInMBs <<= 1; } else { if(ePic_Class == IDR_PIC) { core_enc->m_SliceHeader.idr_pic_id--; core_enc->m_SliceHeader.idr_pic_id &= 0xff; //Restrict to 255 to reduce number of bits(max value 65535 in standard) } } [/cpp]
0 Kudos
Reply