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

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

Definition at line 428 of file libx265.c.

Definition at line 429 of file libx265.c.

Function Documentation

static int is_keyframe ( NalUnitType  naltype)
static
static av_cold int libx265_encode_close ( AVCodecContext avctx)
static

Definition at line 67 of file libx265.c.

Referenced by libx265_encode_init().

static av_cold int libx265_encode_init ( AVCodecContext avctx)
static

Definition at line 79 of file libx265.c.

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

Definition at line 288 of file libx265.c.

static av_cold void libx265_encode_init_csp ( AVCodec codec)
static

Definition at line 418 of file libx265.c.

Variable Documentation

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:71
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74

Definition at line 376 of file libx265.c.

Referenced by libx265_encode_init_csp().

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:71
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:395
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:360
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:382
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:379
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:380
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74

Definition at line 385 of file libx265.c.

Referenced by libx265_encode_init_csp().

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:71
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:395
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:383
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:360
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:361
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:384
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:382
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:379
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:396
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:380
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:386
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74

Definition at line 399 of file libx265.c.

Referenced by libx265_encode_init_csp().

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:429
#define OFFSET(x)
Definition: libx265.c:428
mfxU16 profile
Definition: qsvenc.c:44
preset
Definition: vf_curves.c:46

Definition at line 430 of file libx265.c.

class_name = "libx265"

Definition at line 441 of file libx265.c.

item_name = av_default_item_name

Definition at line 442 of file libx265.c.

option = options

Definition at line 443 of file libx265.c.

Definition at line 444 of file libx265.c.

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

Definition at line 447 of file libx265.c.

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:1036
#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:993
static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
Definition: libx265.c:288
#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:418
static av_cold int libx265_encode_init(AVCodecContext *avctx)
Definition: libx265.c:79
static const AVCodecDefault x265_defaults[]
Definition: libx265.c:447
static av_cold int libx265_encode_close(AVCodecContext *avctx)
Definition: libx265.c:67

Definition at line 452 of file libx265.c.