Are you sure it is not the playback device that is changing the volume on certain codecs?
Otherwise, the AC-3 Dolby 'Studio' encoder had a 'fixed' loudness level that could not be changed. The AC-3 'Pro' encoder had loudness options. Maybe the preset being used is to blame.