[FFmpeg-devel] [PATCH 0/2] Origin Wing Commander IV video decoder

Diego Biurrun diego
Thu Feb 3 12:30:17 CET 2011


On Thu, Feb 03, 2011 at 10:32:25AM +0100, Kostya wrote:
> Here's mammoth-age project that should put both Mike (since he has been not
> working on it since 2003 or 2004) and Peter (since it can be considered to
> be EA codec) to shame.

:)

Funny, I remember fiddling with MPlayer trying to get Xxan samples to work...

> --- /dev/null
> +++ b/libavcodec/xxan.c
> @@ -0,0 +1,423 @@
> +/*
> + * Wing Commander/Xan Video Decoder
> + * Copyright (C) 2011 Konstantin Shishkov
> + * based on work of Mike Melanson

s/of/by

> +static int xan_unpack_luma(const uint8_t *src, int src_size, uint8_t *dst, int dst_size)

Long line; src_size and dst_size should be const.

> +   uint8_t *dst_end = dst + dst_size;
> +   const uint8_t *src_end = src + src_size;

dst_end should be const as well.

> +/* almost the same as in xan_wc3 decoder */
> +static int xan_unpack(uint8_t *dest, int dest_len, const uint8_t *src, int src_len)

Long line; dest_len and src_len should be const.

Can the function be shared with wc3?

> +    const uint8_t *src_end = src + src_len;
> +    uint8_t *dest_end = dest + dest_len;

I think dest_end can be const as well.

> +            if ( (opcode & 0x80) == 0 ) {
> +            } else if ( (opcode & 0x40) == 0 ) {

nit: extra spaces inside parentheses

> +                size = *src >> 6;
> +                back  = (bytestream_get_be16(&src) & 0x3fff) + 1;
> +                size2 = (opcode & 0x3f) + 4;
> +            } else {
> +                size = opcode & 3;
> +                back  = ((opcode & 0x10) << 12) + bytestream_get_be16(&src) + 1;
> +                size2 = ((opcode & 0x0c) <<  6) + *src++ + 5;

nit: Could be aligned, same above and below.

> +            memcpy(dest, src, size);  dest += size;  src += size;

nit: Multiple statements on one line confuse me, same below.

> +    src = s->y_buffer;
> +    ybuf = s->pic.data[0];

nit: align

> >From 02c8c1fac247673435b4ea2c18ef321538d5b4fe Mon Sep 17 00:00:00 2001
> From: Kostya <kostya.shishkov at gmail.com>
> Date: Thu, 3 Feb 2011 10:06:12 +0100
> Subject: [PATCH 2/2] Remove Xan WC4 cruft from xan.c

OK I guess.

Diego



More information about the ffmpeg-devel mailing list