FFmpeg  2.1.1
Data Structures | Macros | Functions | Variables
pngenc.c File Reference
#include "avcodec.h"
#include "internal.h"
#include "bytestream.h"
#include "dsputil.h"
#include "png.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include <zlib.h>

Go to the source code of this file.

Data Structures

struct  PNGEncContext
 

Macros

#define IOBUF_SIZE   4096
 
#define OFFSET(x)   offsetof(PNGEncContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void png_get_interlaced_row (uint8_t *dst, int row_size, int bits_per_pixel, int pass, const uint8_t *src, int width)
 
static void sub_png_paeth_prediction (uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)
 
static void png_filter_row (DSPContext *dsp, uint8_t *dst, int filter_type, uint8_t *src, uint8_t *top, int size, int bpp)
 
static uint8_tpng_choose_filter (PNGEncContext *s, uint8_t *dst, uint8_t *src, uint8_t *top, int size, int bpp)
 
static void png_write_chunk (uint8_t **f, uint32_t tag, const uint8_t *buf, int length)
 
static int png_write_row (PNGEncContext *s, const uint8_t *data, int size)
 
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int png_enc_init (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass pngenc_class
 
AVCodec ff_png_encoder
 

Macro Definition Documentation

#define IOBUF_SIZE   4096

Definition at line 32 of file pngenc.c.

Referenced by encode_frame(), and png_write_row().

#define OFFSET (   x)    offsetof(PNGEncContext, x)

Definition at line 475 of file pngenc.c.

Definition at line 476 of file pngenc.c.

Function Documentation

static void png_get_interlaced_row ( uint8_t dst,
int  row_size,
int  bits_per_pixel,
int  pass,
const uint8_t src,
int  width 
)
static

Definition at line 51 of file pngenc.c.

Referenced by encode_frame().

static void sub_png_paeth_prediction ( uint8_t dst,
uint8_t src,
uint8_t top,
int  w,
int  bpp 
)
static

Definition at line 90 of file pngenc.c.

Referenced by png_filter_row().

static void png_filter_row ( DSPContext dsp,
uint8_t dst,
int  filter_type,
uint8_t src,
uint8_t top,
int  size,
int  bpp 
)
static

Definition at line 117 of file pngenc.c.

Referenced by png_choose_filter().

static uint8_t* png_choose_filter ( PNGEncContext s,
uint8_t dst,
uint8_t src,
uint8_t top,
int  size,
int  bpp 
)
static

Definition at line 147 of file pngenc.c.

Referenced by encode_frame().

static void png_write_chunk ( uint8_t **  f,
uint32_t  tag,
const uint8_t buf,
int  length 
)
static

Definition at line 177 of file pngenc.c.

Referenced by encode_frame(), and png_write_row().

static int png_write_row ( PNGEncContext s,
const uint8_t data,
int  size 
)
static

Definition at line 197 of file pngenc.c.

Referenced by encode_frame().

static int encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pict,
int *  got_packet 
)
static

Definition at line 217 of file pngenc.c.

static av_cold int png_enc_init ( AVCodecContext avctx)
static

Definition at line 437 of file pngenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{"dpi", "Set image resolution (in dots per inch)", OFFSET(dpi), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x10000, VE},
{"dpm", "Set image resolution (in dots per meter)", OFFSET(dpm), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x10000, VE},
{ NULL }
}
#define OFFSET(x)
Definition: pngenc.c:475
#define VE
Definition: pngenc.c:476

Definition at line 477 of file pngenc.c.

const AVClass pngenc_class
static
Initial value:
= {
.class_name = "PNG encoder",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: avcodec.h:820
const char * av_default_item_name(void *ctx)
Return the context name.
Definition: log.c:145
const OptionDef options[]
Definition: ffserver.c:4682

Definition at line 483 of file pngenc.c.

AVCodec ff_png_encoder
Initial value:
= {
.name = "png",
.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
.priv_data_size = sizeof(PNGEncContext),
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
},
.priv_class = &pngenc_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: avcodec.h:4536
8bit gray, 8bit alpha
Definition: avcodec.h:4611
static const AVClass pngenc_class
Definition: pngenc.c:483
Pixel format.
Definition: avcodec.h:4533
Y , 8bpp.
Definition: avcodec.h:4542
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: avcodec.h:4579
#define CODEC_CAP_INTRA_ONLY
Codec is intra only.
Definition: avcodec.h:831
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:151
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
int AC3_NAME() encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: avcodec.h:4684
static av_cold int png_enc_init(AVCodecContext *avctx)
Definition: pngenc.c:437
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:811
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: avcodec.h:4544
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: avcodec.h:4563
8 bit with PIX_FMT_RGB32 palette
Definition: avcodec.h:4545
Y , 16bpp, big-endian.
Definition: avcodec.h:4567

Definition at line 490 of file pngenc.c.