[FFmpeg-devel] [PATCH] RV40 Decoder - 2/3 - MC functions
Michael Niedermayer
michaelni
Fri Nov 28 09:23:35 CET 2008
On Fri, Nov 28, 2008 at 09:25:09AM +0200, Kostya wrote:
> On Thu, Nov 27, 2008 at 09:14:48PM +0100, Michael Niedermayer wrote:
> > On Thu, Nov 27, 2008 at 09:25:08AM +0200, Kostya wrote:
> > > $subj
> > >
> > > I've decided not to taint H.264 chroma MC with the idiocy from RV40,
> > > so here are all functions in a single file.
> >
> > [...]
> > > #define RV40_LOWPASS(OPNAME, OP) \
> > > static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
> > > const int h, const int C1, const int C2, const int C3){\
> > > uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
> > > int i;\
> > > for(i=0; i<h; i++)\
> > > {\
> > > OP(dst[0], (src[-2] + src[ 3] - 5*(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[1], (src[-1] + src[ 4] - 5*(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[2], (src[ 0] + src[ 5] - 5*(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[3], (src[ 1] + src[ 6] - 5*(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[4], (src[ 2] + src[ 7] - 5*(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[5], (src[ 3] + src[ 8] - 5*(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[6], (src[ 4] + src[ 9] - 5*(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + (1<<(C3-1))) >> C3);\
> > > OP(dst[7], (src[ 5] + src[10] - 5*(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + (1<<(C3-1))) >> C3);\
> > > dst+=dstStride;\
> > > src+=srcStride;\
> > > }\
> > > }\
> >
> > please rename C3 to SHIFT or something like that
> > also in the other functions ...
>
> done
>
> > [...]
> >
> >
> > > \
> > > 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]
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081128/d2e0dbf5/attachment.pgp>
More information about the ffmpeg-devel
mailing list