[FFmpeg-soc] [soc]: r297 - rv40/rv40.c

Kostya kostya.shishkov at gmail.com
Sun Jul 1 18:50:19 CEST 2007


On Sun, Jul 01, 2007 at 06:04:19PM +0200, Michael Niedermayer wrote:
> Hi
> 
> On Sun, Jul 01, 2007 at 04:05:08PM +0200, kostya wrote:
> > Author: kostya
> > Date: Sun Jul  1 16:05:08 2007
> > New Revision: 297
> > 
> > Log:
> > Skeleton and some functions for RV40 decoder.
> [...]
> > +/**
> > + * Real Video 4.0 inverse transform
> > + * Code is almost the same as in SVQ3, only scaling is different
> > + */
> 
> what about passing qmul instead of qp into the svq3 function? is there
> still a difference then?

RV40 uses either two quantizers or even whole quantizer matrix, which is
different from SVQ3.  
 
> [...]
> > +#define DECODE_COEFF(dst, dstidx, coef, esc, gb, vlc) \
> > +    if(coef){ \
> > +        if(coef == esc){ \
> > +            coef = get_vlc2(gb, vlc.table, 9, 2); \
> > +            if(coef > 23){ \
> > +                coef -= 23; \
> > +                coef = 22 + ((1 << coef) | get_bits(gb, coef)); \
> > +            } \
> > +            coef += esc; \
> > +        } \
> > +        if(get_bits1(gb)) \
> > +            coef = -coef; \
> > +        dst[dstidx] = coef; \
> > +    }
> > +
> > +#define DECODE_2x2_BLOCK(dst, dstoff, stride, coeffs, gb, vlc) \
> > +    DECODE_COEFF(dst, dstoff+0       , coeffs[0], 3, gb, vlc); \
> > +    DECODE_COEFF(dst, dstoff+1       , coeffs[1], 2, gb, vlc); \
> > +    DECODE_COEFF(dst, dstoff+0+stride, coeffs[2], 2, gb, vlc); \
> > +    DECODE_COEFF(dst, dstoff+1+stride, coeffs[3], 2, gb, vlc); \
> 
> i dont like this forced inlining, normal inline functions would be cleaner

inlined 

> [...]
> > +    if(!*h){
> > +        do{
> > +            t = get_bits(gb, 8);
> > +            *h += t << 2;
> > +        }while(t == 0xFF);
> > +    }
> 
> duplciate

moved to inline function 
 
> [...]
> > +    if(!tables_done){
> > +        rv40_init_tables();
> > +        tables_done = 1;
> > +
> > +        if(0){
> > +         uint8_t bits[] = {0xD1, 0xB7, 0x37, 0x6A};
> > +         GetBitContext gb;
> 
> the indention does not look good

That's test code that will be dropped soon. Identation just helps not to forget it.
 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Democracy is the form of government in which you can choose your dictator



More information about the FFmpeg-soc mailing list