static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, void *dst, const int type)

{

    int i, j, count = 0;

    int last, t;

    int A, B, L, L2, R, R2;

    int pos = s->pos;

    uint32_t crc = s->sc.crc;

    uint32_t crc_extra_bits = s->extra_sc.crc;

    int16_t *dst16 = dst;

    int32_t *dst32 = dst;

    float   *dstfl = dst;

    const int channel_pad = s->avctx->channels - 2;



    if(s->samples_left == s->samples)

        s->one = s->zero = s->zeroes = 0;

    do{

        L = wv_get_value(s, gb, 0, &last);

        if(last) break;

        R = wv_get_value(s, gb, 1, &last);

        if(last) break;

        for(i = 0; i < s->terms; i++){

            t = s->decorr[i].value;

            if(t > 0){

                if(t > 8){

                    if(t & 1){

                        A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];

                        B = 2 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1];

                    }else{

                        A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;

                        B = (3 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1;

                    }

                    s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];

                    s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0];

                    j = 0;

                }else{

                    A = s->decorr[i].samplesA[pos];

                    B = s->decorr[i].samplesB[pos];

                    j = (pos + t) & 7;

                }

                if(type != AV_SAMPLE_FMT_S16){

                    L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);

                    R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10);

                }else{

                    L2 = L + ((s->decorr[i].weightA * A + 512) >> 10);

                    R2 = R + ((s->decorr[i].weightB * B + 512) >> 10);

                }

                if(A && L) s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;

                if(B && R) s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta;

                s->decorr[i].samplesA[j] = L = L2;

                s->decorr[i].samplesB[j] = R = R2;

            }else if(t == -1){

                if(type != AV_SAMPLE_FMT_S16)

                    L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10);

                else

                    L2 = L + ((s->decorr[i].weightA * s->decorr[i].samplesA[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L);

                L = L2;

                if(type != AV_SAMPLE_FMT_S16)

                    R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10);

                else

                    R2 = R + ((s->decorr[i].weightB * L2 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R);

                R = R2;

                s->decorr[i].samplesA[0] = R;

            }else{

                if(type != AV_SAMPLE_FMT_S16)

                    R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10);

                else

                    R2 = R + ((s->decorr[i].weightB * s->decorr[i].samplesB[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R);

                R = R2;



                if(t == -3){

                    R2 = s->decorr[i].samplesA[0];

                    s->decorr[i].samplesA[0] = R;

                }



                if(type != AV_SAMPLE_FMT_S16)

                    L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10);

                else

                    L2 = L + ((s->decorr[i].weightA * R2 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L);

                L = L2;

                s->decorr[i].samplesB[0] = L;

            }

        }

        pos = (pos + 1) & 7;

        if(s->joint)

            L += (R -= (L >> 1));

        crc = (crc * 3 + L) * 3 + R;



        if(type == AV_SAMPLE_FMT_FLT){

            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, L);

            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, R);

            dstfl += channel_pad;

        } else if(type == AV_SAMPLE_FMT_S32){

            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, L);

            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, R);

            dst32 += channel_pad;

        } else {

            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, L);

            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, R);

            dst16 += channel_pad;

        }

        count++;

    }while(!last && count < s->max_samples);



    s->samples_left -= count;

    if(!s->samples_left){

        wv_reset_saved_context(s);

        if(crc != s->CRC){

            av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");

            return -1;

        }

        if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){

            av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n");

            return -1;

        }

    }else{

        s->pos = pos;

        s->sc.crc = crc;

        s->sc.bits_used = get_bits_count(&s->gb);

        if(s->got_extra_bits){

            s->extra_sc.crc = crc_extra_bits;

            s->extra_sc.bits_used = get_bits_count(&s->gb_extra_bits);

        }

    }

    return count * 2;

}

static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, void *dst, const int type)

