Structural changes in YBa2Cu4O8 have been studied as a function of pressure using TOF neutron powder diffraction with a sample in a helium-gas pressure cell. Its structure contains double chains of edge-sharing [CuO4] squares and two-dimensional CuO2 planes. The distance between an apical oxygen atom and an in-plane copper atom decreases with increasing pressure. The distance between barium and oxygen atoms in the chain and between in-plane copper atoms located on both sides of a Y layer also change significantly with pressure. All of these movements of atoms are closely related to charge transfer from the CuO chain to the CuO2 plane. Calculation of Madelung energies based on our structural parameters shows that the concentration of holes in the conducting CuO2 plane increases appreciably with increasing pressure, which is in good agreement with the observed rise in Tc under high pressure.