static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,

                                  int srcSliceH, uint8_t* dst[], int dstStride[])

{

    uint8_t *dstPtr= dst[0];

    const uint8_t *srcPtr= src[0];

    int i;

    void (*copy)       (const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);

    void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);



    switch(c->srcFormat) {

#define CASE(pixfmt, prefix) \

    case pixfmt: copy        = bayer_##prefix##_to_rgb24_copy; \

                 interpolate = bayer_##prefix##_to_rgb24_interpolate; \

                 break;

    CASE(AV_PIX_FMT_BAYER_BGGR8,    bggr8)

    CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)

    CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)

    CASE(AV_PIX_FMT_BAYER_RGGB8,    rggb8)

    CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)

    CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)

    CASE(AV_PIX_FMT_BAYER_GBRG8,    gbrg8)

    CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)

    CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)

    CASE(AV_PIX_FMT_BAYER_GRBG8,    grbg8)

    CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)

    CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)

#undef CASE

    default: return 0;

    }



    copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

    srcPtr += 2 * srcStride[0];

    dstPtr += 2 * dstStride[0];



    for (i = 2; i < srcSliceH - 2; i += 2) {

        interpolate(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

        srcPtr += 2 * srcStride[0];

        dstPtr += 2 * dstStride[0];

    }



    copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

    return srcSliceH;

}

static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,

                                  int srcSliceH, uint8_t* dst[], int dstStride[])

{

    uint8_t *dstPtr= dst[0];

    const uint8_t *srcPtr= src[0];

    int i;

    void (*copy)       (const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);

    void (*interpolate)(const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width);



    switch(c->srcFormat) {

#define CASE(pixfmt, prefix) \

    case pixfmt: copy        = bayer_##prefix##_to_rgb24_copy; \

                 interpolate = bayer_##prefix##_to_rgb24_interpolate; \

                 break;

    CASE(AV_PIX_FMT_BAYER_BGGR8,    bggr8)

    CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)

    CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)

    CASE(AV_PIX_FMT_BAYER_RGGB8,    rggb8)

    CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)

    CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)

    CASE(AV_PIX_FMT_BAYER_GBRG8,    gbrg8)

    CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)

    CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)

    CASE(AV_PIX_FMT_BAYER_GRBG8,    grbg8)

    CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)

    CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)

#undef CASE

    default: return 0;

    }



    copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

    srcPtr += 2 * srcStride[0];

    dstPtr += 2 * dstStride[0];



    for (i = 2; i < srcSliceH - 2; i += 2) {

        interpolate(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

        srcPtr += 2 * srcStride[0];

        dstPtr += 2 * dstStride[0];

    }



    copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);

    return srcSliceH;

}

static int FUNC_0(SwsContext *VAR_0, const uint8_t* VAR_14[], int VAR_2[], int VAR_3,

                                  int VAR_4, uint8_t* VAR_14[], int VAR_6[])

{

    uint8_t *dstPtr= VAR_14[0];

    const uint8_t *VAR_7= VAR_14[0];

    int VAR_8;

    void (*VAR_9)       (const uint8_t *VAR_14, int VAR_14, uint8_t *VAR_14, int VAR_14, int VAR_14);

    void (*VAR_13)(const uint8_t *VAR_14, int VAR_14, uint8_t *VAR_14, int VAR_14, int VAR_14);



    switch(VAR_0->srcFormat) {

#define CASE(pixfmt, prefix) \

    case pixfmt: VAR_9        = bayer_##prefix##_to_rgb24_copy; \

                 VAR_13 = bayer_##prefix##_to_rgb24_interpolate; \

                 break;

    CASE(AV_PIX_FMT_BAYER_BGGR8,    bggr8)

    CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)

    CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)

    CASE(AV_PIX_FMT_BAYER_RGGB8,    rggb8)

    CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)

    CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)

    CASE(AV_PIX_FMT_BAYER_GBRG8,    gbrg8)

    CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)

    CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)

    CASE(AV_PIX_FMT_BAYER_GRBG8,    grbg8)

    CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)

    CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)

#undef CASE

    default: return 0;

    }



    VAR_9(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW);

    VAR_7 += 2 * VAR_2[0];

    dstPtr += 2 * VAR_6[0];



    for (VAR_8 = 2; VAR_8 < VAR_4 - 2; VAR_8 += 2) {

        VAR_13(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW);

        VAR_7 += 2 * VAR_2[0];

        dstPtr += 2 * VAR_6[0];

    }



    VAR_9(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW);

    return VAR_4;

}

static int FUNC_0(SwsContext *VAR_0, const uint8_t* VAR_14[], int VAR_2[], int VAR_3,
int VAR_4, uint8_t* VAR_14[], int VAR_6[])
{ uint8_t *dstPtr= VAR_14[0]; const uint8_t *VAR_7= VAR_14[0]; int VAR_8; void (*VAR_9)       (const uint8_t *VAR_14, int VAR_14, uint8_t *VAR_14, int VAR_14, int VAR_14); void (*VAR_13)(const uint8_t *VAR_14, int VAR_14, uint8_t *VAR_14, int VAR_14, int VAR_14); switch(VAR_0->srcFormat) { #define CASE(pixfmt, prefix) \
case pixfmt: VAR_9        = bayer_##prefix##_to_rgb24_copy; \ VAR_13 = bayer_##prefix##_to_rgb24_interpolate; \ break; CASE(AV_PIX_FMT_BAYER_BGGR8,    bggr8)
CASE(AV_PIX_FMT_BAYER_BGGR16LE, bggr16le)
CASE(AV_PIX_FMT_BAYER_BGGR16BE, bggr16be)
CASE(AV_PIX_FMT_BAYER_RGGB8,    rggb8)
CASE(AV_PIX_FMT_BAYER_RGGB16LE, rggb16le)
CASE(AV_PIX_FMT_BAYER_RGGB16BE, rggb16be)
CASE(AV_PIX_FMT_BAYER_GBRG8,    gbrg8)
CASE(AV_PIX_FMT_BAYER_GBRG16LE, gbrg16le)
CASE(AV_PIX_FMT_BAYER_GBRG16BE, gbrg16be)
CASE(AV_PIX_FMT_BAYER_GRBG8,    grbg8)
CASE(AV_PIX_FMT_BAYER_GRBG16LE, grbg16le)
CASE(AV_PIX_FMT_BAYER_GRBG16BE, grbg16be)
#undef CASE
default: return 0; } VAR_9(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW); VAR_7 += 2 * VAR_2[0]; dstPtr += 2 * VAR_6[0]; for (VAR_8 = 2; VAR_8 < VAR_4 - 2; VAR_8 += 2) { VAR_13(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW); VAR_7 += 2 * VAR_2[0]; dstPtr += 2 * VAR_6[0]; } VAR_9(VAR_7, VAR_2[0], dstPtr, VAR_6[0], VAR_0->srcW); return VAR_4; }