Now it is possible to adjust compression speed vs R/D when needed
and also skip vintage players compatibility at will.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/54/head
addr-see-the-website@aetey.se11 years agocommitted byMichael Niedermayer
#define VECTOR_MAX 6 //six or four entries per vector depending on format
#define CODEBOOK_MAX 256 //size of a codebook
//#define MAX_STRIPS 32 //Note: having fewer choices regarding the number of strips speeds up encoding (obviously)
#define MAX_STRIPS 3 // This seems to be max for vintage players! -- rl
// TODO: we might want to have a "vintage compatibilty" switch
#define MAX_STRIPS 32 //Note: having fewer choices regarding the number of strips speeds up encoding (obviously)
#define MIN_STRIPS 1 //Note: having more strips speeds up encoding the frame (this is less obvious)
// MAX_STRIPS limits the maximum quality you can reach
// when you want hight quality on high resolutions,
@ -132,6 +134,7 @@ typedef struct {
}strip_info;
typedefstruct{
constAVClass*class;
AVCodecContext*avctx;
unsignedchar*pict_bufs[4],*strip_buf,*frame_buf;
AVFrame*last_frame;
@ -154,8 +157,32 @@ typedef struct {
intnum_v1_mode,num_v4_mode,num_mc_mode;
intnum_v1_encs,num_v4_encs,num_skips;
#endif
// options
intmax_extra_cb_iterations;
intskip_empty_cb;
intmin_min_strips;
intmax_max_strips;
intstrip_number_delta_range;
}CinepakEncContext;
#define OFFSET(x) offsetof(CinepakEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
staticconstAVOptionoptions[]={
{"max_extra_cb_iterations","Max extra codebook recalculation passes, more is better and slower",OFFSET(max_extra_cb_iterations),AV_OPT_TYPE_INT,{.i64=2},0,INT_MAX,VE},
{"max_strips","Limit strips/frame, vintage compatible is 1..3, otherwise the more the better",OFFSET(max_max_strips),AV_OPT_TYPE_INT,{.i64=3},MIN_STRIPS,MAX_STRIPS,VE},
{"min_strips","Enforce min strips/frame, more is worse and faster, must be <= max_strips",OFFSET(min_min_strips),AV_OPT_TYPE_INT,{.i64=MIN_STRIPS},MIN_STRIPS,MAX_STRIPS,VE},
{"strip_number_adaptivity","How fast the strip number adapts, more is slightly better, much slower",OFFSET(strip_number_delta_range),AV_OPT_TYPE_INT,{.i64=0},0,MAX_STRIPS-MIN_STRIPS,VE},