libavcodec/libx264.c File Reference

#include "libavutil/opt.h"
#include "avcodec.h"
#include <x264.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

Defines

#define OPT_STR(opt, param)
#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, uint8_t *buf, int size, x264_nal_t *nals, int nnal, int skip_sei)
static int X264_frame (AVCodecContext *ctx, uint8_t *buf, int orig_bufsize, void *data)
static av_cold int X264_close (AVCodecContext *avctx)
static void check_default_settings (AVCodecContext *avctx)
 Detect default settings and use default profile to avoid libx264 failure.
static av_cold int X264_init (AVCodecContext *avctx)

Variables

static const AVOption options []
class {
      libx264
      av_default_item_name
      options
}; 
AVCodec ff_libx264_encoder


Define Documentation

#define OFFSET (  )     offsetof(X264Context,x)

Definition at line 430 of file libx264.c.

#define OPT_STR ( opt,
param   ) 

Value:

do {                                                                \
        if (param && x264_param_parse(&x4->params, opt, param) < 0) {   \
            av_log(avctx, AV_LOG_ERROR,                                 \
                   "bad value for '%s': '%s'\n", opt, param);           \
            return -1;                                                  \
        }                                                               \
    } while (0);                                                        \

Definition at line 213 of file libx264.c.

Referenced by X264_init().

#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Definition at line 431 of file libx264.c.


Function Documentation

static void check_default_settings ( AVCodecContext avctx  )  [static]

Detect default settings and use default profile to avoid libx264 failure.

Definition at line 191 of file libx264.c.

Referenced by X264_init().

static int encode_nals ( AVCodecContext ctx,
uint8_t *  buf,
int  size,
x264_nal_t *  nals,
int  nnal,
int  skip_sei 
) [static]

Definition at line 64 of file libx264.c.

Referenced by X264_frame(), X264_init(), XAVS_frame(), and XAVS_init().

static av_cold int X264_close ( AVCodecContext avctx  )  [static]

Definition at line 175 of file libx264.c.

static int X264_frame ( AVCodecContext ctx,
uint8_t *  buf,
int  orig_bufsize,
void *  data 
) [static]

Definition at line 103 of file libx264.c.

static av_cold int X264_init ( AVCodecContext avctx  )  [static]

Definition at line 222 of file libx264.c.

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

Definition at line 48 of file libx264.c.

Referenced by X264_init().


Variable Documentation

const { ... } [static]

av_default_item_name

Definition at line 445 of file libx264.c.

Initial value:

 {
    .name           = "libx264",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_H264,
    .priv_data_size = sizeof(X264Context),
    .init           = X264_init,
    .encode         = X264_frame,
    .close          = X264_close,
    .capabilities   = CODEC_CAP_DELAY,
    .pix_fmts       = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, PIX_FMT_NONE },
    .long_name      = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
    .priv_class     = &class,
}

Definition at line 447 of file libx264.c.

Definition at line 445 of file libx264.c.

Referenced by avcodec_register_all().

options (  )  [static]

Initial value:

 {
    {"preset", "Set the encoding preset", OFFSET(preset), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"tune", "Tune the encoding params", OFFSET(tune), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), FF_OPT_TYPE_INT, {.dbl=1}, 0, 1, VE},
    {"profile", "Set profile restrictions", OFFSET(profile), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"level", "Specify level (as defined by Annex A)", OFFSET(level), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"wpredp", "Weighted prediction for P-frames", OFFSET(weightp), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    {"x264opts", "x264 options", OFFSET(x264opts), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
    { NULL },
}

Definition at line 433 of file libx264.c.


Generated on Fri Oct 26 02:38:17 2012 for FFmpeg by  doxygen 1.5.8