codec independent approach