From 8c4be4593568c7d03e2936051125cea7cc98f798 Mon Sep 17 00:00:00 2001 From: Gamnn <44366267+Gamnn@users.noreply.github.com> Date: Thu, 13 Feb 2020 22:03:43 +0900 Subject: [PATCH 1/2] crack at #462 Output NTSC activeVideoEnd as 760 from activeVideoStart, if it doesn't exceed fieldWidth. There's probably a more elegant way to do this. --- lddecode/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lddecode/core.py b/lddecode/core.py index 604050a8a..041926381 100644 --- a/lddecode/core.py +++ b/lddecode/core.py @@ -3124,7 +3124,10 @@ def build_json(self, f): vp['colourBurstStart'] = np.round((f.rf.SysParams['colorBurstUS'][0] * spu) + badj) vp['colourBurstEnd'] = np.round((f.rf.SysParams['colorBurstUS'][1] * spu) + badj) vp['activeVideoStart'] = np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) - vp['activeVideoEnd'] = np.round((f.rf.SysParams['activeVideoUS'][1] * spu) + badj) + if self.rf.system == 'NTSC' and (np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) + 760 ) < f.rf.SysParams['outlinelen'] : + vp['activeVideoEnd'] = (np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) + 760 ) + else: + vp['activeVideoEnd'] = np.round((f.rf.SysParams['activeVideoUS'][1] * spu) + badj) jout['videoParameters'] = vp From 5f2eb48e96a55e4d4d8f1006608c19d5d1d10071 Mon Sep 17 00:00:00 2001 From: Gamnn <44366267+Gamnn@users.noreply.github.com> Date: Fri, 14 Feb 2020 17:03:27 +0900 Subject: [PATCH 2/2] adjust NTSC activeVideo parameters for 760 width This seems to work, and is more elegant than the previous attempt. --- lddecode/core.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lddecode/core.py b/lddecode/core.py index 041926381..612ce52b5 100644 --- a/lddecode/core.py +++ b/lddecode/core.py @@ -75,7 +75,7 @@ def calclinelen(SP, mult, mhz): 'audio_rfreq': (1000000*315/88/227.5) * 178.75, 'colorBurstUS': (5.3, 7.8), - 'activeVideoUS': (9.45, 63.555-1.5), + 'activeVideoUS': (9.45, 63.555-1.0), # In NTSC framing, the distances between the first/last eq pulses and the # corresponding next lines are different. @@ -90,7 +90,7 @@ def calclinelen(SP, mult, mhz): # In color NTSC, the line period was changed from 63.5 to 227.5 color cycles, # which works out to 63.555(with a bar on top) usec SysParams_NTSC['line_period'] = 1/(SysParams_NTSC['fsc_mhz']/227.5) -SysParams_NTSC['activeVideoUS'] = (9.45, SysParams_NTSC['line_period'] - 1.5) +SysParams_NTSC['activeVideoUS'] = (9.45, SysParams_NTSC['line_period'] - 1.0) SysParams_NTSC['FPS'] = 1000000/ (525 * SysParams_NTSC['line_period']) @@ -3124,10 +3124,7 @@ def build_json(self, f): vp['colourBurstStart'] = np.round((f.rf.SysParams['colorBurstUS'][0] * spu) + badj) vp['colourBurstEnd'] = np.round((f.rf.SysParams['colorBurstUS'][1] * spu) + badj) vp['activeVideoStart'] = np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) - if self.rf.system == 'NTSC' and (np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) + 760 ) < f.rf.SysParams['outlinelen'] : - vp['activeVideoEnd'] = (np.round((f.rf.SysParams['activeVideoUS'][0] * spu) + badj) + 760 ) - else: - vp['activeVideoEnd'] = np.round((f.rf.SysParams['activeVideoUS'][1] * spu) + badj) + vp['activeVideoEnd'] = np.round((f.rf.SysParams['activeVideoUS'][1] * spu) + badj) jout['videoParameters'] = vp