int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)

{

    if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) {

        int rgba = ff_random_get_seed();

        rgba_color[0] = rgba >> 24;

        rgba_color[1] = rgba >> 16;

        rgba_color[2] = rgba >> 8;

        rgba_color[3] = rgba;

    } else

    if (!strncmp(color_string, "0x", 2)) {

        char *tail;

        int len = strlen(color_string);

        int rgba = strtol(color_string, &tail, 16);



        if (*tail || (len != 8 && len != 10)) {

            av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string);

            return -1;

        }

        if (len == 10) {

            rgba_color[3] = rgba;

            rgba >>= 8;

        }

        rgba_color[0] = rgba >> 16;

        rgba_color[1] = rgba >> 8;

        rgba_color[2] = rgba;

    } else {

        const ColorEntry *entry = bsearch(color_string,

                                          color_table,

                                          FF_ARRAY_ELEMS(color_table),

                                          sizeof(ColorEntry),

                                          color_table_compare);

        if (!entry) {

            av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string);

            return -1;

        }

        memcpy(rgba_color, entry->rgba_color, 4);

    }



    return 0;

}

int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)

{

    if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) {

        int rgba = ff_random_get_seed();

        rgba_color[0] = rgba >> 24;

        rgba_color[1] = rgba >> 16;

        rgba_color[2] = rgba >> 8;

        rgba_color[3] = rgba;

    } else

    if (!strncmp(color_string, "0x", 2)) {

        char *tail;

        int len = strlen(color_string);

        int rgba = strtol(color_string, &tail, 16);



        if (*tail || (len != 8 && len != 10)) {

            av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string);

            return -1;

        }

        if (len == 10) {

            rgba_color[3] = rgba;

            rgba >>= 8;

        }

        rgba_color[0] = rgba >> 16;

        rgba_color[1] = rgba >> 8;

        rgba_color[2] = rgba;

    } else {

        const ColorEntry *entry = bsearch(color_string,

                                          color_table,

                                          FF_ARRAY_ELEMS(color_table),

                                          sizeof(ColorEntry),

                                          color_table_compare);

        if (!entry) {

            av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string);

            return -1;

        }

        memcpy(rgba_color, entry->rgba_color, 4);

    }



    return 0;

}

        int rgba = strtol(color_string, &tail, 16);
int FUNC_0(uint8_t *VAR_0, const char *VAR_1, void *VAR_2)

{

    if (!strcasecmp(VAR_1, "random") || !strcasecmp(VAR_1, "bikeshed")) {

        int VAR_6 = ff_random_get_seed();

        VAR_0[0] = VAR_6 >> 24;

        VAR_0[1] = VAR_6 >> 16;

        VAR_0[2] = VAR_6 >> 8;

        VAR_0[3] = VAR_6;

    } else

    if (!strncmp(VAR_1, "0x", 2)) {

        char *VAR_4;

        int VAR_5 = strlen(VAR_1);

        int VAR_6 = strtol(VAR_1, &VAR_4, 16);



        if (*VAR_4 || (VAR_5 != 8 && VAR_5 != 10)) {

            av_log(VAR_2, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", VAR_1);

            return -1;

        }

        if (VAR_5 == 10) {

            VAR_0[3] = VAR_6;

            VAR_6 >>= 8;

        }

        VAR_0[0] = VAR_6 >> 16;

        VAR_0[1] = VAR_6 >> 8;

        VAR_0[2] = VAR_6;

    } else {

        const ColorEntry *VAR_6 = bsearch(VAR_1,

                                          color_table,

                                          FF_ARRAY_ELEMS(color_table),

                                          sizeof(ColorEntry),

                                          color_table_compare);

        if (!VAR_6) {

            av_log(VAR_2, AV_LOG_ERROR, "Cannot find color '%s'\n", VAR_1);

            return -1;

        }

        memcpy(VAR_0, VAR_6->VAR_0, 4);

    }



    return 0;

}

int FUNC_0(uint8_t *VAR_0, const char *VAR_1, void *VAR_2)
{ if (!strcasecmp(VAR_1, "random") || !strcasecmp(VAR_1, "bikeshed")) { int VAR_6 = ff_random_get_seed(); VAR_0[0] = VAR_6 >> 24; VAR_0[1] = VAR_6 >> 16; VAR_0[2] = VAR_6 >> 8; VAR_0[3] = VAR_6; } else if (!strncmp(VAR_1, "0x", 2)) { char *VAR_4; int VAR_5 = strlen(VAR_1); int VAR_6 = strtol(VAR_1, &VAR_4, 16); if (*VAR_4 || (VAR_5 != 8 && VAR_5 != 10)) { av_log(VAR_2, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", VAR_1); return -1; } if (VAR_5 == 10) { VAR_0[3] = VAR_6; VAR_6 >>= 8; } VAR_0[0] = VAR_6 >> 16; VAR_0[1] = VAR_6 >> 8; VAR_0[2] = VAR_6; } else { const ColorEntry *VAR_6 = bsearch(VAR_1,
color_table,
FF_ARRAY_ELEMS(color_table),
sizeof(ColorEntry),
color_table_compare); if (!VAR_6) { av_log(VAR_2, AV_LOG_ERROR, "Cannot find color '%s'\n", VAR_1); return -1; } memcpy(VAR_0, VAR_6->VAR_0, 4); } return 0; }