If a twin cylinder opposed twin, as Noel and Jason say, the compression ratio is (swept volume + combustion volume) / combustion volume., so the ratio would be calculated for each cylinder.
The engine capacity, is the swept volume of all the cylinders (A 125 twin would have a swept volume of 62.5 cc in each cylinder)
In an opposed piston engine (Such a Deltic, Commer TS3, or Rolls-Royce K Series) the “swept” volume will be the volume (Bore area x stroke) when both pistons are at maximum separation, (To provide port timings, they may not both be at bdc at the same time)
The compression ratio will be that volume divided by the combustion volume, when both pistons are at minimum distance.
The Rolls -Royce K Series varied the compression ratio, to allow running on different fuels (It was known colloquially as the peanut butter engine) by changing the phasing of the two crankshafts.
The different phasing altered the port timings which also had an effect on actual, (as opposed ro theoretical) compression ratio, depending of gas inertia effects.
Compression ratio affects the air standard efficiency of an engine, which is why the increase of compression ration from 7.3 to 8.3 resulted in a greater output from the BMC “A” Series engine than just the increase in swept volume from 803cc to 945cc (The contemporary Standard 8 and 10 also increased their C R at about the same time)
Howard