I found this online:
http://home.weblung.org/meyer/hydroge2.htm
“Direct high pressure hydrogen injection is the most efficient application in internal combustion engines. Injection is provided after the closing of the valves. Ignition is done with a spark or glow plug. Preignition is decreased by using this application. Since hydrogen does not displace air in the cylinder, it provides better volumetric efficiency which means higher power.”
Hydrogen has an energy density of 143 MJ/kg at STP, and compression causes it increase. Diesel has an energy density of 45.8 MJ/kg, and compression only effects burn rate, not energy density.
So, the answer to your question is: No, hydrogen does not have the same energy density as diesel. It is much higher.
So you either have much less energy in the same volume, or so much pressure there is no way to intake air for combustion.