What drives decisions by autonomous vehicles in dire situations?

Despite dramatic reductions in accident-related fatalities, injuries and damages, as well as significant improvements in transportation efficiency and safety, consumers aren’t as excited about the promise of autonomous vehicles as the auto industry is. Research shows that people are nervous about life-and-death driving decisions being made by algorithms rather than by humans. Who determines the ethics of the algorithms?