[XviD-devel] [PATCH] Faster direct/interpolate bvop block
interpolation
Edouard Gomez
ed.gomez at free.fr
Sat Jul 24 11:50:26 CEST 2004
skal (skal at planet-d.net) wrote:
> Nope =>
> Section 6.3.5, syntax element "vop_rounding_type":
> "...When vop_rounding_type is not present in the VOP
> header, the value of rounding_control is 0".
>
> and dst = (a+b+ 1-rounding_control)>>1
Well you didn't quote the right clause as this one applies to
P/S-VOPs:
The right chapter to quote would have been this one:
7.6.9.4 Bi-directional mode
Both the forward vector (MVFx,MVFy) and the backward vector
(MVBx,MVBy) are applied in this mode. The prediction blocks
Pi_Y, Pi_U, and Pi_V are generated from the forward and backward
reference VOPs by doing the forward prediction, the backward
prediction and then averaging both predictions pixel by pixel
as follows.
mc(Pf_Y, ref_Y_for, x, y, 16, 16, MVFx, MVFy, 0, 0, 0, 1);
mc(Pf_U, ref_U_for, x/2, y/2, 8, 8, MVFx_chro, MVFy_chro, 0, 0, 0,1);
mc(Pf_V, ref_V_for, x/2, y/2, 8, 8, MVFx_chro, MVFy_chro, 0, 0, 0,1);
mc(Pb_Y, ref_Y_back, x, y, 16, 16, MVBx, MVBy, 0, 0, 0, 1);
mc(Pb_U, ref_U_back, x/2, y/2, 8, 8, MVBx_chro, MVBy_chro, 0, 0, 0,1);
mc(Pb_V, ref_V_back, x/2, y/2, 8, 8, MVBx_chro, MVBy_chro, 0, 0, 0,1);
Pi_Y[i][j] = (Pf_Y[i][j] + Pb_Y[i][j] + 1)>>1; i,j=0,1,2...15;
Pi_U[i][j] = (Pf_U[i][j] + Pb_U[i][j] + 1)>>1; i,j=0,1,2...8;
Pi_V[i][j] = (Pf_V[i][j] + Pb_V[i][j] + 1)>>1; i,j=0,1,2...8;
NB: even if your quote wasn't right, you were right, xvid
should use a +1 bias in averaging stage ! :-(
> > xmm code doesn't match the spec, or we're doing wrong in xvid
> > since ever. I hope it'syour code that is wrong :-)
>
> Nope. In decoder.c, calls to interpolate8x8_avg2()
> should be done with a rounding param 0 (instead of '1',
> currently).
Absolutly right... so i have to change the C backend again to
include a +1 bias when averaging with the dst, and change the
last step averaging for qpel as well.
--
Edouard Gomez
More information about the XviD-devel
mailing list