Go to the documentation of this file.
31 #include "config_components.h"
61 s->font_height = p[0];
69 if (!
s->font_height) {
79 for (
i = 0;
i < 16;
i++) {
80 s->palette[
i] = 0xFF000000 | (
AV_RB24(p) << 2) | ((
AV_RB24(p) >> 4) & 0x30303);
84 for (
i = 0;
i < 16;
i++)
91 switch(
s->font_height) {
111 #define DEFAULT_BG_COLOR 0
115 if (
s->y < avctx->
height -
s->font_height) {
116 s->y +=
s->font_height;
118 memmove(
s->frame->data[0],
s->frame->data[0] +
s->font_height*
s->frame->linesize[0],
119 (avctx->
height -
s->font_height)*
s->frame->linesize[0]);
120 memset(
s->frame->data[0] + (avctx->
height -
s->font_height)*
s->frame->linesize[0],
131 if (
s->y > avctx->
height -
s->font_height)
134 s->frame->linesize[0],
s->font,
s->font_height,
c,
139 s->y +=
s->font_height;
147 const uint8_t *buf = avpkt->
data;
148 int buf_size = avpkt->
size;
149 const uint8_t *buf_end = buf+buf_size;
160 #if FF_API_PALETTE_HAS_CHANGED
162 s->frame->palette_has_changed = 1;
165 memcpy(
s->frame->data[1],
s->palette, 16 * 4);
168 while (buf + 2 < buf_end) {
170 int type = *buf >> 6;
171 int count = (*buf & 0x3F) + 1;
175 for (
i = 0;
i < count && buf + 1 < buf_end;
i++) {
182 for (
i = 0;
i < count && buf < buf_end;
i++)
187 for (
i = 0;
i < count && buf < buf_end;
i++)
193 for (
i = 0;
i < count && buf < buf_end;
i++)
199 while (buf + 2 < buf_end) {
202 if (buf + 6 > buf_end)
204 for (
i = 0;
i < buf[2];
i++)
213 while (buf + 1 < buf_end) {
223 #if CONFIG_BINTEXT_DECODER
235 #if CONFIG_XBIN_DECODER
247 #if CONFIG_IDF_DECODER
#define FF_ENABLE_DEPRECATION_WARNINGS
#define AV_LOG_WARNING
Something somehow does not look correct.
const uint32_t ff_cga_palette[16]
static av_unused void hscroll(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static av_cold int decode_init(AVCodecContext *avctx)
AVCodec p
The public AVCodec.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
void ff_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg)
Draw CGA/EGA/VGA font to 8-bit pixel buffer.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_DECODE_CB(func)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define CODEC_LONG_NAME(str)
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
@ AV_PICTURE_TYPE_I
Intra.
static void draw_char(AVCodecContext *avctx, int c, int a)
Draw character to screen.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
const FFCodec ff_xbin_decoder
const FFCodec ff_bintext_decoder
const uint8_t avpriv_vga16_font[4096]
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
#define FF_DISABLE_DEPRECATION_WARNINGS
const uint8_t avpriv_cga_font[2048]
This structure stores compressed data.
int width
picture width / height.
const FFCodec ff_idf_decoder
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24