static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],

                                     int srcStride[], int srcSliceY, int srcSliceH,

                                     uint8_t *dst[], int dstStride[])

{

    uint16_t *dst2013[] = { (uint16_t *)dst[2], (uint16_t *)dst[0], (uint16_t *)dst[1], (uint16_t *)dst[3] };

    uint16_t *dst1023[] = { (uint16_t *)dst[1], (uint16_t *)dst[0], (uint16_t *)dst[2], (uint16_t *)dst[3] };

    int stride2013[] = { dstStride[2], dstStride[0], dstStride[1], dstStride[3] };

    int stride1023[] = { dstStride[1], dstStride[0], dstStride[2], dstStride[3] };

    const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);

    const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);

    int bpc = dst_format->comp[0].depth;

    int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;

    int swap = 0;

    if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   src_format->flags & AV_PIX_FMT_FLAG_BE)

        swap++;

    if ( HAVE_BIGENDIAN && !(dst_format->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   dst_format->flags & AV_PIX_FMT_FLAG_BE)

        swap += 2;



    if ((dst_format->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) !=

        (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || bpc < 9) {

        av_log(c, AV_LOG_ERROR, "unsupported conversion to planar RGB %s -> %s\n",

               src_format->name, dst_format->name);

        return srcSliceH;

    }

    switch (c->srcFormat) {

    case AV_PIX_FMT_RGB48LE:

    case AV_PIX_FMT_RGB48BE:

    case AV_PIX_FMT_RGBA64LE:

    case AV_PIX_FMT_RGBA64BE:

        packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],

                         dst2013, stride2013, srcSliceH, alpha, swap,

                         16 - bpc, c->srcW);

        break;

    case AV_PIX_FMT_BGR48LE:

    case AV_PIX_FMT_BGR48BE:

    case AV_PIX_FMT_BGRA64LE:

    case AV_PIX_FMT_BGRA64BE:

        packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],

                         dst1023, stride1023, srcSliceH, alpha, swap,

                         16 - bpc, c->srcW);

        break;

    default:

        av_log(c, AV_LOG_ERROR,

               "unsupported conversion to planar RGB %s -> %s\n",

               src_format->name, dst_format->name);

    }



    return srcSliceH;

}

static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],

                                     int srcStride[], int srcSliceY, int srcSliceH,

                                     uint8_t *dst[], int dstStride[])

