[FFmpeg-devel] PATH :wmv2 Limit the mvx and mvy to be integer in some condition

Michael Niedermayer michaelni at gmx.at
Thu Oct 16 03:16:48 CEST 2014


Hi

On Wed, Oct 15, 2014 at 11:44:18AM +0000, Di Wu wrote:
> Hi :
>     I have created a patch, but I'm not sure if the patch is correct 
> because I don't have the spec of wmv2.
>     The following code which is in ff_mspel_motion function seems to 
> limit the mvx and mvy to be integer to make sure the prediction right 
> and to void reading overflow. But I'm not sure, maybe this is just 
> specified by the spec of wmv2.
>      if (src_x <= -16 || src_x >= s->width)
>         dxy &= ~3;
>     if (src_y <= -16 || src_y >= s->height)
>         dxy &= ~4;
> 
>     If the goal of the up code is the former one, the following code 
> can play the same role, So I'm confused.
>     if (src_x < 1 || src_y < 1 || src_x + 17 >= s->h_edge_pos ||
>         src_y + h + 1 >= v_edge_pos) {
>         s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize,
>                                  s->linesize, s->linesize, 19, 19,
>                                  src_x - 1, src_y - 1,
>                                  s->h_edge_pos, s->v_edge_pos);
>         ptr = s->edge_emu_buffer + 1 + s->linesize;
>         emu = 1;
>     }
>     
>     If this code is used to make sure the prediction right and to void 
> reading overflow, I think my patch should applied or just remove this 
> code.
>     My patch is attached, please check it.

i dont have wmv2 specs and i suspect noone outside MS and outside some
NDA has.
So to awnser if and where cliping of MVs is needed/correct a differnt
method has to be used.
Maybe you could hack the motion estimation code to produce many
MVs that fall at the cliping boundary and encode some test material
and then check how it looks when decoded by the binary decoder from MS
and ours with various cliping positions

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141016/2348f944/attachment.asc>


More information about the ffmpeg-devel mailing list