{

    int i, j, count = 0;

    int last, t;

    int A, B, L, L2, R, R2;

    int pos = s->pos;

    uint32_t crc = s->sc.crc;

    uint32_t crc_extra_bits = s->extra_sc.crc;

    int16_t *dst16 = dst;

    int32_t *dst32 = dst;

    float   *dstfl = dst;

    const int channel_pad = s->avctx->channels - 2;



    if(s->samples_left == s->samples)

        s->one = s->zero = s->zeroes = 0;

    do{

        L = wv_get_value(s, gb, 0, &last);

        if(last) break;

        R = wv_get_value(s, gb, 1, &last);

        if(last) break;

        for(i = 0; i < s->terms; i++){

            t = s->decorr[i].value;

            if(t > 0){

                if(t > 8){

                    if(t & 1){

                        A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];

                        B = 2 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1];

                    }else{

                        A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;

                        B = (3 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1;

                    }

                    s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];

                    s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0];

                    j = 0;

                }else{

                    A = s->decorr[i].samplesA[pos];

                    B = s->decorr[i].samplesB[pos];

                    j = (pos + t) & 7;

                }

                if(type != AV_SAMPLE_FMT_S16){

                    L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);

                    R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10);

                }else{

                    L2 = L + ((s->decorr[i].weightA * A + 512) >> 10);

                    R2 = R + ((s->decorr[i].weightB * B + 512) >> 10);

                }

                if(A && L) s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;

                if(B && R) s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta;

                s->decorr[i].samplesA[j] = L = L2;

                s->decorr[i].samplesB[j] = R = R2;

            }else if(t == -1){

                if(type != AV_SAMPLE_FMT_S16)

                    L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10);

                else

                    L2 = L + ((s->decorr[i].weightA * s->decorr[i].samplesA[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L);

                L = L2;

                if(type != AV_SAMPLE_FMT_S16)

                    R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10);

                else

                    R2 = R + ((s->decorr[i].weightB * L2 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R);

                R = R2;

                s->decorr[i].samplesA[0] = R;

            }else{

                if(type != AV_SAMPLE_FMT_S16)

                    R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10);

                else

                    R2 = R + ((s->decorr[i].weightB * s->decorr[i].samplesB[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R);

                R = R2;



                if(t == -3){

                    R2 = s->decorr[i].samplesA[0];

                    s->decorr[i].samplesA[0] = R;

                }



                if(type != AV_SAMPLE_FMT_S16)

                    L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10);

                else

                    L2 = L + ((s->decorr[i].weightA * R2 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L);

                L = L2;

                s->decorr[i].samplesB[0] = L;

            }

        }

        pos = (pos + 1) & 7;

        if(s->joint)

            L += (R -= (L >> 1));

        crc = (crc * 3 + L) * 3 + R;



        if(type == AV_SAMPLE_FMT_FLT){

            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, L);

            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, R);

            dstfl += channel_pad;

        } else if(type == AV_SAMPLE_FMT_S32){

            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, L);

            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, R);

            dst32 += channel_pad;

        } else {

            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, L);

            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, R);

            dst16 += channel_pad;

        }

        count++;

    }while(!last && count < s->max_samples);



    s->samples_left -= count;

    if(!s->samples_left){

        wv_reset_saved_context(s);

        if(crc != s->CRC){

            av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");

            return -1;

        }

        if(s->got_extra_bits && crc_extra_bits != s->crc_extra_bits){

            av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n");

            return -1;

        }

    }else{

        s->pos = pos;

        s->sc.crc = crc;

        s->sc.bits_used = get_bits_count(&s->gb);

        if(s->got_extra_bits){

            s->extra_sc.crc = crc_extra_bits;

            s->extra_sc.bits_used = get_bits_count(&s->gb_extra_bits);

        }

    }

    return count * 2;

}

    s->samples_left -= count;     s->samples_left -= count;
static inline int FUNC_0(WavpackFrameContext *VAR_0, GetBitContext *VAR_1, void *VAR_2, const int VAR_3)

