[Mplayer-cvslog] CVS: main/DOCS/tech TODO,1.9,1.10

Michael Niedermayer michaelni at gmx.at
Fri Dec 14 21:34:27 CET 2001


Hi

On Friday 14 December 2001 20:33, Arpi wrote:
[...]> > See original mail. At 00:12:14 the stuff is very visible (looks like
> > shit)
>
> maybe it depends on CPU ?
no 
[...]

fixed ...
^_^

replace draw_edges function from mpegvideo.c with that one ...

static void draw_edges(UINT8 *buf, int wrap, int width, int height, int w)
{
    UINT8 *ptr, *last_line;
    int i;
    int bottom_w;

    // XXX Assuming that w is either 8(chrominance) or 16(luminance)    
    last_line = buf + (((height+(w-1))&(~(w-1))) - 1) * wrap; // Last line in 
MB
    bottom_w= w - ((height+(w-1))&(~(w-1))) + height; // remaining w from 
last line of MB to requested end
//     printf("%d %d\n", bottom_w, (( (height+(w-1)) & (~(w-1)) ) - 1));   
	/* top */
    for(i=0;i<w;i++) {
        memcpy(buf - (i + 1) * wrap, buf, width);
    }
        /* bottom */
    for(i=0;i<bottom_w;i++) {
        memcpy(last_line + (i + 1) * wrap, last_line, width);
    }
    
    /* left and right */
    ptr = buf;
    for(i=0;i<height+w;i++) {
        memset(ptr - w, ptr[0], w);
        memset(ptr + width, ptr[width-1], w);
        ptr += wrap;
    }
    /* top corners */
    for(i=0;i<w;i++) {
        memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
        memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
    }
    
    /* bottom corners */
    for(i=0;i<bottom_w;i++) {
        memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left 
*/
        memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* 
top right */
    }
}

now i only need to test it with a few videos and someone who knows more about 
h263 / mpeg4 than i do should check if its ok with h263/mpeg4 std or if its 
msmpeg specific nonsense

and than i need to try if the same problem exists if the width isnt divisable 
through 16 ...

Michael

PS: the problem was simply that ffdivx allways uses the height as a reference 
for the draw edges stuff while m$ appearently uses the number of macro blocks 
vertically *16  



More information about the MPlayer-cvslog mailing list