From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 73C644B7AD for ; Tue, 22 Jul 2025 00:47:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 2852268CBD2; Tue, 22 Jul 2025 03:47:14 +0300 (EEST) Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 45B3668C5F6 for ; Tue, 22 Jul 2025 03:47:06 +0300 (EEST) Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-531b4407cfbso1127523e0c.1 for ; Mon, 21 Jul 2025 17:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753145224; x=1753750024; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oEcEqjz9gfa/Cv90m5QAMnlftVL/ClVY0bmcEDZUVp4=; b=UwWNlLAFnENO0twl/C2FhSjNZeQ1aGt8DCHPEDQs3VQVlUB8hfYRcLxfCJ1SkO3Ppk juDe7b6HW8OQH44veWvfN5GFUMtXqesajk0wwZ5ECi8qyNY71twWeC6ISLqTkCnqgpzD 4Laof/UIRX8y0KyNUtRrwVPry/DRdxuWK0swoNLpzGdo4jrl5WZs4oJfesh4OrJdRoXv FAbCK92RVGTXJD6JIJsWZsPFz0cvGlGXpDzGRY2aaR7G0tirOvzLcdaT95ep45iMRDJX qL4bRmWpEcdN2yrFBnv00I/1+a3qWqhTnI6K77OIjiUijeXPsyjzrXYSbIuTYsHViFZL Peqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753145224; x=1753750024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oEcEqjz9gfa/Cv90m5QAMnlftVL/ClVY0bmcEDZUVp4=; b=CHeW37WI0rBHgnKHCBO7Yn2DER0jE0Ff2utdyjxkfYNXAFGEnSOpuJunyVmHUulcr8 g5wlYybX+Kpk4zZpUWMWmdc1lgpJCtFCZEB01DAXWgkP4M8kVkzX8IkuHTXSZ880bUWl NlgM8o8TukpxbJYUAd7RHoOx25IpGWhFLNdTwcA351eJFQnd6KfU862ZI2XCswGdWPNW UizQbZBJ0/otBVfzEY2Vqxn1Gu2J4OROCec2gA1DNkjtNxJ1+BeHxkaZiLMp9r5gnIkM IpQX2XKNNEOK0trNtxxLOTwDKdd6oIx1dFFanT7j5ucxEn0vHffH5hC/ZTQi8Jepargt uAaw== X-Gm-Message-State: AOJu0YyeIua0bJv4lvbPPiixH3D8dxc440dKc+rKULAZHcB5DnUkniuv bdv8+6SFkX9m3eePlQkUhvAinN37tD3Y7XZoDzgwJ3RcHRnudVENs5Ei8hXxkw== X-Gm-Gg: ASbGnctld3L0khe8uSnTzec/YsWY+qSpY45ddNDbgUA7YZpv340fsFv3dg5ZHR5pR14 09NLdXbVrXjoje1kzxoD6PYmSPV0ii/15p55iueXnw8Rh/E7yzts+sHSjBt9UinZJQ+Ws/2zgIs N2GeRrMKQ0aDrg9mbqag/hKgxThJLNKvmP17hNDfpcK5vxwM/khDv2nCSJxp1Y8eDq38gRATJ36 fgbXarI3bAJ5qQogBYTyVJrkW12sQ0tf/zzBMHJ+XpOnvjFmo1DvEPMTpojUDTHqspO3oliwEOU VJq+H+BJXUXoe7Na61Wb9JVe0yPSGgCZthKFEedJPd6Rp9oRsBL8StbPLQkm5IEYFxuEQSdlC7c IXKWp3+2A5V5Fp7o39Xo= X-Google-Smtp-Source: AGHT+IFydsExp0lVAPdVSb4NnojrU1gn65sZAMG1D8RJXwjYVjd+X9bOz0vHMDE32GlRPYz8sLSXCw== X-Received: by 2002:a05:6122:2a06:b0:531:2afc:4637 with SMTP id 71dfb90a1353d-5373fcb9490mr10237896e0c.9.1753145223984; Mon, 21 Jul 2025 17:47:03 -0700 (PDT) Received: from Gryph ([2800:2121:b000:82e:a1d7:ee24:579c:2fe2]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-53764eed627sm3484929e0c.4.2025.07.21.17.47.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jul 2025 17:47:03 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Jul 2025 21:46:47 -0300 Message-ID: <20250722004647.15233-3-jamrial@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250722004647.15233-1-jamrial@gmail.com> References: <20250722004647.15233-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avfilter: use the getters for xGA font data arrays X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- libavfilter/af_aiir.c | 2 +- libavfilter/avf_showcqt.c | 3 ++- libavfilter/avf_showspectrum.c | 2 +- libavfilter/avf_showvolume.c | 2 +- libavfilter/f_ebur128.c | 4 ++-- libavfilter/f_graphmonitor.c | 2 +- libavfilter/src_avsynctest.c | 3 ++- libavfilter/vf_datascope.c | 3 ++- libavfilter/vf_vectorscope.c | 8 ++++---- libavfilter/vf_waveform.c | 16 ++++++++-------- libavfilter/vsrc_testsrc.c | 3 ++- 11 files changed, 26 insertions(+), 22 deletions(-) diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 9a43235ad6..f18b6e9286 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -1038,7 +1038,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint32_t color int font_height; int i; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (i = 0; txt[i]; i++) { int char_y, mask; diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c index 8ff6ecbe09..5050f46e25 100644 --- a/libavfilter/avf_showcqt.c +++ b/libavfilter/avf_showcqt.c @@ -655,6 +655,7 @@ fail: static int render_default_font(AVFrame *tmp) { const char *str = "EF G A BC D "; + const uint8_t *vga16_font = avpriv_vga16_font_get(); int x, u, v, mask; uint8_t *data = tmp->data[0]; int linesize = tmp->linesize[0]; @@ -666,7 +667,7 @@ static int render_default_font(AVFrame *tmp) for (v = 0; v < height; v++) { uint8_t *p = startptr + v * linesize + height/2 * 4 * u; for (mask = 0x80; mask; mask >>= 1, p += 4) { - if (mask & avpriv_vga16_font[str[u] * 16 + v]) + if (mask & vga16_font[str[u] * 16 + v]) p[3] = 255; else p[3] = 0; diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index dc608c450a..ee71d55894 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -492,7 +492,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, int o) const uint8_t *font; int font_height; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (int i = 0; txt[i]; i++) { int char_y, mask; diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c index e760caad2d..8472e86a15 100644 --- a/libavfilter/avf_showvolume.c +++ b/libavfilter/avf_showvolume.c @@ -225,7 +225,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, int o) int font_height; int i; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (i = 0; txt[i]; i++) { int char_y, mask; diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index 63669b71de..a352f3831f 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -246,8 +246,8 @@ static void drawtext(AVFrame *pic, int x, int y, int ftid, const uint8_t *color, int font_height; va_list vl; - if (ftid == FONT16) font = avpriv_vga16_font, font_height = 16; - else if (ftid == FONT8) font = avpriv_cga_font, font_height = 8; + if (ftid == FONT16) font = avpriv_vga16_font_get(), font_height = 16; + else if (ftid == FONT8) font = avpriv_cga_font_get(), font_height = 8; else return; va_start(vl, fmt); diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c index de9946586c..20cdcce79d 100644 --- a/libavfilter/f_graphmonitor.c +++ b/libavfilter/f_graphmonitor.c @@ -186,7 +186,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, int font_height; int i; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; if (y + 8 >= pic->height || x + len * 8 >= pic->width) diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c index 68dffba43a..9c71a9fee8 100644 --- a/libavfilter/src_avsynctest.c +++ b/libavfilter/src_avsynctest.c @@ -252,6 +252,7 @@ static int audio_frame(AVFilterLink *outlink) static void draw_text(FFDrawContext *draw, AVFrame *out, FFDrawColor *color, int x0, int y0, const uint8_t *text) { + const uint8_t *cga_font = avpriv_cga_font_get(); int x = x0; for (; *text; text++) { @@ -262,7 +263,7 @@ static void draw_text(FFDrawContext *draw, AVFrame *out, FFDrawColor *color, } ff_blend_mask(draw, color, out->data, out->linesize, out->width, out->height, - avpriv_cga_font + *text * 8, 1, 8, 8, 0, 0, x, y0); + &cga_font[*text * 8], 1, 8, 8, 0, 0, x, y0); x += 8; } } diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c index 6efeb875a6..87137cee83 100644 --- a/libavfilter/vf_datascope.c +++ b/libavfilter/vf_datascope.c @@ -88,6 +88,7 @@ static int query_formats(const AVFilterContext *ctx, static void draw_text(FFDrawContext *draw, AVFrame *frame, FFDrawColor *color, int x0, int y0, const uint8_t *text, int vertical) { + const uint8_t *cga_font = avpriv_cga_font_get(); int x = x0; for (; *text; text++) { @@ -98,7 +99,7 @@ static void draw_text(FFDrawContext *draw, AVFrame *frame, FFDrawColor *color, } ff_blend_mask(draw, color, frame->data, frame->linesize, frame->width, frame->height, - avpriv_cga_font + *text * 8, 1, 8, 8, 0, 0, x, y0); + &cga_font[*text * 8], 1, 8, 8, 0, 0, x, y0); if (vertical) { x = x0; y0 += 8; diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c index 2143f9dcc2..eeee166172 100644 --- a/libavfilter/vf_vectorscope.c +++ b/libavfilter/vf_vectorscope.c @@ -968,7 +968,7 @@ static void draw_ihtext(AVFrame *out, int x, int y, float o1, float o2, const ch int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -993,7 +993,7 @@ static void draw_ihtext16(AVFrame *out, int x, int y, float o1, float o2, const int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -1019,7 +1019,7 @@ static void draw_htext(AVFrame *out, int x, int y, float o1, float o2, const cha int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -1045,7 +1045,7 @@ static void draw_htext16(AVFrame *out, int x, int y, float o1, float o2, const c int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c index 6d2b529e88..a8e4e71bf6 100644 --- a/libavfilter/vf_waveform.c +++ b/libavfilter/vf_waveform.c @@ -2635,7 +2635,7 @@ static void draw_htext(AVFrame *out, int x, int y, int mult, float o1, float o2, int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2661,7 +2661,7 @@ static void draw_htext16(AVFrame *out, int x, int y, int mult, float o1, float o int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2687,7 +2687,7 @@ static void draw_vtext(AVFrame *out, int x, int y, int mult, float o1, float o2, int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2712,7 +2712,7 @@ static void draw_vtext16(AVFrame *out, int x, int y, int mult, float o1, float o int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2779,7 +2779,7 @@ static void idraw_htext(AVFrame *out, int x, int y, int mult, float o1, float o2 int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2805,7 +2805,7 @@ static void idraw_htext16(AVFrame *out, int x, int y, int mult, float o1, float int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2831,7 +2831,7 @@ static void idraw_vtext(AVFrame *out, int x, int y, int mult, float o1, float o2 int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { @@ -2856,7 +2856,7 @@ static void idraw_vtext16(AVFrame *out, int x, int y, int mult, float o1, float int font_height; int i, plane; - font = avpriv_cga_font, font_height = 8; + font = avpriv_cga_font_get(), font_height = 8; for (plane = 0; plane < 4 && out->data[plane]; plane++) { for (i = 0; txt[i]; i++) { diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 78680441a8..81301edbfe 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -733,6 +733,7 @@ static uint32_t color_gradient(unsigned index) static void draw_text(TestSourceContext *s, AVFrame *frame, FFDrawColor *color, int x0, int y0, const uint8_t *text) { + const uint8_t *vga16_font = avpriv_vga16_font_get(); int x = x0; for (; *text; text++) { @@ -743,7 +744,7 @@ static void draw_text(TestSourceContext *s, AVFrame *frame, FFDrawColor *color, } ff_blend_mask(&s->draw, color, frame->data, frame->linesize, frame->width, frame->height, - avpriv_vga16_font + *text * 16, 1, 8, 16, 0, 0, x, y0); + &vga16_font[*text * 16], 1, 8, 16, 0, 0, x, y0); x += 8; } } -- 2.50.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".