hevc: move splitting the packet into NALUs into a separate function