[FFmpeg-devel] [PATCH]Decode AVUI visually correct with transparency information

Michael Niedermayer michaelni at gmx.at
Mon May 7 15:39:25 CEST 2012


On Mon, May 07, 2012 at 04:19:06PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch decodes the two AVUI samples I have visually correct
> and with alpha info.
> 
> Please review, Carl Eugen

>  libavcodec/Makefile    |    1 
>  libavcodec/allcodecs.c |    1 
>  libavcodec/avcodec.h   |    1 
>  libavcodec/avuidec.c   |  123 +++++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/isom.c     |    2 
>  5 files changed, 127 insertions(+), 1 deletion(-)
> 16368ee4066f9c77a39a2d2530bca3357767a4cd  patchavuidec.diff
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index a39ec88..371e3d4 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -96,6 +96,7 @@ OBJS-$(CONFIG_AURA2_DECODER)           += aura.o
>  OBJS-$(CONFIG_AVRP_DECODER)            += r210dec.o
>  OBJS-$(CONFIG_AVRP_ENCODER)            += r210enc.o
>  OBJS-$(CONFIG_AVS_DECODER)             += avs.o
> +OBJS-$(CONFIG_AVUI_DECODER)            += avuidec.o
>  OBJS-$(CONFIG_AYUV_DECODER)            += v408dec.o
>  OBJS-$(CONFIG_AYUV_ENCODER)            += v408enc.o
>  OBJS-$(CONFIG_BETHSOFTVID_DECODER)     += bethsoftvideo.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 5390410..b2d8ea5 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -81,6 +81,7 @@ void avcodec_register_all(void)
>      REGISTER_DECODER (AURA2, aura2);
>      REGISTER_ENCDEC  (AVRP, avrp);
>      REGISTER_DECODER (AVS, avs);
> +    REGISTER_DECODER (AVUI, avui);
>      REGISTER_ENCDEC  (AYUV, ayuv);
>      REGISTER_DECODER (BETHSOFTVID, bethsoftvid);
>      REGISTER_DECODER (BFI, bfi);
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index db17917..9a23daf 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -263,6 +263,7 @@ enum CodecID {
>      CODEC_ID_AVRP       = MKBETAG('A','V','R','P'),
>  
>      CODEC_ID_G2M        = MKBETAG( 0 ,'G','2','M'),
> +    CODEC_ID_AVUI       = MKBETAG('A','V','U','I'),
>      CODEC_ID_AYUV       = MKBETAG('A','Y','U','V'),
>      CODEC_ID_V308       = MKBETAG('V','3','0','8'),
>      CODEC_ID_V408       = MKBETAG('V','4','0','8'),
> diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c
> index e69de29..a06a2bf 100644
> --- a/libavcodec/avuidec.c
> +++ b/libavcodec/avuidec.c
> @@ -0,0 +1,123 @@
> +/*
> + * AVID Meridien decoder
> + *
> + * Copyright (c) 2012 Carl Eugen Hoyos
> + *
> + * 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
> + */
> +
> +#include "avcodec.h"
> +
> +static av_cold int avui_decode_init(AVCodecContext *avctx)
> +{
> +    avctx->pix_fmt = PIX_FMT_YUVA444P;

i think this should by YUVA422P

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- 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/20120507/dcb36b9c/attachment.asc>


More information about the ffmpeg-devel mailing list