transform: hash the generated matrix
Making an exception for the transform node, we use a slightly heavier hash to save more rendering time later. Fixes #1560 Addresses some of #1360
This commit is contained in:
@@ -230,7 +230,7 @@ void Block::Retranslate()
|
||||
SetInputName(kReverseInput, tr("Reverse"));
|
||||
}
|
||||
|
||||
void Block::Hash(const QString &, QCryptographicHash &, const rational &) const
|
||||
void Block::Hash(const QString &, QCryptographicHash &, const rational &, const VideoParams &) const
|
||||
{
|
||||
// A block does nothing by default, so we hash nothing
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
return GetStandardValue(kReverseInput).toBool();
|
||||
}
|
||||
|
||||
virtual void Hash(const QString& output, QCryptographicHash &hash, const rational &time) const override;
|
||||
virtual void Hash(const QString& output, QCryptographicHash &hash, const rational &time, const VideoParams& video_params) const override;
|
||||
|
||||
static const QString kLengthInput;
|
||||
static const QString kMediaInInput;
|
||||
|
||||
@@ -109,7 +109,7 @@ void ClipBlock::Retranslate()
|
||||
SetInputName(kBufferIn, tr("Buffer"));
|
||||
}
|
||||
|
||||
void ClipBlock::Hash(const QString &out, QCryptographicHash &hash, const rational &time) const
|
||||
void ClipBlock::Hash(const QString &out, QCryptographicHash &hash, const rational &time, const VideoParams &video_params) const
|
||||
{
|
||||
Q_UNUSED(out)
|
||||
|
||||
@@ -117,7 +117,7 @@ void ClipBlock::Hash(const QString &out, QCryptographicHash &hash, const rationa
|
||||
rational t = InputTimeAdjustment(kBufferIn, -1, TimeRange(time, time)).in();
|
||||
|
||||
NodeOutput output = GetConnectedOutput(kBufferIn);
|
||||
output.node()->Hash(output.output(), hash, t);
|
||||
output.node()->Hash(output.output(), hash, t, video_params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Hash(const QString& output, QCryptographicHash &hash, const rational &time) const override;
|
||||
virtual void Hash(const QString& output, QCryptographicHash &hash, const rational &time, const VideoParams& video_params) const override;
|
||||
|
||||
static const QString kBufferIn;
|
||||
|
||||
|
||||
@@ -116,9 +116,9 @@ double TransitionBlock::GetInProgress(const double &time) const
|
||||
return clamp((GetInternalTransitionTime(time) - out_offset().toDouble()) / in_offset().toDouble(), 0.0, 1.0);
|
||||
}
|
||||
|
||||
void TransitionBlock::Hash(const QString &output, QCryptographicHash &hash, const rational &time) const
|
||||
void TransitionBlock::Hash(const QString &output, QCryptographicHash &hash, const rational &time, const VideoParams &video_params) const
|
||||
{
|
||||
Node::Hash(output, hash, time);
|
||||
Node::Hash(output, hash, time, video_params);
|
||||
|
||||
double time_dbl = time.toDouble();
|
||||
double all_prog = GetTotalProgress(time_dbl);
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
double GetOutProgress(const double &time) const;
|
||||
double GetInProgress(const double &time) const;
|
||||
|
||||
virtual void Hash(const QString& output, QCryptographicHash& hash, const rational &time) const override;
|
||||
virtual void Hash(const QString& output, QCryptographicHash& hash, const rational &time, const VideoParams& video_params) const override;
|
||||
|
||||
virtual NodeValueTable Value(const QString& output, NodeValueDatabase &value) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user