On Sat, Mar 07, 2015 at 09:03:10AM +0000, Vittorio Giovara wrote:
> --- /dev/null
> +++ b/libavcodec/tdsc.c
> @@ -0,0 +1,585 @@
> +/*
> + * TDSC decoder

What does TDCS stand for?

> +/**
> + * @file
> + * TDSC decoder
> + *
> + * Fourcc: TSDC
> + *
> + * Codec is very simple:
> + *  it codes picture by tiles, storing them in raw BGR24 format or 
> compressing

TDSC is very simple. It codes

> + *  Every frame is then packed with ZLib.

zlib

> +static av_cold int tdsc_init(AVCodecContext *avctx)
> +{
> +    TDSCContext *ctx = avctx->priv_data;
> +    int ret;
> +
> +    ctx->refframe = av_frame_alloc();
> +    ctx->jpgframe = av_frame_alloc();
> +    if (!ctx->jpgframe)
> +        return AVERROR(ENOMEM);

Care to check both allocations?

> +        /* here BE bytestream is used, even though frame is stored LE */
> +        switch (cursor_fmt) {
> +        case 0x01010004: // old monochrome
> +        case 0x20010004: // full colour - BGRA
> +        case 0x20010008: // full colour - RGBA

I suggest an enum for these magic values.

> +    /* Prepare a packet and send it to mjpeg decoder */

to the MJPEG decoder

Remember that we're currently teaching Sashka how to use English articles ;)

> +        av_log(avctx, AV_LOG_ERROR,
> +               "Jpeg decoding error (%d) for (%d) frame.\n",

JPEG

> +/* Parse frame and either copy data or decode jpeg. */

same

> +static int tdsc_decode_tiles(AVCodecContext *avctx, int number_tiles)
> +{
> +    /* Restore context format and dimensions because of mjpeg overlap */

Same, while I'm at it ..

> +    /* Decode alllll tiles in a frame */

aaaaallllll of them? :)

> +static int tdsc_parse_dtsm(AVCodecContext *avctx)
> +{
> +    if (action == 2 || action == 3) {
> +        ret = tdsc_load_cursor(avctx, action);
> +        /* Do not consider cursor errors fatal unless explode */

unless in explode mode

Looks decent overall.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to