dvdsubdec.c File Reference
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "libavutil/colorspace.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/avstring.h"
Include dependency graph for dvdsubdec.c:

Go to the source code of this file.

Data Structures

struct  DVDSubContext
 

Macros

#define READ_OFFSET(a)   (big_offsets ? AV_RB32(a) : AV_RB16(a))
 
#define OFFSET(field)   offsetof(DVDSubContext, field)
 
#define VD   AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Typedefs

typedef struct DVDSubContext DVDSubContext
 

Functions

static void yuv_a_to_rgba (const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
 
static int decode_run_2bit (GetBitContext *gb, int *color)
 
static int decode_run_8bit (GetBitContext *gb, int *color)
 
static int decode_rle (uint8_t *bitmap, int linesize, int w, int h, const uint8_t *buf, int start, int buf_size, int is_8bit)
 
static void guess_palette (DVDSubContext *ctx, uint32_t *rgba_palette, uint32_t subtitle_color)
 
static int decode_dvd_subtitles (DVDSubContext *ctx, AVSubtitle *sub_header, const uint8_t *buf, int buf_size)
 
static int is_transp (const uint8_t *buf, int pitch, int n, const uint8_t *transp_color)
 
static int find_smallest_bounding_rectangle (AVSubtitle *s)
 
static int dvdsub_decode (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
static void parse_palette (DVDSubContext *ctx, char *p)
 
static int dvdsub_parse_extradata (AVCodecContext *avctx)
 
static int dvdsub_init (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
class {
      class_name = "dvdsubdec"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
AVCodec ff_dvdsub_decoder
 

Macro Definition Documentation

#define OFFSET (   field)    offsetof(DVDSubContext, field)

Definition at line 589 of file dvdsubdec.c.

#define READ_OFFSET (   a)    (big_offsets ? AV_RB32(a) : AV_RB16(a))

Definition at line 188 of file dvdsubdec.c.

Referenced by decode_dvd_subtitles().

Definition at line 590 of file dvdsubdec.c.

Referenced by decode_flush().

Typedef Documentation

typedef struct DVDSubContext DVDSubContext

Function Documentation

static int decode_dvd_subtitles ( DVDSubContext ctx,
AVSubtitle sub_header,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 190 of file dvdsubdec.c.

Referenced by dvdsub_decode().

static int decode_rle ( uint8_t bitmap,
int  linesize,
int  w,
int  h,
const uint8_t buf,
int  start,
int  buf_size,
int  is_8bit 
)
static

Definition at line 94 of file dvdsubdec.c.

Referenced by decode_dvd_subtitles().

static int decode_run_2bit ( GetBitContext gb,
int *  color 
)
static

Definition at line 58 of file dvdsubdec.c.

Referenced by decode_rle().

static int decode_run_8bit ( GetBitContext gb,
int *  color 
)
static

Definition at line 72 of file dvdsubdec.c.

Referenced by decode_rle().

static int dvdsub_decode ( AVCodecContext avctx,
void data,
int *  data_size,
AVPacket avpkt 
)
static

Definition at line 487 of file dvdsubdec.c.

static int dvdsub_init ( AVCodecContext avctx)
static

Definition at line 568 of file dvdsubdec.c.

static int dvdsub_parse_extradata ( AVCodecContext avctx)
static

Definition at line 532 of file dvdsubdec.c.

Referenced by dvdsub_init().

static int find_smallest_bounding_rectangle ( AVSubtitle s)
static

Definition at line 403 of file dvdsubdec.c.

Referenced by dvdsub_decode().

static void guess_palette ( DVDSubContext ctx,
uint32_t *  rgba_palette,
uint32_t  subtitle_color 
)
static

Definition at line 131 of file dvdsubdec.c.

Referenced by decode_dvd_subtitles().

static int is_transp ( const uint8_t buf,
int  pitch,
int  n,
const uint8_t transp_color 
)
static

Definition at line 390 of file dvdsubdec.c.

Referenced by find_smallest_bounding_rectangle().

static void parse_palette ( DVDSubContext ctx,
char *  p 
)
static

Definition at line 520 of file dvdsubdec.c.

Referenced by dvdsub_init(), and dvdsub_parse_extradata().

static void yuv_a_to_rgba ( const uint8_t ycbcr,
const uint8_t alpha,
uint32_t *  rgba,
int  num_values 
)
static

Definition at line 41 of file dvdsubdec.c.

Referenced by decode_dvd_subtitles().

Variable Documentation

const { ... }
class_name = "dvdsubdec"
private

Definition at line 596 of file dvdsubdec.c.

AVCodec ff_dvdsub_decoder
Initial value:
= {
.name = "dvdsub",
.priv_data_size = sizeof(DVDSubContext),
.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"),
.priv_class = &class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
struct DVDSubContext DVDSubContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int dvdsub_decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
Definition: dvdsubdec.c:487
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
static int dvdsub_init(AVCodecContext *avctx)
Definition: dvdsubdec.c:568

Definition at line 602 of file dvdsubdec.c.

item_name = av_default_item_name
private

Definition at line 597 of file dvdsubdec.c.

option = options
private

Definition at line 598 of file dvdsubdec.c.

const AVOption options[]
static
Initial value:
= {
{ "palette", "set the global palette", OFFSET(palette_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
{ NULL }
}
#define VD
Definition: dvdsubdec.c:590
#define OFFSET(field)
Definition: dvdsubdec.c:589
NULL
Definition: eval.c:55

Definition at line 591 of file dvdsubdec.c.

version = LIBAVUTIL_VERSION_INT
private

Definition at line 599 of file dvdsubdec.c.