FFmpeg
|
#include "config_components.h"
#include <vpx/vpx_encoder.h>
#include <vpx/vp8cx.h>
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libvpx.h"
#include "packet_internal.h"
#include "profiles.h"
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/fifo.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.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 | FrameData |
struct | VPxEncoderContext |
Macros | |
#define | VPX_DISABLE_CTRL_TYPECHECKS 1 |
#define | VPX_CODEC_DISABLE_COMPAT 1 |
#define | IS_VP9(avctx) (CONFIG_LIBVPX_VP9_ENCODER && avctx->codec_id == AV_CODEC_ID_VP9) |
#define | IS_VP8(avctx) (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8) |
#define | VP8F_ERROR_RESILIENT 0x00000001 |
Enable measures appropriate for streaming over lossy links. More... | |
#define | VP8F_AUTO_ALT_REF 0x00000002 |
Enable automatic alternate reference frame generation. More... | |
#define | MAX_DELTA_Q 63 |
#define | OFFSET(x) offsetof(VPxContext, x) |
#define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
#define | COMMON_OPTIONS |
#define | LEGACY_OPTIONS |
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, int level) |
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 void | frame_data_uninit (FrameData *fd) |
static av_cold void | fifo_free (AVFifo **fifo) |
static int | frame_data_submit (AVCodecContext *avctx, AVFifo *fifo, const AVFrame *frame) |
static int | frame_data_apply (AVCodecContext *avctx, AVFifo *fifo, AVPacket *pkt) |
static av_cold int | codecctl_int (AVCodecContext *avctx, enum vp8e_enc_control_id id, int val) |
static av_cold int | vpx_free (AVCodecContext *avctx) |
static void | vp8_ts_parse_int_array (int *dest, char *value, size_t value_len, int max_entries) |
static void | set_temporal_layer_pattern (int layering_mode, vpx_codec_enc_cfg_t *cfg, int *layer_flags, int *flag_periodicity) |
static int | vpx_ts_param_parse (VPxContext *ctx, struct vpx_codec_enc_cfg *enccfg, char *key, char *value, enum AVCodecID codec_id) |
static void | set_vp8_defaults (AVCodecContext *avctx, struct vpx_codec_enc_cfg *enccfg) |
Set the target bitrate to VPX library default. More... | |
static void | set_vpx_defaults (AVCodecContext *avctx, struct vpx_codec_enc_cfg *enccfg) |
Called when the bitrate is not set. More... | |
static av_cold int | vpx_init (AVCodecContext *avctx, const struct vpx_codec_iface *iface) |
static void | cx_pktcpy (struct FrameListData *dst, const struct vpx_codec_cx_pkt *src, VPxContext *ctx) |
static int | storeframe (AVCodecContext *avctx, struct FrameListData *cx_frame, struct FrameListData *alpha_cx_frame, AVPacket *pkt) |
Store coded frame information in format suitable for return from encode2(). More... | |
static int | queue_frames (AVCodecContext *avctx, struct vpx_codec_ctx *encoder, struct FrameListData **frame_list, AVPacket *pkt_out) |
Queue multiple output frames from the encoder, returning the front-most. More... | |
static int | set_roi_map (AVCodecContext *avctx, const AVFrameSideData *sd, int frame_width, int frame_height, vpx_roi_map_t *roi_map, int block_size, int segment_cnt) |
static int | vp9_encode_set_roi (AVCodecContext *avctx, int frame_width, int frame_height, const AVFrameSideData *sd) |
static int | vp8_encode_set_roi (AVCodecContext *avctx, int frame_width, int frame_height, const AVFrameSideData *sd) |
static int | realloc_alpha_uv (AVCodecContext *avctx, int width, int height) |
static int | vpx_encode (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) |
Variables | |
static const char *const | ctlidstr [] |
String mappings for enum vp8e_enc_control_id. More... | |
static const FFCodecDefault | defaults [] |
VP8/9 encoder support via libvpx
Definition in file libvpxenc.c.
#define VPX_DISABLE_CTRL_TYPECHECKS 1 |
Definition at line 28 of file libvpxenc.c.
#define VPX_CODEC_DISABLE_COMPAT 1 |
Definition at line 29 of file libvpxenc.c.
#define IS_VP9 | ( | avctx | ) | (CONFIG_LIBVPX_VP9_ENCODER && avctx->codec_id == AV_CODEC_ID_VP9) |
Definition at line 52 of file libvpxenc.c.
#define IS_VP8 | ( | avctx | ) | (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8) |
Definition at line 53 of file libvpxenc.c.
#define VP8F_ERROR_RESILIENT 0x00000001 |
Enable measures appropriate for streaming over lossy links.
Definition at line 101 of file libvpxenc.c.
#define VP8F_AUTO_ALT_REF 0x00000002 |
Enable automatic alternate reference frame generation.
Definition at line 102 of file libvpxenc.c.
#define MAX_DELTA_Q 63 |
#define OFFSET | ( | x | ) | offsetof(VPxContext, x) |
Definition at line 1897 of file libvpxenc.c.
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Definition at line 1898 of file libvpxenc.c.
#define COMMON_OPTIONS |
Definition at line 1900 of file libvpxenc.c.
#define LEGACY_OPTIONS |
Definition at line 1931 of file libvpxenc.c.
|
static |
Definition at line 206 of file libvpxenc.c.
Referenced by codecctl_int(), vp8_encode_set_roi(), vp9_encode_set_roi(), vpx_encode(), and vpx_init().
|
static |
Definition at line 217 of file libvpxenc.c.
Referenced by vpx_init().
|
static |
Definition at line 315 of file libvpxenc.c.
Referenced by queue_frames().
|
static |
Definition at line 325 of file libvpxenc.c.
Referenced by free_frame_list(), queue_frames(), and vpx_encode().
|
static |
Definition at line 331 of file libvpxenc.c.
Referenced by vpx_free().
|
static |
Definition at line 342 of file libvpxenc.c.
Referenced by fifo_free(), frame_data_apply(), and frame_data_submit().
Definition at line 348 of file libvpxenc.c.
Referenced by vpx_free().
|
static |
Definition at line 356 of file libvpxenc.c.
Referenced by vpx_encode().
|
static |
Definition at line 396 of file libvpxenc.c.
Referenced by storeframe().
|
static |
Definition at line 435 of file libvpxenc.c.
Referenced by vpx_encode(), and vpx_init().
|
static |
Definition at line 501 of file libvpxenc.c.
|
static |
Definition at line 531 of file libvpxenc.c.
Referenced by vpx_ts_param_parse().
|
static |
2-layers, 2-frame period.
3-layers structure with one reference frame. This works same as temporal_layering_mode 3.
3-layers, 4-frame period.
0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
3-layers structure. added dependency between the two TL2 frames (on top of case 3). 3-layers, 4-frame period.
0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
do not change the layer_flags or the flag_periodicity in this case; it might be that the code is using external flags to be used.
Definition at line 557 of file libvpxenc.c.
Referenced by vpx_ts_param_parse().
|
static |
Definition at line 661 of file libvpxenc.c.
Referenced by vpx_init().
|
static |
Set the target bitrate to VPX library default.
Also set CRF to 32 if needed.
Definition at line 906 of file libvpxenc.c.
Referenced by set_vpx_defaults().
|
static |
Called when the bitrate is not set.
It sets appropriate default values for bitrate and CRF.
Definition at line 950 of file libvpxenc.c.
Referenced by vpx_init().
|
static |
Definition at line 963 of file libvpxenc.c.
|
inlinestatic |
Definition at line 1291 of file libvpxenc.c.
Referenced by queue_frames().
|
static |
Store coded frame information in format suitable for return from encode2().
Write information from cx_frame to pkt
Definition at line 1321 of file libvpxenc.c.
Referenced by queue_frames(), and vpx_encode().
|
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.
Definition at line 1381 of file libvpxenc.c.
Referenced by vpx_encode().
|
static |
range of vpx_roi_map_t.delta_q[i] is [-63, 63]
Definition at line 1476 of file libvpxenc.c.
Referenced by vp8_encode_set_roi(), and vp9_encode_set_roi().
|
static |
Definition at line 1583 of file libvpxenc.c.
Referenced by vpx_encode().
|
static |
Definition at line 1633 of file libvpxenc.c.
Referenced by vpx_encode().
|
static |
Definition at line 1655 of file libvpxenc.c.
Referenced by vpx_encode().
|
static |
Definition at line 1683 of file libvpxenc.c.
|
static |
String mappings for enum vp8e_enc_control_id.
Definition at line 156 of file libvpxenc.c.
Referenced by codecctl_int().
|
static |
Definition at line 2010 of file libvpxenc.c.