28 #define PUTNIBBLE(val)\ 31 *q++ = bitbuf | ((val) & 0x0f);\ 37 const uint8_t *bitmap,
int linesize,
42 unsigned int bitbuf = 0;
48 for (y = 0; y < h; ++y) {
50 for(x = 0; x < w; x +=
len) {
52 for (len=1; x+len < w; ++
len)
53 if (bitmap[x+len] != color)
59 }
else if (len < 0x10) {
62 }
else if (len < 0x40) {
66 }
else if (x+len == w) {
94 int offset1[20], offset2[20];
97 unsigned long hist[256];
100 if (rects == 0 || !h->
rects)
106 for (i=0; i<256; ++i) {
110 for (object_id = 0; object_id < rects; object_id++) {
116 for (j = 0; j < 4; j++) {
124 for (i=0; i<h->
rects[object_id]->
w*h->
rects[object_id]->
h; ++i) {
128 hist[
color] += alpha;
131 for (color=3;; --
color) {
134 for (i=0; i<256; ++i)
135 if (hist[i] > hmax) {
144 imax, hist[imax], color);
152 for (object_id = 0; object_id < rects; object_id++) {
153 offset1[object_id] = q - outbuf;
155 if ((q - outbuf) + h->
rects[object_id]->
w*h->
rects[object_id]->
h/2
156 + 17*rects + 21 > outbuf_size) {
164 offset2[object_id] = q - outbuf;
173 bytestream_put_be16(&qq, q - outbuf);
177 bytestream_put_be16(&q, (q - outbuf) + 8 + 12*rects + 2);
179 *q++ = 0x03; *q++ = 0x7f;
181 *q++ = 0xf0; *q++ = 0x00;
186 for (object_id = 0; object_id < rects; object_id++) {
187 int x2 = h->
rects[object_id]->
x + h->
rects[object_id]->
w - 1;
188 int y2 = h->
rects[object_id]->
y + h->
rects[object_id]->
h - 1;
192 *q++ = h->
rects[object_id]->
x >> 4;
193 *q++ = (h->
rects[object_id]->
x << 4) | ((x2 >> 8) & 0xf);
196 *q++ = h->
rects[object_id]->
y >> 4;
197 *q++ = (h->
rects[object_id]->
y << 4) | ((y2 >> 8) & 0xf);
202 bytestream_put_be16(&q, offset1[object_id]);
203 bytestream_put_be16(&q, offset2[object_id]);
210 bytestream_put_be16(&q, (q - outbuf) - 2 );
215 bytestream_put_be16(&qq, q - outbuf);
222 unsigned char *buf,
int buf_size,
int x
top left corner of pict, undefined when pict is not set
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
static int encode_dvd_subtitles(uint8_t *outbuf, int outbuf_size, const AVSubtitle *h)
attribute_deprecated AVPicture pict
int w
width of pict, undefined when pict is not set
static void dvd_encode_rle(uint8_t **pq, const uint8_t *bitmap, int linesize, int w, int h, const int cmap[256])
attribute_deprecated int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
int h
height of pict, undefined when pict is not set
static int dvdsub_encode(AVCodecContext *avctx, unsigned char *buf, int buf_size, const AVSubtitle *sub)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int y
top left corner of pict, undefined when pict is not set
AVCodec ff_dvdsub_encoder
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
uint32_t end_display_time
attribute_deprecated uint8_t * data[AV_NUM_DATA_POINTERS]
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
Libavcodec external API header.
main external API structure.
static const uint8_t color[NB_LEVELS]
#define FF_DISABLE_DEPRECATION_WARNINGS
uint32_t start_display_time
#define FF_ENABLE_DEPRECATION_WARNINGS