[FFmpeg-devel] [RFC] RV30 1/3pel MC functions

Michael Niedermayer michaelni
Wed Dec 26 03:38:35 CET 2007


On Mon, Dec 24, 2007 at 01:04:00PM +0200, Kostya wrote:
[...]
> +        mx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24);
> +        my = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
> +        lx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
> +        ly = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
> +        dxy = ly*4 + lx;

> +        uvmx = chroma_coeffs[((s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) >> 1) % 3];
> +        uvmy = chroma_coeffs[((s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) >> 1) % 3];

this is wrong ([0] vs. [1])
also i think (3*(mx&1) + lx)>>1 could be used to avoid the %



[...]

> @@ -422,6 +422,10 @@
>      void (*x8_setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
>             int * range, int * sum,  int edges);
>  
> +    /* rv30 functions */
> +    qpel_mc_func put_rv30_tpel_pixels_tab[4][16];
> +    qpel_mc_func avg_rv30_tpel_pixels_tab[4][16];
> +

this could be put under CONFIG_RV30_DECODER as well


[...]
> +static void OPNAME ## rv30_tpel8_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++)\
> +    {\
> +        OP2(dst[0], 36*src[0]+54*src[1]+6*src[2]+54*src[0+srcStride]+81*src[1+srcStride]+9*src[2+srcStride]+6*src[0+srcStride*2]+9*src[1+srcStride*2]+src[2+srcStride*2]);\

instead of 9 read, 8 mul (or 5 if factored a little), 8 add, 1 store per pixel
this can be implemented as 6 read, 4 multiply, 4 add, 2 store by simply
spliting the filter in horizontal and vetical


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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- 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/20071226/163bbb24/attachment.pgp>



More information about the ffmpeg-devel mailing list