{

    int VAR_4, VAR_5, VAR_6 = 0;

    int VAR_7, VAR_8;

    int VAR_9, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14;

    int VAR_15 = VAR_0->VAR_15;

    uint32_t crc = VAR_0->sc.crc;

    uint32_t crc_extra_bits = VAR_0->extra_sc.crc;

    int16_t *dst16 = VAR_2;

    int32_t *dst32 = VAR_2;

    float   *VAR_16 = VAR_2;

    const int VAR_17 = VAR_0->avctx->channels - 2;



    if(VAR_0->samples_left == VAR_0->samples)

        VAR_0->one = VAR_0->zero = VAR_0->zeroes = 0;

    do{

        VAR_11 = wv_get_value(VAR_0, VAR_1, 0, &VAR_7);

        if(VAR_7) break;

        VAR_13 = wv_get_value(VAR_0, VAR_1, 1, &VAR_7);

        if(VAR_7) break;

        for(VAR_4 = 0; VAR_4 < VAR_0->terms; VAR_4++){

            VAR_8 = VAR_0->decorr[VAR_4].value;

            if(VAR_8 > 0){

                if(VAR_8 > 8){

                    if(VAR_8 & 1){

                        VAR_9 = 2 * VAR_0->decorr[VAR_4].samplesA[0] - VAR_0->decorr[VAR_4].samplesA[1];

                        VAR_10 = 2 * VAR_0->decorr[VAR_4].samplesB[0] - VAR_0->decorr[VAR_4].samplesB[1];

                    }else{

                        VAR_9 = (3 * VAR_0->decorr[VAR_4].samplesA[0] - VAR_0->decorr[VAR_4].samplesA[1]) >> 1;

                        VAR_10 = (3 * VAR_0->decorr[VAR_4].samplesB[0] - VAR_0->decorr[VAR_4].samplesB[1]) >> 1;

                    }

                    VAR_0->decorr[VAR_4].samplesA[1] = VAR_0->decorr[VAR_4].samplesA[0];

                    VAR_0->decorr[VAR_4].samplesB[1] = VAR_0->decorr[VAR_4].samplesB[0];

                    VAR_5 = 0;

                }else{

                    VAR_9 = VAR_0->decorr[VAR_4].samplesA[VAR_15];

                    VAR_10 = VAR_0->decorr[VAR_4].samplesB[VAR_15];

                    VAR_5 = (VAR_15 + VAR_8) & 7;

                }

                if(VAR_3 != AV_SAMPLE_FMT_S16){

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_9 + 512) >> 10);

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_10 + 512) >> 10);

                }else{

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_9 + 512) >> 10);

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_10 + 512) >> 10);

                }

                if(VAR_9 && VAR_11) VAR_0->decorr[VAR_4].weightA -= ((((VAR_11 ^ VAR_9) >> 30) & 2) - 1) * VAR_0->decorr[VAR_4].delta;

                if(VAR_10 && VAR_13) VAR_0->decorr[VAR_4].weightB -= ((((VAR_13 ^ VAR_10) >> 30) & 2) - 1) * VAR_0->decorr[VAR_4].delta;

                VAR_0->decorr[VAR_4].samplesA[VAR_5] = VAR_11 = VAR_12;

                VAR_0->decorr[VAR_4].samplesB[VAR_5] = VAR_13 = VAR_14;

            }else if(VAR_8 == -1){

                if(VAR_3 != AV_SAMPLE_FMT_S16)

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_0->decorr[VAR_4].samplesA[0] + 512) >> 10);

                else

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_0->decorr[VAR_4].samplesA[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightA, VAR_0->decorr[VAR_4].delta, VAR_0->decorr[VAR_4].samplesA[0], VAR_11);

                VAR_11 = VAR_12;

                if(VAR_3 != AV_SAMPLE_FMT_S16)

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_12 + 512) >> 10);

                else

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_12 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightB, VAR_0->decorr[VAR_4].delta, VAR_12, VAR_13);

                VAR_13 = VAR_14;

                VAR_0->decorr[VAR_4].samplesA[0] = VAR_13;

            }else{

                if(VAR_3 != AV_SAMPLE_FMT_S16)

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_0->decorr[VAR_4].samplesB[0] + 512) >> 10);

                else

                    VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_0->decorr[VAR_4].samplesB[0] + 512) >> 10);

                UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightB, VAR_0->decorr[VAR_4].delta, VAR_0->decorr[VAR_4].samplesB[0], VAR_13);

                VAR_13 = VAR_14;



                if(VAR_8 == -3){

                    VAR_14 = VAR_0->decorr[VAR_4].samplesA[0];

                    VAR_0->decorr[VAR_4].samplesA[0] = VAR_13;

                }



                if(VAR_3 != AV_SAMPLE_FMT_S16)

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_14 + 512) >> 10);

                else

                    VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_14 + 512) >> 10);

                UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightA, VAR_0->decorr[VAR_4].delta, VAR_14, VAR_11);

                VAR_11 = VAR_12;

                VAR_0->decorr[VAR_4].samplesB[0] = VAR_11;

            }

        }

        VAR_15 = (VAR_15 + 1) & 7;

        if(VAR_0->joint)

            VAR_11 += (VAR_13 -= (VAR_11 >> 1));

        crc = (crc * 3 + VAR_11) * 3 + VAR_13;



        if(VAR_3 == AV_SAMPLE_FMT_FLT){

            *VAR_16++ = wv_get_value_float(VAR_0, &crc_extra_bits, VAR_11);

            *VAR_16++ = wv_get_value_float(VAR_0, &crc_extra_bits, VAR_13);

            VAR_16 += VAR_17;

        } else if(VAR_3 == AV_SAMPLE_FMT_S32){

            *dst32++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_11);

            *dst32++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_13);

            dst32 += VAR_17;

        } else {

            *dst16++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_11);

            *dst16++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_13);

            dst16 += VAR_17;

        }

        VAR_6++;

    }while(!VAR_7 && VAR_6 < VAR_0->max_samples);



    VAR_0->samples_left -= VAR_6;

    if(!VAR_0->samples_left){

        wv_reset_saved_context(VAR_0);

        if(crc != VAR_0->CRC){

            av_log(VAR_0->avctx, AV_LOG_ERROR, "CRC error\n");

            return -1;

        }

        if(VAR_0->got_extra_bits && crc_extra_bits != VAR_0->crc_extra_bits){

            av_log(VAR_0->avctx, AV_LOG_ERROR, "Extra bits CRC error\n");

            return -1;

        }

    }else{

        VAR_0->VAR_15 = VAR_15;

        VAR_0->sc.crc = crc;

        VAR_0->sc.bits_used = get_bits_count(&VAR_0->VAR_1);

        if(VAR_0->got_extra_bits){

            VAR_0->extra_sc.crc = crc_extra_bits;

            VAR_0->extra_sc.bits_used = get_bits_count(&VAR_0->gb_extra_bits);

        }

    }

    return VAR_6 * 2;

}

