Magnetic and optical anomalies in infinite-layer iron oxide CaFeO2 and BaFeO2: A density functional theory investigation