FFmpeg
Data Structures | Macros | Functions | Variables
libopenh264enc.c File Reference
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "internal.h"
#include "libopenh264.h"

Go to the source code of this file.

Data Structures

struct  SVCContext
 

Macros

#define SM_SIZELIMITED_SLICE   SM_DYN_SLICE
 
#define OFFSET(x)   offsetof(SVCContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int svc_encode_close (AVCodecContext *avctx)
 
static av_cold int svc_encode_init (AVCodecContext *avctx)
 
static int svc_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet)
 

Variables

static const AVOption options []
 
class {
      class_name = "libopenh264enc"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
AVCodec ff_libopenh264_encoder
 

Macro Definition Documentation

◆ SM_SIZELIMITED_SLICE

#define SM_SIZELIMITED_SLICE   SM_DYN_SLICE

Definition at line 37 of file libopenh264enc.c.

◆ OFFSET

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

Definition at line 52 of file libopenh264enc.c.

◆ VE

Definition at line 53 of file libopenh264enc.c.

Function Documentation

◆ svc_encode_close()

static av_cold int svc_encode_close ( AVCodecContext avctx)
static

Definition at line 84 of file libopenh264enc.c.

◆ svc_encode_init()

static av_cold int svc_encode_init ( AVCodecContext avctx)
static

Definition at line 95 of file libopenh264enc.c.

◆ svc_encode_frame()

static int svc_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 271 of file libopenh264enc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
{ "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
{ "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
{ "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
{ "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" },
{ "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE },
{ "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "cabac", "Enable cabac", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ NULL }
}

Definition at line 54 of file libopenh264enc.c.

◆ class_name

class_name = "libopenh264enc"
private

Definition at line 78 of file libopenh264enc.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 79 of file libopenh264enc.c.

◆ option

option = options
private

Definition at line 80 of file libopenh264enc.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 81 of file libopenh264enc.c.

◆ @108

const { ... }

◆ ff_libopenh264_encoder

AVCodec ff_libopenh264_encoder
Initial value:
= {
.name = "libopenh264",
.long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
.priv_data_size = sizeof(SVCContext),
.encode2 = svc_encode_frame,
.close = svc_encode_close,
.capabilities = AV_CODEC_CAP_AUTO_THREADS,
.priv_class = &class,
.wrapper_name = "libopenh264",
}

Definition at line 335 of file libopenh264enc.c.

SVCContext
Definition: libopenh264dec.c:36
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
profile
mfxU16 profile
Definition: qsvenc.c:44
svc_encode_frame
static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet)
Definition: libopenh264enc.c:271
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: avcodec.h:245
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_CAP_AUTO_THREADS
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:1049
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
OFFSET
#define OFFSET(x)
Definition: libopenh264enc.c:52
svc_encode_init
static av_cold int svc_encode_init(AVCodecContext *avctx)
Definition: libopenh264enc.c:95
svc_encode_close
static av_cold int svc_encode_close(AVCodecContext *avctx)
Definition: libopenh264enc.c:84
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
VE
#define VE
Definition: libopenh264enc.c:53
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232