   // subtract the amount for sync-to-blanking-end 9.48μs.
   x -= 10;
 
-  // on 8MHz Arduinos micros() has a resolution of 8μs.
+  // on 8MHz/16MHz Arduinos micros() has a resolution of 8μs/4μs respectively.
   // actual brightness information Arduino Pro Mini 8MHz can capture from each scan line is only 5 (or 6) samples. 
-  x >>= 2; 
+  x >>= 2;
+#if F_CPU == 16000000 // overclocked Arduino Pro Mini
+  // store two bit per interrupt.
+  if ((ACSR & (1 << ACO))) {
+      // AIN+ > AIN-
+      line[x >> 3] |= (image_t)1 << ((x & B111) << 1);
+  } else {
+      // AIN+ > AIN-
+      line[x >> 3] |= (image_t)1 << (((x & B111) << 1) | 1);
+  }
+#else // F_CPU == 8000000
   // store two bit per interrupt.
   if ((ACSR & (1 << ACO))) {
     // AIN+ > AIN-

//   D7 (AIN1) : Analog comparator negative input. (voltage to compare)
//   D9 (PWM)  : Constant reference PWM voltage for brightness threshold.

#if defined(__MK20DX256__) // Teensy 3.1

// No library exists for Freescale MK20DX256 processor's 
// built-in CMP module, so we need to do it in low level...
#define CMP_SCR_DMAEN   ((uint8_t)0x40) // DMA Enable Control
#define CMP_SCR_IER     ((uint8_t)0x10) // Comparator Interrupt Enable Rising
#define CMP_SCR_IEF     ((uint8_t)0x08) // Comparator Interrupt Enable Falling
#define CMP_SCR_CFR     ((uint8_t)0x04) // Analog Comparator Flag Rising
#define CMP_SCR_CFF     ((uint8_t)0x02) // Analog Comparator Flag Falling
#define CMP_SCR_COUT    ((uint8_t)0x01) // Analog Comparator Output

#elif defined(REL_GR_KURUMI) // GR-KURUMI

// Renesas RL78/G13 has 10 external interrupts (INTP0-INTP6, INTP8, INTP9, INTKR)
// but GR-KURUMI made all of these pins unusable except

// In order to use D4 as an interrupt pin we need to do it low level. (sigh..)
// "How To Do It" documents about GR-KURUMI should be prepared...

#else // Arduino Pro Mini or Teensy 3.1

// The part of code utilizes the following library. Please download and install.
//   https://github.com/orangkucing/analogComp
//#include "analogComp.h" // *** please comment out this line if GR-KURUMI ***

#endif

// Bulk motion detection:
// volatile variables

volatile uint16_t interlace;
volatile uint16_t currentLine;
volatile uint16_t lastHsyncTime;
