hevc/refs: remove duplicated code