On Sat, Jul 07, 2012 at 02:35:23PM +0200, Kostya Shishkov wrote:
> 
> --- a/Changelog
> +++ b/Changelog
> @@ -31,6 +31,7 @@ version <next>:
>  - Microsoft ATC Screen decoder
> +- Microsoft Expression Encoder Screen decoder
>  
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -533,6 +533,8 @@ following image formats are supported:
>  @item Microsoft ATC Screen   @tab     @tab  X
>      @tab Also known as Microsoft Screen 3.
> +@item Microsoft EE Screen    @tab     @tab  X
> +    @tab Also known as Microsoft Titanium Screen 2.

These two names do not match.

> --- /dev/null
> +++ b/libavcodec/mss4.c
> @@ -0,0 +1,750 @@
> +
> +static const uint8_t mss4_ac_vlc_syms[2][162] = {
> +  {
> +    0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
> +    0xF9, 0xFA
> +  },

Merge the braces and the data lines.

> +static int init_vlcs(MSS4Context *ctx)
> +
> +static void free_vlcs(MSS4Context *ctx)
> +
> +static av_always_inline int get_coeff_bits(GetBitContext *gb, int nbits)
> +
> +static inline int get_coeff(GetBitContext *gb, VLC *vlc)
> +
> +static int decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc, int 
> *block,
> +                      int *prev_dc, int prev_dc_stride, int bx, int by,
> +                      uint16_t *quant_mat)

These names are very generic, please prefix them.

> +static void decode_image_block(MSS4Context *ctx, GetBitContext *gb,
> +                               uint8_t *picdst[3], int mb_x, int mb_y)
> +{
> +    uint8_t vec[3][4];
> +    int     vec_len[3];
> +    int     sel_len[3], sel_flag[3];
> +    int     i, j, k, mode, split;
> +    int     prev_vec1 = 0, prev_split = 0;
> +    int     vals[3], prev_pix[3];
> +    int     prev_mode[16];
> +    uint8_t *dst[3];
> +
> +    for (i = 0; i < 3; i++)
> +        dst[i] = ctx->imgbuf[i];
> +    memset(prev_mode, 0, sizeof(prev_mode));
> +    memset(prev_pix,  0, sizeof(prev_pix));
> +    memset(vals,      0, sizeof(vals));

You could initialize the arrays to "{ 0 }" instead.

> +            if (split) {
> +                vals[0] =  prev_mode[0]       & 7;
> +                vals[1] = (prev_mode[0] >> 3) & 7;
> +                vals[2] =  prev_mode[0] >> 6;
> +
> +            if (split != 16) {
> +                vals[0] =  prev_vec1       & 7;
> +                vals[1] = (prev_vec1 >> 3) & 7;
> +                vals[2] =  prev_vec1 >> 6;

nit: pointless ()

> +    if (frame_type != INTRA_FRAME && c->got_error)
> +        return buf_size;
> +    c->got_error = 0;
> +
> +    c->pic.reference    = 3;
> +    c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
> +                          FF_BUFFER_HINTS_REUSABLE;

Align all 3?

> +    for (i = 0; i < 3; i++)
> +        memset(c->prev_dc[i], 0, sizeof(**c->prev_dc) * c->prev_dc_stride[i] 
> * c->prev_dc_height[i]);

long line

> +        for (i = 0; i < 3; i++) {
> +            memmove(c->prev_dc[i],
> +                    c->prev_dc[i] + c->prev_dc_stride[i]
> +                                    * (c->prev_dc_height[i] - 1),
> +                    sizeof(**c->prev_dc) * c->prev_dc_stride[i]);

Indentation is off.

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to