[FFmpeg-devel] [PATCH][RFC] Indeo3 replacement

Maxim max_pole
Fri Jul 31 13:28:21 CEST 2009


Michael Niedermayer schrieb:
> On Mon, Jul 27, 2009 at 05:28:07PM +0200, Maxim wrote:
>   
>> Michael Niedermayer schrieb:
>>     
>>>>     /* setup output and reference pointers */
>>>>     dst = &plane->pixels[buf_switch][(cell->ypos << 2) * plane->pitch + (cell->xpos << 2)];
>>>>     /* reference block = prev_frame(cell_xpos + mv_x, cell_ypos + mv_y) */
>>>>     mv_y = cell->mv_ptr[0];
>>>>     mv_x = cell->mv_ptr[1];
>>>>     offset = ((cell->ypos << 2) + mv_y) * plane->pitch + (cell->xpos << 2) + mv_x;
>>>>     src = &plane->pixels[buf_switch ^ 1][offset];A typical cell consists of 4x4 blocks in raster order and is usually
>>>> 4-6 blocks or 16-24 pixels wide. By INTER pictures it's usually bigger
>>>>
>>>>     for (y = cell->height << 2; y > 0; src += plane->pitch, dst += plane->pitch, y--)
>>>>         memcpy(dst, src, cell->width << 2);
>>>> }
>>>>     
>>>>         
>>> also, cant the dsputil block copy code be used?
>>>   
>>>       
>> Which function I have to look into? Plz help, I'm not a dsputil's guru...
>>     

I'm very sorry but I don't really understand why you ask me to replace
the code above with block_copy? Is "memcpy" not fast enough? I'm aware
of the fact that we shouldn't duplicate code but I'm not sure that the
block_copy would be a better solution for this case IMHO. Dsputil's
block copy code operates on blocks of fixed width but I often need to
copy blocks of 24 and more pixels wide...

For example, "c93.c" contains its own "copy_block" as well doing
practically the same as my code. I just wonder if we have a common
"copy_block" routine in dsputils which is capable of copying of large
blocks of ANY size?

Regards
Maxim



More information about the ffmpeg-devel mailing list