Add generic codec implementation