#include <vpx/vpx_encoder.h>
#include <vpx/vp8cx.h>
#include "avcodec.h"
#include "libavutil/base64.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
Go to the source code of this file.
Data Structures | |
struct | FrameListData |
Portion of struct vpx_codec_cx_pkt from vpx_encoder.h. More... | |
struct | VP8EncoderContext |
Defines | |
#define | VPX_DISABLE_CTRL_TYPECHECKS 1 |
#define | VPX_CODEC_DISABLE_COMPAT 1 |
#define | VP8F_ERROR_RESILIENT 0x00000001 |
Enable measures appropriate for streaming over lossy links. | |
#define | VP8F_AUTO_ALT_REF 0x00000002 |
Enable automatic alternate reference frame generation. | |
#define | V AV_OPT_FLAG_VIDEO_PARAM |
#define | E AV_OPT_FLAG_ENCODING_PARAM |
Typedefs | |
typedef struct VP8EncoderContext | VP8Context |
Functions | |
static av_cold void | log_encoder_error (AVCodecContext *avctx, const char *desc) |
static av_cold void | dump_enc_cfg (AVCodecContext *avctx, const struct vpx_codec_enc_cfg *cfg) |
static void | coded_frame_add (void *list, struct FrameListData *cx_frame) |
static av_cold void | free_coded_frame (struct FrameListData *cx_frame) |
static av_cold void | free_frame_list (struct FrameListData *list) |
static av_cold int | codecctl_int (AVCodecContext *avctx, enum vp8e_enc_control_id id, int val) |
static av_cold int | vp8_free (AVCodecContext *avctx) |
static av_cold int | vp8_init (AVCodecContext *avctx) |
static void | cx_pktcpy (struct FrameListData *dst, const struct vpx_codec_cx_pkt *src) |
static int | storeframe (AVCodecContext *avctx, struct FrameListData *cx_frame, uint8_t *buf, int buf_size, AVFrame *coded_frame) |
Store coded frame information in format suitable for return from encode(). | |
static int | queue_frames (AVCodecContext *avctx, uint8_t *buf, int buf_size, AVFrame *coded_frame) |
Queue multiple output frames from the encoder, returning the front-most. | |
static int | vp8_encode (AVCodecContext *avctx, uint8_t *buf, int buf_size, void *data) |
Variables | |
static const AVOption | options [] |
class { | |
libvpx | |
av_default_item_name | |
options | |
}; | |
static const char * | ctlidstr [] |
String mappings for enum vp8e_enc_control_id. | |
AVCodec | ff_libvpx_encoder |
Definition in file libvpxenc.c.
#define E AV_OPT_FLAG_ENCODING_PARAM |
#define V AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 73 of file libvpxenc.c.
Referenced by altivec_uyvy_rgb32(), aura_decode_frame(), config_input(), config_props(), decode_frame(), draw_slice(), ff_yuv2packedX_altivec(), init(), nsv_parse_NSVf_header(), pred16x16_plane_compat(), pred8x8_plane(), rgb24toyv12_c(), rv34_mc(), rv34_output_macroblock(), tm2_decode_blocks(), tm2_hi_res_block(), tm2_low_res_block(), tm2_med_res_block(), tm2_motion_block(), tm2_null_res_block(), tm2_still_block(), tm2_update_block(), vp6_adjust(), xan_decode_chroma(), yuv2422_1_c_template(), yuv2422_2_c_template(), yuv2422_X_c_template(), yuv2rgb48_1_c_template(), yuv2rgb48_2_c_template(), and yuv2rgb48_X_c_template().
#define VP8F_AUTO_ALT_REF 0x00000002 |
Enable automatic alternate reference frame generation.
Definition at line 66 of file libvpxenc.c.
Referenced by vp8_init().
#define VP8F_ERROR_RESILIENT 0x00000001 |
Enable measures appropriate for streaming over lossy links.
Definition at line 65 of file libvpxenc.c.
Referenced by vp8_init().
#define VPX_CODEC_DISABLE_COMPAT 1 |
Definition at line 27 of file libvpxenc.c.
#define VPX_DISABLE_CTRL_TYPECHECKS 1 |
Definition at line 26 of file libvpxenc.c.
typedef struct VP8EncoderContext VP8Context |
static av_cold int codecctl_int | ( | AVCodecContext * | avctx, | |
enum vp8e_enc_control_id | id, | |||
int | val | |||
) | [static] |
static void coded_frame_add | ( | void * | list, | |
struct FrameListData * | cx_frame | |||
) | [static] |
static void cx_pktcpy | ( | struct FrameListData * | dst, | |
const struct vpx_codec_cx_pkt * | src | |||
) | [inline, static] |
static av_cold void dump_enc_cfg | ( | AVCodecContext * | avctx, | |
const struct vpx_codec_enc_cfg * | cfg | |||
) | [static] |
static av_cold void free_coded_frame | ( | struct FrameListData * | cx_frame | ) | [static] |
static av_cold void free_frame_list | ( | struct FrameListData * | list | ) | [static] |
static av_cold void log_encoder_error | ( | AVCodecContext * | avctx, | |
const char * | desc | |||
) | [static] |
Definition at line 116 of file libvpxenc.c.
Referenced by codecctl_int(), vp8_encode(), and vp8_init().
static int queue_frames | ( | AVCodecContext * | avctx, | |
uint8_t * | buf, | |||
int | buf_size, | |||
AVFrame * | coded_frame | |||
) | [static] |
Queue multiple output frames from the encoder, returning the front-most.
In cases where vpx_codec_get_cx_data() returns more than 1 frame append the frame queue. Return the head frame if available.
AVERROR(EINVAL) on output size error
AVERROR(ENOMEM) on coded frame queue data allocation error
Definition at line 427 of file libvpxenc.c.
Referenced by vp8_encode().
static int storeframe | ( | AVCodecContext * | avctx, | |
struct FrameListData * | cx_frame, | |||
uint8_t * | buf, | |||
int | buf_size, | |||
AVFrame * | coded_frame | |||
) | [static] |
Store coded frame information in format suitable for return from encode().
Write buffer information from cx_frame to buf & buf_size. Timing/frame details to coded_frame.
AVERROR(EINVAL) on error
Definition at line 397 of file libvpxenc.c.
Referenced by queue_frames().
static int vp8_encode | ( | AVCodecContext * | avctx, | |
uint8_t * | buf, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
Definition at line 505 of file libvpxenc.c.
static av_cold int vp8_free | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 230 of file libvpxenc.c.
static av_cold int vp8_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 242 of file libvpxenc.c.
const { ... } [static] |
av_default_item_name |
Definition at line 90 of file libvpxenc.c.
const char* ctlidstr[] [static] |
Initial value:
{ [VP8E_UPD_ENTROPY] = "VP8E_UPD_ENTROPY", [VP8E_UPD_REFERENCE] = "VP8E_UPD_REFERENCE", [VP8E_USE_REFERENCE] = "VP8E_USE_REFERENCE", [VP8E_SET_ROI_MAP] = "VP8E_SET_ROI_MAP", [VP8E_SET_ACTIVEMAP] = "VP8E_SET_ACTIVEMAP", [VP8E_SET_SCALEMODE] = "VP8E_SET_SCALEMODE", [VP8E_SET_CPUUSED] = "VP8E_SET_CPUUSED", [VP8E_SET_ENABLEAUTOALTREF] = "VP8E_SET_ENABLEAUTOALTREF", [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY", [VP8E_SET_SHARPNESS] = "VP8E_SET_SHARPNESS", [VP8E_SET_STATIC_THRESHOLD] = "VP8E_SET_STATIC_THRESHOLD", [VP8E_SET_TOKEN_PARTITIONS] = "VP8E_SET_TOKEN_PARTITIONS", [VP8E_GET_LAST_QUANTIZER] = "VP8E_GET_LAST_QUANTIZER", [VP8E_SET_ARNR_MAXFRAMES] = "VP8E_SET_ARNR_MAXFRAMES", [VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", [VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE", [VP8E_SET_CQ_LEVEL] = "VP8E_SET_CQ_LEVEL", }
Definition at line 96 of file libvpxenc.c.
Referenced by codecctl_int().
Initial value:
{ "libvpx", AVMEDIA_TYPE_VIDEO, CODEC_ID_VP8, sizeof(VP8Context), vp8_init, vp8_encode, vp8_free, NULL, CODEC_CAP_DELAY, .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), .priv_class= &class, }
Definition at line 548 of file libvpxenc.c.
options [static] |
Initial value:
{ {"speed", "", 0x42, FF_OPT_TYPE_INT, 3, -16, 16, V|E}, {"quality", "", 0x42, FF_OPT_TYPE_INT, VPX_DL_GOOD_QUALITY, INT_MIN, INT_MAX, V|E, "quality"}, {"best", NULL, 0, FF_OPT_TYPE_CONST, VPX_DL_BEST_QUALITY, INT_MIN, INT_MAX, V|E, "quality"}, {"good", NULL, 0, FF_OPT_TYPE_CONST, VPX_DL_GOOD_QUALITY, INT_MIN, INT_MAX, V|E, "quality"}, {"realtime", NULL, 0, FF_OPT_TYPE_CONST, VPX_DL_REALTIME, INT_MIN, INT_MAX, V|E, "quality"}, {"vp8flags", "", 0x42, FF_OPT_TYPE_FLAGS, 0, 0, UINT_MAX, V|E, "flags"}, {"error_resilient", "enable error resilience", 0, FF_OPT_TYPE_CONST, VP8F_ERROR_RESILIENT, INT_MIN, INT_MAX, V|E, "flags"}, {"altref", "enable use of alternate reference frames (VP8/2-pass only)", 0, FF_OPT_TYPE_CONST, VP8F_AUTO_ALT_REF, INT_MIN, INT_MAX, V|E, "flags"}, {"arnr_max_frames", "altref noise reduction max frame count", 0x42, FF_OPT_TYPE_INT, 0, 0, 15, V|E}, {"arnr_strength", "altref noise reduction filter strength", 0x42, FF_OPT_TYPE_INT, 3, 0, 6, V|E}, {"arnr_type", "altref noise reduction filter type", 0x42, FF_OPT_TYPE_INT, 3, 1, 3, V|E}, {NULL} }
Definition at line 76 of file libvpxenc.c.