1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 03:41:47 -05:00

ATV Modulator: factorize vsync code. Use standard sync pulses at start of equalizing lines. New frame rates and number of lines

This commit is contained in:
f4exb 2017-04-03 17:23:20 +02:00
parent efad6f948c
commit 64b09910fd
3 changed files with 134 additions and 92 deletions

View File

@ -829,6 +829,84 @@ private:
}
}
inline void pullVSyncLineLongPulses(Real& sample)
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < (m_nbHorizPoints/2) - m_pointsPerSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
if (m_singleLongSync && (m_horizontalCount < m_nbHorizPoints/2)) {
sample = 0.0f;
} else {
sample = m_blackLevel;
}
}
}
inline void pullVSyncLineEqualizingPulses(Real& sample)
{
if (m_horizontalCount < m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else if (m_horizontalCount < (m_nbHorizPoints/2))
{
sample = m_blackLevel; // black
}
else if (m_horizontalCount < (m_nbHorizPoints/2) + m_pointsPerFSync)
{
sample = 0.0f; // ultra-black
}
else
{
sample = m_blackLevel; // black
}
}
inline void pullVSyncLineEqualizingThenLongPulses(Real& sample)
{
if (m_horizontalCount < m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else if (m_horizontalCount < (m_nbHorizPoints/2))
{
sample = m_blackLevel; // black
}
else if (m_horizontalCount < m_nbHorizPoints - m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else
{
sample = m_blackLevel; // black
}
}
inline void pullVSyncLineLongThenEqualizingPulses(Real& sample)
{
if (m_horizontalCount < (m_nbHorizPoints/2) - m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else if (m_horizontalCount < (m_nbHorizPoints/2))
{
sample = m_blackLevel; // black
}
else if (m_horizontalCount < (m_nbHorizPoints/2) + m_pointsPerFSync)
{
sample = 0.0f; // ultra-black
}
else
{
sample = m_blackLevel; // black
}
}
inline void pullVSyncLine(Real& sample)
{
if (m_lineCount < m_nbLines2 + 1) // even
@ -837,80 +915,23 @@ private:
if (fieldLine < m_nbLongSyncLines) // 0,1: Whole line "long" pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < (m_nbHorizPoints/2) - m_pointsPerSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineLongPulses(sample);
}
else if (fieldLine < m_nbLongSyncLines + m_nbHalfLongSync) // long pulse then equalizing pulse
{
if (m_horizontalCount < (m_nbHorizPoints/2) - m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else if (m_horizontalCount < (m_nbHorizPoints/2))
{
sample = m_blackLevel; // black
}
else if (m_horizontalCount < (m_nbHorizPoints/2) + m_pointsPerFSync)
{
sample = 0.0f; // ultra-black
}
else
{
sample = m_blackLevel; // black
}
pullVSyncLineLongThenEqualizingPulses(sample);
}
else if (fieldLine < m_nbLongSyncLines + m_nbHalfLongSync + m_nbWholeEqLines) // Whole line equalizing pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < m_pointsPerFSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineEqualizingPulses(sample);
}
else if (fieldLine > m_nbLines2 - m_nbHalfLongSync) // equalizing pulse then long pulse
{
if (m_horizontalCount < m_pointsPerFSync)
{
sample = 0.0f; // ultra-black
}
else if (m_horizontalCount < (m_nbHorizPoints/2))
{
sample = m_blackLevel; // black
}
else if (m_horizontalCount < m_nbHorizPoints - m_pointsPerSync)
{
sample = 0.0f; // ultra-black
}
else
{
sample = m_blackLevel; // black
}
pullVSyncLineEqualizingThenLongPulses(sample);
}
else if (fieldLine > m_nbLines2 - m_nbHalfLongSync - m_nbWholeEqLines) // Whole line equalizing pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < m_pointsPerFSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineEqualizingPulses(sample);
}
else // black images
{
@ -930,42 +951,15 @@ private:
if (fieldLine < m_nbLongSyncLines) // 0,1: Whole line "long" pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < (m_nbHorizPoints/2) - m_pointsPerSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineLongPulses(sample);
}
else if (fieldLine < m_nbLongSyncLines + m_nbWholeEqLines) // Whole line equalizing pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < m_pointsPerFSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineEqualizingPulses(sample);
}
else if (fieldLine > m_nbLines2 - 1 - m_nbWholeEqLines - m_nbHalfLongSync) // Whole line equalizing pulses
{
int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
if (halfIndex < m_pointsPerFSync) // ultra-black
{
sample = 0.0f;
}
else // black
{
sample = m_blackLevel;
}
pullVSyncLineEqualizingPulses(sample);
}
else // black images
{

View File

@ -276,6 +276,18 @@ int ATVModGUI::getNbLines()
case 2:
return 405;
break;
case 3:
return 343;
break;
case 4:
return 240;
break;
case 5:
return 180;
break;
case 6:
return 90;
break;
case 0:
default:
return 625;
@ -296,6 +308,12 @@ int ATVModGUI::getFPS()
case 3:
return 16;
break;
case 4:
return 12;
break;
case 5:
return 10;
break;
case 1:
default:
return 25;

View File

@ -554,6 +554,26 @@
<string>405</string>
</property>
</item>
<item>
<property name="text">
<string>343</string>
</property>
</item>
<item>
<property name="text">
<string>240</string>
</property>
</item>
<item>
<property name="text">
<string>180</string>
</property>
</item>
<item>
<property name="text">
<string>90</string>
</property>
</item>
</widget>
</item>
<item>
@ -594,6 +614,16 @@
<string>16</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
</property>
</item>
<item>
<property name="text">
<string>10</string>
</property>
</item>
</widget>
</item>
<item>