static inline int FUNC_0(WavpackFrameContext *VAR_0, GetBitContext *VAR_1, void *VAR_2, const int VAR_3)
{ int VAR_4, VAR_5, VAR_6 = 0; int VAR_7, VAR_8; int VAR_9, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14; int VAR_15 = VAR_0->VAR_15; uint32_t crc = VAR_0->sc.crc; uint32_t crc_extra_bits = VAR_0->extra_sc.crc; int16_t *dst16 = VAR_2; int32_t *dst32 = VAR_2; float   *VAR_16 = VAR_2; const int VAR_17 = VAR_0->avctx->channels - 2; if(VAR_0->samples_left == VAR_0->samples)
VAR_0->one = VAR_0->zero = VAR_0->zeroes = 0; do{ VAR_11 = wv_get_value(VAR_0, VAR_1, 0, &VAR_7); if(VAR_7) break; VAR_13 = wv_get_value(VAR_0, VAR_1, 1, &VAR_7); if(VAR_7) break; for(VAR_4 = 0; VAR_4 < VAR_0->terms; VAR_4++){ VAR_8 = VAR_0->decorr[VAR_4].value; if(VAR_8 > 0){ if(VAR_8 > 8){ if(VAR_8 & 1){ VAR_9 = 2 * VAR_0->decorr[VAR_4].samplesA[0] - VAR_0->decorr[VAR_4].samplesA[1]; VAR_10 = 2 * VAR_0->decorr[VAR_4].samplesB[0] - VAR_0->decorr[VAR_4].samplesB[1]; }else{ VAR_9 = (3 * VAR_0->decorr[VAR_4].samplesA[0] - VAR_0->decorr[VAR_4].samplesA[1]) >> 1; VAR_10 = (3 * VAR_0->decorr[VAR_4].samplesB[0] - VAR_0->decorr[VAR_4].samplesB[1]) >> 1; } VAR_0->decorr[VAR_4].samplesA[1] = VAR_0->decorr[VAR_4].samplesA[0]; VAR_0->decorr[VAR_4].samplesB[1] = VAR_0->decorr[VAR_4].samplesB[0]; VAR_5 = 0; }else{ VAR_9 = VAR_0->decorr[VAR_4].samplesA[VAR_15]; VAR_10 = VAR_0->decorr[VAR_4].samplesB[VAR_15]; VAR_5 = (VAR_15 + VAR_8) & 7; } if(VAR_3 != AV_SAMPLE_FMT_S16){ VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_9 + 512) >> 10); VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_10 + 512) >> 10); }else{ VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_9 + 512) >> 10); VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_10 + 512) >> 10); } if(VAR_9 && VAR_11) VAR_0->decorr[VAR_4].weightA -= ((((VAR_11 ^ VAR_9) >> 30) & 2) - 1) * VAR_0->decorr[VAR_4].delta; if(VAR_10 && VAR_13) VAR_0->decorr[VAR_4].weightB -= ((((VAR_13 ^ VAR_10) >> 30) & 2) - 1) * VAR_0->decorr[VAR_4].delta; VAR_0->decorr[VAR_4].samplesA[VAR_5] = VAR_11 = VAR_12; VAR_0->decorr[VAR_4].samplesB[VAR_5] = VAR_13 = VAR_14; }else if(VAR_8 == -1){ if(VAR_3 != AV_SAMPLE_FMT_S16)
VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_0->decorr[VAR_4].samplesA[0] + 512) >> 10); else
VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_0->decorr[VAR_4].samplesA[0] + 512) >> 10); UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightA, VAR_0->decorr[VAR_4].delta, VAR_0->decorr[VAR_4].samplesA[0], VAR_11); VAR_11 = VAR_12; if(VAR_3 != AV_SAMPLE_FMT_S16)
VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_12 + 512) >> 10); else
VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_12 + 512) >> 10); UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightB, VAR_0->decorr[VAR_4].delta, VAR_12, VAR_13); VAR_13 = VAR_14; VAR_0->decorr[VAR_4].samplesA[0] = VAR_13; }else{ if(VAR_3 != AV_SAMPLE_FMT_S16)
VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * (int64_t)VAR_0->decorr[VAR_4].samplesB[0] + 512) >> 10); else
VAR_14 = VAR_13 + ((VAR_0->decorr[VAR_4].weightB * VAR_0->decorr[VAR_4].samplesB[0] + 512) >> 10); UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightB, VAR_0->decorr[VAR_4].delta, VAR_0->decorr[VAR_4].samplesB[0], VAR_13); VAR_13 = VAR_14; if(VAR_8 == -3){ VAR_14 = VAR_0->decorr[VAR_4].samplesA[0]; VAR_0->decorr[VAR_4].samplesA[0] = VAR_13; } if(VAR_3 != AV_SAMPLE_FMT_S16)
VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * (int64_t)VAR_14 + 512) >> 10); else
VAR_12 = VAR_11 + ((VAR_0->decorr[VAR_4].weightA * VAR_14 + 512) >> 10); UPDATE_WEIGHT_CLIP(VAR_0->decorr[VAR_4].weightA, VAR_0->decorr[VAR_4].delta, VAR_14, VAR_11); VAR_11 = VAR_12; VAR_0->decorr[VAR_4].samplesB[0] = VAR_11; } } VAR_15 = (VAR_15 + 1) & 7; if(VAR_0->joint)
VAR_11 += (VAR_13 -= (VAR_11 >> 1)); crc = (crc * 3 + VAR_11) * 3 + VAR_13; if(VAR_3 == AV_SAMPLE_FMT_FLT){ *VAR_16++ = wv_get_value_float(VAR_0, &crc_extra_bits, VAR_11); *VAR_16++ = wv_get_value_float(VAR_0, &crc_extra_bits, VAR_13); VAR_16 += VAR_17; } else if(VAR_3 == AV_SAMPLE_FMT_S32){ *dst32++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_11); *dst32++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_13); dst32 += VAR_17; } else { *dst16++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_11); *dst16++ = wv_get_value_integer(VAR_0, &crc_extra_bits, VAR_13); dst16 += VAR_17; } VAR_6++; }while(!VAR_7 && VAR_6 < VAR_0->max_samples); VAR_0->samples_left -= VAR_6; if(!VAR_0->samples_left){ wv_reset_saved_context(VAR_0); if(crc != VAR_0->CRC){ av_log(VAR_0->avctx, AV_LOG_ERROR, "CRC error\n"); return -1; } if(VAR_0->got_extra_bits && crc_extra_bits != VAR_0->crc_extra_bits){ av_log(VAR_0->avctx, AV_LOG_ERROR, "Extra bits CRC error\n"); return -1; } }else{ VAR_0->VAR_15 = VAR_15; VAR_0->sc.crc = crc; VAR_0->sc.bits_used = get_bits_count(&VAR_0->VAR_1); if(VAR_0->got_extra_bits){ VAR_0->extra_sc.crc = crc_extra_bits; VAR_0->extra_sc.bits_used = get_bits_count(&VAR_0->gb_extra_bits); } } return VAR_6 * 2; }