[XviD-devel] GME

Radek Czyz syskin at ihug.com.au
Sun Jul 13 01:41:42 CEST 2003


Hello,

> i already know this problem and i use motion vector
> form previous frame (i hope they will not change too much between 2 frame)

Very good idea indeed.

> i add

>         static int* my_vector=NULL;
>         if(my_vector==NULL)
>         {
>         my_vector=malloc(sizeof(int)*2*mb_width*mb_height);
>         }
> just after
> FrameCodeP(Encoder * pEnc,
>                    Bitstream * bs,
>                    bool force_inter,
>                    bool vol_header)

Sorry, I don't understand - if you create new my_vector table, you
don't have vectors from previous frame in it... it's not initialized
yet.
Anyway, you don't have to do that, you can access previous frame's
vectors from reference->mbs[]. We store them for motion prediction.

>                         if((y*16)+my_vector[2*(x+mb_width*y)+1]<0)

What is it? What is 16 doing there.... How about this:
     if (y == 0) // this is the top edge
        if (my_vector[2*(x+mb_width*y)+1]<0) // y component negative
           decrease quant;


> just before
>         SetMacroblockQuants(&pEnc->mbParam, current);

Yes, this is what you have to do to make dquants 'applied'.
However, as I see in the code, it will not change dquant to -1 or 0 if
the given dquant would lead to quant<=0. So you can 'force' decoder
to use negative quants, which will always cause trouble.

Do you remember to set dquant to +2 in the next macroblock so that the
rest of the image uses normal quantizer ?


Have fun,
Radek



More information about the XviD-devel mailing list