struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,

                                  int dstW, int dstH, int dstFormat,

                                  int flags, SwsFilter *srcFilter,

                                  SwsFilter *dstFilter, double *param)

{

    struct SwsContext *ctx;



    ctx = av_malloc(sizeof(struct SwsContext));

    if (ctx)

        ctx->av_class = av_mallocz(sizeof(AVClass));

    if (!ctx || !ctx->av_class) {

        av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");



        return NULL;

    }



    if ((srcH != dstH) || (srcW != dstW)) {

        if ((srcFormat != PIX_FMT_YUV420P) || (dstFormat != PIX_FMT_YUV420P)) {

            av_log(NULL, AV_LOG_INFO, "PIX_FMT_YUV420P will be used as an intermediate format for rescaling\n");

        }

        ctx->resampling_ctx = img_resample_init(dstW, dstH, srcW, srcH);

    } else {

        ctx->resampling_ctx = av_malloc(sizeof(ImgReSampleContext));

        ctx->resampling_ctx->iheight = srcH;

        ctx->resampling_ctx->iwidth = srcW;

        ctx->resampling_ctx->oheight = dstH;

        ctx->resampling_ctx->owidth = dstW;

    }

    ctx->src_pix_fmt = srcFormat;

    ctx->dst_pix_fmt = dstFormat;



    return ctx;

}

struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,

                                  int dstW, int dstH, int dstFormat,

                                  int flags, SwsFilter *srcFilter,

                                  SwsFilter *dstFilter, double *param)

{

    struct SwsContext *ctx;



    ctx = av_malloc(sizeof(struct SwsContext));

    if (ctx)

        ctx->av_class = av_mallocz(sizeof(AVClass));

    if (!ctx || !ctx->av_class) {

        av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");



        return NULL;

    }



    if ((srcH != dstH) || (srcW != dstW)) {

        if ((srcFormat != PIX_FMT_YUV420P) || (dstFormat != PIX_FMT_YUV420P)) {

            av_log(NULL, AV_LOG_INFO, "PIX_FMT_YUV420P will be used as an intermediate format for rescaling\n");

        }

        ctx->resampling_ctx = img_resample_init(dstW, dstH, srcW, srcH);

    } else {

        ctx->resampling_ctx = av_malloc(sizeof(ImgReSampleContext));

        ctx->resampling_ctx->iheight = srcH;

        ctx->resampling_ctx->iwidth = srcW;

        ctx->resampling_ctx->oheight = dstH;

        ctx->resampling_ctx->owidth = dstW;

    }

    ctx->src_pix_fmt = srcFormat;

    ctx->dst_pix_fmt = dstFormat;



    return ctx;

}

    if (ctx)         ctx->av_class = av_mallocz(sizeof(AVClass));     if (!ctx || !ctx->av_class) {
struct SwsContext *FUNC_0(int VAR_0, int VAR_1, int VAR_2,

                                  int VAR_3, int VAR_4, int VAR_5,

                                  int VAR_6, SwsFilter *VAR_7,

                                  SwsFilter *VAR_8, double *VAR_9)

{

    struct SwsContext *VAR_10;



    VAR_10 = av_malloc(sizeof(struct SwsContext));

    if (VAR_10)

        VAR_10->av_class = av_mallocz(sizeof(AVClass));

    if (!VAR_10 || !VAR_10->av_class) {

        av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");



        return NULL;

    }



    if ((VAR_1 != VAR_4) || (VAR_0 != VAR_3)) {

        if ((VAR_2 != PIX_FMT_YUV420P) || (VAR_5 != PIX_FMT_YUV420P)) {

            av_log(NULL, AV_LOG_INFO, "PIX_FMT_YUV420P will be used as an intermediate format for rescaling\n");

        }

        VAR_10->resampling_ctx = img_resample_init(VAR_3, VAR_4, VAR_0, VAR_1);

    } else {

        VAR_10->resampling_ctx = av_malloc(sizeof(ImgReSampleContext));

        VAR_10->resampling_ctx->iheight = VAR_1;

        VAR_10->resampling_ctx->iwidth = VAR_0;

        VAR_10->resampling_ctx->oheight = VAR_4;

        VAR_10->resampling_ctx->owidth = VAR_3;

    }

    VAR_10->src_pix_fmt = VAR_2;

    VAR_10->dst_pix_fmt = VAR_5;



    return VAR_10;

}

struct SwsContext *FUNC_0(int VAR_0, int VAR_1, int VAR_2,
int VAR_3, int VAR_4, int VAR_5,
int VAR_6, SwsFilter *VAR_7,
SwsFilter *VAR_8, double *VAR_9)
{ struct SwsContext *VAR_10; VAR_10 = av_malloc(sizeof(struct SwsContext)); if (VAR_10)
VAR_10->av_class = av_mallocz(sizeof(AVClass)); if (!VAR_10 || !VAR_10->av_class) { av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); return NULL; } if ((VAR_1 != VAR_4) || (VAR_0 != VAR_3)) { if ((VAR_2 != PIX_FMT_YUV420P) || (VAR_5 != PIX_FMT_YUV420P)) { av_log(NULL, AV_LOG_INFO, "PIX_FMT_YUV420P will be used as an intermediate format for rescaling\n"); } VAR_10->resampling_ctx = img_resample_init(VAR_3, VAR_4, VAR_0, VAR_1); } else { VAR_10->resampling_ctx = av_malloc(sizeof(ImgReSampleContext)); VAR_10->resampling_ctx->iheight = VAR_1; VAR_10->resampling_ctx->iwidth = VAR_0; VAR_10->resampling_ctx->oheight = VAR_4; VAR_10->resampling_ctx->owidth = VAR_3; } VAR_10->src_pix_fmt = VAR_2; VAR_10->dst_pix_fmt = VAR_5; return VAR_10; }