libx264.c File Reference
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"
#include <x264.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  X264Context
 

Macros

#define PARSE_X264_OPT(name, var)
 
#define OFFSET(x)   offsetof(X264Context, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Typedefs

typedef struct X264Context X264Context
 

Functions

static void X264_log (void *p, int level, const char *fmt, va_list args)
 
static int encode_nals (AVCodecContext *ctx, AVPacket *pkt, x264_nal_t *nals, int nnal)
 
static int X264_frame (AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int X264_close (AVCodecContext *avctx)
 
static int convert_pix_fmt (enum AVPixelFormat pix_fmt)
 
static av_cold int X264_init (AVCodecContext *avctx)
 
static av_cold void X264_init_static (AVCodec *codec)
 

Variables

static enum AVPixelFormat pix_fmts_8bit []
 
static enum AVPixelFormat pix_fmts_9bit []
 
static enum AVPixelFormat pix_fmts_10bit []
 
static const AVOption options []
 
class {
      class_name = "libx264"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
static const AVCodecDefault x264_defaults []
 
AVCodec ff_libx264_encoder
 

Macro Definition Documentation

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

Definition at line 479 of file libx264.c.

#define PARSE_X264_OPT (   name,
  var 
)
Value:
if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
return AVERROR(EINVAL);\
}

Definition at line 225 of file libx264.c.

Referenced by X264_init().

Definition at line 480 of file libx264.c.

Typedef Documentation

typedef struct X264Context X264Context

Function Documentation

static int convert_pix_fmt ( enum AVPixelFormat  pix_fmt)
static

Definition at line 209 of file libx264.c.

Referenced by X264_init().

static int encode_nals ( AVCodecContext ctx,
AVPacket pkt,
x264_nal_t *  nals,
int  nnal 
)
static

Definition at line 91 of file libx264.c.

Referenced by X264_frame().

static av_cold int X264_close ( AVCodecContext avctx)
static

Definition at line 196 of file libx264.c.

static int X264_frame ( AVCodecContext ctx,
AVPacket pkt,
const AVFrame frame,
int *  got_packet 
)
static

Definition at line 124 of file libx264.c.

static av_cold int X264_init ( AVCodecContext avctx)
static

Definition at line 231 of file libx264.c.

static av_cold void X264_init_static ( AVCodec codec)
static

Definition at line 469 of file libx264.c.

static void X264_log ( void p,
int  level,
const char *  fmt,
va_list  args 
)
static

Definition at line 75 of file libx264.c.

Referenced by X264_init().

Variable Documentation

const { ... }
class_name = "libx264"

Definition at line 534 of file libx264.c.

AVCodec ff_libx264_encoder
Initial value:
= {
.name = "libx264",
.priv_data_size = sizeof(X264Context),
.encode2 = X264_frame,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
.priv_class = &class,
.defaults = x264_defaults,
.init_static_data = X264_init_static,
}

Definition at line 567 of file libx264.c.

item_name = av_default_item_name

Definition at line 535 of file libx264.c.

option = options

Definition at line 536 of file libx264.c.

const AVOption options[]
static

Definition at line 481 of file libx264.c.

enum AVPixelFormat pix_fmts_10bit[]
static
Initial value:

Definition at line 462 of file libx264.c.

Referenced by X264_init_static().

enum AVPixelFormat pix_fmts_8bit[]
static
enum AVPixelFormat pix_fmts_9bit[]
static
Initial value:

Definition at line 457 of file libx264.c.

Referenced by X264_init_static().

Definition at line 537 of file libx264.c.

const AVCodecDefault x264_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "bf", "-1" },
{ "g", "-1" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ "qdiff", "-1" },
{ "qblur", "-1" },
{ "qcomp", "-1" },
{ "refs", "-1" },
{ "sc_threshold", "-1" },
{ "trellis", "-1" },
{ "nr", "-1" },
{ "me_range", "-1" },
{ "me_method", "-1" },
{ "subq", "-1" },
{ "b_strategy", "-1" },
{ "keyint_min", "-1" },
{ "coder", "-1" },
{ "cmp", "-1" },
{ "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
{ "thread_type", "0" },
{ "flags", "+cgop" },
{ "rc_init_occupancy","-1" },
{ NULL },
}

Definition at line 540 of file libx264.c.