static inline void horizX1Filter(uint8_t *src, int stride, int QP)

{

    int y;

    static uint64_t *lut= NULL;

    if(lut==NULL)

    {

        int i;

        lut = av_malloc(256*8);

        for(i=0; i<256; i++)

        {

            int v= i < 128 ? 2*i : 2*(i-256);

/*

//Simulate 112242211 9-Tap filter

            uint64_t a= (v/16)  & 0xFF;

            uint64_t b= (v/8)   & 0xFF;

            uint64_t c= (v/4)   & 0xFF;

            uint64_t d= (3*v/8) & 0xFF;

*/

//Simulate piecewise linear interpolation

            uint64_t a= (v/16)   & 0xFF;

            uint64_t b= (v*3/16) & 0xFF;

            uint64_t c= (v*5/16) & 0xFF;

            uint64_t d= (7*v/16) & 0xFF;

            uint64_t A= (0x100 - a)&0xFF;

            uint64_t B= (0x100 - b)&0xFF;

            uint64_t C= (0x100 - c)&0xFF;

            uint64_t D= (0x100 - c)&0xFF;



            lut[i]   = (a<<56) | (b<<48) | (c<<40) | (d<<32) |

                       (D<<24) | (C<<16) | (B<<8)  | (A);

            //lut[i] = (v<<32) | (v<<24);

        }

    }



    for(y=0; y<BLOCK_SIZE; y++){

        int a= src[1] - src[2];

        int b= src[3] - src[4];

        int c= src[5] - src[6];



        int d= FFMAX(FFABS(b) - (FFABS(a) + FFABS(c))/2, 0);



        if(d < QP){

            int v = d * FFSIGN(-b);



            src[1] +=v/8;

            src[2] +=v/4;

            src[3] +=3*v/8;

            src[4] -=3*v/8;

            src[5] -=v/4;

            src[6] -=v/8;

        }

        src+=stride;

    }

}

static inline void horizX1Filter(uint8_t *src, int stride, int QP)

{

    int y;

    static uint64_t *lut= NULL;

    if(lut==NULL)

    {

        int i;

        lut = av_malloc(256*8);

        for(i=0; i<256; i++)

        {

            int v= i < 128 ? 2*i : 2*(i-256);

















            uint64_t a= (v/16)   & 0xFF;

            uint64_t b= (v*3/16) & 0xFF;

            uint64_t c= (v*5/16) & 0xFF;

            uint64_t d= (7*v/16) & 0xFF;

            uint64_t A= (0x100 - a)&0xFF;

            uint64_t B= (0x100 - b)&0xFF;

            uint64_t C= (0x100 - c)&0xFF;

            uint64_t D= (0x100 - c)&0xFF;



            lut[i]   = (a<<56) | (b<<48) | (c<<40) | (d<<32) |

                       (D<<24) | (C<<16) | (B<<8)  | (A);

            

        }

    }



    for(y=0; y<BLOCK_SIZE; y++){

        int a= src[1] - src[2];

        int b= src[3] - src[4];

        int c= src[5] - src[6];



        int d= FFMAX(FFABS(b) - (FFABS(a) + FFABS(c))/2, 0);



        if(d < QP){

            int v = d * FFSIGN(-b);



            src[1] +=v/8;

            src[2] +=v/4;

            src[3] +=3*v/8;

            src[4] -=3*v/8;

            src[5] -=v/4;

            src[6] -=v/8;

        }

        src+=stride;

    }

}

    static uint64_t *lut= NULL;     if(lut==NULL)         lut = av_malloc(256*8);
static inline void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2)

{

    int VAR_3;

    static uint64_t *VAR_4= NULL;

    if(VAR_4==NULL)

    {

        int VAR_5;

        VAR_4 = av_malloc(256*8);

        for(VAR_5=0; VAR_5<256; VAR_5++)

        {

            int VAR_6= VAR_5 < 128 ? 2*VAR_5 : 2*(VAR_5-256);

















            uint64_t a= (VAR_6/16)   & 0xFF;

            uint64_t b= (VAR_6*3/16) & 0xFF;

            uint64_t c= (VAR_6*5/16) & 0xFF;

            uint64_t d= (7*VAR_6/16) & 0xFF;

            uint64_t A= (0x100 - a)&0xFF;

            uint64_t B= (0x100 - b)&0xFF;

            uint64_t C= (0x100 - c)&0xFF;

            uint64_t D= (0x100 - c)&0xFF;



            VAR_4[VAR_5]   = (a<<56) | (b<<48) | (c<<40) | (d<<32) |

                       (D<<24) | (C<<16) | (B<<8)  | (A);

            

        }

    }



    for(VAR_3=0; VAR_3<BLOCK_SIZE; VAR_3++){

        int a= VAR_0[1] - VAR_0[2];

        int b= VAR_0[3] - VAR_0[4];

        int c= VAR_0[5] - VAR_0[6];



        int d= FFMAX(FFABS(b) - (FFABS(a) + FFABS(c))/2, 0);



        if(d < VAR_2){

            int VAR_6 = d * FFSIGN(-b);



            VAR_0[1] +=VAR_6/8;

            VAR_0[2] +=VAR_6/4;

            VAR_0[3] +=3*VAR_6/8;

            VAR_0[4] -=3*VAR_6/8;

            VAR_0[5] -=VAR_6/4;

            VAR_0[6] -=VAR_6/8;

        }

        VAR_0+=VAR_1;

    }

}

static inline void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2)
{ int VAR_3; static uint64_t *VAR_4= NULL; if(VAR_4==NULL)
{ int VAR_5; VAR_4 = av_malloc(256*8); for(VAR_5=0; VAR_5<256; VAR_5++) { int VAR_6= VAR_5 < 128 ? 2*VAR_5 : 2*(VAR_5-256); uint64_t a= (VAR_6/16)   & 0xFF; uint64_t b= (VAR_6*3/16) & 0xFF; uint64_t c= (VAR_6*5/16) & 0xFF; uint64_t d= (7*VAR_6/16) & 0xFF; uint64_t A= (0x100 - a)&0xFF; uint64_t B= (0x100 - b)&0xFF; uint64_t C= (0x100 - c)&0xFF; uint64_t D= (0x100 - c)&0xFF; VAR_4[VAR_5]   = (a<<56) | (b<<48) | (c<<40) | (d<<32) |
(D<<24) | (C<<16) | (B<<8)  | (A); } } for(VAR_3=0; VAR_3<BLOCK_SIZE; VAR_3++){ int a= VAR_0[1] - VAR_0[2]; int b= VAR_0[3] - VAR_0[4]; int c= VAR_0[5] - VAR_0[6]; int d= FFMAX(FFABS(b) - (FFABS(a) + FFABS(c))/2, 0); if(d < VAR_2){ int VAR_6 = d * FFSIGN(-b); VAR_0[1] +=VAR_6/8; VAR_0[2] +=VAR_6/4; VAR_0[3] +=3*VAR_6/8; VAR_0[4] -=3*VAR_6/8; VAR_0[5] -=VAR_6/4; VAR_0[6] -=VAR_6/8; } VAR_0+=VAR_1; } }