Commit 81bbce9c authored by Clément Bœsch's avatar Clément Bœsch

Move xGA font data from lavc to lavu.

This needs to be accessible for libavfilter in the next commit.
parent c39916bc
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavutil/lfg.h" #include "libavutil/lfg.h"
#include "libavutil/xga_font_data.h"
#include "avcodec.h" #include "avcodec.h"
#include "cga_data.h" #include "cga_data.h"
...@@ -78,7 +79,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -78,7 +79,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = PIX_FMT_PAL8;
/* defaults */ /* defaults */
s->font = ff_vga16_font; s->font = avpriv_vga16_font;
s->font_height = 16; s->font_height = 16;
s->fg = DEFAULT_FG_COLOR; s->fg = DEFAULT_FG_COLOR;
s->bg = DEFAULT_BG_COLOR; s->bg = DEFAULT_BG_COLOR;
...@@ -203,19 +204,19 @@ static int execute_code(AVCodecContext * avctx, int c) ...@@ -203,19 +204,19 @@ static int execute_code(AVCodecContext * avctx, int c)
height = avctx->height; height = avctx->height;
switch(s->args[0]) { switch(s->args[0]) {
case 0: case 1: case 4: case 5: case 13: case 19: //320x200 (25 rows) case 0: case 1: case 4: case 5: case 13: case 19: //320x200 (25 rows)
s->font = ff_cga_font; s->font = avpriv_cga_font;
s->font_height = 8; s->font_height = 8;
width = 40<<3; width = 40<<3;
height = 25<<3; height = 25<<3;
break; break;
case 2: case 3: //640x400 (25 rows) case 2: case 3: //640x400 (25 rows)
s->font = ff_vga16_font; s->font = avpriv_vga16_font;
s->font_height = 16; s->font_height = 16;
width = 80<<3; width = 80<<3;
height = 25<<4; height = 25<<4;
break; break;
case 6: case 14: //640x200 (25 rows) case 6: case 14: //640x200 (25 rows)
s->font = ff_cga_font; s->font = avpriv_cga_font;
s->font_height = 8; s->font_height = 8;
width = 80<<3; width = 80<<3;
height = 25<<3; height = 25<<3;
...@@ -223,13 +224,13 @@ static int execute_code(AVCodecContext * avctx, int c) ...@@ -223,13 +224,13 @@ static int execute_code(AVCodecContext * avctx, int c)
case 7: //set line wrapping case 7: //set line wrapping
break; break;
case 15: case 16: //640x350 (43 rows) case 15: case 16: //640x350 (43 rows)
s->font = ff_cga_font; s->font = avpriv_cga_font;
s->font_height = 8; s->font_height = 8;
width = 80<<3; width = 80<<3;
height = 43<<3; height = 43<<3;
break; break;
case 17: case 18: //640x480 (60 rows) case 17: case 18: //640x480 (60 rows)
s->font = ff_cga_font; s->font = avpriv_cga_font;
s->font_height = 8; s->font_height = 8;
width = 80<<3; width = 80<<3;
height = 60<<4; height = 60<<4;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
*/ */
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/xga_font_data.h"
#include "avcodec.h" #include "avcodec.h"
#include "cga_data.h" #include "cga_data.h"
#include "bintext.h" #include "bintext.h"
...@@ -82,10 +83,10 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -82,10 +83,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_WARNING, "font height %i not supported\n", s->font_height); av_log(avctx, AV_LOG_WARNING, "font height %i not supported\n", s->font_height);
s->font_height = 8; s->font_height = 8;
case 8: case 8:
s->font = ff_cga_font; s->font = avpriv_cga_font;
break; break;
case 16: case 16:
s->font = ff_vga16_font; s->font = avpriv_vga16_font;
break; break;
} }
} }
......
This diff is collapsed.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
/** /**
* @file * @file
* CGA/EGA/VGA ROM data * CGA/EGA/VGA ROM data
* @note fonts are in libavutil/xga_font_data.[ch]
*/ */
#ifndef AVCODEC_CGA_DATA_H #ifndef AVCODEC_CGA_DATA_H
...@@ -28,8 +29,6 @@ ...@@ -28,8 +29,6 @@
#include <stdint.h> #include <stdint.h>
extern const uint8_t ff_cga_font[2048];
extern const uint8_t ff_vga16_font[4096];
extern const uint32_t ff_cga_palette[16]; extern const uint32_t ff_cga_palette[16];
extern const uint32_t ff_ega_palette[64]; extern const uint32_t ff_ega_palette[64];
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/xga_font_data.h"
#include "cga_data.h" #include "cga_data.h"
...@@ -75,7 +76,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, ...@@ -75,7 +76,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data,
bg = *src >> 4; bg = *src >> 4;
fg = *src++ & 0xF; fg = *src++ & 0xF;
ff_draw_pc_font(dst + x * 8, tmv->pic.linesize[0], ff_draw_pc_font(dst + x * 8, tmv->pic.linesize[0],
ff_cga_font, 8, c, fg, bg); avpriv_cga_font, 8, c, fg, bg);
} }
dst += tmv->pic.linesize[0] * 8; dst += tmv->pic.linesize[0] * 8;
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 61 #define LIBAVCODEC_VERSION_MINOR 62
#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
...@@ -92,6 +92,7 @@ OBJS = adler32.o \ ...@@ -92,6 +92,7 @@ OBJS = adler32.o \
timecode.o \ timecode.o \
tree.o \ tree.o \
utils.o \ utils.o \
xga_font_data.o \
xtea.o \ xtea.o \
OBJS-$(HAVE_BROKEN_SNPRINTF) += ../compat/msvcrt/snprintf.o OBJS-$(HAVE_BROKEN_SNPRINTF) += ../compat/msvcrt/snprintf.o
......
This diff is collapsed.
/*
* CGA/EGA/VGA ROM font data
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* CGA/EGA/VGA ROM font data
*/
#ifndef AVUTIL_XGA_FONT_DATA_H
#define AVUTIL_XGA_FONT_DATA_H
#include <stdint.h>
extern const uint8_t avpriv_cga_font[2048];
extern const uint8_t avpriv_vga16_font[4096];
#endif /* AVUTIL_XGA_FONT_DATA_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment