[utils] add helper function for parsing codecs