[FFmpeg-devel] [PATCH] IFF: Make lavf/iff.c stop using ff_cmap_read_palette

Stefano Sabatini stefano.sabatini-lala
Sun May 9 21:41:49 CEST 2010


On date Sunday 2010-05-09 20:16:31 +0200, Sebastian Vater encoded:
> Martin recommeded to do these as a separate patch.
> 
> It removes call to ff_cmap_read_palette in lavf/iff.c for preparation of
> the HAM patch.

[...]
> diff --git a/libavcodec/iff.c b/libavcodec/iff.c
> index 398c768..7a54f78 100644
> --- a/libavcodec/iff.c
> +++ b/libavcodec/iff.c

> @@ -183,25 +183,25 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
>      }
>  
>      if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
> -    if (avctx->pix_fmt == PIX_FMT_PAL8) {
> -        for(y = 0; y < avctx->height; y++ ) {
> -            uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
> -            memset(row, 0, avctx->width);
> -            for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
> -                decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane);
> -                buf += s->planesize;
> +        if (avctx->pix_fmt == PIX_FMT_PAL8) {
> +            for(y = 0; y < avctx->height; y++ ) {
> +                uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
> +                memset(row, 0, avctx->width);
> +                for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
> +                    decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane);
> +                    buf += s->planesize;
> +                }

cosmetics, avoid reindenting in functional patches, same below.

>              }
> -        }
> -    } else { // PIX_FMT_BGR32
> -        for(y = 0; y < avctx->height; y++ ) {
> -            uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
> -            memset(row, 0, avctx->width << 2);
> -            for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
> -                decodeplane32((uint32_t *) row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane);
> -                buf += s->planesize;
> +        } else { // PIX_FMT_BGR32
> +            for(y = 0; y < avctx->height; y++ ) {
> +                uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
> +                memset(row, 0, avctx->width << 2);
> +                for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {
> +                    decodeplane32((uint32_t *) row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane);
> +                    buf += s->planesize;
> +                }
>              }
>          }
> -    }
>      } else if (avctx->pix_fmt == PIX_FMT_PAL8) { // IFF-PBM
>          for(y = 0; y < avctx->height; y++ ) {
>              uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];



> diff --git a/libavformat/iff.c b/libavformat/iff.c
> index 6901236..8131931 100644
> --- a/libavformat/iff.c
> +++ b/libavformat/iff.c
> @@ -256,7 +256,7 @@ static int iff_read_header(AVFormatContext *s,
>      case AVMEDIA_TYPE_VIDEO:
>          switch (compression) {
>          case BITMAP_RAW:
> -                st->codec->codec_id = CODEC_ID_IFF_ILBM;
> +            st->codec->codec_id = CODEC_ID_IFF_ILBM;

cosmetics.

>              break;
>          case BITMAP_BYTERUN1:
>              st->codec->codec_id = CODEC_ID_IFF_BYTERUN1;

Regards.
-- 
FFmpeg = Free Freak Multipurpose Power Elastic Gymnast



More information about the ffmpeg-devel mailing list