On Mon, Feb 13, 2012 at 03:42:27AM +0000, Paul B Mahol wrote:
> 
> Signed-off-by: Paul B Mahol <[email protected]>
> ---
>  Changelog                |    1 +
>  doc/general.texi         |    4 +
>  libavcodec/Makefile      |    1 +
>  libavcodec/allcodecs.c   |    1 +
>  libavcodec/avcodec.h     |    1 +
>  libavcodec/cdxl.c        |  275 
> ++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/version.h     |    2 +-
>  libavformat/Makefile     |    1 +
>  libavformat/allformats.c |    1 +
>  libavformat/cdxl.c       |  161 +++++++++++++++++++++++++++
>  libavformat/version.h    |    2 +-
>  11 files changed, 448 insertions(+), 2 deletions(-)
>  create mode 100644 libavcodec/cdxl.c
>  create mode 100644 libavformat/cdxl.c

I think this would be quicker to get merged if demuxer and decoder were
separate patches.

> --- /dev/null
> +++ b/libavcodec/cdxl.c
> @@ -0,0 +1,275 @@
> +
> +static av_cold int cdxl_decode_init(AVCodecContext *avctx)
> +{
> +    CDXLVideoContext *c = avctx->priv_data;
> +
> +    avcodec_get_frame_defaults(&c->frame);
> +    c->new_video_size = 0;
> +    c->avctx = avctx;

nit: align

> +            switch (op) {
> +            case 0:
> +                r = (new_palette[index] & 0xFF0000);
> +                g = (new_palette[index] & 0xFF00);
> +                b = (new_palette[index] & 0xFF);

pointless ()

> +            case 1:
> +                b = index * 0x11;
> +                break;
> +            case 2:
> +                r = (index * 0x11) << 16;
> +                break;
> +            case 3:
> +                g = (index * 0x11) << 8;
> +                break;

ditto

> +    for (y = 0; y < avctx->height; y++) {
> +        r = (new_palette[0] & 0xFF0000);
> +        g = (new_palette[0] & 0xFF00);
> +        b = (new_palette[0] & 0xFF);

more

> +        for (x = 0; x < avctx->width; x++) {
> +            index = *ptr++;
> +            op = index >> 6;
> +            index &= 63;

nit: align

> +            switch (op) {
> +            case 0:
> +                r = (new_palette[index] & 0xFF0000);
> +                g = (new_palette[index] & 0xFF00);
> +                b = (new_palette[index] & 0xFF);

pointless ()

> --- /dev/null
> +++ b/libavformat/cdxl.c
> @@ -0,0 +1,161 @@
> +
> +    cdxl->read_chunk = 0;
> +    cdxl->video_stream_index = -1;
> +    cdxl->audio_stream_index = -1;

nit: align

> +#define OFFSET(x) offsetof(CDXLDemuxContext, x)
> +static const AVOption cdxl_options[] = {
> +    { "sample_rate", "", OFFSET(sample_rate), AV_OPT_TYPE_INT,    {.dbl = 
> 11025}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
> +    { "framerate",   "", OFFSET(framerate),   AV_OPT_TYPE_STRING, {.str = 
> "10"},  0, 0,       AV_OPT_FLAG_DECODING_PARAM },

spaces inside {}

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

Reply via email to