Method and system for decoding variable length encoded signals, computer program product therefor