[FFmpeg-devel] [PATCH]Fix alpha for iff deep

Michael Niedermayer michaelni at gmx.at
Wed Mar 14 20:50:24 CET 2012


On Fri, Mar 09, 2012 at 12:49:32PM +0100, Carl-Eugen Hoyos wrote:
> Hi!
> 
> Attached patch makes no difference for the RGBA DEEP iff sample from
> ticket 1045, but matches the specification (see ticket) better.
> 
> Please comment, Carl Eugen

>  iff.c |    3 +++
>  1 file changed, 3 insertions(+)
> 7fc792033cbced78f6f50656dffd9faa2760080f  patchdeepalpha.diff
> diff --git a/libavcodec/iff.c b/libavcodec/iff.c
> index 9b09604..68b1672 100644
> --- a/libavcodec/iff.c
> +++ b/libavcodec/iff.c
> @@ -506,10 +506,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
>          }
>      } else if (avctx->codec_tag == MKTAG('D','E','E','P')) {
>          int raw_width = avctx->width * (av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]) >> 3);
> +        int x;
>          for(y = 0; y < avctx->height && buf < buf_end; y++ ) {
>              uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
>              memcpy(row, buf, FFMIN(raw_width, buf_end - buf));
>              buf += raw_width;
> +        for(x = 0; x < avctx->width; x++)
> +            row[4 * x + 3] = row[4 * x + 3] & 0xF0 | (row[4 * x + 3] >> 4);
>          }

This code looks strange, the raw_width line seems to assume that
BPP can be more than 1 value
while the new loops seems to assume its 32bpp

  [...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There seems to be only one solution to NIH syndrom, ... a shooting squad
-------------- 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/20120314/6218e6c7/attachment.asc>


More information about the ffmpeg-devel mailing list