static void blend_image(AVFilterContext *ctx,

                        AVFilterBufferRef *dst, AVFilterBufferRef *src,

                        int x, int y)

{

    OverlayContext *over = ctx->priv;

    int i, j, k;

    int width   = src->video->w;

    int height  = src->video->h;



    if (over->main_is_packed_rgb) {

        uint8_t *dp = dst->data[0] + x * over->main_pix_step[0] +

                      y * dst->linesize[0];

        uint8_t *sp = src->data[0];

        uint8_t alpha;          ///< the amount of overlay to blend on to main

        const int dr = over->main_rgba_map[R];

        const int dg = over->main_rgba_map[G];

        const int db = over->main_rgba_map[B];

        const int da = over->main_rgba_map[A];

        const int dstep = over->main_pix_step[0];

        const int sr = over->overlay_rgba_map[R];

        const int sg = over->overlay_rgba_map[G];

        const int sb = over->overlay_rgba_map[B];

        const int sa = over->overlay_rgba_map[A];

        const int sstep = over->overlay_pix_step[0];

        const int main_has_alpha = over->main_has_alpha;

        for (i = 0; i < height; i++) {

            uint8_t *d = dp, *s = sp;

            for (j = 0; j < width; j++) {

                alpha = s[sa];



                // if the main channel has an alpha channel, alpha has to be calculated

                // to create an un-premultiplied (straight) alpha value

                if (main_has_alpha && alpha != 0 && alpha != 255) {

                    uint8_t alpha_d = d[da];

                    alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                }



                switch (alpha) {

                case 0:

                    break;

                case 255:

                    d[dr] = s[sr];

                    d[dg] = s[sg];

                    d[db] = s[sb];

                    break;

                default:

                    // main_value = main_value * (1 - alpha) + overlay_value * alpha

                    // since alpha is in the range 0-255, the result must divided by 255

                    d[dr] = FAST_DIV255(d[dr] * (255 - alpha) + s[sr] * alpha);

                    d[dg] = FAST_DIV255(d[dg] * (255 - alpha) + s[sg] * alpha);

                    d[db] = FAST_DIV255(d[db] * (255 - alpha) + s[sb] * alpha);

                }

                if (main_has_alpha) {

                    switch (alpha) {

                    case 0:

                        break;

                    case 255:

                        d[da] = s[sa];

                        break;

                    default:

                        // apply alpha compositing: main_alpha += (1-main_alpha) * overlay_alpha

                        d[da] += FAST_DIV255((255 - d[da]) * s[sa]);

                    }

                }

                d += dstep;

                s += sstep;

            }

            dp += dst->linesize[0];

            sp += src->linesize[0];

        }

    } else {

        const int main_has_alpha = over->main_has_alpha;

        if (main_has_alpha) {

            uint8_t *da = dst->data[3] + x * over->main_pix_step[3] +

                          y * dst->linesize[3];

            uint8_t *sa = src->data[3];

            uint8_t alpha;          ///< the amount of overlay to blend on to main

            for (i = 0; i < height; i++) {

                uint8_t *d = da, *s = sa;

                for (j = 0; j < width; j++) {

                    alpha = *s;

                    if (alpha != 0 && alpha != 255) {

                        uint8_t alpha_d = *d;

                        alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                    }

                    switch (alpha) {

                    case 0:

                        break;

                    case 255:

                        *d = *s;

                        break;

                    default:

                        // apply alpha compositing: main_alpha += (1-main_alpha) * overlay_alpha

                        *d += FAST_DIV255((255 - *d) * *s);

                    }

                    d += 1;

                    s += 1;

                }

                da += dst->linesize[3];

                sa += src->linesize[3];

            }

        }

        for (i = 0; i < 3; i++) {

            int hsub = i ? over->hsub : 0;

            int vsub = i ? over->vsub : 0;

            uint8_t *dp = dst->data[i] + (x >> hsub) +

                (y >> vsub) * dst->linesize[i];

            uint8_t *sp = src->data[i];

            uint8_t *ap = src->data[3];

            int wp = FFALIGN(width, 1<<hsub) >> hsub;

            int hp = FFALIGN(height, 1<<vsub) >> vsub;

            for (j = 0; j < hp; j++) {

                uint8_t *d = dp, *s = sp, *a = ap;

                for (k = 0; k < wp; k++) {

                    // average alpha for color components, improve quality

                    int alpha_v, alpha_h, alpha;

                    if (hsub && vsub && j+1 < hp && k+1 < wp) {

                        alpha = (a[0] + a[src->linesize[3]] +

                                 a[1] + a[src->linesize[3]+1]) >> 2;

                    } else if (hsub || vsub) {

                        alpha_h = hsub && k+1 < wp ?

                            (a[0] + a[1]) >> 1 : a[0];

                        alpha_v = vsub && j+1 < hp ?

                            (a[0] + a[src->linesize[3]]) >> 1 : a[0];

                        alpha = (alpha_v + alpha_h) >> 1;

                    } else

                        alpha = a[0];

                    // if the main channel has an alpha channel, alpha has to be calculated

                    // to create an un-premultiplied (straight) alpha value

                    if (main_has_alpha && alpha != 0 && alpha != 255) {

                        // average alpha for color components, improve quality

                        uint8_t alpha_d;

                        if (hsub && vsub && j+1 < hp && k+1 < wp) {

                            alpha_d = (d[0] + d[src->linesize[3]] +

                                       d[1] + d[src->linesize[3]+1]) >> 2;

                        } else if (hsub || vsub) {

                            alpha_h = hsub && k+1 < wp ?

                                (d[0] + d[1]) >> 1 : d[0];

                            alpha_v = vsub && j+1 < hp ?

                                (d[0] + d[src->linesize[3]]) >> 1 : d[0];

                            alpha_d = (alpha_v + alpha_h) >> 1;

                        } else

                            alpha_d = d[0];

                        alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                    }

                    *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha);

                    s++;

                    d++;

                    a += 1 << hsub;

                }

                dp += dst->linesize[i];

                sp += src->linesize[i];

                ap += (1 << vsub) * src->linesize[3];

            }

        }

    }

}

