static void lag_pred_line(LagarithContext *l, uint8_t *buf,

                          int width, int stride, int line)

{

    int L, TL;



    /* Left pixel is actually prev_row[width] */

    L = buf[width - stride - 1];

    if (!line) {

        /* Left prediction only for first line */

        L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,

                                            width - 1, buf[0]);

        return;

    } else if (line == 1) {

        /* Second line, left predict first pixel, the rest of the line is median predicted

         * NOTE: In the case of RGB this pixel is top predicted */

        TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;

    } else {

        /* Top left is 2 rows back, last pixel */

        TL = buf[width - (2 * stride) - 1];

    }



    add_lag_median_prediction(buf, buf - stride, buf,

                              width, &L, &TL);

}

static void lag_pred_line(LagarithContext *l, uint8_t *buf,

                          int width, int stride, int line)

{

    int L, TL;



    

    L = buf[width - stride - 1];

    if (!line) {

        

        L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,

                                            width - 1, buf[0]);

        return;

    } else if (line == 1) {

        



        TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;

    } else {

        

        TL = buf[width - (2 * stride) - 1];

    }



    add_lag_median_prediction(buf, buf - stride, buf,

                              width, &L, &TL);

}

static void FUNC_0(LagarithContext *VAR_0, uint8_t *VAR_1,

                          int VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5, VAR_6;



    

    VAR_5 = VAR_1[VAR_2 - VAR_3 - 1];

    if (!VAR_4) {

        

        VAR_5 = VAR_0->dsp.add_hfyu_left_prediction(VAR_1 + 1, VAR_1 + 1,

                                            VAR_2 - 1, VAR_1[0]);

        return;

    } else if (VAR_4 == 1) {

        



        VAR_6 = VAR_0->avctx->pix_fmt == PIX_FMT_YUV420P ? VAR_1[-VAR_3] : VAR_5;

    } else {

        

        VAR_6 = VAR_1[VAR_2 - (2 * VAR_3) - 1];

    }



    add_lag_median_prediction(VAR_1, VAR_1 - VAR_3, VAR_1,

                              VAR_2, &VAR_5, &VAR_6);

}

static void FUNC_0(LagarithContext *VAR_0, uint8_t *VAR_1,
int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5, VAR_6; VAR_5 = VAR_1[VAR_2 - VAR_3 - 1]; if (!VAR_4) { VAR_5 = VAR_0->dsp.add_hfyu_left_prediction(VAR_1 + 1, VAR_1 + 1,
VAR_2 - 1, VAR_1[0]); return; } else if (VAR_4 == 1) { VAR_6 = VAR_0->avctx->pix_fmt == PIX_FMT_YUV420P ? VAR_1[-VAR_3] : VAR_5; } else { VAR_6 = VAR_1[VAR_2 - (2 * VAR_3) - 1]; } add_lag_median_prediction(VAR_1, VAR_1 - VAR_3, VAR_1,
VAR_2, &VAR_5, &VAR_6); }