Update depacketizer to using the same algorithm as the Java version for decreased CPU load