mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-23 18:52:28 -04:00
ATV Demod: resize screen appropriately according to TV standard
This commit is contained in:
parent
044fe0565d
commit
27f85da812
@ -77,6 +77,8 @@ ATVDemod::ATVDemod(BasebandSampleSink* objScopeSink) :
|
||||
memset((void*)m_fltBufferQ,0,6*sizeof(float));
|
||||
|
||||
m_objPhaseDiscri.setFMScaling(1.0f);
|
||||
|
||||
applyStandard();
|
||||
}
|
||||
|
||||
ATVDemod::~ATVDemod()
|
||||
@ -93,6 +95,7 @@ void ATVDemod::configure(
|
||||
float fltLineDurationUs,
|
||||
float fltTopDurationUs,
|
||||
float fltFramePerS,
|
||||
ATVStd enmATVStandard,
|
||||
float fltRatioOfRowsToDisplay,
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
@ -105,6 +108,7 @@ void ATVDemod::configure(
|
||||
fltLineDurationUs,
|
||||
fltTopDurationUs,
|
||||
fltFramePerS,
|
||||
enmATVStandard,
|
||||
fltRatioOfRowsToDisplay,
|
||||
fltVoltLevelSynchroTop,
|
||||
fltVoltLevelSynchroBlack,
|
||||
@ -442,7 +446,7 @@ void ATVDemod::demod(Complex& c)
|
||||
|
||||
if (blnComputeImage)
|
||||
{
|
||||
m_objRegisteredATVScreen->setDataColor(m_intColIndex,intVal, intVal, intVal);
|
||||
m_objRegisteredATVScreen->setDataColor(m_intColIndex - m_intNumberSamplePerTop, intVal, intVal, intVal);
|
||||
}
|
||||
|
||||
m_intColIndex++;
|
||||
@ -508,7 +512,7 @@ void ATVDemod::demod(Complex& c)
|
||||
|
||||
if(blnComputeImage)
|
||||
{
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex);
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -532,7 +536,7 @@ void ATVDemod::demod(Complex& c)
|
||||
|
||||
if(m_intRowIndex<m_intNumberOfLines)
|
||||
{
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex);
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
|
||||
}
|
||||
|
||||
m_blnLineSynchronized=false;
|
||||
@ -561,7 +565,7 @@ void ATVDemod::demod(Complex& c)
|
||||
|
||||
if(blnComputeImage)
|
||||
{
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex);
|
||||
m_objRegisteredATVScreen->selectRow(m_intRowIndex - m_intNumberOfSyncLines);
|
||||
}
|
||||
|
||||
//Rendering when odd image processed
|
||||
@ -730,7 +734,8 @@ void ATVDemod::applySettings()
|
||||
|| (m_objConfig.m_fltLineDuration != m_objRunning.m_fltLineDuration)
|
||||
|| (m_objConfig.m_intSampleRate != m_objRunning.m_intSampleRate)
|
||||
|| (m_objConfig.m_fltTopDuration != m_objRunning.m_fltTopDuration)
|
||||
|| (m_objConfig.m_fltRatioOfRowsToDisplay != m_objRunning.m_fltRatioOfRowsToDisplay))
|
||||
|| (m_objConfig.m_fltRatioOfRowsToDisplay != m_objRunning.m_fltRatioOfRowsToDisplay)
|
||||
|| (m_objConfig.m_enmATVStandard != m_objRunning.m_enmATVStandard))
|
||||
{
|
||||
m_objSettingsMutex.lock();
|
||||
|
||||
@ -738,15 +743,21 @@ void ATVDemod::applySettings()
|
||||
m_intNumberSamplePerLine = (int) (m_objConfig.m_fltLineDuration * m_objConfig.m_intSampleRate);
|
||||
m_intNumberOfRowsToDisplay = (int) (m_objConfig.m_fltRatioOfRowsToDisplay * m_objConfig.m_fltLineDuration * m_objConfig.m_intSampleRate);
|
||||
|
||||
m_intNumberSamplePerTop = (int) (m_objConfig.m_fltTopDuration * m_objConfig.m_intSampleRate);
|
||||
|
||||
applyStandard();
|
||||
|
||||
m_objRegisteredATVScreen->resizeATVScreen(
|
||||
m_intNumberSamplePerLine - (m_intNumberSamplePerTop+m_intNumberSamplePerEndOfLine),
|
||||
m_intNumberOfLines - m_intNumberOfBlackLines);
|
||||
|
||||
qDebug() << "ATVDemod::applySettings:"
|
||||
<< " m_fltLineDuration: " << m_objConfig.m_fltLineDuration
|
||||
<< " m_fltFramePerS: " << m_objConfig.m_fltFramePerS
|
||||
<< " m_intNumberOfLines: " << m_intNumberOfLines
|
||||
<< " m_intNumberSamplePerLine: " << m_intNumberSamplePerLine
|
||||
<< " m_intNumberOfRowsToDisplay: " << m_intNumberOfRowsToDisplay;
|
||||
|
||||
m_intNumberSamplePerTop = (int) (m_objConfig.m_fltTopDuration * m_objConfig.m_intSampleRate);
|
||||
m_objRegisteredATVScreen->resizeATVScreen(m_intNumberSamplePerLine, m_intNumberOfLines);
|
||||
<< " m_intNumberOfRowsToDisplay: " << m_intNumberOfRowsToDisplay
|
||||
<< " m_intNumberOfBlackLines: " << m_intNumberOfBlackLines;
|
||||
|
||||
m_intRowsLimit = m_intNumberOfLines-1;
|
||||
m_intImageIndex = 0;
|
||||
@ -803,6 +814,31 @@ void ATVDemod::applySettings()
|
||||
m_objRunningPrivate = m_objConfigPrivate;
|
||||
}
|
||||
|
||||
void ATVDemod::applyStandard()
|
||||
{
|
||||
switch(m_objConfig.m_enmATVStandard)
|
||||
{
|
||||
case ATVStd405: // Follows loosely the 405 lines standard
|
||||
// what is left in a 64 us line for the image
|
||||
m_intNumberOfSyncLines = 24; // (15+7)*2 - 20
|
||||
m_intNumberOfBlackLines = 28; // above + 4
|
||||
break;
|
||||
case ATVStdPAL525: // Follows PAL-M standard
|
||||
// what is left in a 64/1.008 us line for the image
|
||||
m_intNumberOfSyncLines = 40; // (15+15)*2 - 20
|
||||
m_intNumberOfBlackLines = 44; // above + 4
|
||||
break;
|
||||
case ATVStdPAL625: // Follows PAL-B/G/H standard
|
||||
default:
|
||||
// what is left in a 64 us line for the image
|
||||
m_intNumberOfSyncLines = 44; // (15+17)*2 - 20
|
||||
m_intNumberOfBlackLines = 48; // above + 4
|
||||
}
|
||||
|
||||
// for now all standards apply this
|
||||
m_intNumberSamplePerEndOfLine = (int) ((7.3f/64.0f)*m_objConfig.m_fltLineDuration * m_objConfig.m_intSampleRate);
|
||||
}
|
||||
|
||||
int ATVDemod::getSampleRate()
|
||||
{
|
||||
return m_objRunning.m_intSampleRate;
|
||||
|
@ -45,6 +45,13 @@ class ATVDemod : public BasebandSampleSink
|
||||
|
||||
public:
|
||||
|
||||
enum ATVStd
|
||||
{
|
||||
ATVStdPAL625,
|
||||
ATVStdPAL525,
|
||||
ATVStd405
|
||||
};
|
||||
|
||||
enum ATVModulation {
|
||||
ATV_FM1, //!< Classical frequency modulation with discriminator #1
|
||||
ATV_FM2, //!< Classical frequency modulation with discriminator #2
|
||||
@ -57,6 +64,7 @@ public:
|
||||
struct ATVConfig
|
||||
{
|
||||
int m_intSampleRate;
|
||||
ATVStd m_enmATVStandard;
|
||||
float m_fltLineDuration;
|
||||
float m_fltTopDuration;
|
||||
float m_fltFramePerS;
|
||||
@ -70,6 +78,7 @@ public:
|
||||
|
||||
ATVConfig() :
|
||||
m_intSampleRate(0),
|
||||
m_enmATVStandard(ATVStdPAL625),
|
||||
m_fltLineDuration(0.0f),
|
||||
m_fltTopDuration(0.0f),
|
||||
m_fltFramePerS(0.0f),
|
||||
@ -139,6 +148,7 @@ public:
|
||||
float fltLineDurationUs,
|
||||
float fltTopDurationUs,
|
||||
float fltFramePerS,
|
||||
ATVStd enmATVStandard,
|
||||
float fltRatioOfRowsToDisplay,
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
@ -186,6 +196,7 @@ private:
|
||||
float fltLineDurationUs,
|
||||
float fltTopDurationUs,
|
||||
float fltFramePerS,
|
||||
ATVStd enmATVStandard,
|
||||
float fltRatioOfRowsToDisplay,
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
@ -198,6 +209,7 @@ private:
|
||||
fltLineDurationUs,
|
||||
fltTopDurationUs,
|
||||
fltFramePerS,
|
||||
enmATVStandard,
|
||||
fltRatioOfRowsToDisplay,
|
||||
fltVoltLevelSynchroTop,
|
||||
fltVoltLevelSynchroBlack,
|
||||
@ -214,6 +226,7 @@ private:
|
||||
float fltLineDurationUs,
|
||||
float fltTopDurationUs,
|
||||
float fltFramePerS,
|
||||
ATVStd enmATVStandard,
|
||||
float flatRatioOfRowsToDisplay,
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
@ -226,6 +239,7 @@ private:
|
||||
m_objMsgConfig.m_fltVoltLevelSynchroBlack = fltVoltLevelSynchroBlack;
|
||||
m_objMsgConfig.m_fltVoltLevelSynchroTop = fltVoltLevelSynchroTop;
|
||||
m_objMsgConfig.m_fltFramePerS = fltFramePerS;
|
||||
m_objMsgConfig.m_enmATVStandard = enmATVStandard;
|
||||
m_objMsgConfig.m_fltLineDuration = fltLineDurationUs;
|
||||
m_objMsgConfig.m_fltTopDuration = fltTopDurationUs;
|
||||
m_objMsgConfig.m_fltRatioOfRowsToDisplay = flatRatioOfRowsToDisplay;
|
||||
@ -295,6 +309,9 @@ private:
|
||||
int m_intNumberSamplePerTop;
|
||||
int m_intNumberOfLines;
|
||||
int m_intNumberOfRowsToDisplay;
|
||||
int m_intNumberOfSyncLines;
|
||||
int m_intNumberOfBlackLines;
|
||||
int m_intNumberSamplePerEndOfLine;
|
||||
|
||||
//*************** PROCESSING ***************
|
||||
|
||||
@ -358,6 +375,7 @@ private:
|
||||
QMutex m_objSettingsMutex;
|
||||
|
||||
void applySettings();
|
||||
void applyStandard();
|
||||
void demod(Complex& c);
|
||||
static float getRFBandwidthDivisor(ATVModulation modulation);
|
||||
};
|
||||
|
@ -368,6 +368,7 @@ void ATVDemodGUI::applySettings()
|
||||
getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) + ui->lineTime->value() * m_fltLineTimeMultiplier,
|
||||
getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) * (4.7f / 64.0f) + ui->topTime->value() * m_fltTopTimeMultiplier,
|
||||
getFps(ui->fps->currentIndex()),
|
||||
(ATVDemod::ATVStd) ui->standard->currentIndex(),
|
||||
(ui->halfImage->checkState() == Qt::Checked) ? 0.5f : 1.0f,
|
||||
ui->synchLevel->value() / 1000.0f,
|
||||
ui->blackLevel->value() / 1000.0f,
|
||||
@ -552,6 +553,11 @@ void ATVDemodGUI::on_fps_currentIndexChanged(int index)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_standard_currentIndexChanged(int index)
|
||||
{
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_reset_clicked(bool checked)
|
||||
{
|
||||
resetToDefaults();
|
||||
|
@ -75,6 +75,7 @@ private slots:
|
||||
void on_modulation_currentIndexChanged(int index);
|
||||
void on_nbLines_currentIndexChanged(int index);
|
||||
void on_fps_currentIndexChanged(int index);
|
||||
void on_standard_currentIndexChanged(int index);
|
||||
void on_reset_clicked(bool checked);
|
||||
void on_rfBW_valueChanged(int value);
|
||||
void on_rfOppBW_valueChanged(int value);
|
||||
|
@ -545,6 +545,28 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="standard">
|
||||
<property name="toolTip">
|
||||
<string>TV standard scheme</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PAL625L</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PAL525L</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>405L</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hSync">
|
||||
<property name="toolTip">
|
||||
|
@ -42,7 +42,6 @@ public:
|
||||
{
|
||||
ATVStdPAL625,
|
||||
ATVStdPAL525,
|
||||
ATVStd525L20F,
|
||||
ATVStd405
|
||||
} ATVStd;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user