static rgbConvFn findRgbConvFn(SwsContext *c)
{
    const enum AVPixelFormat srcFormat = c->srcFormat;
    const enum AVPixelFormat dstFormat = c->dstFormat;
    const int srcId = c->srcFormatBpp;
    const int dstId = c->dstFormatBpp;
    rgbConvFn conv = NULL;
    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
#define IS_NOT_NE(bpp, desc) \
    (((bpp + 7) >> 3) == 2 && \
     (!(desc->flags & AV_PIX_FMT_FLAG_BE) != !HAVE_BIGENDIAN))
    if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
        return NULL;
#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)
    if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {
        if (     CONV_IS(ABGR, RGBA)
              || CONV_IS(ARGB, BGRA)
              || CONV_IS(BGRA, ARGB)
              || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210;
        else if (CONV_IS(ABGR, ARGB)
              || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321;
        else if (CONV_IS(ABGR, BGRA)
              || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230;
        else if (CONV_IS(BGRA, RGBA)
              || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103;
        else if (CONV_IS(BGRA, ABGR)
              || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012;
    } else
    if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||
        (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {
        switch (srcId | (dstId << 16)) {
        case 0x000F000C: conv = rgb12to15; break;
        case 0x000F0010: conv = rgb16to15; break;
        case 0x000F0018: conv = rgb24to15; break;
        case 0x000F0020: conv = rgb32to15; break;
        case 0x0010000F: conv = rgb15to16; break;
        case 0x00100018: conv = rgb24to16; break;
        case 0x00100020: conv = rgb32to16; break;
        case 0x0018000F: conv = rgb15to24; break;
        case 0x00180010: conv = rgb16to24; break;
        case 0x00180020: conv = rgb32to24; break;
        case 0x0020000F: conv = rgb15to32; break;
        case 0x00200010: conv = rgb16to32; break;
        case 0x00200018: conv = rgb24to32; break;
        }
    } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||
               (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {
        switch (srcId | (dstId << 16)) {
        case 0x000C000C: conv = rgb12tobgr12; break;
        case 0x000F000F: conv = rgb15tobgr15; break;
        case 0x000F0010: conv = rgb16tobgr15; break;
        case 0x000F0018: conv = rgb24tobgr15; break;
        case 0x000F0020: conv = rgb32tobgr15; break;
        case 0x0010000F: conv = rgb15tobgr16; break;
        case 0x00100010: conv = rgb16tobgr16; break;
        case 0x00100018: conv = rgb24tobgr16; break;
        case 0x00100020: conv = rgb32tobgr16; break;
        case 0x0018000F: conv = rgb15tobgr24; break;
        case 0x00180010: conv = rgb16tobgr24; break;
        case 0x00180018: conv = rgb24tobgr24; break;
        case 0x00180020: conv = rgb32tobgr24; break;
        case 0x0020000F: conv = rgb15tobgr32; break;
        case 0x00200010: conv = rgb16tobgr32; break;
        case 0x00200018: conv = rgb24tobgr32; break;
        }
    }
    return conv;
}
['static rgbConvFn findRgbConvFn(SwsContext *c)\n{\n    const enum AVPixelFormat srcFormat = c->srcFormat;\n    const enum AVPixelFormat dstFormat = c->dstFormat;\n    const int srcId = c->srcFormatBpp;\n    const int dstId = c->dstFormatBpp;\n    rgbConvFn conv = NULL;\n    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);\n    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);\n#define IS_NOT_NE(bpp, desc) \\\n    (((bpp + 7) >> 3) == 2 && \\\n     (!(desc->flags & AV_PIX_FMT_FLAG_BE) != !HAVE_BIGENDIAN))\n    if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))\n        return NULL;\n#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)\n    if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {\n        if (     CONV_IS(ABGR, RGBA)\n              || CONV_IS(ARGB, BGRA)\n              || CONV_IS(BGRA, ARGB)\n              || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210;\n        else if (CONV_IS(ABGR, ARGB)\n              || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321;\n        else if (CONV_IS(ABGR, BGRA)\n              || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230;\n        else if (CONV_IS(BGRA, RGBA)\n              || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103;\n        else if (CONV_IS(BGRA, ABGR)\n              || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012;\n    } else\n    if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||\n        (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {\n        switch (srcId | (dstId << 16)) {\n        case 0x000F000C: conv = rgb12to15; break;\n        case 0x000F0010: conv = rgb16to15; break;\n        case 0x000F0018: conv = rgb24to15; break;\n        case 0x000F0020: conv = rgb32to15; break;\n        case 0x0010000F: conv = rgb15to16; break;\n        case 0x00100018: conv = rgb24to16; break;\n        case 0x00100020: conv = rgb32to16; break;\n        case 0x0018000F: conv = rgb15to24; break;\n        case 0x00180010: conv = rgb16to24; break;\n        case 0x00180020: conv = rgb32to24; break;\n        case 0x0020000F: conv = rgb15to32; break;\n        case 0x00200010: conv = rgb16to32; break;\n        case 0x00200018: conv = rgb24to32; break;\n        }\n    } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||\n               (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {\n        switch (srcId | (dstId << 16)) {\n        case 0x000C000C: conv = rgb12tobgr12; break;\n        case 0x000F000F: conv = rgb15tobgr15; break;\n        case 0x000F0010: conv = rgb16tobgr15; break;\n        case 0x000F0018: conv = rgb24tobgr15; break;\n        case 0x000F0020: conv = rgb32tobgr15; break;\n        case 0x0010000F: conv = rgb15tobgr16; break;\n        case 0x00100010: conv = rgb16tobgr16; break;\n        case 0x00100018: conv = rgb24tobgr16; break;\n        case 0x00100020: conv = rgb32tobgr16; break;\n        case 0x0018000F: conv = rgb15tobgr24; break;\n        case 0x00180010: conv = rgb16tobgr24; break;\n        case 0x00180018: conv = rgb24tobgr24; break;\n        case 0x00180020: conv = rgb32tobgr24; break;\n        case 0x0020000F: conv = rgb15tobgr32; break;\n        case 0x00200010: conv = rgb16tobgr32; break;\n        case 0x00200018: conv = rgb24tobgr32; break;\n        }\n    }\n    return conv;\n}', 'const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)\n{\n    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)\n        return NULL;\n    return &av_pix_fmt_descriptors[pix_fmt];\n}']