static void blend_image(AVFilterContext *ctx,

                        AVFilterBufferRef *dst, AVFilterBufferRef *src,

                        int x, int y)

{

    OverlayContext *over = ctx->priv;

    int i, j, k;

    int width   = src->video->w;

    int height  = src->video->h;



    if (over->main_is_packed_rgb) {

        uint8_t *dp = dst->data[0] + x * over->main_pix_step[0] +

                      y * dst->linesize[0];

        uint8_t *sp = src->data[0];

        uint8_t alpha;          

        const int dr = over->main_rgba_map[R];

        const int dg = over->main_rgba_map[G];

        const int db = over->main_rgba_map[B];

        const int da = over->main_rgba_map[A];

        const int dstep = over->main_pix_step[0];

        const int sr = over->overlay_rgba_map[R];

        const int sg = over->overlay_rgba_map[G];

        const int sb = over->overlay_rgba_map[B];

        const int sa = over->overlay_rgba_map[A];

        const int sstep = over->overlay_pix_step[0];

        const int main_has_alpha = over->main_has_alpha;

        for (i = 0; i < height; i++) {

            uint8_t *d = dp, *s = sp;

            for (j = 0; j < width; j++) {

                alpha = s[sa];



                

                

                if (main_has_alpha && alpha != 0 && alpha != 255) {

                    uint8_t alpha_d = d[da];

                    alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                }



                switch (alpha) {

                case 0:

                    break;

                case 255:

                    d[dr] = s[sr];

                    d[dg] = s[sg];

                    d[db] = s[sb];

                    break;

                default:

                    

                    

                    d[dr] = FAST_DIV255(d[dr] * (255 - alpha) + s[sr] * alpha);

                    d[dg] = FAST_DIV255(d[dg] * (255 - alpha) + s[sg] * alpha);

                    d[db] = FAST_DIV255(d[db] * (255 - alpha) + s[sb] * alpha);

                }

                if (main_has_alpha) {

                    switch (alpha) {

                    case 0:

                        break;

                    case 255:

                        d[da] = s[sa];

                        break;

                    default:

                        

                        d[da] += FAST_DIV255((255 - d[da]) * s[sa]);

                    }

                }

                d += dstep;

                s += sstep;

            }

            dp += dst->linesize[0];

            sp += src->linesize[0];

        }

    } else {

        const int main_has_alpha = over->main_has_alpha;

        if (main_has_alpha) {

            uint8_t *da = dst->data[3] + x * over->main_pix_step[3] +

                          y * dst->linesize[3];

            uint8_t *sa = src->data[3];

            uint8_t alpha;          

            for (i = 0; i < height; i++) {

                uint8_t *d = da, *s = sa;

                for (j = 0; j < width; j++) {

                    alpha = *s;

                    if (alpha != 0 && alpha != 255) {

                        uint8_t alpha_d = *d;

                        alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                    }

                    switch (alpha) {

                    case 0:

                        break;

                    case 255:

                        *d = *s;

                        break;

                    default:

                        

                        *d += FAST_DIV255((255 - *d) * *s);

                    }

                    d += 1;

                    s += 1;

                }

                da += dst->linesize[3];

                sa += src->linesize[3];

            }

        }

        for (i = 0; i < 3; i++) {

            int hsub = i ? over->hsub : 0;

            int vsub = i ? over->vsub : 0;

            uint8_t *dp = dst->data[i] + (x >> hsub) +

                (y >> vsub) * dst->linesize[i];

            uint8_t *sp = src->data[i];

            uint8_t *ap = src->data[3];

            int wp = FFALIGN(width, 1<<hsub) >> hsub;

            int hp = FFALIGN(height, 1<<vsub) >> vsub;

            for (j = 0; j < hp; j++) {

                uint8_t *d = dp, *s = sp, *a = ap;

                for (k = 0; k < wp; k++) {

                    

                    int alpha_v, alpha_h, alpha;

                    if (hsub && vsub && j+1 < hp && k+1 < wp) {

                        alpha = (a[0] + a[src->linesize[3]] +

                                 a[1] + a[src->linesize[3]+1]) >> 2;

                    } else if (hsub || vsub) {

                        alpha_h = hsub && k+1 < wp ?

                            (a[0] + a[1]) >> 1 : a[0];

                        alpha_v = vsub && j+1 < hp ?

                            (a[0] + a[src->linesize[3]]) >> 1 : a[0];

                        alpha = (alpha_v + alpha_h) >> 1;

                    } else

                        alpha = a[0];

                    

                    

                    if (main_has_alpha && alpha != 0 && alpha != 255) {

                        

                        uint8_t alpha_d;

                        if (hsub && vsub && j+1 < hp && k+1 < wp) {

                            alpha_d = (d[0] + d[src->linesize[3]] +

                                       d[1] + d[src->linesize[3]+1]) >> 2;

                        } else if (hsub || vsub) {

                            alpha_h = hsub && k+1 < wp ?

                                (d[0] + d[1]) >> 1 : d[0];

                            alpha_v = vsub && j+1 < hp ?

                                (d[0] + d[src->linesize[3]]) >> 1 : d[0];

                            alpha_d = (alpha_v + alpha_h) >> 1;

                        } else

                            alpha_d = d[0];

                        alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d);

                    }

                    *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha);

                    s++;

                    d++;

                    a += 1 << hsub;

                }

                dp += dst->linesize[i];

                sp += src->linesize[i];

                ap += (1 << vsub) * src->linesize[3];

            }

        }

    }

}

