FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
libxavs.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <float.h>
#include <xavs.h>
#include "avcodec.h"
#include "internal.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  XavsContext
 

Macros

#define END_OF_STREAM   0x001
 
#define XAVS_PART_I8X8   0x002 /* Analyze i8x8 (requires 8x8 transform) */
 
#define XAVS_PART_P8X8   0x010 /* Analyze p16x8, p8x16 and p8x8 */
 
#define XAVS_PART_B8X8   0x100 /* Analyze b16x8, b*/
 
#define OFFSET(x)   offsetof(XavsContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void XAVS_log (void *p, int level, const char *fmt, va_list args)
 
static int encode_nals (AVCodecContext *ctx, AVPacket *pkt, xavs_nal_t *nals, int nnal)
 
static int XAVS_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int XAVS_close (AVCodecContext *avctx)
 
static av_cold int XAVS_init (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass xavs_class
 
static const AVCodecDefault xavs_defaults []
 
AVCodec ff_libxavs_encoder
 

Macro Definition Documentation

#define END_OF_STREAM   0x001

Definition at line 35 of file libxavs.c.

Referenced by XAVS_frame().

#define XAVS_PART_I8X8   0x002 /* Analyze i8x8 (requires 8x8 transform) */

Definition at line 37 of file libxavs.c.

#define XAVS_PART_P8X8   0x010 /* Analyze p16x8, p8x16 and p8x8 */

Definition at line 38 of file libxavs.c.

#define XAVS_PART_B8X8   0x100 /* Analyze b16x8, b*/

Definition at line 39 of file libxavs.c.

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

Definition at line 392 of file libxavs.c.

Definition at line 393 of file libxavs.c.

Function Documentation

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

Definition at line 63 of file libxavs.c.

Referenced by XAVS_init().

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

Definition at line 78 of file libxavs.c.

Referenced by XAVS_frame().

static int XAVS_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int *  got_packet 
)
static

Definition at line 113 of file libxavs.c.

static av_cold int XAVS_close ( AVCodecContext avctx)
static

Definition at line 199 of file libxavs.c.

static av_cold int XAVS_init ( AVCodecContext avctx)
static

Definition at line 215 of file libxavs.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "crf", "Select the quality for constant quality mode", OFFSET(crf), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE },
{ "qp", "Constant quantization parameter rate control method",OFFSET(cqp), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, VE },
{ "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), AV_OPT_TYPE_INT, {.i64 = INT_MIN}, INT_MIN, INT_MAX, VE },
{ "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE},
{ "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, VE, "direct-pred" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" },
{ "spatial", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" },
{ "temporal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" },
{ "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" },
{ "aud", "Use access unit delimiters.", OFFSET(aud), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, VE},
{ "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, VE},
{ "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE },
{ "fast-pskip", NULL, OFFSET(fast_pskip), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, VE},
{ NULL },
}

Definition at line 394 of file libxavs.c.

const AVClass xavs_class
static
Initial value:
= {
.class_name = "libxavs",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 411 of file libxavs.c.

const AVCodecDefault xavs_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL },
}

Definition at line 418 of file libxavs.c.

AVCodec ff_libxavs_encoder
Initial value:
= {
.name = "libxavs",
.long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),
.priv_data_size = sizeof(XavsContext),
.encode2 = XAVS_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &xavs_class,
.defaults = xavs_defaults,
}

Definition at line 423 of file libxavs.c.