hvirtual/quicktime/ffmpeg/libavcodec/dvbsubdec.c File Reference

#include "avcodec.h"
#include "dsputil.h"
#include "bitstream.h"

Include dependency graph for dvbsubdec.c:

Go to the source code of this file.

Data Structures

struct  DVBSubCLUT
struct  DVBSubObjectDisplay
struct  DVBSubObject
struct  DVBSubRegionDisplay
struct  DVBSubRegion
struct  DVBSubContext
struct  DVBSubParseContext

Defines

#define DVBSUB_PAGE_SEGMENT   0x10
#define DVBSUB_REGION_SEGMENT   0x11
#define DVBSUB_CLUT_SEGMENT   0x12
#define DVBSUB_OBJECT_SEGMENT   0x13
#define DVBSUB_DISPLAY_SEGMENT   0x80
#define RGBA(r, g, b, a)   (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define SCALEBITS   10
#define ONE_HALF   (1 << (SCALEBITS - 1))
#define FIX(x)   ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define YUV_TO_RGB1_CCIR(cb1, cr1)
#define YUV_TO_RGB2_CCIR(r, g, b, y1)
#define PARSE_BUF_SIZE   (65536)

Functions

static DVBSubObjectget_object (DVBSubContext *ctx, int object_id)
static DVBSubCLUTget_clut (DVBSubContext *ctx, int clut_id)
static DVBSubRegionget_region (DVBSubContext *ctx, int region_id)
static void delete_region_display_list (DVBSubContext *ctx, DVBSubRegion *region)
static void delete_state (DVBSubContext *ctx)
static int dvbsub_init_decoder (AVCodecContext *avctx)
static int dvbsub_close_decoder (AVCodecContext *avctx)
static int dvbsub_read_2bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table)
static int dvbsub_read_4bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table)
static int dvbsub_read_8bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table)
static void dvbsub_parse_pixel_data_block (AVCodecContext *avctx, DVBSubObjectDisplay *display, uint8_t *buf, int buf_size, int top_bottom, int non_mod)
static void dvbsub_parse_object_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size)
static void dvbsub_parse_clut_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size)
static void dvbsub_parse_region_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size)
static void dvbsub_parse_page_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size)
static int dvbsub_display_end_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size, AVSubtitle *sub)
static int dvbsub_decode (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int dvbsub_parse_init (AVCodecParserContext *s)
static int dvbsub_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static void dvbsub_parse_close (AVCodecParserContext *s)

Variables

static unsigned char * cm
static DVBSubCLUT default_clut
AVCodec dvbsub_decoder
AVCodecParser dvbsub_parser


Define Documentation

#define DVBSUB_CLUT_SEGMENT   0x12

Definition at line 29 of file dvbsubdec.c.

Referenced by dvbsub_decode().

#define DVBSUB_DISPLAY_SEGMENT   0x80

Definition at line 31 of file dvbsubdec.c.

Referenced by dvbsub_decode().

#define DVBSUB_OBJECT_SEGMENT   0x13

Definition at line 30 of file dvbsubdec.c.

Referenced by dvbsub_decode().

#define DVBSUB_PAGE_SEGMENT   0x10

Definition at line 27 of file dvbsubdec.c.

Referenced by dvbsub_decode().

#define DVBSUB_REGION_SEGMENT   0x11

Definition at line 28 of file dvbsubdec.c.

Referenced by dvbsub_decode().

#define FIX (  )     ((int) ((x) * (1<<SCALEBITS) + 0.5))

Definition at line 899 of file dvbsubdec.c.

#define ONE_HALF   (1 << (SCALEBITS - 1))

Definition at line 898 of file dvbsubdec.c.

#define PARSE_BUF_SIZE   (65536)

Definition at line 1467 of file dvbsubdec.c.

Referenced by dvbsub_parse(), and dvbsub_parse_init().

#define RGBA ( r,
g,
b,
a   )     (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))

Definition at line 151 of file dvbsubdec.c.

Referenced by dvbsub_init_decoder(), and dvbsub_parse_clut_segment().

#define SCALEBITS   10

Definition at line 897 of file dvbsubdec.c.

#define YUV_TO_RGB1_CCIR ( cb1,
cr1   ) 

Value:

{\
    cb = (cb1) - 128;\
    cr = (cr1) - 128;\
    r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
    g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
            ONE_HALF;\
    b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
}

Definition at line 901 of file dvbsubdec.c.

Referenced by dvbsub_parse_clut_segment().

#define YUV_TO_RGB2_CCIR ( r,
g,
b,
y1   ) 

Value:

