libavcodec/xsubenc.c File Reference

#include "avcodec.h"
#include "bytestream.h"
#include "put_bits.h"

Go to the source code of this file.

Defines

#define PADDING   0
 Number of pixels to pad left and right.
#define PADDING_COLOR   0

Functions

static void put_xsub_rle (PutBitContext *pb, int len, int color)
 Encode a single color run.
static int xsub_encode_rle (PutBitContext *pb, const uint8_t *bitmap, int linesize, int w, int h)
 Encode a 4-color bitmap with XSUB rle.
static int make_tc (uint64_t ms, int *tc)
static int xsub_encode (AVCodecContext *avctx, unsigned char *buf, int bufsize, void *data)
static av_cold int xsub_encoder_init (AVCodecContext *avctx)

Variables

AVCodec ff_xsub_encoder


Define Documentation

#define PADDING   0

Number of pixels to pad left and right.

The official encoder pads the subtitles with two pixels on either side, but until we find out why, we won't do it (we will pad to have width divisible by 2 though).

Definition at line 34 of file xsubenc.c.

Referenced by xsub_encode(), and xsub_encode_rle().

#define PADDING_COLOR   0

Definition at line 35 of file xsubenc.c.

Referenced by xsub_encode(), and xsub_encode_rle().


Function Documentation

static int make_tc ( uint64_t  ms,
int *  tc 
) [static]

Definition at line 101 of file xsubenc.c.

Referenced by xsub_encode().

static void put_xsub_rle ( PutBitContext pb,
int  len,
int  color 
) [static]

Encode a single color run.

At most 16 bits will be used.

Parameters:
len length of the run, values > 255 mean "until end of line", may not be < 0.
color color to encode, only the lowest two bits are used and all others must be 0.

Definition at line 42 of file xsubenc.c.

Referenced by xsub_encode(), and xsub_encode_rle().

static int xsub_encode ( AVCodecContext avctx,
unsigned char *  buf,
int  bufsize,
void *  data 
) [static]

Definition at line 113 of file xsubenc.c.

static int xsub_encode_rle ( PutBitContext pb,
const uint8_t *  bitmap,
int  linesize,
int  w,
int  h 
) [static]

Encode a 4-color bitmap with XSUB rle.

The encoded bitmap may be wider than the source bitmap due to padding.

Definition at line 56 of file xsubenc.c.

Referenced by xsub_encode().

static av_cold int xsub_encoder_init ( AVCodecContext avctx  )  [static]

Definition at line 205 of file xsubenc.c.


Variable Documentation

Initial value:

 {
    .name      = "xsub",
    .type      = AVMEDIA_TYPE_SUBTITLE,
    .id        = CODEC_ID_XSUB,
    .init      = xsub_encoder_init,
    .encode    = xsub_encode,
    .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"),
}

Definition at line 213 of file xsubenc.c.


Generated on Fri Oct 26 02:46:11 2012 for FFmpeg by  doxygen 1.5.8