#include <limits.h>
#include <aom/aom_encoder.h>
#include <aom/aomcx.h>
#include "libavutil/avassert.h"
#include "libavutil/base64.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/imgutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "av1.h"
#include "avcodec.h"
#include "bsf.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"
#include "libaom.h"
#include "packet_internal.h"
#include "profiles.h"
Go to the source code of this file.
|
static av_cold void | log_encoder_error (AVCodecContext *avctx, const char *desc) |
|
static av_cold void | dump_enc_cfg (AVCodecContext *avctx, const struct aom_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 av_cold int | codecctl_int (AVCodecContext *avctx, enum aome_enc_control_id id, int val) |
|
static av_cold int | codecctl_imgp (AVCodecContext *avctx, enum aome_enc_control_id id, struct aom_image *img) |
|
static av_cold int | aom_free (AVCodecContext *avctx) |
|
static int | set_pix_fmt (AVCodecContext *avctx, aom_codec_caps_t codec_caps, struct aom_codec_enc_cfg *enccfg, aom_codec_flags_t *flags, aom_img_fmt_t *img_fmt) |
|
static void | set_color_range (AVCodecContext *avctx) |
|
static int | count_uniform_tiling (int dim, int sb_size, int tiles_log2) |
|
static int | choose_tiling (AVCodecContext *avctx, struct aom_codec_enc_cfg *enccfg) |
|
static av_cold int | aom_init (AVCodecContext *avctx, const struct aom_codec_iface *iface) |
|
static void | cx_pktcpy (AOMContext *ctx, struct FrameListData *dst, const struct aom_codec_cx_pkt *src) |
|
static int | storeframe (AVCodecContext *avctx, struct FrameListData *cx_frame, AVPacket *pkt) |
| Store coded frame information in format suitable for return from encode2(). More...
|
|
static int | queue_frames (AVCodecContext *avctx, AVPacket *pkt_out) |
| Queue multiple output frames from the encoder, returning the front-most. More...
|
|
static enum AVPixelFormat | aomfmt_to_pixfmt (struct aom_image *img) |
|
static int | aom_encode (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) |
|
static av_cold void | av1_init_static (FFCodec *codec) |
|
static av_cold int | av1_init (AVCodecContext *avctx) |
|
AV1 encoder support via libaom
Definition in file libaomenc.c.
◆ AOM_DISABLE_CTRL_TYPECHECKS
#define AOM_DISABLE_CTRL_TYPECHECKS 1 |
◆ OFFSET
#define OFFSET |
( |
|
x | ) |
offsetof(AOMContext, x) |
◆ VE
◆ log_encoder_error()
◆ dump_enc_cfg()
◆ coded_frame_add()
static void coded_frame_add |
( |
void * |
list, |
|
|
struct FrameListData * |
cx_frame |
|
) |
| |
|
static |
◆ free_coded_frame()
◆ free_frame_list()
◆ codecctl_int()
◆ codecctl_imgp()
◆ aom_free()
◆ set_pix_fmt()
static int set_pix_fmt |
( |
AVCodecContext * |
avctx, |
|
|
aom_codec_caps_t |
codec_caps, |
|
|
struct aom_codec_enc_cfg * |
enccfg, |
|
|
aom_codec_flags_t * |
flags, |
|
|
aom_img_fmt_t * |
img_fmt |
|
) |
| |
|
static |
◆ set_color_range()
◆ count_uniform_tiling()
static int count_uniform_tiling |
( |
int |
dim, |
|
|
int |
sb_size, |
|
|
int |
tiles_log2 |
|
) |
| |
|
static |
◆ choose_tiling()
static int choose_tiling |
( |
AVCodecContext * |
avctx, |
|
|
struct aom_codec_enc_cfg * |
enccfg |
|
) |
| |
|
static |
◆ aom_init()
◆ cx_pktcpy()
static void cx_pktcpy |
( |
AOMContext * |
ctx, |
|
|
struct FrameListData * |
dst, |
|
|
const struct aom_codec_cx_pkt * |
src |
|
) |
| |
|
inlinestatic |
◆ storeframe()
Store coded frame information in format suitable for return from encode2().
Write information from cx_frame to pkt
- Returns
- packet data size on success
-
a negative AVERROR on error
Definition at line 1086 of file libaomenc.c.
Referenced by queue_frames().
◆ queue_frames()
Queue multiple output frames from the encoder, returning the front-most.
In cases where aom_codec_get_cx_data() returns more than 1 frame append the frame queue. Return the head frame if available.
- Returns
- Stored frame size
-
AVERROR(EINVAL) on output size error
-
AVERROR(ENOMEM) on coded frame queue data allocation error
Definition at line 1149 of file libaomenc.c.
Referenced by aom_encode().
◆ aomfmt_to_pixfmt()
static enum AVPixelFormat aomfmt_to_pixfmt |
( |
struct aom_image * |
img | ) |
|
|
static |
◆ aom_encode()
◆ av1_init_static()
◆ av1_init()
◆ ctlidstr
const char* const ctlidstr[] |
|
static |
◆ av1_pix_fmts
◆ av1_pix_fmts_with_gray
◆ av1_pix_fmts_highbd
◆ av1_pix_fmts_highbd_with_gray
◆ options
◆ defaults
Initial value:= {
{ "b", "0" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ "g", "-1" },
{ "keyint_min", "-1" },
}
Definition at line 1538 of file libaomenc.c.
◆ class_aom
Initial value:= {
.class_name = "libaom-av1 encoder",
}
Definition at line 1547 of file libaomenc.c.
◆ ff_libaom_av1_encoder
Initial value:= {
.p.name = "libaom-av1",
.p.wrapper_name = "libaom",
.priv_data_size = sizeof(AOMContext),
}
Definition at line 1554 of file libaomenc.c.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static const FFCodecDefault defaults[]
#define AV_CODEC_CAP_ENCODER_RECON_FRAME
The encoder is able to output reconstructed frame data, i.e.
#define AV_PIX_FMT_YUV420P10
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
static const AVOption options[]
#define AV_PIX_FMT_GBRP10
#define FF_CODEC_ENCODE_CB(func)
#define AV_PIX_FMT_YUV444P10
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
const AVProfile ff_av1_profiles[]
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define CODEC_LONG_NAME(str)
#define AV_PIX_FMT_GRAY10
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
static av_cold int av1_init(AVCodecContext *avctx)
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV420P12
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVClass class_aom
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
static av_cold void av1_init_static(FFCodec *codec)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
#define AV_PIX_FMT_GRAY12
static av_cold int aom_free(AVCodecContext *avctx)