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

H264 exception

alex78
New Contributor I
697 Views
Dear H264 experts,

we have a H264 decoder based on Intel IPP 6.1 and the H264 UMC decoder sample. It works very well for most H264 streams. Now we have come accross a H264 camera that streams either a 4:3 or a 16:9 aspect ratio. The 4:3 streams is decoded correctly, but the 16:9 stream produces a H264 exception inside the UMC decoder. I have attached a 16:9 H264 IDR frame, the frame is preceded with SPS and PPS bytes, so the file has the following structure: 0 0 1 SPS NAL 0 0 1 PPS NAL 0 0 1 IDRSLICE NAL. Does anybody know, what is the cause of the H264 exception?

1. Is it a bug in Intel 6.1 code? When yes,is it already fixed?

2. Does the camera produce an invalid H264 stream when using 16:9 aspect ratio?

File link: http://software.intel.com/file/41774

Thank you very much.

Alex
0 Kudos
10 Replies
SergeyKostrov
Valued Contributor II
697 Views
Quoting alex78
...but the 16:9 stream produces a H264 exception inside the UMC decoder...

[SergeyK] What was a code for the exception? What about the exceptiontext?

Does anybody know, what is the cause of the H264 exception?

[SergeyK] Could you provide more technical details, please? Are you absolutely sure that it wasn't a Win32 exception,
like Access Violation?

Best regards,
Sergey
0 Kudos
alex78
New Contributor I
697 Views
Dear Sergey,

I did not provide more technical details because I thought that it would be better to provide the H264 IDR frame causing the problem so that it can be reproduced easily. Ok, so I made a debug build and I got the following text:

Microsoft C++ exception: UMC::h264_exception at memory location 0x04f4dd20.

The stack shows the following trace:

msvcr80d.dll!_CxxThrowException(void * pExceptionObject=0x04f4dd20, const _s__ThrowInfo * pThrowInfo=0x0cb6b944) Line 161 C++

h264.dll!UMC::MBDecoder::DecodeMacroblock_I_CAVLC(UMC::H264SegmentDecoderMultiThreaded * sd=0x06cfa4f8) Line 1059 C++

h264.dll!UMC::MBDecoder::DecodeMacroblock_ISlice_CAVLC(UMC::H264SegmentDecoderMultiThreaded * sd=0x06cfa4f8) Line 549 C++

h264.dll!UMC::SegmentDecoderHP<:MBDECODER>,UMC::MBReconstructor,short,unsigned char,unsigned char,1,0,1>::DecodeSegmentCAVLC_Single(int curMB=882, int nBorder=920, UMC::H264SegmentDecoderMultiThreaded * sd=0x06cfa4f8) Line 2327 + 0xf bytes C++

h264.dll!UMC::H264SegmentDecoderMultiThreaded::ProcessSlice(int iCurMBNumber=880, int & iMBToProcess=920) Line 2665 + 0x29 bytes C++

h264.dll!UMC::H264SegmentDecoderMultiThreaded::ProcessSegment() Line 210 + 0x13 bytes C++

h264.dll!UMC::TaskSupplier::RunDecoding(UMC::MediaData * dst=0x00000000, UMC::MediaData * src=0x00000000, bool force=true) Line 3167 + 0x19 bytes C++

h264.dll!UMC::TaskSupplier::AddSource(UMC::MediaData * & pSource=0x00000000, UMC::MediaData * dst=0x04f4e940) Line 2316 + 0xe bytes C++

h264.dll!UMC::H264VideoDecoder::ParseFrame(UMC::MediaData * pDestination=0x04f4e940, UMC::MediaData * pSource=0x00000000) Line 270 + 0x16 bytes C++

h264.dll!UMC::H264VideoDecoder::GetFrame(UMC::MediaData * src=0x00000000, UMC::MediaData * dst=0x04f4e940) Line 199 C++


The H264 decoder is configured to use just one thread. I can provide any other details if needed. The basic information that we would like to know, if there is a bug in Intel IPP 6.1 or if the stream is corrupted or invalid, in which case we will notify the device manufacturer to fix it.

Thanks for your help

Alex

0 Kudos
SergeyKostrov
Valued Contributor II
697 Views
Hi Alex, Please take a look at my comments.I can see that this is a C++ exception!

Quoting alex78
...
Microsoft C++ exception: UMC::h264_exception at memory location 0x04f4dd20.

The stack shows the following trace:

msvcr80d.dll!_CxxThrowException(void * pExceptionObject=0x04f4dd20, const _s__ThrowInfo * pThrowInfo=0x0cb6b944) Line 161 C++

[SergeyK]I recommend you to debug a method:

DecodeMacroblock_I_CAVLC ( around line 1059 )

of atemplate class MBDecoder in a namespace UMC

As soon as you reproduce the problem take a look at a parameter _s__ThrowInfo.
It should havea description of the exception, its reason, etc.

h264.dll!UMC::MBDecoder::DecodeMacroblock_I_CAVLC(UMC::H264SegmentDecoderMultiThreaded * sd=0x06cfa4f8) Line 1059 C++
...
...if there is a bug in Intel IPP 6.1 or if the stream is corrupted or invalid...
...
[SergeyK] If your application managed to process many frames before it crashed I could assume
that there is a problem with the MBDecoder class. Try to debug the applicationbecause
it is the most efficient way for you to understand what is going on.


