The PCNT (Pulse Counter) module is designed to count the number of rising and/or falling edges of an input signal. Each pulse counter unit has a 16-bit signed counter register and two channels that can be configured to either increment or decrement the counter. Each channel has a signal input that accepts signal edges to be detected, as well as a control input that can be used to enable or disable the signal input. The inputs have optional filters that can be used to discard unwanted glitches in the signal.The PCNT module has eight independent counting "units" numbered from 0 to 7. In the API they are referred to using pcnt_unit_t. Each unit has two independent channels numbered as 0 and 1 and specified with pcnt_channel_t.https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/pcnt.html
For the counter not to miss any pulses, the pulse duration should be longer than one APB_CLK cycle (12.5 ns).