{\
    y = ((y1) - 16) * FIX(255.0/219.0);\
    r = cm[(y + r_add) >> SCALEBITS];\
    g = cm[(y + g_add) >> SCALEBITS];\
    b = cm[(y + b_add) >> SCALEBITS];\
}

Definition at line 911 of file dvbsubdec.c.

Referenced by dvbsub_parse_clut_segment().


Function Documentation

static void delete_region_display_list ( DVBSubContext ctx,
DVBSubRegion region 
) [static]

static void delete_state ( DVBSubContext ctx  )  [static]

static int dvbsub_close_decoder ( AVCodecContext avctx  )  [static]

Definition at line 415 of file dvbsubdec.c.

References av_free(), delete_state(), DVBSubContext::display_list, DVBSubRegionDisplay::next, NULL, and AVCodecContext::priv_data.

Here is the call graph for this function:

static int dvbsub_decode ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

static int dvbsub_display_end_segment ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size,
AVSubtitle sub 
) [static]

static int dvbsub_init_decoder ( AVCodecContext avctx  )  [static]

static int dvbsub_parse ( AVCodecParserContext s,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size 
) [static]

static void dvbsub_parse_close ( AVCodecParserContext s  )  [static]

Definition at line 1621 of file dvbsubdec.c.

References av_freep(), DVBSubParseContext::packet_buf, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

static void dvbsub_parse_clut_segment ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 920 of file dvbsubdec.c.

References av_log(), AV_LOG_ERROR, AV_LOG_INFO, av_malloc(), b, cb, DVBSubContext::clut_list, get_clut(), memcpy, NULL, AVCodecContext::priv_data, r, RGBA, YUV_TO_RGB1_CCIR, and YUV_TO_RGB2_CCIR.

Referenced by dvbsub_decode().

Here is the call graph for this function:

static int dvbsub_parse_init ( AVCodecParserContext s  )  [static]

Definition at line 1478 of file dvbsubdec.c.

References av_malloc(), DVBSubParseContext::packet_buf, PARSE_BUF_SIZE, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

static void dvbsub_parse_object_segment ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 838 of file dvbsubdec.c.

References av_log(), AV_LOG_ERROR, BE_16, dvbsub_parse_pixel_data_block(), get_object(), and AVCodecContext::priv_data.

Referenced by dvbsub_decode().

Here is the call graph for this function:

static void dvbsub_parse_page_segment ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size 
) [static]

static void dvbsub_parse_pixel_data_block ( AVCodecContext avctx,
DVBSubObjectDisplay display,
uint8_t *  buf,
int  buf_size,
int  top_bottom,
int  non_mod 
) [static]

static void dvbsub_parse_region_segment ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size 
) [static]

static int dvbsub_read_2bit_string ( uint8_t *  destbuf,
int  dbuf_len,
uint8_t **  srcbuf,
int  buf_size,
int  non_mod,
uint8_t *  map_table 
) [static]

Definition at line 433 of file dvbsubdec.c.

References av_log(), AV_LOG_ERROR, bits, get_bits(), get_bits_count(), init_get_bits(), and NULL.

Referenced by dvbsub_parse_pixel_data_block().

Here is the call graph for this function:

static int dvbsub_read_4bit_string ( uint8_t *  destbuf,
int  dbuf_len,
uint8_t **  srcbuf,
int  buf_size,
int  non_mod,
uint8_t *  map_table 
) [static]

Definition at line 538 of file dvbsubdec.c.

References av_log(), AV_LOG_ERROR, bits, get_bits(), get_bits_count(), init_get_bits(), and NULL.

Referenced by dvbsub_parse_pixel_data_block().

Here is the call graph for this function:

static int dvbsub_read_8bit_string ( uint8_t *  destbuf,
int  dbuf_len,
uint8_t **  srcbuf,
int  buf_size,
int  non_mod,
uint8_t *  map_table 
) [static]

Definition at line 659 of file dvbsubdec.c.

References av_log(), AV_LOG_ERROR, bits, and NULL.

Referenced by dvbsub_parse_pixel_data_block().

Here is the call graph for this function:

static DVBSubCLUT* get_clut ( DVBSubContext ctx,
int  clut_id 
) [static]

static DVBSubObject* get_object ( DVBSubContext ctx,
int  object_id 
) [static]

static DVBSubRegion* get_region ( DVBSubContext ctx,
int  region_id 
) [static]


Variable Documentation

unsigned char* cm [static]

Definition at line 163 of file dvbsubdec.c.

Initial value:

Definition at line 1454 of file dvbsubdec.c.

Referenced by avcodec_register_all().

Initial value:

Definition at line 1627 of file dvbsubdec.c.

Referenced by avcodec_register_all().


Generated on Mon Apr 28 14:03:52 2008 for Cinelerra by  doxygen 1.5.5