{

    uint16_t *dst2013[] = { (uint16_t *)dst[2], (uint16_t *)dst[0], (uint16_t *)dst[1], (uint16_t *)dst[3] };

    uint16_t *dst1023[] = { (uint16_t *)dst[1], (uint16_t *)dst[0], (uint16_t *)dst[2], (uint16_t *)dst[3] };

    int stride2013[] = { dstStride[2], dstStride[0], dstStride[1], dstStride[3] };

    int stride1023[] = { dstStride[1], dstStride[0], dstStride[2], dstStride[3] };

    const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);

    const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);

    int bpc = dst_format->comp[0].depth;

    int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;

    int swap = 0;

    if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   src_format->flags & AV_PIX_FMT_FLAG_BE)

        swap++;

    if ( HAVE_BIGENDIAN && !(dst_format->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   dst_format->flags & AV_PIX_FMT_FLAG_BE)

        swap += 2;



    if ((dst_format->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) !=

        (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || bpc < 9) {

        av_log(c, AV_LOG_ERROR, "unsupported conversion to planar RGB %s -> %s\n",

               src_format->name, dst_format->name);

        return srcSliceH;

    }

    switch (c->srcFormat) {

    case AV_PIX_FMT_RGB48LE:

    case AV_PIX_FMT_RGB48BE:

    case AV_PIX_FMT_RGBA64LE:

    case AV_PIX_FMT_RGBA64BE:

        packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],

                         dst2013, stride2013, srcSliceH, alpha, swap,

                         16 - bpc, c->srcW);

        break;

    case AV_PIX_FMT_BGR48LE:

    case AV_PIX_FMT_BGR48BE:

    case AV_PIX_FMT_BGRA64LE:

    case AV_PIX_FMT_BGRA64BE:

        packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],

                         dst1023, stride1023, srcSliceH, alpha, swap,

                         16 - bpc, c->srcW);

        break;

    default:

        av_log(c, AV_LOG_ERROR,

               "unsupported conversion to planar RGB %s -> %s\n",

               src_format->name, dst_format->name);

    }



    return srcSliceH;

}

        packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],         packed16togbra16(src[0] + srcSliceY * srcStride[0], srcStride[0],
static int FUNC_0(SwsContext *VAR_0, const uint8_t *VAR_1[],

                                     int VAR_2[], int VAR_3, int VAR_4,

                                     uint8_t *VAR_5[], int VAR_6[])

{

    uint16_t *dst2013[] = { (uint16_t *)VAR_5[2], (uint16_t *)VAR_5[0], (uint16_t *)VAR_5[1], (uint16_t *)VAR_5[3] };

    uint16_t *dst1023[] = { (uint16_t *)VAR_5[1], (uint16_t *)VAR_5[0], (uint16_t *)VAR_5[2], (uint16_t *)VAR_5[3] };

    int VAR_7[] = { VAR_6[2], VAR_6[0], VAR_6[1], VAR_6[3] };

    int VAR_8[] = { VAR_6[1], VAR_6[0], VAR_6[2], VAR_6[3] };

    const AVPixFmtDescriptor *VAR_9 = av_pix_fmt_desc_get(VAR_0->srcFormat);

    const AVPixFmtDescriptor *VAR_10 = av_pix_fmt_desc_get(VAR_0->dstFormat);

    int VAR_11 = VAR_10->comp[0].depth;

    int VAR_12 = VAR_9->flags & AV_PIX_FMT_FLAG_ALPHA;

    int VAR_13 = 0;

    if ( HAVE_BIGENDIAN && !(VAR_9->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   VAR_9->flags & AV_PIX_FMT_FLAG_BE)

        VAR_13++;

    if ( HAVE_BIGENDIAN && !(VAR_10->flags & AV_PIX_FMT_FLAG_BE) ||

        !HAVE_BIGENDIAN &&   VAR_10->flags & AV_PIX_FMT_FLAG_BE)

        VAR_13 += 2;



    if ((VAR_10->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) !=

        (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || VAR_11 < 9) {

        av_log(VAR_0, AV_LOG_ERROR, "unsupported conversion to planar RGB %s -> %s\n",

               VAR_9->name, VAR_10->name);

        return VAR_4;

    }

    switch (VAR_0->srcFormat) {

    case AV_PIX_FMT_RGB48LE:

    case AV_PIX_FMT_RGB48BE:

    case AV_PIX_FMT_RGBA64LE:

    case AV_PIX_FMT_RGBA64BE:

        packed16togbra16(VAR_1[0] + VAR_3 * VAR_2[0], VAR_2[0],

                         dst2013, VAR_7, VAR_4, VAR_12, VAR_13,

                         16 - VAR_11, VAR_0->srcW);

        break;

    case AV_PIX_FMT_BGR48LE:

    case AV_PIX_FMT_BGR48BE:

    case AV_PIX_FMT_BGRA64LE:

    case AV_PIX_FMT_BGRA64BE:

        packed16togbra16(VAR_1[0] + VAR_3 * VAR_2[0], VAR_2[0],

                         dst1023, VAR_8, VAR_4, VAR_12, VAR_13,

                         16 - VAR_11, VAR_0->srcW);

        break;

    default:

        av_log(VAR_0, AV_LOG_ERROR,

               "unsupported conversion to planar RGB %s -> %s\n",

               VAR_9->name, VAR_10->name);

    }



    return VAR_4;

}

static int FUNC_0(SwsContext *VAR_0, const uint8_t *VAR_1[],
int VAR_2[], int VAR_3, int VAR_4,
uint8_t *VAR_5[], int VAR_6[])
{ uint16_t *dst2013[] = { (uint16_t *)VAR_5[2], (uint16_t *)VAR_5[0], (uint16_t *)VAR_5[1], (uint16_t *)VAR_5[3] }; uint16_t *dst1023[] = { (uint16_t *)VAR_5[1], (uint16_t *)VAR_5[0], (uint16_t *)VAR_5[2], (uint16_t *)VAR_5[3] }; int VAR_7[] = { VAR_6[2], VAR_6[0], VAR_6[1], VAR_6[3] }; int VAR_8[] = { VAR_6[1], VAR_6[0], VAR_6[2], VAR_6[3] }; const AVPixFmtDescriptor *VAR_9 = av_pix_fmt_desc_get(VAR_0->srcFormat); const AVPixFmtDescriptor *VAR_10 = av_pix_fmt_desc_get(VAR_0->dstFormat); int VAR_11 = VAR_10->comp[0].depth; int VAR_12 = VAR_9->flags & AV_PIX_FMT_FLAG_ALPHA; int VAR_13 = 0; if ( HAVE_BIGENDIAN && !(VAR_9->flags & AV_PIX_FMT_FLAG_BE) ||
!HAVE_BIGENDIAN &&   VAR_9->flags & AV_PIX_FMT_FLAG_BE)
VAR_13++; if ( HAVE_BIGENDIAN && !(VAR_10->flags & AV_PIX_FMT_FLAG_BE) ||
!HAVE_BIGENDIAN &&   VAR_10->flags & AV_PIX_FMT_FLAG_BE)
VAR_13 += 2; if ((VAR_10->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) !=
(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || VAR_11 < 9) { av_log(VAR_0, AV_LOG_ERROR, "unsupported conversion to planar RGB %s -> %s\n",
VAR_9->name, VAR_10->name); return VAR_4; } switch (VAR_0->srcFormat) { case AV_PIX_FMT_RGB48LE:
case AV_PIX_FMT_RGB48BE:
case AV_PIX_FMT_RGBA64LE:
case AV_PIX_FMT_RGBA64BE:
packed16togbra16(VAR_1[0] + VAR_3 * VAR_2[0], VAR_2[0],
dst2013, VAR_7, VAR_4, VAR_12, VAR_13,
16 - VAR_11, VAR_0->srcW); break; case AV_PIX_FMT_BGR48LE:
case AV_PIX_FMT_BGR48BE:
case AV_PIX_FMT_BGRA64LE:
case AV_PIX_FMT_BGRA64BE:
packed16togbra16(VAR_1[0] + VAR_3 * VAR_2[0], VAR_2[0],
dst1023, VAR_8, VAR_4, VAR_12, VAR_13,
16 - VAR_11, VAR_0->srcW); break; default:
av_log(VAR_0, AV_LOG_ERROR,
"unsupported conversion to planar RGB %s -> %s\n",
VAR_9->name, VAR_10->name); } return VAR_4; }