static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan,
                            const uint32_t *quant) {
    int coeff, i, n;
    int8_t ac;
    uint8_t dc = get_bits(gb, 8);
    // block not coded
    if (dc == 255)
    // number of non-zero coefficients
    coeff = get_bits(gb, 6);
    // normally we would only need to clear the (63 - coeff) last values,
    // but since we do not know where they are we just clear the whole block
    memset(block, 0, 64 * sizeof(DCTELEM));
    // 2 bits per coefficient
    while (coeff) {
        ac = get_sbits(gb, 2);
        if (ac == -2)
            break; // continue with more bits
        PUT_COEFF(ac);
    }
    // 4 bits per coefficient
    ALIGN(4);
    if (get_bits_count(gb) + (coeff << 2) >= gb->size_in_bits)
    while (coeff) {
        ac = get_sbits(gb, 4);
        if (ac == -8)
            break; // continue with more bits
        PUT_COEFF(ac);
    }
    // 8 bits per coefficient
    ALIGN(8);
    if (get_bits_count(gb) + (coeff << 3) >= gb->size_in_bits)
    while (coeff) {
        ac = get_sbits(gb, 8);
        PUT_COEFF(ac);
    }
    PUT_COEFF(dc);
    return 1;
}
static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan,
                            const uint32_t *quant) {
    int coeff, i, n;
    int8_t ac;
    uint8_t dc = get_bits(gb, 8);
    
    if (dc == 255)
    
    coeff = get_bits(gb, 6);
    
    
    memset(block, 0, 64 * sizeof(DCTELEM));
    
    while (coeff) {
        ac = get_sbits(gb, 2);
        if (ac == -2)
            break; 
        PUT_COEFF(ac);
    }
    
    ALIGN(4);
    if (get_bits_count(gb) + (coeff << 2) >= gb->size_in_bits)
    while (coeff) {
        ac = get_sbits(gb, 4);
        if (ac == -8)
            break; 
        PUT_COEFF(ac);
    }
    
    ALIGN(8);
    if (get_bits_count(gb) + (coeff << 3) >= gb->size_in_bits)
    while (coeff) {
        ac = get_sbits(gb, 8);
        PUT_COEFF(ac);
    }
    PUT_COEFF(dc);
    return 1;
}
static inline int FUNC_0(GetBitContext *VAR_0, DCTELEM *VAR_1, const uint8_t *VAR_2,
                            const uint32_t *VAR_3) {
    int VAR_4, VAR_5, VAR_6;
    int8_t ac;
    uint8_t dc = get_bits(VAR_0, 8);
    
    if (dc == 255)
    
    VAR_4 = get_bits(VAR_0, 6);
    
    
    memset(VAR_1, 0, 64 * sizeof(DCTELEM));
    
    while (VAR_4) {
        ac = get_sbits(VAR_0, 2);
        if (ac == -2)
            break; 
        PUT_COEFF(ac);
    }
    
    ALIGN(4);
    if (get_bits_count(VAR_0) + (VAR_4 << 2) >= VAR_0->size_in_bits)
    while (VAR_4) {
        ac = get_sbits(VAR_0, 4);
        if (ac == -8)
            break; 
        PUT_COEFF(ac);
    }
    
    ALIGN(8);
    if (get_bits_count(VAR_0) + (VAR_4 << 3) >= VAR_0->size_in_bits)
    while (VAR_4) {
        ac = get_sbits(VAR_0, 8);
        PUT_COEFF(ac);
    }
    PUT_COEFF(dc);
    return 1;
}
static inline int FUNC_0(GetBitContext *VAR_0, DCTELEM *VAR_1, const uint8_t *VAR_2,
const uint32_t *VAR_3) { int VAR_4, VAR_5, VAR_6; int8_t ac; uint8_t dc = get_bits(VAR_0, 8); if (dc == 255)
VAR_4 = get_bits(VAR_0, 6); memset(VAR_1, 0, 64 * sizeof(DCTELEM)); while (VAR_4) { ac = get_sbits(VAR_0, 2); if (ac == -2)
break; PUT_COEFF(ac); } ALIGN(4); if (get_bits_count(VAR_0) + (VAR_4 << 2) >= VAR_0->size_in_bits)
while (VAR_4) { ac = get_sbits(VAR_0, 4); if (ac == -8)
break; PUT_COEFF(ac); } ALIGN(8); if (get_bits_count(VAR_0) + (VAR_4 << 3) >= VAR_0->size_in_bits)
while (VAR_4) { ac = get_sbits(VAR_0, 8); PUT_COEFF(ac); } PUT_COEFF(dc); return 1; }