Best regards,
Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
697 Views
Hi Alex,

Does it crash on a call to:
...
sd->DecodeEdgeType();
...
?

This isfrom aline '1059'.
0 Kudos
alex78
New Contributor I
697 Views
Hi Sergey,

thanks once more for your help.

Exactly, the last code line which the debugger holds on is sd->DecodeEdgeType. When this crash happens, the debugger does not step into DecodeEdgeType any more. I looked atpThrowInfo, but it does not seem to be very informative (I cant see any reason or text values) - see below. The crash does happen even for the very first frame (IDR) that comes from the camera. But not on the first call to DecodeMacroblock_I_CAVLC. There are many successful calls to this method until the crash happens (still while processing the first frame).

Without knowing the H264 background it is impossible for us to "see what happens", so I still believe that the best way for you to see the crash is to use the H264 frame I already uploaded (see my first post on this topic).

Thank you very much for your help.

Alex


pThrowInfo 0x0caab944 __TI1?AVh264_exception@UMC@@ {attributes=0 pmfnUnwind=0x0c59f200 pForwardCompat=0x00000000 ...} const _s__ThrowInfo *

attributes 0 unsigned int
pmfnUnwind 0x0c59f200 UMC::h264_exception::~h264_exception(void) void (void)*
pForwardCompat 0x00000000 int ()*
pCatchableTypeArray 0x0caab954 __CTA1?AVh264_exception@UMC@@ {nCatchableTypes=1 arrayOfCatchableTypes=0x0caab958 } const _s__CatchableTypeArray *
nCatchableTypes 1 int
arrayOfCatchableTypes 0x0caab958 const _s__CatchableType * [0]



0 Kudos
SergeyKostrov
Valued Contributor II
697 Views
Quoting alex78
...sd->DecodeEdgeType...

- Set a breakpoint on the call to theDecodeEdgeTypemethod (before a 1st frame is processed )
- Run the application until it hits the breakpoint (your 1st frame is about to be processed)
- Try to step-into the DecodeEdgeTypemethod to investigate what is wrong

Best regards,
Sergey
0 Kudos
Ying_H_Intel
Employee
697 Views
Hi Alex78,

is it possible to try the latest one IPP 7.0.6 Intel IPP 7.0 Library Bug Fixes which had fixed some h.264 issues. The package can be download from

Code Samples for Intel IPP Library 7.0* .

Just quick try, the decoder seems works without exception with the frame although the decode image looks gray.

Best Regards,
Ying

0 Kudos
alex78
New Contributor I
697 Views
Hi Ying and Sergey,

thanks for your comments. We have made a quick check with IPP 7.0.6 and (as you noted) there is no more exception when processing the frames. We found out, however, that the decoded video is distorted (some damaged areas). This lets us to conclude (for now) that the 16:9 h264 video stream from this camera manufacturer is corrupted, whichcauses IPP 6.1 h264 decoder to produce an exception and the IPP 7.0.6 decoder to produce damaged video. Yes, the camera itself contains a h264 decoder that displays the video correctly even in 16:9 ratio, but this does not necessarily mean, that the video stream is correct.

Thanks for your help.

Alex
0 Kudos
SergeyKostrov
Valued Contributor II
697 Views

Hi Alex,

It is possible that some of these already fixed bugs caused an exception. Please take a look at:

http://software.intel.com/en-us/articles/intel-ipp-70-library-bug-fixes/

...
DPD200261436 UMC H264 baseline profile CAVLC overflow chroma error, level_prefix correction
DPD200215155 UMC H264 codec hangs when closing
DPD200223103 UMC H264 doesn't check video consistency on IDR frame
DPD200226794 UMC H264 encoder crashed when transform_8x8_mode=1 and quality=3
DPD200228069 UMC Wrong pointer checking after ippMalloc in video resizing
DPD200230243 UMC H264 Decoder H264SegmentDecoder InitDeblockingOnceEv Crash
...
DPD200093686 UMC H264 Decoder->Reset() crashes when the decoder is initialized to use more then 1 thread.
DPD200137745 UMC H264 decoder crashes with some data streams (contains some invalid data).
DPD200148980 UMC H264 decoder crashes due to multithreading issues.
DPD200154970 UMC H264 Decoder->Reset() crashes due to multithreading issues.
...

Quoting alex78

...This lets us to conclude (for now) that the 16:9 h264 video stream from this camera manufacturer is corrupted, whichcauses IPP 6.1
h264 decoder to produce an exception...


A conclusion like this has to be proven in an independent test. Ideally, it isnice to have a test environment
without a camerathat simulates a working onewith an absolutely verified 16:9 H264 video stream from
another source. In that case you will be able to easily detect anysoftware or hardwareproblems.

Best regards,
Sergey

0 Kudos
Sergey_K_Intel
Employee
697 Views
Quoting alex78
We found out, however, that the decoded video is distorted (some damaged areas). This lets us to conclude (for now) that the 16:9 h264 video stream from this camera manufacturer is corrupted

Check your failing 16:9 stream with any other decoder (VLC on Windows processes ES/TS/PS streams with H.264 content rather well). If you could share stream example with us, we could look into core of the problem. Both cases are possible - the stream can be broken and there can be problems in decoder - we need to sort them out.

Regards,
Sergey

0 Kudos
Reply