36 #define PADDING_COLOR 0 58 int linesize,
int w,
int h)
62 for (y = 0; y <
h; y++) {
70 color = bitmap[x1++] & 3;
71 while (x1 < w && (bitmap[x1] & 3) == color)
86 len =
FFMIN(len, 255);
104 static const int tc_divs[3] = { 1000, 60, 60 };
106 for (i=0; i<3; i++) {
107 tc[
i] = ms % tc_divs[
i];
117 uint64_t startTime = h->
pts / 1000;
119 int start_tc[4], end_tc[4];
126 if (bufsize < 27 + 7*2 + 4*3) {
140 for (j = 0; j < 4; j++) {
159 if (((uint32_t *)h->
rects[0]->
data[1])[0] & 0xff000000)
160 av_log(avctx,
AV_LOG_WARNING,
"Color index 0 is not transparent. Transparency will be messed up.\n");
168 "[%02d:%02d:%02d.%03d-%02d:%02d:%02d.%03d]",
169 start_tc[3], start_tc[2], start_tc[1], start_tc[0],
170 end_tc[3], end_tc[2], end_tc[1], end_tc[0]);
179 bytestream_put_le16(&hdr, width);
180 bytestream_put_le16(&hdr, height);
181 bytestream_put_le16(&hdr, h->
rects[0]->
x);
182 bytestream_put_le16(&hdr, h->
rects[0]->
y);
183 bytestream_put_le16(&hdr, h->
rects[0]->
x + width -1);
184 bytestream_put_le16(&hdr, h->
rects[0]->
y + height -1);
191 bytestream_put_be24(&hdr, ((uint32_t *)h->
rects[0]->
data[1])[i]);
static void align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
#define PADDING
Number of pixels to pad left and right.
static void put_xsub_rle(PutBitContext *pb, int len, int color)
Encode a single color run.
int x
top left corner of pict, undefined when pict is not set
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
#define AV_LOG_WARNING
Something somehow does not look correct.
int nb_colors
number of colors in pict, undefined when pict is not set
static int put_bytes_count(const PutBitContext *s, int round_up)
attribute_deprecated AVPicture pict
int w
width of pict, undefined when pict is not set
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static int make_tc(uint64_t ms, int *tc)
attribute_deprecated int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
int h
height of pict, undefined when pict is not set
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#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
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, int bufsize, const AVSubtitle *h)
const char * name
Name of the codec implementation.
static int xsub_encode_rle(PutBitContext *pb, const uint8_t *bitmap, int linesize, int w, int h)
Encode a 4-color bitmap with XSUB rle.
uint32_t end_display_time
int64_t pts
Same as packet pts, in AV_TIME_BASE.
#define AVERROR_BUFFER_TOO_SMALL
Buffer too small.
attribute_deprecated uint8_t * data[AV_NUM_DATA_POINTERS]
pointers to the image data planes
static int put_bytes_output(const PutBitContext *s)
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
const uint8_t ff_log2_tab[256]
Libavcodec external API header.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static av_cold int xsub_encoder_init(AVCodecContext *avctx)
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
uint32_t start_display_time
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static int put_bytes_left(const PutBitContext *s, int round_up)
#define FF_ENABLE_DEPRECATION_WARNINGS
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
#define MKTAG(a, b, c, d)