From 289cd4cebdba012ee617566c566a17660c143d4c Mon Sep 17 00:00:00 2001 From: IanSB Date: Fri, 11 Feb 2022 20:33:31 +0000 Subject: [PATCH] Change field type threshold to 40000 see #272 --- src/defs.h | 3 ++- src/rgb_to_hdmi.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/defs.h b/src/defs.h index 5ff61741..b14c78c4 100644 --- a/src/defs.h +++ b/src/defs.h @@ -350,7 +350,8 @@ typedef struct { #define YUV_VERSION 0x91 //these defines are adjusted for different clock speeds -#define FIELD_TYPE_THRESHOLD 45000 // post frame sync times are ~22uS & ~54uS on beeb and ~34uS and ~66uS on Amiga so threshold of 45uS covers both +#define FIELD_TYPE_THRESHOLD_BBC 39000 // post frame sync times are ~22uS & ~54uS on beeb and ~34uS and ~66uS on Amiga so threshold of 45uS covers both +#define FIELD_TYPE_THRESHOLD_AMIGA 45000 // post frame sync times are ~22uS & ~54uS on beeb and ~34uS and ~66uS on Amiga so threshold of 45uS covers both #define ELK_LO_FIELD_SYNC_THRESHOLD 150000 // 150uS #define ELK_HI_FIELD_SYNC_THRESHOLD 170000 // 170uS #define ODD_THRESHOLD 22500 diff --git a/src/rgb_to_hdmi.c b/src/rgb_to_hdmi.c index 13559937..9605a0c1 100644 --- a/src/rgb_to_hdmi.c +++ b/src/rgb_to_hdmi.c @@ -872,8 +872,10 @@ void set_pll_frequency(double f, int pll_ctrl, int pll_fract) { void set_hsync_threshold() { if (capinfo->vsync_type == VSYNC_INTERLACED) { equalising_threshold = EQUALISING_THRESHOLD * cpuspeed / 1000; // if explicitly selecting interlaced then support filtering equalising pulses + field_type_threshold = FIELD_TYPE_THRESHOLD_AMIGA * cpuspeed / 1000; } else { equalising_threshold = 100 * cpuspeed / 1000; // otherwise only filter very small pulses (0.1us) which might be glitches + field_type_threshold = FIELD_TYPE_THRESHOLD_BBC * cpuspeed / 1000; } if (capinfo->vsync_type == VSYNC_BLANKING) { normal_hsync_threshold = BLANKING_HSYNC_THRESHOLD * cpuspeed / 1000; @@ -1638,7 +1640,6 @@ static int old_cpuspeed = 0; log_info("CPU speed detected as: %d Mhz", cpuspeed); old_cpuspeed = cpuspeed; } - field_type_threshold = FIELD_TYPE_THRESHOLD * cpuspeed / 1000; elk_lo_field_sync_threshold = ELK_LO_FIELD_SYNC_THRESHOLD * cpuspeed / 1000; elk_hi_field_sync_threshold = ELK_HI_FIELD_SYNC_THRESHOLD * cpuspeed / 1000; odd_threshold = ODD_THRESHOLD * cpuspeed / 1000;