static int draw_glyphs(DrawTextContext *s, AVFrame *frame,

                       int width, int height,

                       const uint8_t rgbcolor[4], const uint8_t yuvcolor[4],

                       int x, int y)

{

    char *text = HAVE_LOCALTIME_R ? s->expanded_text : s->text;

    uint32_t code = 0;

    int i;

    uint8_t *p;

    Glyph *glyph = NULL;



    for (i = 0, p = text; *p; i++) {

        Glyph dummy = { 0 };

        GET_UTF8(code, *p++, continue;);



        /* skip new line chars, just go to new line */

        if (code == '\n' || code == '\r' || code == '\t')

            continue;



        dummy.code = code;

        glyph = av_tree_find(s->glyphs, &dummy, (void *)glyph_cmp, NULL);



        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&

            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)

            return AVERROR(EINVAL);



        if (s->is_packed_rgb) {

            draw_glyph_rgb(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           s->pixel_step[0], rgbcolor, s->rgba_map, s->alpha);

        } else {

            draw_glyph_yuv(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           yuvcolor, s->hsub, s->vsub, s->alpha);

        }

    }



    return 0;

}

static int draw_glyphs(DrawTextContext *s, AVFrame *frame,

                       int width, int height,

                       const uint8_t rgbcolor[4], const uint8_t yuvcolor[4],

                       int x, int y)

{

    char *text = HAVE_LOCALTIME_R ? s->expanded_text : s->text;

    uint32_t code = 0;

    int i;

    uint8_t *p;

    Glyph *glyph = NULL;



    for (i = 0, p = text; *p; i++) {

        Glyph dummy = { 0 };

        GET_UTF8(code, *p++, continue;);



        

        if (code == '\n' || code == '\r' || code == '\t')

            continue;



        dummy.code = code;

        glyph = av_tree_find(s->glyphs, &dummy, (void *)glyph_cmp, NULL);



        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&

            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)

            return AVERROR(EINVAL);



        if (s->is_packed_rgb) {

            draw_glyph_rgb(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           s->pixel_step[0], rgbcolor, s->rgba_map, s->alpha);

        } else {

            draw_glyph_yuv(frame, &glyph->bitmap,

                           s->positions[i].x+x, s->positions[i].y+y, width, height,

                           yuvcolor, s->hsub, s->vsub, s->alpha);

        }

    }



    return 0;

}

static int FUNC_0(DrawTextContext *VAR_0, AVFrame *VAR_1,

                       int VAR_2, int VAR_3,

                       const uint8_t VAR_4[4], const uint8_t VAR_5[4],

                       int VAR_6, int VAR_7)

{

    char *VAR_8 = HAVE_LOCALTIME_R ? VAR_0->expanded_text : VAR_0->VAR_8;

    uint32_t code = 0;

    int VAR_9;

    uint8_t *p;

    Glyph *glyph = NULL;



    for (VAR_9 = 0, p = VAR_8; *p; VAR_9++) {

        Glyph dummy = { 0 };

        GET_UTF8(code, *p++, continue;);



        

        if (code == '\n' || code == '\r' || code == '\t')

            continue;



        dummy.code = code;

        glyph = av_tree_find(VAR_0->glyphs, &dummy, (void *)glyph_cmp, NULL);



        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&

            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)

            return AVERROR(EINVAL);



        if (VAR_0->is_packed_rgb) {

            draw_glyph_rgb(VAR_1, &glyph->bitmap,

                           VAR_0->positions[VAR_9].VAR_6+VAR_6, VAR_0->positions[VAR_9].VAR_7+VAR_7, VAR_2, VAR_3,

                           VAR_0->pixel_step[0], VAR_4, VAR_0->rgba_map, VAR_0->alpha);

        } else {

            draw_glyph_yuv(VAR_1, &glyph->bitmap,

                           VAR_0->positions[VAR_9].VAR_6+VAR_6, VAR_0->positions[VAR_9].VAR_7+VAR_7, VAR_2, VAR_3,

                           VAR_5, VAR_0->hsub, VAR_0->vsub, VAR_0->alpha);

        }

    }



    return 0;

}

static int FUNC_0(DrawTextContext *VAR_0, AVFrame *VAR_1,
int VAR_2, int VAR_3,
const uint8_t VAR_4[4], const uint8_t VAR_5[4],
int VAR_6, int VAR_7)
{ char *VAR_8 = HAVE_LOCALTIME_R ? VAR_0->expanded_text : VAR_0->VAR_8; uint32_t code = 0; int VAR_9; uint8_t *p; Glyph *glyph = NULL; for (VAR_9 = 0, p = VAR_8; *p; VAR_9++) { Glyph dummy = { 0 }; GET_UTF8(code, *p++, continue;); if (code == '\n' || code == '\r' || code == '\t')
continue; dummy.code = code; glyph = av_tree_find(VAR_0->glyphs, &dummy, (void *)glyph_cmp, NULL); if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&
glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
return AVERROR(EINVAL); if (VAR_0->is_packed_rgb) { draw_glyph_rgb(VAR_1, &glyph->bitmap,
VAR_0->positions[VAR_9].VAR_6+VAR_6, VAR_0->positions[VAR_9].VAR_7+VAR_7, VAR_2, VAR_3,
VAR_0->pixel_step[0], VAR_4, VAR_0->rgba_map, VAR_0->alpha); } else { draw_glyph_yuv(VAR_1, &glyph->bitmap,
VAR_0->positions[VAR_9].VAR_6+VAR_6, VAR_0->positions[VAR_9].VAR_7+VAR_7, VAR_2, VAR_3,
VAR_5, VAR_0->hsub, VAR_0->vsub, VAR_0->alpha); } } return 0; }