[XviD-devel] bug in the XviD encoder about full pixel precision

Christoph Lampert xvid-devel@xvid.org
Wed, 25 Dec 2002 15:18:42 +0100 (CET)


On Mon, 23 Dec 2002, zhouxiao wrote:

> Just as I said, I am a beginner, So, until now I am not sure that MV will only have even values if encoder works in full pixel precision. 
> But asssuming that it is true, 

It is true, that's what deactivating halfpel is about: not using halfpel 
positions in ME.

> there is still a problem in the encoder.

No, there is not. 
 
> That is :
> Because chrominance MV is derived by the division of luminance MVs by 2 , chrominance MV is likely to be on the half pixel postion even if luminance MVs all are on full pixel positions.
> While, in MBMotionCompensation( ) function, whether encoder workis in full or half pixel precision, it will do chrominance component's image interpolation when chrominance MV is on half pixel position. 

Yes, and that's why for chrominance the motion compensation _always_ uses
halfpel which is computed on-the-fly (block based) and not by
image_interpolate(). 

Sorry, what exactly is your point? Please don't tell us about so called 
"bugs" in the source code, if you didn't even read the code or don't
understand it. 

XVID is a working codec, don't you think we tested at least a little? 
If fullpel-only encoding used NULL-pointers all the time, don't you
think we would have noticed??? 
Of course there still are bugs in XVID, but certainly none of the type
which you "found".

gruel







> Wish someone give some advice.
> 
> zxjan
> 
> >> 
> >> I am a starter on XviD and It seems like a bug in the XviD encoder about full pixel precision.
> >> 
> >> The possible bug exists in this way: 
> >> 
> >> In xvid_encraw.c, we can specify the encoder quanlity between [ 0, 6]. 
> >> the quanlity determines the working mode of encoder. 
> >> According to the general_preset[], if we specify quanlity be 0 ~2, encoder will work in full pixel precision , and if specify quanlity be 3 ~ 6, in half pixel precision. 
> >> 
> >> Now assume encoder quanlity be 1, that is, encoder works in full pixel precision. 
> >> 
> >> Thus, during encodeing a P-frame , encoder will not interpolate this frame because of full pixel precision. that is, in function FrameCodeP(), this if-sentence wil be skipped: 
> >> 
> >> if ((pEnc->current->global_flags & XVID_HALFPEL)) 
> >> { 
> >> image_interpolate ( pRef, &pEnc->vInterH, &pEnc->vInterV, 
> >> &pEnc->vInterHV, pEnc->mbParam.edged_width, 
> >> pEnc->mbParam.edged_height, 
> >> pEnc->current->rounding_type); 
> >> } 
> >> 
> >> thus, vInterH, vInterV, vInterHV image buffers are all void. 
> >> 
> >> then, encoder begin to do Motion estimation for this P-frame. that is:: 
> >> bIntra = 
> >> MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference, 
> >> &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV, 
> >> iLimit); 
> >> 
> >> while, In this function, encoder first do MB motion search for finding SAD16 and MV16. 
> >> Hmm, the bug just is here! 
> >> when encoder caculates SAD between current MB and target MB, because the MV is in half-pixel resolution and it maybe lies in half-pixel position, encoder is likely to fetch image data of target MV from vInterH or vInterV or vInterHV buffer. 
> >
> >The MV will only have even values, so only fullpel position will be
> >searched.
> >
> >gruel
> >
> >
> >> But at this time, these buffer are all void !! 
> >> 
> >> Can someone help me? 
> >> 
> >> Please help me! 
> >> 
> >> 
> >> zxjan
> >> 
> 
> 
> 
> 
> _______________________________________________
> XviD-devel mailing list
> XviD-devel@xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
>