[FFmpeg-devel] [PATCH] Video decoder and demuxer for AMV files

Vladimir Voroshilov voroshil
Mon Sep 24 16:27:21 CEST 2007


2007/9/24, Aurelien Jacobs <aurel at gnuage.org>:
> On Mon, 24 Sep 2007 20:14:36 +0700
> "Vladimir Voroshilov" <voroshil at gmail.com> wrote:
>
> > Hi, All.
> >
> > amv_codec_ffmpeg.patch: Decoder for modified MJPEG, used it AMV files.
> >
> > All video frames in this file are JPEG's without header, with applied
> > coded entropy data (i.e. added 0x00 bytes after each 0xff), enclosed
> > in SOI and EOI markers.
> > sp5x decoder code was reused.
>
> This looks mostly ok.
>
> > Index: ../mplayer/libavcodec/sp5xdec.c
> > ===================================================================
> > --- ../mplayer/libavcodec/sp5xdec.c   (revision 10560)
> > +++ ../mplayer/libavcodec/sp5xdec.c   (working copy)
> > @@ -72,6 +72,12 @@
> >      memcpy(recoded+j, &sp5x_data_sos[0], sizeof(sp5x_data_sos));
> >      j += sizeof(sp5x_data_sos);
> >
> > +    if(avctx->codec_id==CODEC_ID_AMVVIDEO)
> > +    for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
> > +    {
> > +        recoded[j++] = buf[i];
> > +    }
>
> Unneeded brackets, and the for() needs to be indented.
>
> > +AVCodec amvvideo_decoder = {
> > +    "amvv",
> > +    CODEC_TYPE_VIDEO,
> > +    CODEC_ID_AMVVIDEO,
> > +    sizeof(MJpegDecodeContext),
> > +    ff_mjpeg_decode_init,
> > +    NULL,
> > +    ff_mjpeg_decode_end,
> > +    sp5x_decode_frame,
> > +    CODEC_CAP_DR1,
> > +    NULL
> > +};
>
> The trailing NULL is useless.
>
> > Index: ../mplayer/libavcodec/avcodec.h
> > ===================================================================
> > --- ../mplayer/libavcodec/avcodec.h   (revision 10560)
> > +++ ../mplayer/libavcodec/avcodec.h   (working copy)
> > @@ -68,6 +68,7 @@
> >      CODEC_ID_MJPEGB,
> >      CODEC_ID_LJPEG,
> >      CODEC_ID_SP5X,
> > +    CODEC_ID_AMVVIDEO,
> >      CODEC_ID_JPEGLS,
> >      CODEC_ID_MPEG4,
> >      CODEC_ID_RAWVIDEO,
>
> This breaks ABI ! You must put new codec at the end of the
> appropriate enum section.
>
> > amv_demux_ffmpeg.patch: AMV file demuxer.
>
> Better post one email per patch.

Thank you for review.
Fixed version attached.

Fixes for demuxer will be sent later.

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amv_codec_ffmpeg2.patch
Type: text/x-diff
Size: 1733 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070924/48387cc2/attachment.patch>



More information about the ffmpeg-devel mailing list