Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/ld-chroma-decoder/comb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ void Comb::updateConfiguration(const LdDecodeMetaData::VideoParameters &_videoPa
// Set the frame height
frameHeight = ((videoParameters.fieldHeight * 2) - 1);

// Set the first and last active line
configuration.firstActiveLine = videoParameters.firstActiveFrameLine;
configuration.lastActiveLine = videoParameters.lastActiveFrameLine;

configurationSet = true;
}

Expand Down
4 changes: 4 additions & 0 deletions tools/ld-chroma-decoder/palcolour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ void PalColour::updateConfiguration(const LdDecodeMetaData::VideoParameters &_vi
// Build the look-up tables
buildLookUpTables();

// Set the frame area
configuration.firstActiveLine = videoParameters.firstActiveFrameLine;
configuration.lastActiveLine = videoParameters.lastActiveFrameLine;

if (configuration.chromaFilter == transform2DFilter || configuration.chromaFilter == transform3DFilter) {
// Create the Transform PAL filter
if (configuration.chromaFilter == transform2DFilter) {
Expand Down
12 changes: 1 addition & 11 deletions tools/ld-diffdod/tbcsources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,18 +363,8 @@ void TbcSources::performLumaClip(QVector<SourceVideo::Data> &fields, QVector<QVe
// Get the metadata for the video parameters (all sources are the same, so just grab from the first)
LdDecodeMetaData::VideoParameters videoParameters = sourceVideos[0]->ldDecodeMetaData.getVideoParameters();

qint32 firstActiveFieldLine;
qint32 lastActiveFieldLine;
if (videoParameters.isSourcePal) {
firstActiveFieldLine = 22;
lastActiveFieldLine = 308;
} else {
firstActiveFieldLine = 20;
lastActiveFieldLine = 259;
}

// Process the fields one line at a time
for (qint32 y = firstActiveFieldLine; y < lastActiveFieldLine; y++) {
for (qint32 y = videoParameters.firstActiveFieldLine; y < videoParameters.lastActiveFieldLine; y++) {
qint32 startOfLinePointer = y * videoParameters.fieldWidth;

for (qint32 sourceCounter = 0; sourceCounter < fields.size(); sourceCounter++) {
Expand Down
19 changes: 4 additions & 15 deletions tools/ld-dropout-correct/dropoutcorrect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,6 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
bool isColourBurst, bool intraField, QVector<qint32> &availableSourcesForFrame,
QVector<qreal> &sourceFrameQuality)
{
// Determine the first and last active scan line based on the source format
qint32 firstActiveFieldLine;
qint32 lastActiveFieldLine;
if (videoParameters[0].isSourcePal) {
firstActiveFieldLine = 22;
lastActiveFieldLine = 308;
} else {
firstActiveFieldLine = 20;
lastActiveFieldLine = 259;
}

// Define the minimum step size to use when searching for replacement
// lines, and the offset to the nearest replacement line in the other
// field.
Expand Down Expand Up @@ -330,13 +319,13 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
// Look up the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
thisFieldDropouts, true, 0, -stepAmount,
firstActiveFieldLine, lastActiveFieldLine,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
candidates, currentSource, sourceFrameQuality);

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

// Only check the other field for visible line replacements
Expand All @@ -346,13 +335,13 @@ DropOutCorrect::Replacement DropOutCorrect::findReplacementLine(const QVector<QV
// Look up the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
otherFieldDropouts, false, otherFieldOffset, -stepAmount,
firstActiveFieldLine, lastActiveFieldLine,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
candidates, currentSource, sourceFrameQuality);

// Look down the field for a replacement
findPotentialReplacementLine(thisFieldDropouts, dropOutIndex,
otherFieldDropouts, false, otherFieldOffset + stepAmount, stepAmount,
firstActiveFieldLine, lastActiveFieldLine,
videoParameters[0].firstActiveFieldLine, videoParameters[0].lastActiveFieldLine,
candidates, currentSource, sourceFrameQuality);
}
}
Expand Down
15 changes: 15 additions & 0 deletions tools/library/tbc/lddecodemetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ LdDecodeMetaData::VideoParameters LdDecodeMetaData::getVideoParameters()
return videoParameters;
}

// Add in the active field line range psuedo-metadata
if (videoParameters.isSourcePal) {
// PAL
videoParameters.firstActiveFieldLine = 22;
videoParameters.lastActiveFieldLine = 308;
videoParameters.firstActiveFrameLine = 44;
videoParameters.lastActiveFrameLine = 620;
} else {
// NTSC
videoParameters.firstActiveFieldLine = 20;
videoParameters.lastActiveFieldLine = 259;
videoParameters.firstActiveFrameLine = 40;
videoParameters.lastActiveFrameLine = 525;
}

return videoParameters;
}

Expand Down
7 changes: 7 additions & 0 deletions tools/library/tbc/lddecodemetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ class LdDecodeMetaData
qint32 fsc;

bool isMapped;

// Note: These are psuedo metadata items
// The values are populated by the library
qint32 firstActiveFieldLine;
qint32 lastActiveFieldLine;
qint32 firstActiveFrameLine;
qint32 lastActiveFrameLine;
};

// Drop-outs metadata definition
Expand Down