On Sat, Jun 30, 2012 at 09:12:59AM +0200, Kostya Shishkov wrote:
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -292,6 +292,7 @@ OBJS-$(CONFIG_MSMPEG4V3_ENCODER)       += msmpeg4.o 
> msmpeg4enc.o msmpeg4data.o \
>  OBJS-$(CONFIG_MSRLE_DECODER)           += msrle.o msrledec.o
> +OBJS-$(CONFIG_MSA1_DECODER)            += mss3.o
>  OBJS-$(CONFIG_MSS1_DECODER)            += mss1.o

The naming is inconsistent - you use mss3 for the filename, but msa1
as codec name.  This is confusing.

> --- /dev/null
> +++ b/libavcodec/mss3.c
> @@ -0,0 +1,969 @@
> +
> +typedef struct MSS3Context {
> +} MSS3Context;

The same applies to the naming of this struct.

> +static void model2_update(Model2 *m, int bit)
> +{
> +    m->total_weight += m->upd_val;
> +    if (m->total_weight > 0x2000) {
> +        m->total_weight = (m->total_weight + 1) >> 1;
> +        m->zero_weight  = (m->zero_weight  + 1) >> 1;
> +        if (m->total_weight == m->zero_weight)
> +            m->total_weight = m->zero_weight + 1;
> +    }
> +    m->upd_val = (m->upd_val * 5) >> 2;
> +    if (m->upd_val > 64)
> +        m->upd_val = 64;
> +    scale = 0x80000000u / m->total_weight;
> +    m->zero_freq    = (m->zero_weight  * scale) >> 18;
> +    m->total_freq   = (m->total_weight * scale) >> 18;
> +    m->till_rescale = m->upd_val;

nit: some pointless () - more below if you care...

> +#define DCT_TEMPLATE(blk, step, SOP, shift) \
> +    const int t0 = -39409 * blk[7 * step] -  58980 * blk[1 * step]; \
> +    const int t1 =  39410 * blk[1 * step] -  58980 * blk[7 * step]; \
> +    const int t2 = -33410 * blk[5 * step] - 167963 * blk[3 * step]; \
> +    const int t3 =  33410 * blk[3 * step] - 167963 * blk[5 * step]; \
> +    const int t4 = blk[3 * step] + blk[7 * step]; \
> +    const int t5 = blk[1 * step] + blk[5 * step]; \
> +    const int t6 =  77062 * t4 + 51491 * t5; \
> +    const int t7 =  77062 * t5 - 51491 * t4; \
> +    const int t8 =  35470 * blk[2 * step] - 85623 * blk[6 * step]; \
> +    const int t9 =  35470 * blk[6 * step] + 85623 * blk[2 * step]; \
> +    const int tA = SOP(blk[0 * step] - blk[4 * step]); \
> +    const int tB = SOP(blk[0 * step] + blk[4 * step]); \
> +\
> +    blk[0 * step] = (  t1 + t6  + t9 + tB) >> shift; \
> +    blk[1 * step] = (  t3 + t7  + t8 + tA) >> shift; \
> +    blk[2 * step] = (  t2 + t6  - t8 + tA) >> shift; \
> +    blk[3 * step] = (  t0 + t7  - t9 + tB) >> shift; \
> +    blk[4 * step] = (-(t0 + t7) - t9 + tB) >> shift; \
> +    blk[5 * step] = (-(t2 + t6) - t8 + tA) >> shift; \
> +    blk[6 * step] = (-(t3 + t7) + t8 + tA) >> shift; \
> +    blk[7 * step] = (-(t1 + t6) + t9 + tB) >> shift; \
> +\

nit: Please align the \ and you could drop that last one (or two).
     You could also prettypring t4 and t5 some more.

> +    if ((avctx->width & 0xF) || (avctx->height & 0xF)) {
> +        av_log(avctx, AV_LOG_ERROR,
> +               "Image dimensions should be multiple of 16\n");

a multiple, end in a period.

> +    avctx->pix_fmt = PIX_FMT_YUV420P;
> +
> +    avctx->coded_frame = &c->pic;

nit: align ;)

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

Reply via email to