static void FUNC_0(AVFilterContext *VAR_0,

                        AVFilterBufferRef *VAR_1, AVFilterBufferRef *VAR_2,

                        int VAR_3, int VAR_4)

{

    OverlayContext *over = VAR_0->priv;

    int VAR_5, VAR_6, VAR_7;

    int VAR_8   = VAR_2->video->w;

    int VAR_9  = VAR_2->video->h;



    if (over->main_is_packed_rgb) {

        uint8_t *dp = VAR_1->data[0] + VAR_3 * over->main_pix_step[0] +

                      VAR_4 * VAR_1->linesize[0];

        uint8_t *sp = VAR_2->data[0];

        uint8_t VAR_27;          

        const int VAR_10 = over->main_rgba_map[R];

        const int VAR_11 = over->main_rgba_map[G];

        const int VAR_12 = over->main_rgba_map[B];

        const int VAR_13 = over->main_rgba_map[A];

        const int VAR_14 = over->main_pix_step[0];

        const int VAR_15 = over->overlay_rgba_map[R];

        const int VAR_16 = over->overlay_rgba_map[G];

        const int VAR_17 = over->overlay_rgba_map[B];

        const int VAR_18 = over->overlay_rgba_map[A];

        const int VAR_19 = over->overlay_pix_step[0];

        const int VAR_21 = over->VAR_21;

        for (VAR_5 = 0; VAR_5 < VAR_9; VAR_5++) {

            uint8_t *d = dp, *s = sp;

            for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) {

                VAR_27 = s[VAR_18];



                

                

                if (VAR_21 && VAR_27 != 0 && VAR_27 != 255) {

                    uint8_t alpha_d = d[VAR_13];

                    VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d);

                }



                switch (VAR_27) {

                case 0:

                    break;

                case 255:

                    d[VAR_10] = s[VAR_15];

                    d[VAR_11] = s[VAR_16];

                    d[VAR_12] = s[VAR_17];

                    break;

                default:

                    

                    

                    d[VAR_10] = FAST_DIV255(d[VAR_10] * (255 - VAR_27) + s[VAR_15] * VAR_27);

                    d[VAR_11] = FAST_DIV255(d[VAR_11] * (255 - VAR_27) + s[VAR_16] * VAR_27);

                    d[VAR_12] = FAST_DIV255(d[VAR_12] * (255 - VAR_27) + s[VAR_17] * VAR_27);

                }

                if (VAR_21) {

                    switch (VAR_27) {

                    case 0:

                        break;

                    case 255:

                        d[VAR_13] = s[VAR_18];

                        break;

                    default:

                        

                        d[VAR_13] += FAST_DIV255((255 - d[VAR_13]) * s[VAR_18]);

                    }

                }

                d += VAR_14;

                s += VAR_19;

            }

            dp += VAR_1->linesize[0];

            sp += VAR_2->linesize[0];

        }

    } else {

        const int VAR_21 = over->VAR_21;

        if (VAR_21) {

            uint8_t *VAR_13 = VAR_1->data[3] + VAR_3 * over->main_pix_step[3] +

                          VAR_4 * VAR_1->linesize[3];

            uint8_t *VAR_18 = VAR_2->data[3];

            uint8_t VAR_27;          

            for (VAR_5 = 0; VAR_5 < VAR_9; VAR_5++) {

                uint8_t *d = VAR_13, *s = VAR_18;

                for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) {

                    VAR_27 = *s;

                    if (VAR_27 != 0 && VAR_27 != 255) {

                        uint8_t alpha_d = *d;

                        VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d);

                    }

                    switch (VAR_27) {

                    case 0:

                        break;

                    case 255:

                        *d = *s;

                        break;

                    default:

                        

                        *d += FAST_DIV255((255 - *d) * *s);

                    }

                    d += 1;

                    s += 1;

                }

                VAR_13 += VAR_1->linesize[3];

                VAR_18 += VAR_2->linesize[3];

            }

        }

        for (VAR_5 = 0; VAR_5 < 3; VAR_5++) {

            int VAR_21 = VAR_5 ? over->VAR_21 : 0;

            int VAR_22 = VAR_5 ? over->VAR_22 : 0;

            uint8_t *dp = VAR_1->data[VAR_5] + (VAR_3 >> VAR_21) +

                (VAR_4 >> VAR_22) * VAR_1->linesize[VAR_5];

            uint8_t *sp = VAR_2->data[VAR_5];

            uint8_t *ap = VAR_2->data[3];

            int VAR_23 = FFALIGN(VAR_8, 1<<VAR_21) >> VAR_21;

            int VAR_24 = FFALIGN(VAR_9, 1<<VAR_22) >> VAR_22;

            for (VAR_6 = 0; VAR_6 < VAR_24; VAR_6++) {

                uint8_t *d = dp, *s = sp, *a = ap;

                for (VAR_7 = 0; VAR_7 < VAR_23; VAR_7++) {

                    

                    int VAR_25, VAR_26, VAR_27;

                    if (VAR_21 && VAR_22 && VAR_6+1 < VAR_24 && VAR_7+1 < VAR_23) {

                        VAR_27 = (a[0] + a[VAR_2->linesize[3]] +

                                 a[1] + a[VAR_2->linesize[3]+1]) >> 2;

                    } else if (VAR_21 || VAR_22) {

                        VAR_26 = VAR_21 && VAR_7+1 < VAR_23 ?

                            (a[0] + a[1]) >> 1 : a[0];

                        VAR_25 = VAR_22 && VAR_6+1 < VAR_24 ?

                            (a[0] + a[VAR_2->linesize[3]]) >> 1 : a[0];

                        VAR_27 = (VAR_25 + VAR_26) >> 1;

                    } else

                        VAR_27 = a[0];

                    

                    

                    if (VAR_21 && VAR_27 != 0 && VAR_27 != 255) {

                        

                        uint8_t alpha_d;

                        if (VAR_21 && VAR_22 && VAR_6+1 < VAR_24 && VAR_7+1 < VAR_23) {

                            alpha_d = (d[0] + d[VAR_2->linesize[3]] +

                                       d[1] + d[VAR_2->linesize[3]+1]) >> 2;

                        } else if (VAR_21 || VAR_22) {

                            VAR_26 = VAR_21 && VAR_7+1 < VAR_23 ?

                                (d[0] + d[1]) >> 1 : d[0];

                            VAR_25 = VAR_22 && VAR_6+1 < VAR_24 ?

                                (d[0] + d[VAR_2->linesize[3]]) >> 1 : d[0];

                            alpha_d = (VAR_25 + VAR_26) >> 1;

                        } else

                            alpha_d = d[0];

                        VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d);

                    }

                    *d = FAST_DIV255(*d * (255 - VAR_27) + *s * VAR_27);

                    s++;

                    d++;

                    a += 1 << VAR_21;

                }

                dp += VAR_1->linesize[VAR_5];

                sp += VAR_2->linesize[VAR_5];

                ap += (1 << VAR_22) * VAR_2->linesize[3];

            }

        }

    }

}

