When working with quadrature encoder hardware you can face three scenarios or should say ways to read the quadrature encoders pulses: X1, X2, X4.

In X1 mode only the rising pulse is considered. For example if channel A rises while channel B is in low level, then it consider positive counting (clockwise). If channel A rises while channel B is in high level, then it is consider negative counting (counter-clockwise).

For X2 mode the rising and falling of channel A is considered. In this mode the counting is doubled compared to X1.

Finally in X4 mode the rising and falling of channels A and B are considered. In this mode the counting is quadruplicated in relation to X1 mode.

Source: https://www.motioncontroltips.com/faq-what-do-x1-x2-and-x4-position-encoding-mean-for-incremental-encoders/

Using ESP32 PCNT as QE: https://www.esp32.com/viewtopic.php?t=4983#p21497