program stored therein, which are characterized by what is stated in the independent claims. Various embodiments of the invention are disclosed in the dependent claims. According to a first aspect, there is provided a method comprising receiving input data divided into a plurality of blocks; overfitting a first neural encoder network for a first block of the data based on a baseline encoder network; encoding the first block by the first overfitted neural encoder network; overfitting a second neural encoder network for at least one subsequent block of the data based on a combination of neural encoder networks used for previous blocks and/or the baseline encoder network; and encoding the at least one subsequent block by the second overfitted neural encoder network. According to a second aspect, there is provided a method for a neural decoder network comprising receiving a block residual defining a difference between an original block of data and a decoded block of the data; based on the residual, recovering the original block to be used as ground-truth data; and overfitting the neural decoder network based on the ground-truth data. According to a third aspect, there is provided an apparatus comprising at least one processor, memory including computer program code, the memory and the computer program code configured to, with the at least one processor, cause the apparatus to receive input data divided into a plurality of blocks; overfit a first neural encoder network for a first block of the data based on a baseline encoder network; encode the first block by the first overfitted neural encoder network; overfit a second neural encoder network for at least one subsequent block of data based on a combination of neural networks used for previous blocks and/or the baseline encoder network; and encode the at least one subsequent block by the second overfitted neural encoder network. According to an embodiment, the apparatus further configured to determine which one of the overfitted neural encoder networks performs the best; and select such overfitted neural encoder network for a current block. According to an embodiment, the performance is determined according to one or both of the following aspects: a reconstruction quality or a bitrate.