FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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"

Go to the source code of this file.

Data Structures

struct  SVCContext
 

Macros

#define OPENH264_VER_AT_LEAST(maj, min)
 
#define OFFSET(x)   offsetof(SVCContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int libopenh264_to_ffmpeg_log_level (int libopenh264_log_level)
 
static void libopenh264_trace_callback (void *ctx, int level, const char *msg)
 
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 {
      libopenh264enc
 
      av_default_item_name
 
      options
 
}; 
 
AVCodec ff_libopenh264_encoder
 

Macro Definition Documentation

#define OPENH264_VER_AT_LEAST (   maj,
  min 
)
Value:
((OPENH264_MAJOR > (maj)) || \
(OPENH264_MAJOR == (maj) && OPENH264_MINOR >= (min)))
float min

Definition at line 47 of file libopenh264enc.c.

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

Definition at line 51 of file libopenh264enc.c.

Definition at line 52 of file libopenh264enc.c.

Function Documentation

static int libopenh264_to_ffmpeg_log_level ( int  libopenh264_log_level)
static

Definition at line 72 of file libopenh264enc.c.

Referenced by libopenh264_trace_callback().

static void libopenh264_trace_callback ( void ctx,
int  level,
const char *  msg 
)
static

Definition at line 88 of file libopenh264enc.c.

Referenced by svc_encode_init().

static av_cold int svc_encode_close ( AVCodecContext avctx)
static

Definition at line 96 of file libopenh264enc.c.

Referenced by svc_encode_init().

static av_cold int svc_encode_init ( AVCodecContext avctx)
static

Definition at line 107 of file libopenh264enc.c.

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

Definition at line 247 of file libopenh264enc.c.

Variable Documentation

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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define VE
mfxU16 profile
Definition: qsvenc.c:42

Definition at line 53 of file libopenh264enc.c.

libopenh264enc

Definition at line 68 of file libopenh264enc.c.

av_default_item_name

Definition at line 68 of file libopenh264enc.c.

Referenced by av_parse_cpu_caps(), av_parse_cpu_flags(), opt_abort_on(), and vs2av_log().

const { ... }
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,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:1031
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
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)
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 307 of file libopenh264enc.c.