diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp
index d18f07404..7df670175 100644
--- a/plugins/channelrx/demodatv/atvdemod.cpp
+++ b/plugins/channelrx/demodatv/atvdemod.cpp
@@ -707,10 +707,17 @@ void ATVDemod::applySettings()
{
m_objSettingsMutex.lock();
- m_intNumberOfLines = (int) (1.0f / (m_objConfig.m_fltLineDuration * m_objConfig.m_fltFramePerS));
+ m_intNumberOfLines = (int) round(1.0f / (m_objConfig.m_fltLineDuration * m_objConfig.m_fltFramePerS));
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);
+// 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_fltTopDurationUs * m_objConfig.m_intSampleRate) / m_fltSecondToUs);
m_objRegisteredATVScreen->resizeATVScreen(m_intNumberSamplePerLine, m_intNumberOfLines);
diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp
index f06def64f..2bc3622e2 100644
--- a/plugins/channelrx/demodatv/atvdemodgui.cpp
+++ b/plugins/channelrx/demodatv/atvdemodgui.cpp
@@ -77,7 +77,7 @@ void ATVDemodGUI::resetToDefaults()
//********** ATV Default values **********
ui->synchLevel->setValue(100);
ui->blackLevel->setValue(310);
- ui->lineTime->setValue(640);
+ ui->lineTime->setValue(0);
ui->topTime->setValue(3);
ui->modulation->setCurrentIndex(0);
ui->fps->setCurrentIndex(0);
@@ -155,7 +155,7 @@ bool ATVDemodGUI::deserialize(const QByteArray& arrData)
ui->synchLevel->setValue(tmp);
d.readS32(4, &tmp, 310);
ui->blackLevel->setValue(tmp);
- d.readS32(5, &tmp, 640);
+ d.readS32(5, &tmp, 0);
ui->lineTime->setValue(tmp);
d.readS32(6, &tmp, 3);
ui->topTime->setValue(tmp);
@@ -339,7 +339,7 @@ void ATVDemodGUI::applySettings()
m_objATVDemod->configure(m_objATVDemod->getInputMessageQueue(),
getNominalLineTime(ui->nbLines->currentIndex(), ui->fps->currentIndex()) + ui->lineTime->value() * m_fltLineTimeMultiplier,
ui->topTime->value() * 1.0f,
- (ui->fps->currentIndex() == 0) ? 25.0f : 30.0f,
+ getFps(ui->fps->currentIndex()),
(ui->halfImage->checkState() == Qt::Checked) ? 0.5f : 1.0f,
ui->synchLevel->value() / 1000.0f,
ui->blackLevel->value() / 1000.0f,
@@ -600,6 +600,9 @@ float ATVDemodGUI::getFps(int fpsIndex)
case 1:
return 30.0f;
break;
+ case 2:
+ return 20.0f;
+ break;
case 0:
default:
return 25.0f;
diff --git a/plugins/channelrx/demodatv/atvdemodgui.ui b/plugins/channelrx/demodatv/atvdemodgui.ui
index 8095cff12..4583b623b 100644
--- a/plugins/channelrx/demodatv/atvdemodgui.ui
+++ b/plugins/channelrx/demodatv/atvdemodgui.ui
@@ -451,6 +451,11 @@
30 Fps
+ -
+
+ 20 Fps
+
+
-
diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp
index 5e338d62a..5a04b7159 100644
--- a/plugins/channeltx/modatv/atvmod.cpp
+++ b/plugins/channeltx/modatv/atvmod.cpp
@@ -720,6 +720,9 @@ int ATVMod::getSampleRateUnits(ATVStd std)
case ATVStdPAL525:
return 1008000; // 64 * 15750
break;
+ case ATVStd525L20F:
+ return 735000; // 70 * 10500
+ break;
case ATVStdPAL625:
default:
return 1000000; // 64 * 15625 Exact MS/s - us
@@ -751,10 +754,10 @@ void ATVMod::applyStandard()
switch(m_config.m_atvStd)
{
case ATVStd405: // Follows loosely the 405 lines standard
- m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7/1.008 us)
- m_pointsPerBP = (uint32_t) roundf(4.7f * m_pointsPerTU); // back porch (4.7/1.008 us)
- m_pointsPerFP = (uint32_t) roundf(1.5f * m_pointsPerTU); // front porch (1.5/1.008 us)
- m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/1.008 us)
+ m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7/0.729 us)
+ m_pointsPerBP = (uint32_t) roundf(4.7f * m_pointsPerTU); // back porch (4.7/0.729 us)
+ m_pointsPerFP = (uint32_t) roundf(1.5f * m_pointsPerTU); // front porch (1.5/0.729 us)
+ m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/0.729 us)
// what is left in a 72/0.729 us line for the image
m_pointsPerImgLine = 72 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
m_nbLines = 405;
@@ -792,6 +795,27 @@ void ATVMod::applyStandard()
m_vBarIncrement = m_spanLevel / (float) m_nbBars;
m_fps = 30.0f;
break;
+ case ATVStd525L20F: // PAL M based 20 FPS
+ m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7/0.735 us)
+ m_pointsPerBP = (uint32_t) roundf(4.7f * m_pointsPerTU); // back porch (4.7/0.735 us)
+ m_pointsPerFP = (uint32_t) roundf(2.3f * m_pointsPerTU); // front porch (2.3/0.735 us)
+ m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/0.735 us)
+ // what is left in a 70/0.735 us line for the image
+ m_pointsPerImgLine = 70 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
+ m_nbLines = 525;
+ m_nbLines2 = 263;
+ m_nbImageLines = 510;
+ m_nbImageLines2 = 255;
+ m_interlaced = true;
+ m_nbHorizPoints = 70 * m_pointsPerTU; // full line
+ m_nbSyncLinesHead = 5;
+ m_nbBlankLines = 15; // yields 480 lines (255 - 15) * 2
+ m_pointsPerHBar = m_pointsPerImgLine / m_nbBars;
+ m_linesPerVBar = m_nbImageLines2 / m_nbBars;
+ m_hBarIncrement = m_spanLevel / (float) m_nbBars;
+ m_vBarIncrement = m_spanLevel / (float) m_nbBars;
+ m_fps = 20.0f;
+ break;
case ATVStdPAL625: // Follows PAL-B/G/H standard
default:
m_pointsPerSync = (uint32_t) roundf(4.7f * m_pointsPerTU); // normal sync pulse (4.7 us)
diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h
index 763d040b8..9b8f2f119 100644
--- a/plugins/channeltx/modatv/atvmod.h
+++ b/plugins/channeltx/modatv/atvmod.h
@@ -42,6 +42,7 @@ public:
{
ATVStdPAL625,
ATVStdPAL525,
+ ATVStd525L20F,
ATVStd405
} ATVStd;
diff --git a/plugins/channeltx/modatv/atvmodgui.ui b/plugins/channeltx/modatv/atvmodgui.ui
index 720717521..8fddcdd33 100644
--- a/plugins/channeltx/modatv/atvmodgui.ui
+++ b/plugins/channeltx/modatv/atvmodgui.ui
@@ -405,6 +405,11 @@
PAL525L
+ -
+
+ 525L20F
+
+
-
405L