FFmpeg
Loading...
Searching...
No Matches
libopenh264enc.c File Reference
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.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 TARGET_BITRATE_DEFAULT   2*1000*1000
 
#define OFFSET(x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 
#define DEPRECATED   AV_OPT_FLAG_DEPRECATED
 
#define PROFILE(name, value)
 

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 
 
};  
 
static const FFCodecDefault svc_enc_defaults []
 
const FFCodec ff_libopenh264_encoder
 

Macro Definition Documentation

◆ SM_SIZELIMITED_SLICE

#define SM_SIZELIMITED_SLICE   SM_DYN_SLICE

Definition at line 39 of file libopenh264enc.c.

Referenced by svc_encode_init().

◆ TARGET_BITRATE_DEFAULT

#define TARGET_BITRATE_DEFAULT   2*1000*1000

Definition at line 42 of file libopenh264enc.c.

Referenced by svc_encode_init().

◆ OFFSET

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

Definition at line 59 of file libopenh264enc.c.

◆ VE

Definition at line 60 of file libopenh264enc.c.

◆ DEPRECATED

#define DEPRECATED   AV_OPT_FLAG_DEPRECATED

Definition at line 61 of file libopenh264enc.c.

◆ PROFILE

#define PROFILE ( name,
value )
Value:
name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, .unit = "profile"
#define VE
Definition amfenc_av1.c:30
#define NULL
Definition coverity.c:32
double value
Definition eval.c:102
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
const char * name
Definition qsvenc.c:142

Function Documentation

◆ svc_encode_close()

static av_cold int svc_encode_close ( AVCodecContext * avctx)
static

Definition at line 98 of file libopenh264enc.c.

◆ svc_encode_init()

static av_cold int svc_encode_init ( AVCodecContext * avctx)
static

Definition at line 109 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 355 of file libopenh264enc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, .unit = "profile" },
#define PROFILE(name, value)
{ PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
{ "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 },
{ "coder", "Coder type", OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE, .unit = "coder" },
{ "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "cabac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "vlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, .unit = "coder" },
{ "rc_mode", "Select rate control mode", OFFSET(rc_mode), AV_OPT_TYPE_INT, { .i64 = RC_QUALITY_MODE }, RC_OFF_MODE, RC_TIMESTAMP_MODE, VE, .unit = "rc_mode" },
{ "off", "bit rate control off", 0, AV_OPT_TYPE_CONST, { .i64 = RC_OFF_MODE }, 0, 0, VE, .unit = "rc_mode" },
{ "quality", "quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RC_QUALITY_MODE }, 0, 0, VE, .unit = "rc_mode" },
{ "bitrate", "bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = RC_BITRATE_MODE }, 0, 0, VE, .unit = "rc_mode" },
{ "buffer", "using buffer status to adjust the video quality (no bitrate control)", 0, AV_OPT_TYPE_CONST, { .i64 = RC_BUFFERBASED_MODE }, 0, 0, VE, .unit = "rc_mode" },
{ NULL }
}
#define PROFILE(name, value)
#define AV_PROFILE_H264_MAIN
Definition defs.h:112
#define AV_PROFILE_UNKNOWN
Definition defs.h:65
#define AV_PROFILE_H264_HIGH
Definition defs.h:114
#define AV_PROFILE_H264_CONSTRAINED_BASELINE
Definition defs.h:111
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
int profile
Definition mxfenc.c:2299
mfxU16 rc_mode
Definition qsvenc.c:141

Definition at line 62 of file libopenh264enc.c.

◆ class_name

class_name = "libopenh264enc"
private

Definition at line 92 of file libopenh264enc.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 93 of file libopenh264enc.c.

◆ option

option = options
private

Definition at line 94 of file libopenh264enc.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 95 of file libopenh264enc.c.

◆ [class]

const AVClass class { ... }

◆ svc_enc_defaults

const FFCodecDefault svc_enc_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "g", "-1" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ NULL },
}

Definition at line 418 of file libopenh264enc.c.

◆ ff_libopenh264_encoder

const FFCodec ff_libopenh264_encoder
Initial value:
= {
.p.name = "libopenh264",
CODEC_LONG_NAME("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SVCContext),
.close = svc_encode_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
.defaults = svc_enc_defaults,
.p.priv_class = &class,
.p.wrapper_name = "libopenh264",
}
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition codec.h:147
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
Definition codec.h:112
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
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 const FFCodecDefault svc_enc_defaults[]
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:766
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:783
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85

Definition at line 426 of file libopenh264enc.c.