26 #include "libavutil/attributes.h"
27 #include "libavutil/file.h"
39 xvid_plg_create_t xvid_plg_create = { 0 };
40 xvid_plugin_2pass2_t xvid_2pass2 = { 0 };
49 static const char frame_types[] =
" ipbs";
55 snprintf(tmp,
sizeof(tmp),
"%c %d %d %d %d %d %d\n",
59 if (write(fd, tmp, strlen(tmp)) < 0) {
69 xvid_2pass2.version= XVID_MAKE_VERSION(1,1,0);
70 xvid_2pass2.filename= tmp_name;
76 xvid_plg_create.version= XVID_MAKE_VERSION(1,1,0);
79 xvid_plg_create.param= &xvid_2pass2;
89 xvid_plg_data_t xvid_plg_data = { 0 };
91 xvid_plg_data.version= XVID_MAKE_VERSION(1,1,0);
92 xvid_plg_data.width = s->
width;
93 xvid_plg_data.height= s->
height;
94 xvid_plg_data.mb_width = s->
mb_width;
98 xvid_plg_data.min_quant[0]= s->
avctx->
qmin;
99 xvid_plg_data.min_quant[1]= s->
avctx->
qmin;
100 xvid_plg_data.min_quant[2]= s->
avctx->
qmin;
101 xvid_plg_data.max_quant[0]= s->
avctx->
qmax;
102 xvid_plg_data.max_quant[1]= s->
avctx->
qmax;
103 xvid_plg_data.max_quant[2]= s->
avctx->
qmax;
104 xvid_plg_data.bquant_offset = 0;
105 xvid_plg_data.bquant_ratio = 100;
109 xvid_plg_data.length=
110 xvid_plg_data.stats.length= (s->
frame_bits + 7)/8;
112 xvid_plg_data.quant= s->
qscale;
122 xvid_plg_data.quant= 0;
141 xvid_plg_destroy_t xvid_plg_destroy;
int frame_bits
bits used for the current frame
RateControlContext rc_context
contains stuff only accessed in ratecontrol.c
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int mb_num
number of MBs of a picture
common functions for use with the Xvid wrappers
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx)
Wrapper to work around the lack of mkstemp() on mingw.
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...
int mb_height
number of MBs horizontally & vertically
int num_entries
number of RateControlEntries
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int qmax
maximum quantizer
int rc_max_rate
maximum bitrate
Libavcodec external API header.
av_cold void ff_xvid_rate_control_uninit(MpegEncContext *s)
int rc_buffer_size
decoder bitstream buffer size
float dry_run_qscale
for xvid rc
int bit_rate
the average bitrate
static void close(AVCodecParserContext *s)
int qmin
minimum quantizer
int height
picture size. must be a multiple of 16
int last_picture_number
for xvid rc
float b_quant_offset
qscale offset between IP and B-frames
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
struct AVCodecContext * avctx
void * non_lavc_opaque
context for non lavc rc code (for example xvid)
av_cold int ff_xvid_rate_control_init(MpegEncContext *s)
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run)