static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize)

{

    uint8_t block[128];

    int i = 0, x, y;



    memset(block, 0, sizeof(block));



    {

        OPEN_READER(re, gb);



        for ( ;; ) {

            int run, level;



            UPDATE_CACHE_LE(re, gb);

            GET_VLC(run, re, gb, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2);



            if (run == 128) break;

            i += run;

            if (i >= 128)

                return AVERROR_INVALIDDATA;



            UPDATE_CACHE_LE(re, gb);

            GET_VLC(level, re, gb, ff_dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2);

            block[i++] = level;

        }



        CLOSE_READER(re, gb);

    }



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

        for (x = 0; x < 16; x++) {

            last_alpha[x] -= block[y * 16 + x];

        }

        memcpy(dest, last_alpha, 16);

        dest += linesize;

    }



    return 0;

}

static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize)

{

    uint8_t block[128];

    int i = 0, x, y;



    memset(block, 0, sizeof(block));



    {

        OPEN_READER(re, gb);



        for ( ;; ) {

            int run, level;



            UPDATE_CACHE_LE(re, gb);

            GET_VLC(run, re, gb, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2);



            if (run == 128) break;

            i += run;

            if (i >= 128)

                return AVERROR_INVALIDDATA;



            UPDATE_CACHE_LE(re, gb);

            GET_VLC(level, re, gb, ff_dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2);

            block[i++] = level;

        }



        CLOSE_READER(re, gb);

    }



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

        for (x = 0; x < 16; x++) {

            last_alpha[x] -= block[y * 16 + x];

        }

        memcpy(dest, last_alpha, 16);

        dest += linesize;

    }



    return 0;

}

            if (run == 128) break;
static inline int FUNC_0(const SHQContext *VAR_0, GetBitContext *VAR_1, uint8_t VAR_2[16], uint8_t *VAR_3, int VAR_4)

{

    uint8_t block[128];

    int VAR_5 = 0, VAR_6, VAR_7;



    memset(block, 0, sizeof(block));



    {

        OPEN_READER(re, VAR_1);



        for ( ;; ) {

            int VAR_8, VAR_9;



            UPDATE_CACHE_LE(re, VAR_1);

            GET_VLC(VAR_8, re, VAR_1, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2);



            if (VAR_8 == 128) break;

            VAR_5 += VAR_8;

            if (VAR_5 >= 128)

                return AVERROR_INVALIDDATA;



            UPDATE_CACHE_LE(re, VAR_1);

            GET_VLC(VAR_9, re, VAR_1, ff_dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2);

            block[VAR_5++] = VAR_9;

        }



        CLOSE_READER(re, VAR_1);

    }



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

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

            VAR_2[VAR_6] -= block[VAR_7 * 16 + VAR_6];

        }

        memcpy(VAR_3, VAR_2, 16);

        VAR_3 += VAR_4;

    }



    return 0;

}

static inline int FUNC_0(const SHQContext *VAR_0, GetBitContext *VAR_1, uint8_t VAR_2[16], uint8_t *VAR_3, int VAR_4)
{ uint8_t block[128]; int VAR_5 = 0, VAR_6, VAR_7; memset(block, 0, sizeof(block)); { OPEN_READER(re, VAR_1); for ( ;; ) { int VAR_8, VAR_9; UPDATE_CACHE_LE(re, VAR_1); GET_VLC(VAR_8, re, VAR_1, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2); if (VAR_8 == 128) break; VAR_5 += VAR_8; if (VAR_5 >= 128)
return AVERROR_INVALIDDATA; UPDATE_CACHE_LE(re, VAR_1); GET_VLC(VAR_9, re, VAR_1, ff_dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2); block[VAR_5++] = VAR_9; } CLOSE_READER(re, VAR_1); } for (VAR_7 = 0; VAR_7 < 8; VAR_7++) { for (VAR_6 = 0; VAR_6 < 16; VAR_6++) { VAR_2[VAR_6] -= block[VAR_7 * 16 + VAR_6]; } memcpy(VAR_3, VAR_2, 16); VAR_3 += VAR_4; } return 0; }