PGS subtitle decoder. More...
#include "avcodec.h"
#include "dsputil.h"
#include "bytestream.h"
#include "libavutil/colorspace.h"
#include "libavutil/imgutils.h"
Go to the source code of this file.
Data Structures | |
struct | PGSSubPresentation |
struct | PGSSubPicture |
struct | PGSSubContext |
Macros | |
#define | RGBA(r, g, b, a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
Typedefs | |
typedef struct PGSSubPresentation | PGSSubPresentation |
typedef struct PGSSubPicture | PGSSubPicture |
typedef struct PGSSubContext | PGSSubContext |
Enumerations | |
enum | SegmentType { PALETTE_SEGMENT = 0x14, PICTURE_SEGMENT = 0x15, PRESENTATION_SEGMENT = 0x16, WINDOW_SEGMENT = 0x17, DISPLAY_SEGMENT = 0x80 } |
Functions | |
static av_cold int | init_decoder (AVCodecContext *avctx) |
static av_cold int | close_decoder (AVCodecContext *avctx) |
static int | decode_rle (AVCodecContext *avctx, AVSubtitle *sub, const uint8_t *buf, unsigned int buf_size) |
Decode the RLE data. | |
static int | parse_picture_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the picture segment packet. | |
static void | parse_palette_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the palette segment packet. | |
static void | parse_presentation_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the presentation segment packet. | |
static int | display_end_segment (AVCodecContext *avctx, void *data, const uint8_t *buf, int buf_size) |
Parse the display segment packet. | |
static int | decode (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
Variables | |
AVCodec | ff_pgssub_decoder |
PGS subtitle decoder.
Definition in file pgssubdec.c.
Definition at line 33 of file pgssubdec.c.
Referenced by parse_palette_segment().
typedef struct PGSSubContext PGSSubContext |
typedef struct PGSSubPicture PGSSubPicture |
typedef struct PGSSubPresentation PGSSubPresentation |
enum SegmentType |
Definition at line 35 of file pgssubdec.c.
|
static |
Definition at line 71 of file pgssubdec.c.
|
static |
Definition at line 403 of file pgssubdec.c.
|
static |
Decode the RLE data.
The subtitle is stored as an Run Length Encoded image.
avctx | contains the current codec context |
sub | pointer to the processed subtitle data |
buf | pointer to the RLE data to process |
buf_size | size of the RLE data to process |
Definition at line 91 of file pgssubdec.c.
Referenced by display_end_segment().
|
static |
Parse the display segment packet.
The display segment controls the updating of the display.
avctx | contains the current codec context |
data | pointer to the data pertaining the subtitle to display |
buf | pointer to the packet to process |
buf_size | size of packet to process |
TODO: Fix start time, relies on correct PTS, currently too late
segment, which is currently ignored as it clears
the subtitle too early.
Definition at line 353 of file pgssubdec.c.
Referenced by decode().
|
static |
Definition at line 64 of file pgssubdec.c.
|
static |
Parse the palette segment packet.
The palette segment contains details of the palette, a maximum of 256 colors can be defined.
avctx | contains the current codec context |
buf | pointer to the packet to process |
buf_size | size of packet to process |
Definition at line 237 of file pgssubdec.c.
Referenced by decode().
|
static |
Parse the picture segment packet.
The picture segment contains details on the sequence id, width, height and Run Length Encoded (RLE) bitmap data.
avctx | contains the current codec context |
buf | pointer to the packet to process |
buf_size | size of packet to process |
Definition at line 158 of file pgssubdec.c.
Referenced by decode().
|
static |
Parse the presentation segment packet.
The presentation segment contains details on the video width, video height, x & y subtitle position.
avctx | contains the current codec context |
buf | pointer to the packet to process |
buf_size | size of packet to process |
TODO: Implement cropping
TODO: Implement forcing of subtitles
Definition at line 280 of file pgssubdec.c.
Referenced by decode().
AVCodec ff_pgssub_decoder |
Definition at line 478 of file pgssubdec.c.