Go to the documentation of this file.
   37 #define END_OF_STREAM 0x001 
   39 #define XAVS_PART_I8X8 0x002  
   40 #define XAVS_PART_P8X8 0x010  
   41 #define XAVS_PART_B8X8 0x100  
   72     static const int level_map[] = {
 
   79     if (level < 0 || level > XAVS_LOG_DEBUG)
 
   86                        xavs_nal_t *nals, 
int nnal)
 
   96     for (
i = 0; 
i < nnal; 
i++)
 
   97         size += 3
U + nals[
i].i_payload;
 
  111     for (
i = 0; 
i < nnal; 
i++) {
 
  112         int size = p_end - p;
 
  113         s = xavs_nal_encode(p, &
size, 1, nals + 
i);
 
  116         if (
s != 3
U + nals[
i].i_payload)
 
  130     xavs_picture_t pic_out;
 
  133     x4->
pic.img.i_csp   = XAVS_CSP_I420;
 
  134     x4->
pic.img.i_plane = 3;
 
  137        for (
i = 0; 
i < 3; 
i++) {
 
  143         x4->
pic.i_type = XAVS_TYPE_AUTO;
 
  147     if (xavs_encoder_encode(x4->
enc, &nal, &nnal,
 
  182     switch (pic_out.i_type) {
 
  200     if (pic_out.i_type == XAVS_TYPE_I) {
 
  219         xavs_encoder_close(x4->
enc);
 
  229     xavs_param_default(&x4->
params);
 
  232     x4->
params.p_log_private        = avctx;
 
  236         x4->
params.rc.i_rc_method = XAVS_RC_ABR;
 
  242         x4->
params.rc.b_stat_read = 1;
 
  245             x4->
params.rc.i_rc_method   = XAVS_RC_CRF;
 
  247         } 
else if (x4->
cqp >= 0) {
 
  248             x4->
params.rc.i_rc_method   = XAVS_RC_CQP;
 
  265     if (x4->
b_bias != INT_MIN)
 
  304     x4->
params.analyse.inter        = XAVS_ANALYSE_I8x8 |XAVS_ANALYSE_PSUB16x16| XAVS_ANALYSE_BSUB16x16;
 
  311     x4->
params.analyse.b_transform_8x8    = 1; 
 
  317     if (avctx->
level > 0)
 
  321         x4->
params.rc.f_rate_tolerance =
 
  326         x4->
params.rc.f_vbv_buffer_init =
 
  329         x4->
params.rc.f_vbv_buffer_init = 0.9;
 
  339     x4->
params.i_log_level    = XAVS_LOG_DEBUG;
 
  344         x4->
params.b_repeat_headers = 0;
 
  346     x4->
enc = xavs_encoder_open(&x4->
params);
 
  360         s = xavs_encoder_headers(x4->
enc, &nal, &nnal);
 
  363         for (
i = 0; 
i < nnal; 
i++) {
 
  365             if (nal[
i].i_type == NAL_SEI) {
 
  367                 if (xavs_nal_encode(x4->
sei, &x4->
sei_size, 1, nal + 
i) < 0)
 
  372             size = xavs_nal_encode(p, &
s, 1, nal + 
i);
 
  382 #define OFFSET(x) offsetof(XavsContext, x) 
  383 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 
  385     { 
"crf",           
"Select the quality for constant quality mode",    
OFFSET(crf),           
AV_OPT_TYPE_FLOAT,  {.dbl = -1 }, -1, FLT_MAX, 
VE },
 
  386     { 
"qp",            
"Constant quantization parameter rate control method",
OFFSET(cqp),        
AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, INT_MAX, 
VE },
 
  387     { 
"b-bias",        
"Influences how often B-frames are used",          
OFFSET(b_bias),        
AV_OPT_TYPE_INT,    {.i64 = INT_MIN}, INT_MIN, INT_MAX, 
VE },
 
  388     { 
"cplxblur",      
"Reduce fluctuations in QP (before curve compression)", 
OFFSET(cplxblur), 
AV_OPT_TYPE_FLOAT,  {.dbl = -1 }, -1, FLT_MAX, 
VE},
 
  389     { 
"direct-pred",   
"Direct MV prediction mode",                       
OFFSET(direct_pred),   
AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, INT_MAX, 
VE, 
"direct-pred" },
 
  396     { 
"mixed-refs",    
"One reference per partition, as opposed to one reference per macroblock", 
OFFSET(mixed_refs), 
AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
VE },
 
  398     { 
"motion-est",   
"Set motion estimation method",                     
OFFSET(motion_est),    
AV_OPT_TYPE_INT,    { .i64 = XAVS_ME_DIA }, -1, XAVS_ME_TESA, 
VE, 
"motion-est"},
 
  404     { 
"b_strategy",    
"Strategy to choose between I/P/B-frames",         
OFFSET(b_frame_strategy), 
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, 
VE},
 
  405     { 
"chromaoffset", 
"QP difference between chroma and luma",           
OFFSET(chroma_offset), 
AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, 
VE},
 
  406     { 
"sc_threshold", 
"Scene change threshold",                           
OFFSET(scenechange_threshold), 
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 
VE},
 
  407     { 
"noise_reduction", 
"Noise reduction",                               
OFFSET(noise_reduction), 
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 
VE},
 
  440     .p.wrapper_name = 
"libxavs",
 
  
#define FF_ALLOCZ_TYPED_ARRAY(p, nelem)
 
void av_vlog(void *avcl, int level, const char *fmt, va_list vl)
Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
#define AV_LOG_WARNING
Something somehow does not look correct.
 
AVPixelFormat
Pixel format.
 
int keyint_min
minimum GOP size
 
static const AVOption options[]
 
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
 
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
 
This structure describes decoded (raw) audio or video data.
 
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
 
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
 
#define AV_CODEC_FLAG_PSNR
error[?] variables will be set during encoding.
 
int qmax
maximum quantizer
 
int me_subpel_quality
subpel ME quality
 
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
 
static void XAVS_log(void *p, int level, const char *fmt, va_list args)
 
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
 
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
 
static av_cold int XAVS_init(AVCodecContext *avctx)
 
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
 
static av_cold int XAVS_close(AVCodecContext *avctx)
 
AVCodec p
The public AVCodec.
 
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
 
int refs
number of reference frames
 
int flags
AV_CODEC_FLAG_*.
 
int bit_rate_tolerance
number of bits the bitstream is allowed to diverge from the reference.
 
#define FF_CODEC_ENCODE_CB(func)
 
#define AV_CODEC_FLAG_INTERLACED_DCT
Use interlaced DCT.
 
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
 
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
 
int has_b_frames
Size of the frame reordering buffer in the decoder.
 
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
 
int(* init)(AVBSFContext *ctx)
 
static const FFCodecDefault xavs_defaults[]
 
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
 
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
 
int64_t rc_max_rate
maximum bitrate
 
static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, xavs_nal_t *nals, int nnal)
 
#define CODEC_LONG_NAME(str)
 
int rc_buffer_size
decoder bitstream buffer size
 
#define LIBAVUTIL_VERSION_INT
 
Describe the class of an AVClass context structure.
 
static __device__ float fabs(float a)
 
float qblur
amount of qscale smoothing over time (0.0-1.0)
 
int64_t bit_rate
the average bitrate
 
const char * av_default_item_name(void *ptr)
Return the context name.
 
@ AV_PICTURE_TYPE_I
Intra.
 
int me_cmp
motion estimation comparison function
 
int trellis
trellis RD quantization
 
int level
Encoding level descriptor.
 
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
 
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
 
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
 
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
 
static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
 
static const AVClass xavs_class
 
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
 
@ AV_PICTURE_TYPE_NONE
Undefined.
 
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
 
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
 
#define AVERROR_EXTERNAL
Generic error in an external library.
 
int flags
A combination of AV_PKT_FLAG values.
 
const FFCodec ff_libxavs_encoder
 
#define AV_LOG_INFO
Standard information.
 
float b_quant_factor
qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q...
 
#define i(width, name, range_min, range_max)
 
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
 
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
 
const char * name
Name of the codec implementation.
 
int64_t frame_num
Frame counter, set by libavcodec.
 
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
 
int max_qdiff
maximum quantizer difference between frames
 
main external API structure.
 
int scenechange_threshold
 
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
 
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
 
int qmin
minimum quantizer
 
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
 
@ AV_PICTURE_TYPE_P
Predicted.
 
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
 
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
 
This structure stores compressed data.
 
int width
picture width / height.
 
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
 
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
 
void * priv_data
Format private data.
 
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
 
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.