configuring ADC for mega2560 adapted from leonardo

I have some great code from fixed point | FreeIO
to do sound localization. There’s an updated link to the full sketch at the bottom of:
Updated link to code at

It’s very demanding for processing, so needs to be configured correctly. He developed it on a Leonardo board, but I need to run it on a Mega2560. I understand the signal processing stuff and most of the rest in the sketch, but I’m having trouble with configuring the Analog to Digital. He configures the A/D Control Status Registers as follows:

ADCSRA = ((1<< ADEN)| // 1 = ADC Enable
(0<< ADSC)| // ADC Start Conversion
(1<<ADATE)| // 1 = ADC Auto Trigger Enable
(0<< ADIF)| // ADC Interrupt Flag
(0<< ADIE)| // ADC Interrupt Enable
(0<<ADPS1)| // ADC Prescaler Selects 1 MHz.

ADCSRB = ((1<<ADHSM)| // High Speed mode select
(1<< MUX5)| // 1 (10100) ADC1<->ADC4 Gain = 200x.
(0<<ADTS2)| // Sets Auto Trigger source - TIMER0 OCA

This compiles fine for the Leonardo, but the ADHSM and ADTS3 are not known for the Mega 2560.
I looked at the datasheets, and it appears that the ADTS3 is 3 on the Leonardo but bit 3 is Mux5 on the Mega (I’m guessing I could leave it out). ADHSM to set high speed mode is 7 on Leonardo but apparently undefined on the Mega. Seems necessary to accomplish this somehow.

Can someone advise me how to set these 2 parameters, and if you see any other problem with leaving everything else as he has it–this is a blind spot for me, but this code is important for me to master.

Let me add that it looks like I could leave out the ADTS3 because the mega2560 spec only goes from ADTS0 to ADTS2 and the ADTS3 in this sketch gets set to 0 anyway.

So I THINK the only question is setting high speed mode, which on the Leonardo is done by setting bit 7 of the ADCSRB register to 1 (confirmed on the datasheet), but bit 7 is undefined for ADCSRB on the Mega2560 datasheet and ADHSM doesn't exist there. How can I set high speed mode, or is it even necessary?

And any other comments from someone who knows about Leonardo - Mega 2560 compatibility?