[FFmpeg-devel] [RFC] ANSI/ASCII animation decoder

Peter Ross pross
Wed Mar 10 14:13:35 CET 2010


On Wed, Mar 10, 2010 at 12:09:24PM +0100, Michael Niedermayer wrote:
> On Sun, Mar 07, 2010 at 03:13:00AM +1100, Peter Ross wrote:
> > Hi,
> > 
> > This was done as a proof-of-concept for Remote Imaging Protocol (RIP)
> > decoding.
> > 
> > The demuxer simulates the line rate, which can be overriden using the
> > AVFormatParameters.sample_rate field (ffmpeg -ar 5000 gives a 5 kilo-
> > byte/second line speed).
> > 
> > Samples: /MPlayer/incoming/ansi, or checkout the pile of floppies/cds
> > gathering dust in your closet.
> > 
> > Cheers,
> [...]
> 
> > +/**
> > + * Draw character to screen
> > + */
> > +static void draw_char(AVCodecContext *avctx, int c)
> 
> please factor this out, we need it for our ass&utf8 subtitle renderer :)

Sure. Its also used by libavcodec/tmv.c decoder.

Now I was considering PIX_FMT_TEXT to emulates the old 0xB800 video ram buffer, e.g.

data[0]= text buffer            sizeof(width * height)
data[1]= color/attribute table  sizeof(width * height * 2)
	where each array element gives 4-bit foreground and background pallete index and
	some bits for attributes (bold, underscore, blinking, etc)
data[2]= palette       sizeof(RGBA) * 16
data[3]= optional structure containing
   font height
   pointer to font table (assumed to be 8 bit wide)

However this is probably not suitable for text-based subtitles, given the frequent need
for UTF8 and variable-width fonts.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100311/787bc908/attachment.pgp>



More information about the ffmpeg-devel mailing list