FFmpeg  4.0
Data Structures | Macros | Functions | Variables
libx265.c File Reference
#include <x265.h>
#include <float.h>
#include "libavutil/internal.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  libx265Context
 

Macros

#define OFFSET(x)   offsetof(libx265Context, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int is_keyframe (NalUnitType naltype)
 
static av_cold int libx265_encode_close (AVCodecContext *avctx)
 
static av_cold int libx265_encode_init (AVCodecContext *avctx)
 
static int libx265_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
 
static av_cold void libx265_encode_init_csp (AVCodec *codec)
 

Variables

static enum AVPixelFormat x265_csp_eight []
 
static enum AVPixelFormat x265_csp_ten []
 
static enum AVPixelFormat x265_csp_twelve []
 
static const AVOption options []
 
class {
      class_name = "libx265"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
static const AVCodecDefault x265_defaults []
 
AVCodec ff_libx265_encoder
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 419 of file libx265.c.

◆ VE

Definition at line 420 of file libx265.c.

Function Documentation

◆ is_keyframe()

static int is_keyframe ( NalUnitType  naltype)
static

◆ libx265_encode_close()

static av_cold int libx265_encode_close ( AVCodecContext avctx)
static

Definition at line 67 of file libx265.c.

Referenced by libx265_encode_init().

◆ libx265_encode_init()

static av_cold int libx265_encode_init ( AVCodecContext avctx)
static

Definition at line 79 of file libx265.c.

◆ libx265_encode_frame()

static int libx265_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pic,
int got_packet 
)
static

Definition at line 279 of file libx265.c.

◆ libx265_encode_init_csp()

static av_cold void libx265_encode_init_csp ( AVCodec codec)
static

Definition at line 409 of file libx265.c.

Variable Documentation

◆ x265_csp_eight

enum AVPixelFormat x265_csp_eight[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:164
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70

Definition at line 367 of file libx265.c.

Referenced by libx265_encode_init_csp().

◆ x265_csp_ten

enum AVPixelFormat x265_csp_ten[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:164
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:384
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:350
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:371
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:368
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:369
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70

Definition at line 376 of file libx265.c.

Referenced by libx265_encode_init_csp().

◆ x265_csp_twelve

enum AVPixelFormat x265_csp_twelve[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:164
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:384
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:372
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:350
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:351
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:373
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:371
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:368
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:385
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:369
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:375
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70

Definition at line 390 of file libx265.c.

Referenced by libx265_encode_init_csp().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "crf", "set the x265 crf", OFFSET(crf), AV_OPT_TYPE_FLOAT, { .dbl = -1 }, -1, FLT_MAX, VE },
{ "forced-idr", "if forcing keyframes, force them as IDR frames", OFFSET(forced_idr),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "profile", "set the x265 profile", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define VE
Definition: libx265.c:420
#define OFFSET(x)
Definition: libx265.c:419
mfxU16 profile
Definition: qsvenc.c:44
preset
Definition: vf_curves.c:46

Definition at line 421 of file libx265.c.

◆ class_name

class_name = "libx265"
private

Definition at line 432 of file libx265.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 433 of file libx265.c.

◆ option

option = options
private

Definition at line 434 of file libx265.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 435 of file libx265.c.

◆ @92

const { ... }

◆ x265_defaults

const AVCodecDefault x265_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 438 of file libx265.c.

◆ ff_libx265_encoder

AVCodec ff_libx265_encoder
Initial value:
= {
.name = "libx265",
.long_name = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"),
.init_static_data = libx265_encode_init_csp,
.priv_data_size = sizeof(libx265Context),
.priv_class = &class,
.wrapper_name = "libx265",
}
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:1027
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:984
static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
Definition: libx265.c:279
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
static av_cold void libx265_encode_init_csp(AVCodec *codec)
Definition: libx265.c:409
static av_cold int libx265_encode_init(AVCodecContext *avctx)
Definition: libx265.c:79
static const AVCodecDefault x265_defaults[]
Definition: libx265.c:438
static av_cold int libx265_encode_close(AVCodecContext *avctx)
Definition: libx265.c:67

Definition at line 443 of file libx265.c.