Libav
Data Structures | Macros | Functions | Variables
libx264.c File Reference
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/stereo3d.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
 

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 void reconfig_encoder (AVCodecContext *ctx, const AVFrame *frame)
 
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 []
 
static const AVCodecDefault x264_defaults []
 

Macro Definition Documentation

◆ PARSE_X264_OPT

#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);\
}
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:124
#define AVERROR(e)
Definition: error.h:43
const char * name
Definition: qsvenc.c:44

Definition at line 363 of file libx264.c.

Referenced by X264_init().

◆ OFFSET

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

Definition at line 715 of file libx264.c.

◆ VE

Definition at line 716 of file libx264.c.

Function Documentation

◆ X264_log()

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

Definition at line 90 of file libx264.c.

Referenced by X264_init().

◆ encode_nals()

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

Definition at line 106 of file libx264.c.

Referenced by X264_frame().

◆ reconfig_encoder()

static void reconfig_encoder ( AVCodecContext ctx,
const AVFrame frame 
)
static

Definition at line 139 of file libx264.c.

Referenced by X264_frame().

◆ X264_frame()

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

Definition at line 236 of file libx264.c.

◆ X264_close()

static av_cold int X264_close ( AVCodecContext avctx)
static

Definition at line 324 of file libx264.c.

◆ convert_pix_fmt()

static int convert_pix_fmt ( enum AVPixelFormat  pix_fmt)
static

Definition at line 339 of file libx264.c.

Referenced by X264_init().

◆ X264_init()

static av_cold int X264_init ( AVCodecContext avctx)
static

Definition at line 369 of file libx264.c.

◆ X264_init_static()

static av_cold void X264_init_static ( AVCodec codec)
static

Definition at line 705 of file libx264.c.

Variable Documentation

◆ pix_fmts_8bit

enum AVPixelFormat pix_fmts_8bit[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:64
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:72
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:86
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:63
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:71
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:59
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:73
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:192

Definition at line 678 of file libx264.c.

Referenced by X264_init_static().

◆ pix_fmts_9bit

enum AVPixelFormat pix_fmts_9bit[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:262
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:260

Definition at line 692 of file libx264.c.

Referenced by X264_init_static().

◆ pix_fmts_10bit

enum AVPixelFormat pix_fmts_10bit[]
static
Initial value:
= {
}
#define AV_PIX_FMT_NV20
Definition: pixfmt.h:287
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:265
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:263
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:264

Definition at line 697 of file libx264.c.

Referenced by X264_init_static().

◆ options

const AVOption options[]
static

Definition at line 717 of file libx264.c.

◆ x264_defaults

const AVCodecDefault x264_defaults[]
static

Definition at line 787 of file libx264.c.