[FFmpeg-devel] [RFC] Add IFF-ANIM decoder to Makefile and all that stuff...
Sebastian Vater
cdgs.basty
Wed Apr 21 00:34:49 CEST 2010
Hi Mans!
M?ns Rullg?rd a ?crit :
>> Index: ffmpeg-svn/libavcodec/allcodecs.c
>> ===================================================================
>> --- ffmpeg-svn/libavcodec/allcodecs.c (r??vision 22921)
>> +++ ffmpeg-svn/libavcodec/allcodecs.c (copie de travail)
>> @@ -117,6 +117,7 @@
>> REGISTER_DECODER (IDCIN, idcin);
>> REGISTER_DECODER (IFF_BYTERUN1, iff_byterun1);
>> REGISTER_DECODER (IFF_ILBM, iff_ilbm);
>> + REGISTER_DECODER (IFF_ANIM, iff_anim);
>> REGISTER_DECODER (INDEO2, indeo2);
>> REGISTER_DECODER (INDEO3, indeo3);
>> REGISTER_DECODER (INDEO5, indeo5);
>>
> Alphabetical order, please.
>
Fixed.
>> Index: ffmpeg-svn/libavcodec/Makefile
>> ===================================================================
>> --- ffmpeg-svn/libavcodec/Makefile (r??vision 22921)
>> +++ ffmpeg-svn/libavcodec/Makefile (copie de travail)
>> @@ -160,6 +160,7 @@
>> OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
>> OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
>> OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
>> +OBJS-$(CONFIG_IFF_ANIM_DECODER) += iff.o
>> OBJS-$(CONFIG_IMC_DECODER) += imc.o
>> OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
>> OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
>>
Fixed.
>> Index: ffmpeg-svn/libavcodec/iff.c
>> ===================================================================
>> --- ffmpeg-svn/libavcodec/iff.c (r??vision 22921)
>> +++ ffmpeg-svn/libavcodec/iff.c (copie de travail)
>> @@ -1,6 +1,6 @@
>> /*
>> - * IFF PBM/ILBM bitmap decoder
>> - * Copyright (c) 2010 Peter Ross <pross at xvid.org>
>> + * IFF PBM/ILBM/ANIM bitmap decoder
>> + * Copyright (c) 2010 Peter Ross <pross at xvid.org> and Sebastian Vater <cdgs.basty at googlemail.com>
>>
Fixed.
> Drop the filename from the @file directive.
>
>
> Index: ffmpeg-svn/libavformat/iff.c
>> ===================================================================
>> --- ffmpeg-svn/libavformat/iff.c (r??vision 22921)
>> +++ ffmpeg-svn/libavformat/iff.c (copie de travail)
>> @@ -1,7 +1,7 @@
>> /*
>> * IFF (.iff) file demuxer
>> * Copyright (c) 2008 Jaikrishnan Menon <realityman at gmx.net>
>> - * Copyright (c) 2010 Peter Ross <pross at xvid.org>
>> + * Copyright (c) 2010 Peter Ross <pross at xvid.org> and Sebastian Vater <cdgs.basty at googlemail.com>
>>
> Again.
>
Fixed.
> * This file is part of FFmpeg.
>> *
>> @@ -21,7 +21,7 @@
>> */
>>
>> /**
>> - * @file
>> + * @file libavformat/iff.c
>>
>
> Same again.
>
Fixed.
>> * IFF file demuxer
>> * by Jaikrishnan Menon
>> * for more information on the .iff file format, visit:
>> @@ -54,6 +54,12 @@
>> #define ID_BODY MKTAG('B','O','D','Y')
>> #define ID_ANNO MKTAG('A','N','N','O')
>>
>> +#define ID_ANIM MKTAG('A','N','I','M')
>> +#define ID_ANHD MKTAG('A','N','H','D')
>> +#define ID_DLTA MKTAG('D','L','T','A')
>> +#define ID_SXHD MKTAG('S','X','H','D')
>> +#define ID_SBDY MKTAG('S','B','D','Y')
>> +
>> #define LEFT 2
>> #define RIGHT 4
>> #define STEREO 6
>> @@ -62,6 +68,7 @@
>>
>> typedef enum {COMP_NONE, COMP_FIB, COMP_EXP} svx8_compression_type;
>> typedef enum {BITMAP_RAW, BITMAP_BYTERUN1} bitmap_compression_type;
>> +typedef enum {ANIM_BITMAP_RAW, ANIM_BITMAP_BYTERUN1, ANIM_LONG_DELTA, ANIM_SHORT_DELTA, ANIM_GENERAL_DELTA, ANIM_BYTE_VERTICAL_DELTA, ANIM_STEREO_BYTE_DELTA, ANIM_BYTE_VERTICAL_DELTA_WORD, ANIM_BYTE_VERTICAL_DELTA_LONG, ANIM_ERIC_GRAHAM = 74} anim_compression_type;
>>
>
> That is the ugliest line I've seen all day. Please put one value per line.
>
Fixed.
>> @@ -118,6 +126,19 @@
>> padding = data_size & 1;
>>
>> switch(chunk_id) {
>> + case ID_FORM:
>> + chunk_id = get_le32(pb);
>> + data_size = get_be32(pb);
>> + padding = data_size & 1;
>> +
>> + case ID_SXHD:
>> + st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
>> + st->codec->bits_per_coded_sample = get_byte(pb);
>> + url_fskip(pb, 14);
>>
>
> What are you skipping over? Please add a comment explaining.
>
Fixed.
>> + st->codec->channels = get_byte(pb);
>> + st->codec->sample_rate = get_be32(pb);
>> + break;
>> +
>> [...]
>> @@ -176,33 +208,34 @@
>>
>> switch(st->codec->codec_type) {
>> case AVMEDIA_TYPE_AUDIO:
>> - av_set_pts_info(st, 32, 1, st->codec->sample_rate);
>> + av_set_pts_info(st, 32, 1, st->codec->sample_rate);
>>
>> - switch(compression) {
>> - case COMP_NONE:
>> - st->codec->codec_id = CODEC_ID_PCM_S8;
>> + switch(compression) {
>> + case COMP_NONE:
>> + st->codec->codec_id = CODEC_ID_PCM_S8;
>> + break;
>> + case COMP_FIB:
>> + st->codec->codec_id = CODEC_ID_8SVX_FIB;
>> + break;
>> + case COMP_EXP:
>> + st->codec->codec_id = CODEC_ID_8SVX_EXP;
>> + break;
>> + default:
>> + av_log(s, AV_LOG_ERROR, "iff: unknown compression method\n");
>> + return -1;
>> + }
>> +
>> + st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample;
>> + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
>> break;
>> - case COMP_FIB:
>> - st->codec->codec_id = CODEC_ID_8SVX_FIB;
>> - break;
>> - case COMP_EXP:
>> - st->codec->codec_id = CODEC_ID_8SVX_EXP;
>> - break;
>> - default:
>> - av_log(s, AV_LOG_ERROR, "iff: unknown compression method\n");
>> - return -1;
>> - }
>>
>
> If you want to change the indentation, and it does seem a bit off, do
> that in a separate patch. As is, spotting your changes is difficult.
>
Fixed.
--
Best regards,
:-) Basty/CDGS (-:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-anim.patch
Type: text/x-patch
Size: 12590 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100421/9a484279/attachment.bin>
More information about the ffmpeg-devel
mailing list