Resonant x-ray scattering study of the antiferroelectric and ferrielectric phases in liquid crystal devices.