46 bytestream2_put_be32u(&s->
p, avctx->
width);
47 bytestream2_put_be32u(&s->
p, avctx->
height);
48 bytestream2_put_be32u(&s->
p, s->
depth);
49 bytestream2_put_be32u(&s->
p, s->
length);
50 bytestream2_put_be32u(&s->
p, s->
type);
51 bytestream2_put_be32u(&s->
p, s->
maptype);
57 const uint32_t *palette_data,
73 for (x = 0; x <
len; x++) {
74 uint32_t
pixel = palette_data[x];
76 bytestream2_put_byteu(&pb_r, (pixel >> 16) & 0xFF);
77 bytestream2_put_byteu(&pb_g, (pixel >> 8) & 0xFF);
78 bytestream2_put_byteu(&s->
p, pixel & 0xFF);
83 alen = len + (len & 1);
92 #define GET_VALUE y >= avctx->height ? 0 : x >= len ? ptr[len-1] : ptr[x]
96 while (y < avctx->
height) {
102 ptr += linesize, y++;
106 while (value2 == value && run < 256 && y < avctx->height) {
111 ptr += linesize, y++;
118 bytestream2_put_byteu(&s->
p, run - 1);
120 bytestream2_put_byteu(&s->
p, value);
121 }
else if (run == 1) {
122 bytestream2_put_byteu(&s->
p, value);
124 bytestream2_put_be16u(&s->
p, (value << 8) | value);
130 for (y = 0; y < avctx->
height; y++) {
133 bytestream2_put_byteu(&s->
p, 0);
143 #if FF_API_CODER_TYPE
200 (
const uint32_t *)frame->
data[1],
212 #define OFFSET(x) offsetof(SUNRASTContext, x)
213 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
227 #if FF_API_CODER_TYPE
245 .priv_class = &sunrast_class,
This structure describes decoded (raw) audio or video data.
static const AVCodecDefault sunrast_defaults[]
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
#define FF_API_CODER_TYPE
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)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
8 bits with AV_PIX_FMT_RGB32 palette
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.
#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)
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
static const AVOption options[]
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)
attribute_deprecated int coder_type
Libavcodec external API header.
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.
Describe the class of an AVClass context structure.
static void sunrast_image_write_header(AVCodecContext *avctx)
static av_cold int sunrast_encode_init(AVCodecContext *avctx)
static enum AVPixelFormat pix_fmts[]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
#define FF_CODER_TYPE_RAW
#define FF_ENABLE_DEPRECATION_WARNINGS
#define FF_CODER_TYPE_RLE
static const AVClass sunrast_class
static const AVCodecDefault defaults[]
AVPixelFormat
Pixel format.
This structure stores compressed data.