FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
libwebpenc.c File Reference

WebP encoder using libwebp. More...

#include <webp/encode.h>
#include "libavutil/common.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  LibWebPContext
 

Macros

#define OFFSET(x)   offsetof(LibWebPContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int libwebp_error_to_averror (int err)
 
static av_cold int libwebp_encode_init (AVCodecContext *avctx)
 
static int libwebp_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

static const AVOption options []
 
class {
      class_name = "libwebp"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
static const AVCodecDefault libwebp_defaults []
 
AVCodec ff_libwebp_encoder
 

Detailed Description

WebP encoder using libwebp.

Definition in file libwebpenc.c.

Macro Definition Documentation

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

Definition at line 242 of file libwebpenc.c.

Definition at line 243 of file libwebpenc.c.

Function Documentation

static int libwebp_error_to_averror ( int  err)
static

Definition at line 46 of file libwebpenc.c.

Referenced by libwebp_encode_frame().

static av_cold int libwebp_encode_init ( AVCodecContext avctx)
static

Definition at line 60 of file libwebpenc.c.

static int libwebp_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int *  got_packet 
)
static

Definition at line 104 of file libwebpenc.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "lossless", "Use lossless mode", OFFSET(lossless), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ "preset", "Configuration preset", OFFSET(preset), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, WEBP_PRESET_TEXT, VE, "preset" },
{ "none", "do not use a preset", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "preset" },
{ "default", "default preset", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DEFAULT }, 0, 0, VE, "preset" },
{ "picture", "digital picture, like portrait, inner shot", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PICTURE }, 0, 0, VE, "preset" },
{ "photo", "outdoor photograph, with natural lighting", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PHOTO }, 0, 0, VE, "preset" },
{ "drawing", "hand or line drawing, with high-contrast details", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DRAWING }, 0, 0, VE, "preset" },
{ "icon", "small-sized colorful images", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_ICON }, 0, 0, VE, "preset" },
{ "text", "text-like", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_TEXT }, 0, 0, VE, "preset" },
{ NULL },
}

Definition at line 244 of file libwebpenc.c.

class_name = "libwebp"

Definition at line 258 of file libwebpenc.c.

Referenced by av_opt_show2().

item_name = av_default_item_name

Definition at line 259 of file libwebpenc.c.

option = options

Definition at line 261 of file libwebpenc.c.

const { ... }
const AVCodecDefault libwebp_defaults[]
static
Initial value:
= {
{ "compression_level", "4" },
{ "global_quality", "-1" },
{ NULL },
}

Definition at line 264 of file libwebpenc.c.

AVCodec ff_libwebp_encoder
Initial value:
= {
.name = "libwebp",
.long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"),
.priv_data_size = sizeof(LibWebPContext),
.pix_fmts = (const enum AVPixelFormat[]) {
},
.priv_class = &class,
.defaults = libwebp_defaults,
}

Definition at line 270 of file libwebpenc.c.