[FFmpeg-devel] [PATCH]Fix remaining AVUI samples (v2)

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 16 15:43:47 CEST 2012


On Tue, May 15, 2012 at 11:34:24PM +0200, Carl Eugen Hoyos wrote:
> -    if (avpkt->size >= 4 * avctx->width * (avctx->height + 16) + 13)
> -        transparent = 1;
> +    transparent = avctx->bits_per_coded_sample == 32 &&
> +                  avpkt->size >= (2 * avctx->height + skip[0] + skip[1]) *
> +                                 2 * avctx->width + 4 + 8 * interlaced;
> +    srca = src + (2 * avctx->height + skip[0] + skip[1]) * avctx->width
> +           + 5 + interlaced * 4;

A comment and/or some intermediate variable should make this easier to
understand.
For example I a quite sure there's a close connection between the
condition and the srca formula.
I suspect something like
frame_data_bytes = (2 * avctx->height + skip[0] + skip[1]) * avctx->width + 2 + 4 * interlaced;
might be it, but I am not sure (especially about the + 2).
In that case this would simplify to
transparent = avctx->bits_per_coded_sample == 32 &&
              avpkt->size >= 2 * frame_data_bytes;
srca = src + frame_data_bytes + 3;


More information about the ffmpeg-devel mailing list