Re[4]: [XviD-devel] qpel - problems I found

Michael Niedermayer xvid-devel@xvid.org
Sat, 12 Oct 2002 16:47:40 +0200


Hi

On Saturday 12 October 2002 16:23, Radek 'sysKin' Czyz wrote:
> > hm, strange. I had the opposite opinion: Last time I checked, DivX5
> > seemed to also do some rounding, at least decoding DivX5 qpel clips with
> > only halfing qpel vectors for chroma blocks looked clearly wrong... Need
> > to look at it again.
>
> Sorry! I thought I checked divx5 but that must have been some time
> ago. You're right. Divx5 decodes with rounding, and the artifacts
> don't even seem to be chroma related (at least not only).
>
> So it's ffdshow/libvacodec which forgets the rounding. Apart from
> that, it seems to decode fine - no other artifacts.
heres the qpel-chroma rounding code from ffmpeg, perhaps it helps, iam pretty 
sure its correct, as i spended some time fixing it after most qpel 
conformance streams looked messed up, as u can see divx5 uses something 
different again :(

    if(field_based){
        mx= motion_x/2;
        my= motion_y>>1;
    }else if(s->divx_version){
        mx= (motion_x>>1)|(motion_x&1);
        my= (motion_y>>1)|(motion_y&1);
    }else{
        mx= motion_x/2;
        my= motion_y/2;
    }
    mx= (mx>>1)|(mx&1);
    my= (my>>1)|(my&1);

[...]

Michael