Skip to content

Commit

Permalink
Use first/lastActiveFrameLine directly in ld-dropout-correct.
Browse files Browse the repository at this point in the history
  • Loading branch information
atsampson committed Jan 27, 2020
1 parent ff8269b commit a4c8110
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions tools/ld-dropout-correct/dropoutcorrect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,12 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
// Look up the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
thisFieldDropouts, true, 0, -stepAmount,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
currentSource, sourceFrameQuality,
candidates);

// Look down the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
thisFieldDropouts, true, stepAmount, stepAmount,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
currentSource, sourceFrameQuality,
candidates);

Expand All @@ -338,14 +336,12 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
// Look up the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
otherFieldDropouts, false, otherFieldOffset, -stepAmount,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
currentSource, sourceFrameQuality,
candidates);

// Look down the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
otherFieldDropouts, false, otherFieldOffset + stepAmount, stepAmount,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
currentSource, sourceFrameQuality,
candidates);
}
Expand Down Expand Up @@ -409,7 +405,6 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
void DropOutCorrect::findPotentialReplacementLine(const QVector<QVector<DropOutLocation>> &targetDropouts, qint32 targetIndex,
const QVector<QVector<DropOutLocation>> &sourceDropouts, bool isSameField,
qint32 sourceOffset, qint32 stepAmount,
qint32 firstActiveFieldLine, qint32 lastActiveFieldLine,
qint32 sourceNo, const QVector<qreal> &sourceFrameQuality,
QVector<Replacement> &candidates)
{
Expand All @@ -418,13 +413,13 @@ void DropOutCorrect::findPotentialReplacementLine(const QVector<QVector<DropOutL
if (sourceNo == 0) sourceLine += sourceOffset;

// Is the line within the active range?
if (sourceLine < firstActiveFieldLine || sourceLine >= lastActiveFieldLine) {
if (sourceLine < videoParameters[sourceNo].firstActiveFieldLine || sourceLine >= videoParameters[sourceNo].lastActiveFieldLine) {
qDebug() << "Line" << sourceLine << "is not in active range - ignoring";
return;
}

// Hunt for a replacement
while (sourceLine >= firstActiveFieldLine && sourceLine < lastActiveFieldLine) {
while (sourceLine >= videoParameters[sourceNo].firstActiveFieldLine && sourceLine < videoParameters[sourceNo].lastActiveFieldLine) {
// Is there a dropout that overlaps the one we're trying to replace?
bool hasOverlap = false;
for (qint32 sourceIndex = 0; sourceIndex < sourceDropouts[sourceNo].size(); sourceIndex++) {
Expand Down
1 change: 0 additions & 1 deletion tools/ld-dropout-correct/dropoutcorrect.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class DropOutCorrect : public QThread
void findPotentialReplacementLine(const QVector<QVector<DropOutLocation>> &targetDropouts, qint32 targetIndex,
const QVector<QVector<DropOutLocation>> &sourceDropouts, bool isSameField,
qint32 sourceOffset, qint32 stepAmount,
qint32 firstActiveFieldLine, qint32 lastActiveFieldLine,
qint32 sourceNo, const QVector<qreal> &sourceFrameQuality,
QVector<Replacement> &candidates);
void correctDropOut(const DropOutLocation &dropOut,
Expand Down

0 comments on commit a4c8110

Please sign in to comment.