42 bytestream2_put_be32u(&s->
p, avctx->
width);
43 bytestream2_put_be32u(&s->
p, avctx->
height);
44 bytestream2_put_be32u(&s->
p, s->
depth);
45 bytestream2_put_be32u(&s->
p, s->
length);
46 bytestream2_put_be32u(&s->
p, s->
type);
47 bytestream2_put_be32u(&s->
p, s->
maptype);
53 const uint32_t *palette_data,
69 for (x = 0; x <
len; x++) {
70 uint32_t
pixel = palette_data[x];
72 bytestream2_put_byteu(&pb_r, (pixel >> 16) & 0xFF);
73 bytestream2_put_byteu(&pb_g, (pixel >> 8) & 0xFF);
74 bytestream2_put_byteu(&s->
p, pixel & 0xFF);
79 alen = len + (len & 1);
88 #define GET_VALUE y >= avctx->height ? 0 : x >= len ? ptr[len-1] : ptr[x]
92 while (y < avctx->
height) {
102 while (value2 == value && run < 256 && y < avctx->height) {
107 ptr += linesize, y++;
114 bytestream2_put_byteu(&s->
p, run - 1);
116 bytestream2_put_byteu(&s->
p, value);
117 }
else if (run == 1) {
118 bytestream2_put_byteu(&s->
p, value);
120 bytestream2_put_be16u(&s->
p, (value << 8) | value);
126 for (y = 0; y < avctx->
height; y++) {
129 bytestream2_put_byteu(&s->
p, 0);
190 (
const uint32_t *)frame->
data[1],
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
This structure describes decoded (raw) audio or video data.
static const AVCodecDefault sunrast_defaults[]
AVFrame * coded_frame
the picture in the bitstream
static av_cold int init(AVCodecContext *avctx)
#define FF_CODER_TYPE_RAW
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int length
length (bytes) of image
static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static av_cold int sunrast_encode_close(AVCodecContext *avctx)
8 bit with AV_PIX_FMT_RGB32 palette
#define FF_CODER_TYPE_RLE
int maplength
length (bytes) of colormap
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int maptype
type of colormap
const char * name
Name of the codec implementation.
static av_always_inline int bytestream2_tell_p(PutByteContext *p)
Libavcodec external API header.
int flags
A combination of AV_PKT_FLAG values.
static av_always_inline void bytestream2_skip_p(PutByteContext *p, unsigned int size)
int width
picture width / height.
GLsizei GLboolean const GLfloat * value
AVCodec ff_sunrast_encoder
packed RGB 8:8:8, 24bpp, BGRBGR...
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, const uint8_t *src, unsigned int size)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
static void sunrast_image_write_image(AVCodecContext *avctx, const uint8_t *pixels, const uint32_t *palette_data, int linesize)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
BYTE int const BYTE int int int height
static void sunrast_image_write_header(AVCodecContext *avctx)
static av_cold int sunrast_encode_init(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
static const AVCodecDefault defaults[]
AVPixelFormat
Pixel format.
This structure stores compressed data.