[FFmpeg-devel] [PATCH] RV40 Decoder - 2/3 - MC functions

Kostya kostya.shishkov
Sat Nov 29 07:40:21 CET 2008


On Fri, Nov 28, 2008 at 09:13:32PM +0100, Michael Niedermayer wrote:
> On Fri, Nov 28, 2008 at 07:38:21PM +0200, Kostya wrote:
> > On Fri, Nov 28, 2008 at 09:23:35AM +0100, Michael Niedermayer wrote:
> > > On Fri, Nov 28, 2008 at 09:25:09AM +0200, Kostya wrote:
> > [...]
> > > > > 
> > > > > 
> > > > > > \
> > > > > > static void OPNAME ## rv40_qpel8_hv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
> > > > > >     const int h=8;\
> > > > > >     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
> > > > > >     int i;\
> > > > > >     for(i=0; i<h; i++)\
> > > > > >     {\
> > > > > >         OP(dst[0], (src[0] + src[1] + src[0 + srcStride] + src[1 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[1], (src[1] + src[2] + src[1 + srcStride] + src[2 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[2], (src[2] + src[3] + src[2 + srcStride] + src[3 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[3], (src[3] + src[4] + src[3 + srcStride] + src[4 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[4], (src[4] + src[5] + src[4 + srcStride] + src[5 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[5], (src[5] + src[6] + src[5 + srcStride] + src[6 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[6], (src[6] + src[7] + src[6 + srcStride] + src[7 + srcStride] + 2) >> 2);\
> > > > > >         OP(dst[7], (src[7] + src[8] + src[7 + srcStride] + src[8 + srcStride] + 2) >> 2);\
> > > > > >         dst+=dstStride;\
> > > > > >         src+=srcStride;\
> > > > > >     }\
> > > > > > }\
> > > > > 
> > > > > duplicate of the hv code from mpeg1/2 ...
> > > >  
> > > > Could be, but I was not able to find such function in dsputil
> > > 
> > > put/avg_pixels_tab[1][3]
> > 
> > Tried those - they have an additional argument for height so they do not
> > work with other functions. Should I add an additional argument for other
> > RV3/4 luma MC functions as well?
> 
> func(a,b,c){
>     func2(a,b,c,123);
> }

That will work in these cases:
1. I move RV40 luma MC to dsputil.c (not a good idea IMO)
2. Make {put,avg}_pixels_xy2_c() non-static (not a good idea either)
3. Initialize DSPContext inside function and call that function (ineffective)

Alternatively I can:
4. Duplicate some code inside rv40dsp.c
5. Add new argument to the MC functions and reuse existing ones from dsputil.

> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB




More information about the ffmpeg-devel mailing list