[libav-devel] [PATCH] Silence errors for I263 dummy frame

Kostya Shishkov kostya.shishkov at gmail.com
Wed Jun 18 10:28:39 CEST 2014


On Wed, Jun 18, 2014 at 10:18:44AM +0200, Dirk Ausserhaus wrote:
> Indeo 4 B-frame takes more time than expected—it involves new buffer
> management since two reference frames are required now, these
> references should be propagated into ivi_common too etc.
> 
> And averaging there is (A + B) >> 1 indeed.

Don't hesistate to ask for help with it - I've fixed some bugs with that
decoder too. But I was (and am) too lazy to add less important missing
features like B-frames or transparency (the latter might be useful for
game engine reimplementations after all).
 
> Meanwhile I've looked at I263 PB-frames decoding. Looks like B-frame
> part of PB-frame is skipped in the middle of P-frame decoding so it
> needs a bit more work too. I must admit current organisation is
> somewhat strange—I263 frame header is read in intelh263dec.c,
> PB-frames are handled in ituh263dec.c but main frame decoding function
> is in h263dec.c.

I've added that skipping code long time ago. Back then it was a monolithic
decoder (IIRC single monstrous h263dec.c) and definitely no possibility for an
additional decoding frame.

> Anyway, here's a small patch to silence decoding errors on dummy
> frames. Those frame look like 8 bytes of previous frame header
> (leftover garbage?) with first byte overwritten to contain picture
> number.

> From 57a41838048195a85777d133272da848064e22bb Mon Sep 17 00:00:00 2001
> From: Dirk Ausserhaus <dausserhaus at gmail.com>
> Date: Wed, 18 Jun 2014 10:01:52 +0200
> Subject: [PATCH] i263: skip dummy frames
> 
> Intel i263 codec has special 8-byte dummy frames that should not be decoded,
> so do not even attempt to decode them and skip them instead.
> ---
>  libavcodec/intelh263dec.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
> index 8a0a381..e34da5c 100644
> --- a/libavcodec/intelh263dec.c
> +++ b/libavcodec/intelh263dec.c
> @@ -26,6 +26,10 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
>  {
>      int format;
>  
> +    if (get_bits_left(&s->gb) == 64) { /* special dummy frames */
> +        return FRAME_SKIPPED;
> +    }
> +
>      /* picture header */
>      if (get_bits_long(&s->gb, 22) != 0x20) {
>          av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
> -- 

looks good to me


More information about the libav-devel mailing list