static int video_inter_quant_bias= FF_DEFAULT_QUANT_BIAS;
static int me_method = ME_EPZS;
static int video_disable = 0;
+static int video_discard = 0;
static int video_codec_id = CODEC_ID_NONE;
static int video_codec_tag = 0;
static int same_quality = 0;
optr = img->data[i] + (img->linesize[i] * (padtop >> shift)) +
(img->linesize[i] - (padright >> shift));
- for (y = 0; y < ((height - (padtop + padbottom)) >> shift); y++) {
+ for (y = 0; y < ((height - (padtop + padbottom) - 1) >> shift); y++) {
memset(optr, color[i], (padleft + padright) >> shift);
optr += img->linesize[i];
}
}
- if (padbottom) {
- optr = img->data[i] + (img->linesize[i] * ((height - padbottom) >> shift));
- memset(optr, color[i], ((img->linesize[i] * padbottom) >> shift));
+ if (padbottom || padright) {
+ optr = img->data[i] + (((img->linesize[i] * (height - padbottom)) - padright) >> shift);
+ memset(optr, color[i], (((img->linesize[i] * padbottom) + padright) >> shift));
}
}
}
codec->frame_rate_base = icodec->frame_rate_base;
codec->width = icodec->width;
codec->height = icodec->height;
+ codec->has_b_frames = icodec->has_b_frames;
break;
default:
av_abort();
audio_channels = enc->channels;
audio_sample_rate = enc->sample_rate;
if(audio_disable)
- ic->streams[i]->discard= 1;
+ ic->streams[i]->discard= AVDISCARD_ALL;
break;
case CODEC_TYPE_VIDEO:
frame_height = enc->height;
enc->rate_emu = rate_emu;
if(video_disable)
- ic->streams[i]->discard= 1;
+ ic->streams[i]->discard= AVDISCARD_ALL;
+ else if(video_discard)
+ ic->streams[i]->discard= video_discard;
break;
case CODEC_TYPE_DATA:
break;
video_enc->gop_size = 0;
if (video_qscale || same_quality) {
video_enc->flags |= CODEC_FLAG_QSCALE;
+ video_enc->global_quality=
st->quality = FF_QP2LAMBDA * video_qscale;
}
static void opt_target(const char *arg)
{
int norm = -1;
- static const char const *frame_rates[] = {"25", "30000/1001", "24000/1001"};
+ static const char *const frame_rates[] = {"25", "30000/1001", "24000/1001"};
if(!strncmp(arg, "pal-", 4)) {
norm = 0;
{ "g", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_gop_size}, "set the group of picture size", "gop_size" },
{ "intra", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_only}, "use only intra frames"},
{ "vn", OPT_BOOL | OPT_VIDEO, {(void*)&video_disable}, "disable video" },
+ { "vdt", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_discard}, "discard threshold", "n" },
{ "qscale", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qscale}, "use fixed video quantiser scale (VBR)", "q" },
{ "qmin", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qmin}, "min video quantiser scale (VBR)", "q" },
{ "qmax", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qmax}, "max video quantiser scale (VBR)", "q" },