adx: move header decoding to ADX common code