static int convert_zp2tf(AVFilterContext *ctx, int channels)

{

    AudioIIRContext *s = ctx->priv;

    int ch, i, j, ret;



    for (ch = 0; ch < channels; ch++) {

        IIRChannel *iir = &s->iir[ch];

        double *topc, *botc;



        topc = av_calloc((iir->nb_ab[0] + 1) * 2, sizeof(*topc));

        botc = av_calloc((iir->nb_ab[1] + 1) * 2, sizeof(*botc));

        if (!topc || !botc)

            return AVERROR(ENOMEM);



        ret = expand(ctx, iir->ab[0], iir->nb_ab[0], botc);

        if (ret < 0) {

            av_free(topc);

            av_free(botc);

            return ret;

        }



        ret = expand(ctx, iir->ab[1], iir->nb_ab[1], topc);

        if (ret < 0) {

            av_free(topc);

            av_free(botc);

            return ret;

        }



        for (j = 0, i = iir->nb_ab[1]; i >= 0; j++, i--) {

            iir->ab[1][j] = topc[2 * i];

        }

        iir->nb_ab[1]++;



        for (j = 0, i = iir->nb_ab[0]; i >= 0; j++, i--) {

            iir->ab[0][j] = botc[2 * i];

        }

        iir->nb_ab[0]++;



        av_free(topc);

        av_free(botc);

    }



    return 0;

}

static int convert_zp2tf(AVFilterContext *ctx, int channels)

{

    AudioIIRContext *s = ctx->priv;

    int ch, i, j, ret;



    for (ch = 0; ch < channels; ch++) {

        IIRChannel *iir = &s->iir[ch];

        double *topc, *botc;



        topc = av_calloc((iir->nb_ab[0] + 1) * 2, sizeof(*topc));

        botc = av_calloc((iir->nb_ab[1] + 1) * 2, sizeof(*botc));

        if (!topc || !botc)

            return AVERROR(ENOMEM);



        ret = expand(ctx, iir->ab[0], iir->nb_ab[0], botc);

        if (ret < 0) {

            av_free(topc);

            av_free(botc);

            return ret;

        }



        ret = expand(ctx, iir->ab[1], iir->nb_ab[1], topc);

        if (ret < 0) {

            av_free(topc);

            av_free(botc);

            return ret;

        }



        for (j = 0, i = iir->nb_ab[1]; i >= 0; j++, i--) {

            iir->ab[1][j] = topc[2 * i];

        }

        iir->nb_ab[1]++;



        for (j = 0, i = iir->nb_ab[0]; i >= 0; j++, i--) {

            iir->ab[0][j] = botc[2 * i];

        }

        iir->nb_ab[0]++;



        av_free(topc);

        av_free(botc);

    }



    return 0;

}

    int ch, i, j, ret;         if (!topc || !botc)             return AVERROR(ENOMEM);             av_free(topc);             av_free(botc);             return ret;             av_free(topc);             av_free(botc);             return ret;     return 0;
static int FUNC_0(AVFilterContext *VAR_0, int VAR_1)

{

    AudioIIRContext *s = VAR_0->priv;

    int VAR_2, VAR_3, VAR_4, VAR_5;



    for (VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) {

        IIRChannel *iir = &s->iir[VAR_2];

        double *VAR_6, *VAR_7;



        VAR_6 = av_calloc((iir->nb_ab[0] + 1) * 2, sizeof(*VAR_6));

        VAR_7 = av_calloc((iir->nb_ab[1] + 1) * 2, sizeof(*VAR_7));

        if (!VAR_6 || !VAR_7)

            return AVERROR(ENOMEM);



        VAR_5 = expand(VAR_0, iir->ab[0], iir->nb_ab[0], VAR_7);

        if (VAR_5 < 0) {

            av_free(VAR_6);

            av_free(VAR_7);

            return VAR_5;

        }



        VAR_5 = expand(VAR_0, iir->ab[1], iir->nb_ab[1], VAR_6);

        if (VAR_5 < 0) {

            av_free(VAR_6);

            av_free(VAR_7);

            return VAR_5;

        }



        for (VAR_4 = 0, VAR_3 = iir->nb_ab[1]; VAR_3 >= 0; VAR_4++, VAR_3--) {

            iir->ab[1][VAR_4] = VAR_6[2 * VAR_3];

        }

        iir->nb_ab[1]++;



        for (VAR_4 = 0, VAR_3 = iir->nb_ab[0]; VAR_3 >= 0; VAR_4++, VAR_3--) {

            iir->ab[0][VAR_4] = VAR_7[2 * VAR_3];

        }

        iir->nb_ab[0]++;



        av_free(VAR_6);

        av_free(VAR_7);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0, int VAR_1)
{ AudioIIRContext *s = VAR_0->priv; int VAR_2, VAR_3, VAR_4, VAR_5; for (VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) { IIRChannel *iir = &s->iir[VAR_2]; double *VAR_6, *VAR_7; VAR_6 = av_calloc((iir->nb_ab[0] + 1) * 2, sizeof(*VAR_6)); VAR_7 = av_calloc((iir->nb_ab[1] + 1) * 2, sizeof(*VAR_7)); if (!VAR_6 || !VAR_7)
return AVERROR(ENOMEM); VAR_5 = expand(VAR_0, iir->ab[0], iir->nb_ab[0], VAR_7); if (VAR_5 < 0) { av_free(VAR_6); av_free(VAR_7); return VAR_5; } VAR_5 = expand(VAR_0, iir->ab[1], iir->nb_ab[1], VAR_6); if (VAR_5 < 0) { av_free(VAR_6); av_free(VAR_7); return VAR_5; } for (VAR_4 = 0, VAR_3 = iir->nb_ab[1]; VAR_3 >= 0; VAR_4++, VAR_3--) { iir->ab[1][VAR_4] = VAR_6[2 * VAR_3]; } iir->nb_ab[1]++; for (VAR_4 = 0, VAR_3 = iir->nb_ab[0]; VAR_3 >= 0; VAR_4++, VAR_3--) { iir->ab[0][VAR_4] = VAR_7[2 * VAR_3]; } iir->nb_ab[0]++; av_free(VAR_6); av_free(VAR_7); } return 0; }