30 #define PUTBITS2(val)\
32 bitbuf |= (val) << bitcnt;\
42 const uint8_t *bitmap,
int linesize,
52 for(y = 0; y < h; y++) {
61 while (x1 < w && bitmap[x1] == color)
64 if (color == 0 && len == 2) {
68 }
else if (len >= 3 && len <= 10) {
74 }
else if (len >= 12 && len <= 27) {
82 }
else if (len >= 29) {
117 #define PUTBITS4(val)\
119 bitbuf |= (val) << bitcnt;\
130 const uint8_t *bitmap,
int linesize,
140 for(y = 0; y < h; y++) {
148 color = bitmap[x1++];
149 while (x1 < w && bitmap[x1] == color)
152 if (color == 0 && len == 2) {
155 }
else if (color == 0 && (len >= 3 && len <= 9)) {
158 }
else if (len >= 4 && len <= 7) {
162 }
else if (len >= 9 && len <= 24) {
167 }
else if (len >= 25) {
201 int page_id, region_id, clut_id, object_id, i, bpp_index, page_state;
217 bytestream_put_be16(&q, page_id);
228 for (region_id = 0; region_id < h->
num_rects; region_id++) {
231 bytestream_put_be16(&q, h->
rects[region_id]->
x);
232 bytestream_put_be16(&q, h->
rects[region_id]->
y);
235 bytestream_put_be16(&pseg_len, q - pseg_len - 2);
238 for (clut_id = 0; clut_id < h->
num_rects; clut_id++) {
254 bytestream_put_be16(&q, page_id);
258 *q++ = (0 << 4) | 0xf;
262 *q++ = (1 << (7 - bpp_index)) | (0xf << 1) | 1;
266 a = (x >> 24) & 0xff;
267 r = (x >> 16) & 0xff;
278 bytestream_put_be16(&pseg_len, q - pseg_len - 2);
282 for (region_id = 0; region_id < h->
num_rects; region_id++) {
298 bytestream_put_be16(&q, page_id);
303 bytestream_put_be16(&q, h->
rects[region_id]->
w);
304 bytestream_put_be16(&q, h->
rects[region_id]->
h);
305 *q++ = ((1 + bpp_index) << 5) | ((1 + bpp_index) << 2) | 0x03;
311 bytestream_put_be16(&q, region_id);
312 *q++ = (0 << 6) | (0 << 4);
318 bytestream_put_be16(&pseg_len, q - pseg_len - 2);
323 for (object_id = 0; object_id < h->
num_rects; object_id++) {
338 bytestream_put_be16(&q, page_id);
342 bytestream_put_be16(&q, object_id);
347 uint8_t *ptop_field_len, *pbottom_field_len, *top_ptr, *bottom_ptr;
349 const uint8_t *bitmap,
int linesize,
353 pbottom_field_len = q;
367 h->
rects[object_id]->
h >> 1);
369 bytestream_put_be16(&ptop_field_len, bottom_ptr - top_ptr);
370 bytestream_put_be16(&pbottom_field_len, q - bottom_ptr);
373 bytestream_put_be16(&pseg_len, q - pseg_len - 2);
381 bytestream_put_be16(&q, page_id);
385 bytestream_put_be16(&pseg_len, q - pseg_len - 2);
395 unsigned char *buf,
int buf_size,
int x
top left corner of pict, undefined when pict is not set
static int dvbsub_encode(AVCodecContext *avctx, unsigned char *buf, int buf_size, const AVSubtitle *sub)
AVCodec ff_dvbsub_encoder
int nb_colors
number of colors in pict, undefined when pict is not set
Various defines for YUV<->RGB conversion.
int w
width of pict, undefined when pict is not set
uint8_t * data[AV_NUM_DATA_POINTERS]
int h
height of pict, undefined when pict is not set
static int encode_dvb_subtitles(DVBSubtitleContext *s, uint8_t *outbuf, const AVSubtitle *h)
int y
top left corner of pict, undefined when pict is not set
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
AVPicture pict
data+linesize for the bitmap of this subtitle.
Libavcodec external API header.
main external API structure.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
#define RGB_TO_U_CCIR(r1, g1, b1, shift)
#define RGB_TO_V_CCIR(r1, g1, b1, shift)
static void dvb_encode_rle2(uint8_t **pq, const uint8_t *bitmap, int linesize, int w, int h)
static const uint8_t color[]
static void dvb_encode_rle4(uint8_t **pq, const uint8_t *bitmap, int linesize, int w, int h)
#define RGB_TO_Y_CCIR(r, g, b)