AVOutputStream *ost,
AVInputStream *ist,
AVFrame *in_picture,
- int *frame_size)
+ int *frame_size, float quality)
{
int nb_frames, i, ret, resample_changed;
AVFrame *final_picture, *formatted_picture;
/* handles sameq here. This is not correct because it may
not be a global option */
- big_picture.quality = same_quality ? ist->st->quality : ost->st->quality;
+ big_picture.quality = quality;
if(!me_threshold)
big_picture.pict_type = 0;
// big_picture.pts = AV_NOPTS_VALUE;
#if CONFIG_AVFILTER
int frame_available;
#endif
+ float quality;
AVPacket avpkt;
int bps = av_get_bytes_per_sample(ist->st->codec->sample_fmt);
ret = avcodec_decode_video2(ist->st->codec,
&picture, &got_output, &avpkt);
- ist->st->quality= picture.quality;
+ quality = same_quality ? picture.quality : 0;
if (ret < 0)
goto fail_decode;
if (!got_output) {
if (ost->picref->video && !ost->frame_aspect_ratio)
ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect;
#endif
- do_video_out(os, ost, ist, &picture, &frame_size);
+ do_video_out(os, ost, ist, &picture, &frame_size,
+ same_quality ? quality : ost->st->codec->global_quality);
if (vstats_filename && frame_size)
do_video_stats(os, ost, frame_size);
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;
+ video_enc->global_quality = FF_QP2LAMBDA * video_qscale;
}
if(intra_matrix)
if (audio_qscale > QSCALE_NONE) {
audio_enc->flags |= CODEC_FLAG_QSCALE;
- audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale;
+ audio_enc->global_quality = FF_QP2LAMBDA * audio_qscale;
}
if (audio_channels)
audio_enc->channels = audio_channels;
int stream_copy; /**< If set, just copy stream. */
enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
+#if FF_API_AVSTREAM_QUALITY
//FIXME move stuff to a flags field?
/**
* Quality, as it has been removed from AVCodecContext and put in AVVideoFrame.
* MN: dunno if that is the right place for it
*/
- float quality;
+ attribute_deprecated float quality;
+#endif
/**
* Decoding: pts of the first frame of the stream, in stream time base.
avio_wb32(pb, codec->codec_id);
avio_w8(pb, codec->codec_type);
avio_wb32(pb, codec->bit_rate);
- avio_wb32(pb, st->quality);
avio_wb32(pb, codec->flags);
avio_wb32(pb, codec->flags2);
avio_wb32(pb, codec->debug);