decoder: removed interlacing property
Interlacing should be moved somewhere else in the pipeline
This commit is contained in:
@@ -199,14 +199,14 @@ DecoderPtr Decoder::CreateFromID(const QString &id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int64_t Decoder::GetTimeInTimebaseUnits(const rational &time, const rational &timebase, int64_t start_time, VideoParams::Interlacing interlacing)
|
||||
int64_t Decoder::GetTimeInTimebaseUnits(const rational &time, const rational &timebase, int64_t start_time)
|
||||
{
|
||||
int64_t t = Timecode::time_to_timestamp(time, timebase);
|
||||
t += start_time;
|
||||
return t;
|
||||
}
|
||||
|
||||
rational Decoder::GetTimestampInTimeUnits(int64_t time, const rational &timebase, int64_t start_time, VideoParams::Interlacing interlacing)
|
||||
rational Decoder::GetTimestampInTimeUnits(int64_t time, const rational &timebase, int64_t start_time)
|
||||
{
|
||||
time -= start_time;
|
||||
return Timecode::timestamp_to_time(time, timebase);
|
||||
|
||||
+3
-7
@@ -150,13 +150,9 @@ public:
|
||||
RetrieveVideoParams()
|
||||
{
|
||||
divider = 1;
|
||||
src_interlacing = VideoParams::kInterlaceNone;
|
||||
dst_interlacing = VideoParams::kInterlaceNone;
|
||||
}
|
||||
|
||||
int divider;
|
||||
VideoParams::Interlacing src_interlacing;
|
||||
VideoParams::Interlacing dst_interlacing;
|
||||
|
||||
void reset()
|
||||
{
|
||||
@@ -165,7 +161,7 @@ public:
|
||||
|
||||
bool operator==(const RetrieveVideoParams& rhs) const
|
||||
{
|
||||
return divider == rhs.divider && src_interlacing == rhs.src_interlacing && dst_interlacing == rhs.dst_interlacing;
|
||||
return divider == rhs.divider;
|
||||
}
|
||||
|
||||
bool operator!=(const RetrieveVideoParams& rhs) const
|
||||
@@ -295,8 +291,8 @@ protected:
|
||||
return stream_;
|
||||
}
|
||||
|
||||
static int64_t GetTimeInTimebaseUnits(const rational& time, const rational& timebase, int64_t start_time, VideoParams::Interlacing interlacing);
|
||||
static rational GetTimestampInTimeUnits(int64_t time, const rational& timebase, int64_t start_time, VideoParams::Interlacing interlacing);
|
||||
static int64_t GetTimeInTimebaseUnits(const rational& time, const rational& timebase, int64_t start_time);
|
||||
static rational GetTimestampInTimeUnits(int64_t time, const rational& timebase, int64_t start_time);
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
||||
@@ -654,7 +654,7 @@ void FFmpegDecoder::ClearFrameCache()
|
||||
|
||||
AVFramePtr FFmpegDecoder::RetrieveFrame(const rational& time, const QAtomicInt *cancelled)
|
||||
{
|
||||
int64_t target_ts = GetTimeInTimebaseUnits(time, instance_.avstream()->time_base, instance_.avstream()->start_time, filter_params_.src_interlacing);
|
||||
int64_t target_ts = GetTimeInTimebaseUnits(time, instance_.avstream()->time_base, instance_.avstream()->start_time);
|
||||
|
||||
const int64_t min_seek = -instance_.avstream()->start_time;
|
||||
int64_t seek_ts = target_ts;
|
||||
@@ -843,19 +843,6 @@ bool FFmpegDecoder::InitScaler(AVFrame *input, const RetrieveVideoParams& params
|
||||
// Link filters as necessary
|
||||
AVFilterContext *last_filter = buffersrc_ctx_;
|
||||
|
||||
// Add interlacing filter if necessary
|
||||
if (filter_params_.src_interlacing != VideoParams::kInterlaceNone) {
|
||||
// Footage is interlaced, our renderer works in progressive so we'll need to de-interlace
|
||||
AVFilterContext* interlace_filter;
|
||||
|
||||
snprintf(filter_args, kFilterArgSz, "mode=1:parity=%s",
|
||||
GetInterlacingModeInFFmpeg(filter_params_.src_interlacing));
|
||||
avfilter_graph_create_filter(&interlace_filter, avfilter_get_by_name("yadif"), "yadif", filter_args, nullptr, filter_graph_);
|
||||
|
||||
avfilter_link(last_filter, 0, interlace_filter, 0);
|
||||
last_filter = interlace_filter;
|
||||
}
|
||||
|
||||
// Add scale filter if necessary
|
||||
int dst_width, dst_height;
|
||||
if (filter_params_.divider > 1) {
|
||||
@@ -864,10 +851,9 @@ bool FFmpegDecoder::InitScaler(AVFrame *input, const RetrieveVideoParams& params
|
||||
dst_width = VideoParams::GetScaledDimension(src_width, filter_params_.divider);
|
||||
dst_height = VideoParams::GetScaledDimension(src_height, filter_params_.divider);
|
||||
|
||||
snprintf(filter_args, kFilterArgSz, "w=%d:h=%d:flags=fast_bilinear:interl=%d",
|
||||
snprintf(filter_args, kFilterArgSz, "w=%d:h=%d:flags=fast_bilinear:interl=-1",
|
||||
dst_width,
|
||||
dst_height,
|
||||
params.dst_interlacing != VideoParams::kInterlaceNone);
|
||||
dst_height);
|
||||
|
||||
avfilter_graph_create_filter(&scale_filter, avfilter_get_by_name("scale"), "scale", filter_args, nullptr, filter_graph_);
|
||||
|
||||
|
||||
@@ -446,8 +446,6 @@ void RenderProcessor::ProcessVideoFootage(TexturePtr destination, const FootageJ
|
||||
if (decoder) {
|
||||
Decoder::RetrieveVideoParams p;
|
||||
p.divider = stream.video_params().divider();
|
||||
p.src_interlacing = stream_data.interlacing();
|
||||
p.dst_interlacing = GetCacheVideoParams().interlacing();
|
||||
|
||||
if (!IsCancelled()) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user