[FFmpeg-cvslog] h264dec: Dont display trash before a keyframe.

John Stebbins stebbins at jetheaddev.com
Sun Sep 18 22:47:18 CEST 2011


On 09/17/2011 10:17 PM, Michael Niedermayer wrote:
> On Sat, Sep 17, 2011 at 10:14:47PM -0700, John Stebbins wrote:
>> On 09/17/2011 09:53 PM, Michael Niedermayer wrote:
>>> this looks odd, like if a () is missing over the +
>>> also id use a & (x-1) instead of %x but thats just me
>>>
>>> [...]
>>>
>> oops!  You are correct.  I just created this patch today and am still
>> testing it.  Good eyes.
> 
> tell me once you are done with testing so i can commit+push it
> 
> [...]

Here's a patch that's been tested better this time.

I have a couple samples that exorcise this code pretty well.  One is an h.264 stream that has recovery points with
recovery_frame_cnt = 0 flagged at B-frames.  Since there is frame re-ordering done, the initial frames output by the
decoder would be incomplete because the flagged B-frame hasn't reached the output yet.  This stream plays back only
clean frames due to mn's previous patch.

The other stream I generated with x264 using intra-refresh.  This stream has only a single IDR at the beginning and
recovery points with non-zero recovery_frame_cnt throughout the rest.  This stream shows junk when played with mn's
patch.  Adding my patch cleans this up.

There is still one remaining issue.  When seeking through such streams, you may hit a recovery point on a slice that
references a frame that is not available.  ffmpeg errors out on such frames and you get some garbage displayed. The spec
says these should be treated like this:

"When decoding starts from the location of the recovery point SEI message, all references to not available reference
pictures shall be inferred as references to pictures containing only macroblocks coded using Intra macroblock prediction
modes and having sample values given by Y samples equal to 128, Cb samples equal to 128, and Cr samples equal to
128 (mid-level grey)"

I tried to upload my PIR sample to upload.ffmpeg.org, but I get connection refused.  Perhaps a firewall problem?  I'll
try from home later.

-- 
John      GnuPG fingerprint: CADFA1DB594CA50EB79427284617578AADE759A1
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-calculate-frame_num-for-recovery-point-keyframe.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110918/2282362c/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110918/2282362c/attachment.asc>


More information about the ffmpeg-cvslog mailing list