[FFmpeg-devel] [PATCH 4/4] Add MxPEG decoder

Michael Niedermayer michaelni at gmx.at
Thu Mar 31 02:41:22 CEST 2011


On Mon, Mar 28, 2011 at 12:03:58AM +0400, Anatoly Nenashev wrote:
>

>  Makefile    |    1 
>  allcodecs.c |    1 
>  mxpegdec.c  |  331 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 333 insertions(+)
> f93a443bb32785eb87051e3922ab1be311cb0a41  0004-Add-MxPEG-decoder.patch
> From 91ec98dfacc4e3e46d05cc63da256eea17ee2a80 Mon Sep 17 00:00:00 2001
> From: anatoly <anatoly.nenashev at ovsoft.ru>
> Date: Thu, 24 Feb 2011 12:22:52 +0300
> Subject: [PATCH 4/4] Add MxPEG decoder
> 
> ---
>  libavcodec/Makefile    |    1 +
>  libavcodec/allcodecs.c |    1 +
>  libavcodec/mxpegdec.c  |  331 ++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 333 insertions(+), 0 deletions(-)
>  create mode 100644 libavcodec/mxpegdec.c
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index ef91ee3..67fe868 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -271,6 +271,7 @@ OBJS-$(CONFIG_MSMPEG4V3_ENCODER)       += msmpeg4.o msmpeg4data.o h263dec.o \
>  OBJS-$(CONFIG_MSRLE_DECODER)           += msrle.o msrledec.o
>  OBJS-$(CONFIG_MSVIDEO1_DECODER)        += msvideo1.o
>  OBJS-$(CONFIG_MSZH_DECODER)            += lcldec.o
> +OBJS-$(CONFIG_MXPEG_DECODER)           += mxpegdec.o
>  OBJS-$(CONFIG_NELLYMOSER_DECODER)      += nellymoserdec.o nellymoser.o
>  OBJS-$(CONFIG_NELLYMOSER_ENCODER)      += nellymoserenc.o nellymoser.o
>  OBJS-$(CONFIG_NUV_DECODER)             += nuv.o rtjpeg.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 861f8c7..c60bccd 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -156,6 +156,7 @@ void avcodec_register_all(void)
>      REGISTER_DECODER (MSRLE, msrle);
>      REGISTER_DECODER (MSVIDEO1, msvideo1);
>      REGISTER_DECODER (MSZH, mszh);
> +    REGISTER_DECODER (MXPEG, mxpeg);
>      REGISTER_DECODER (NUV, nuv);
>      REGISTER_ENCDEC  (PAM, pam);
>      REGISTER_ENCDEC  (PBM, pbm);
> diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
> new file mode 100644
> index 0000000..ba0c23d
> --- /dev/null
> +++ b/libavcodec/mxpegdec.c
> @@ -0,0 +1,331 @@
> +/*
> + * MxPEG decoder
> + * Copyright (c) 2011 Anatoly Nenashev
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +
> +/**
> + * @file
> + * MxPEG decoder.
> + */
> +
> +#include "mjpeg.h"
> +#include "mjpegdec.h"
> +

> +int ff_mxpeg_decode_init(AVCodecContext *avctx);
> +int ff_mxpeg_decode_end(AVCodecContext *avctx);
> +int ff_mxpeg_decode_frame(AVCodecContext *avctx,
> +                          void *data, int *data_size,
> +                          AVPacket *avpkt);

these 3 should be removed, they are unneeded, the functions should be
static


> +
> +typedef struct MXpegDecodeContext {
> +    MJpegDecodeContext jpg;
> +    AVFrame picture[2]; /* pictures array */
> +    int picture_index; /* index of current picture */
> +    int got_sof_data; /* true if SOF data successfully parsed */
> +    int got_mxm_bitmask; /* true if MXM bitmask available */
> +    uint8_t *mxm_bitmask; /* bitmask buffer */
> +    unsigned bitmask_size; /* size of bitmask */
> +    int has_complete_frame; /* true if has complete frame */
> +    uint8_t *completion_bitmask; /* completion bitmask of macroblocks */
> +    unsigned mb_width, mb_height; /* size of picture in MB's from MXM header */
> +} MXpegDecodeContext;

The comments should be made doxygen compatible (///< ...)

for example see:
http://ffmpeg.org/doxygen/trunk/
for our daily generated doxygen docs from trunk (there are of course
also ones for the releases)

ill try to review the rest of this patch in the next days
i sadly dont have the time ATM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110331/ff874e62/attachment.asc>


More information about the ffmpeg-devel mailing list