Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - H264 decoder porting: (12 Items)
   
H264 decoder porting  
Hi,

I am trying to port the H264 decoder into QNX MMF, using the interface similar to IPPMMF decoder. I have few doubts on 
the input buffers

1) Does the input buffer have one frame of input guaranteed always? OR it is unknown?
2) Actually my decoder requires some minimum input buffer size requirement for some optimization reason. To handle this 
I need to make copies for every buffer (when the remaining data is < min-size), if it is unknown to have one frame of 
data. If it contains exactly one frame of data, then I will not have a problem of copies I think. Please clarify.
3) If the source input is raw compressed data, I think the input buffer is unknown about the frame boundaries, so it can
 contain any size need not be equal to the frame size. Is it TRUE?

Regards,
Venkat
Re: H264 decoder porting  
Hi Venka,

1) The input buffer of the decoder may contain a partial frame.  all  our decoders are required to be able to handle 
partial frames.  

2) if the input buffer contains a partial frame, it will be flagged as such with the MRAE_TYPE_PARTIAL_PACKET and 
MRAE_TYPE_PARTIAL_PACKET_COMPLETE.
your decoder needs to implement a state machine that look at these mra properties and eventually reconstruct the full 
frame.

3) Yes,  that would be the job of the parser filter, setting in front of the decoder,  to take raw compressed stream  as
 input and  output  frames,  partial frames.

Regards,
  Angelo
Re: H264 decoder porting  
Hi Angelo,

Thank you. Do you mean to say if we get a flag "MRAE_TYPE_IOV", is it guaranteed to have exactly one frame of data, even
 with raw compressed stream (e.g., without MP4 file format)?


Thanks,
Venkat
Re: H264 decoder porting  
Yes,
If the flag is MRA_TYPE_IOV and you are not in a MRA_TYPE_PARTIAL_PACKET and MRA_TYPE_PARTIAL_PACKET_COMPLETE sequence, 
then you would get 1 full frame in that iov element.

In the case of a raw compressed stream, this implies that there is a parser sitting in front of the decoder, parsing and
  flagging the packets out of the  stream.

Regards,
  Angelo
  
Re: H264 decoder porting  
Hi Angelo,

In the case of raw compressed stream, are you saying that, parser will  find exact frame boundaries and will be able to 
provide one frame of data.
Let me summarize my understanding

1) If the flag is "MRAE_TYPE_IOV", it gives one frame of data. The decoder consumes this and return one frame of output 
(may not output some times depends on the decoder type). 

2) If the flag is PARTIAL_PACKET or PARTIAL_PACKET_COMPLETE, then it is partial frame, both partial frames will form a 
full frame of input data.

3) In both 1) and 2) it will not have more than a frame data. This is correct, right?

Regards,
Venkat
Re: H264 decoder porting  
Hi Angelo,

Please confirm my summary. Is it correct that when we get 1 full frame, it will contain exactly one frame data and not 
any extra data (next frame's data) after the current frame. If this is true, I can discard the any left out  data after 
the decoding the frame.


Regards,
Venkat

Re: H264 decoder porting  
Hi Venkat,
Yes,  this is correct
Regards,
  Angelo
Re: H264 decoder porting  
Thanks Angelo
Re: H264 decoder porting  
For the sake of clarification:

1.  The mp4 parser will attempt to provide MULTIPLE FULL frames of compressed data in an IOV.
2.  If there is a partial frame at then end of an IOV, it will be flagged as a partial IOV.
3.  Each IOV will preceeded by the presentation timestamps for the frames in that IOV.

The only time you should have to copy data is when an IOV is flagged as being a partial frame, but you WILL get multiple
 full frames of compressed data per IOV.
Re: H264 decoder porting  
Hi Adrian Boak,

When the packet type is IOV, you mentioned mp4 parser gives multiple FULL frames per IOV. IOV mra will contain multiple 
elements, where each element contains one frame. Is this correct? Is it possible that each element contains mutiple 
frame? Please clarify.
Re: H264 decoder porting  
From MP4 parser code, I understand that each element of IOV mra contains one chunk not a frame. Each chunk has multiple 
frames.

> Hi Adrian Boak,
> 
> When the packet type is IOV, you mentioned mp4 parser gives multiple FULL 
> frames per IOV. IOV mra will contain multiple elements, where each element 
> contains one frame. Is this correct? Is it possible that each element contains
>  mutiple frame? Please clarify.


Re: H264 decoder porting  
> From MP4 parser code, I understand that each element of IOV mra contains one 
> chunk not a frame. Each chunk has multiple frames.
> 
> > Hi Adrian Boak,
> > 
> > When the packet type is IOV, you mentioned mp4 parser gives multiple FULL 
> > frames per IOV. IOV mra will contain multiple elements, where each element 
> > contains one frame. Is this correct? Is it possible that each element 
> contains
> >  mutiple frame? Please clarify.
> 
> 


Correct.  Each IOV element contains, or attempts to contain 1 chunk.  It can sometimes be split across MRAs, but in this
 case, a PARTIAL packet will be flagged.