static void FUNC_0(AVFilterContext *VAR_0,
AVFilterBufferRef *VAR_1, AVFilterBufferRef *VAR_2,
int VAR_3, int VAR_4)
{ OverlayContext *over = VAR_0->priv; int VAR_5, VAR_6, VAR_7; int VAR_8   = VAR_2->video->w; int VAR_9  = VAR_2->video->h; if (over->main_is_packed_rgb) { uint8_t *dp = VAR_1->data[0] + VAR_3 * over->main_pix_step[0] +
VAR_4 * VAR_1->linesize[0]; uint8_t *sp = VAR_2->data[0]; uint8_t VAR_27; const int VAR_10 = over->main_rgba_map[R]; const int VAR_11 = over->main_rgba_map[G]; const int VAR_12 = over->main_rgba_map[B]; const int VAR_13 = over->main_rgba_map[A]; const int VAR_14 = over->main_pix_step[0]; const int VAR_15 = over->overlay_rgba_map[R]; const int VAR_16 = over->overlay_rgba_map[G]; const int VAR_17 = over->overlay_rgba_map[B]; const int VAR_18 = over->overlay_rgba_map[A]; const int VAR_19 = over->overlay_pix_step[0]; const int VAR_21 = over->VAR_21; for (VAR_5 = 0; VAR_5 < VAR_9; VAR_5++) { uint8_t *d = dp, *s = sp; for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) { VAR_27 = s[VAR_18]; if (VAR_21 && VAR_27 != 0 && VAR_27 != 255) { uint8_t alpha_d = d[VAR_13]; VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d); } switch (VAR_27) { case 0:
break; case 255:
d[VAR_10] = s[VAR_15]; d[VAR_11] = s[VAR_16]; d[VAR_12] = s[VAR_17]; break; default:
d[VAR_10] = FAST_DIV255(d[VAR_10] * (255 - VAR_27) + s[VAR_15] * VAR_27); d[VAR_11] = FAST_DIV255(d[VAR_11] * (255 - VAR_27) + s[VAR_16] * VAR_27); d[VAR_12] = FAST_DIV255(d[VAR_12] * (255 - VAR_27) + s[VAR_17] * VAR_27); } if (VAR_21) { switch (VAR_27) { case 0:
break; case 255:
d[VAR_13] = s[VAR_18]; break; default:
d[VAR_13] += FAST_DIV255((255 - d[VAR_13]) * s[VAR_18]); } } d += VAR_14; s += VAR_19; } dp += VAR_1->linesize[0]; sp += VAR_2->linesize[0]; } } else { const int VAR_21 = over->VAR_21; if (VAR_21) { uint8_t *VAR_13 = VAR_1->data[3] + VAR_3 * over->main_pix_step[3] +
VAR_4 * VAR_1->linesize[3]; uint8_t *VAR_18 = VAR_2->data[3]; uint8_t VAR_27; for (VAR_5 = 0; VAR_5 < VAR_9; VAR_5++) { uint8_t *d = VAR_13, *s = VAR_18; for (VAR_6 = 0; VAR_6 < VAR_8; VAR_6++) { VAR_27 = *s; if (VAR_27 != 0 && VAR_27 != 255) { uint8_t alpha_d = *d; VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d); } switch (VAR_27) { case 0:
break; case 255:
*d = *s; break; default:
*d += FAST_DIV255((255 - *d) * *s); } d += 1; s += 1; } VAR_13 += VAR_1->linesize[3]; VAR_18 += VAR_2->linesize[3]; } } for (VAR_5 = 0; VAR_5 < 3; VAR_5++) { int VAR_21 = VAR_5 ? over->VAR_21 : 0; int VAR_22 = VAR_5 ? over->VAR_22 : 0; uint8_t *dp = VAR_1->data[VAR_5] + (VAR_3 >> VAR_21) +
(VAR_4 >> VAR_22) * VAR_1->linesize[VAR_5]; uint8_t *sp = VAR_2->data[VAR_5]; uint8_t *ap = VAR_2->data[3]; int VAR_23 = FFALIGN(VAR_8, 1<<VAR_21) >> VAR_21; int VAR_24 = FFALIGN(VAR_9, 1<<VAR_22) >> VAR_22; for (VAR_6 = 0; VAR_6 < VAR_24; VAR_6++) { uint8_t *d = dp, *s = sp, *a = ap; for (VAR_7 = 0; VAR_7 < VAR_23; VAR_7++) { int VAR_25, VAR_26, VAR_27; if (VAR_21 && VAR_22 && VAR_6+1 < VAR_24 && VAR_7+1 < VAR_23) { VAR_27 = (a[0] + a[VAR_2->linesize[3]] +
a[1] + a[VAR_2->linesize[3]+1]) >> 2; } else if (VAR_21 || VAR_22) { VAR_26 = VAR_21 && VAR_7+1 < VAR_23 ?
(a[0] + a[1]) >> 1 : a[0]; VAR_25 = VAR_22 && VAR_6+1 < VAR_24 ?
(a[0] + a[VAR_2->linesize[3]]) >> 1 : a[0]; VAR_27 = (VAR_25 + VAR_26) >> 1; } else VAR_27 = a[0]; if (VAR_21 && VAR_27 != 0 && VAR_27 != 255) { uint8_t alpha_d; if (VAR_21 && VAR_22 && VAR_6+1 < VAR_24 && VAR_7+1 < VAR_23) { alpha_d = (d[0] + d[VAR_2->linesize[3]] +
d[1] + d[VAR_2->linesize[3]+1]) >> 2; } else if (VAR_21 || VAR_22) { VAR_26 = VAR_21 && VAR_7+1 < VAR_23 ?
(d[0] + d[1]) >> 1 : d[0]; VAR_25 = VAR_22 && VAR_6+1 < VAR_24 ?
(d[0] + d[VAR_2->linesize[3]]) >> 1 : d[0]; alpha_d = (VAR_25 + VAR_26) >> 1; } else alpha_d = d[0]; VAR_27 = UNPREMULTIPLY_ALPHA(VAR_27, alpha_d); } *d = FAST_DIV255(*d * (255 - VAR_27) + *s * VAR_27); s++; d++; a += 1 << VAR_21; } dp += VAR_1->linesize[VAR_5]; sp += VAR_2->linesize[VAR_5]; ap += (1 << VAR_22) * VAR_2->linesize[3]; } } } }