hevc: reduce variable scope