FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
libx264.c File Reference
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/stereo3d.h"
#include "libavutil/intreadwrite.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 OPT_STR(opt, param)
 
#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, const x264_nal_t *nals, int nnal)
 
static int avfmt2_num_planes (int avfmt)
 
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 enum AVPixelFormat pix_fmts_8bit_rgb []
 
static const AVOption options []
 
static const AVCodecDefault x264_defaults []
 

Macro Definition Documentation

#define OPT_STR (   opt,
  param 
)
Value:
do { \
int ret; \
if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) { \
if(ret == X264_PARAM_BAD_NAME) \
"bad option '%s': '%s'\n", opt, param); \
"bad value for '%s': '%s'\n", opt, param); \
return -1; \
} \
} while (0)
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
return
if(ret< 0)
Definition: vf_mcdeint.c:282

Definition at line 405 of file libx264.c.

Referenced by X264_init().

#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(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
return
const char * name
Definition: opengl_enc.c:103

Definition at line 452 of file libx264.c.

Referenced by X264_init().

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

Definition at line 906 of file libx264.c.

Definition at line 907 of file libx264.c.

Function Documentation

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

Definition at line 97 of file libx264.c.

Referenced by X264_init().

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

Definition at line 113 of file libx264.c.

Referenced by X264_frame().

static int avfmt2_num_planes ( int  avfmt)
static

Definition at line 151 of file libx264.c.

Referenced by X264_frame().

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

Definition at line 171 of file libx264.c.

Referenced by X264_frame().

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

'GA94' is standard in North America for ATSC, but hard coding this style may not be the right thing to do – other formats do exist. This information is not available in the side_data so we are going with this right now.

Definition at line 259 of file libx264.c.

static av_cold int X264_close ( AVCodecContext avctx)
static

Definition at line 390 of file libx264.c.

static int convert_pix_fmt ( enum AVPixelFormat  pix_fmt)
static

Definition at line 419 of file libx264.c.

Referenced by X264_init().

static av_cold int X264_init ( AVCodecContext avctx)
static

Definition at line 458 of file libx264.c.

static av_cold void X264_init_static ( AVCodec codec)
static

Definition at line 896 of file libx264.c.

Variable Documentation

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:68
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:76
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:91
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:67
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:75
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:213

Definition at line 861 of file libx264.c.

Referenced by X264_init_static().

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

Definition at line 875 of file libx264.c.

Referenced by X264_init_static().

enum AVPixelFormat pix_fmts_10bit[]
static
Initial value:
= {
}
#define AV_PIX_FMT_NV20
Definition: pixfmt.h:369
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:330
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:331

Definition at line 880 of file libx264.c.

Referenced by X264_init_static().

enum AVPixelFormat pix_fmts_8bit_rgb[]
static
Initial value:

Definition at line 887 of file libx264.c.

const AVOption options[]
static

Definition at line 908 of file libx264.c.

const AVCodecDefault x264_defaults[]
static

Definition at line 989 of file libx264.c.