An apparatus for encoding one or more blocks of a picture, the one or more blocks comprising a first block (405, 505), the first block comprising a set of data indicative of a first portion of the picture, the apparatus comprising: a memory unit configured to store a hash table that includes one or more entries, each entry being indicative of one or more blocks of the picture, each entry having an associated hash index, the entries of the hash table being indicative only of blocks of the picture that have previously been encoded; and a processor operationally coupled to the memory unit and configured to: apply a hash function to the first block (405, 505) to determine a first hash index; identify an entry in the hash table associated with the first hash index; identify, from the hash table, one or more reference blocks that are previously encoded blocks from the same picture, the identified one or more reference blocks being indicated at the identified entry associated with the first hash index; select a prediction block from among the one or more reference blocks based on a comparison of the first block (405, 505) to the one or more reference blocks, the selected prediction block being used for reconstructing the first block (405, 505); encode the first block (405, 505) based on the selected prediction block, wherein after the first block (405, 505) is reconstructed the first block is added to the hash table as a newly available reference block for the prediction of later-encoded blocks within the same picture. a memory unit configured to store a hash table that includes one or more entries, each entry being indicative of one or more blocks of the picture, each entry having an associated hash index, the entries of the hash table being indicative only of blocks of the picture that have previously been encoded; and a processor operationally coupled to the memory unit and configured to: apply a hash function to the first block (405, 505) to determine a first hash index; identify an entry in the hash table associated with the first hash index; identify, from the hash table, one or more reference blocks that are previously encoded blocks from the same picture, the identified one or more reference blocks being indicated at the identified entry associated with the first hash index; select a prediction block from among the one or more reference blocks based on a comparison of the first block (405, 505) to the one or more reference blocks, the selected prediction block being used for reconstructing the first block (405, 505); encode the first block (405, 505) based on the selected prediction block, wherein after the first block (405, 505) is reconstructed the first block is added to the hash table as a newly available reference block for the prediction of later-encoded blocks within the same picture. apply a hash function to the first block (405, 505) to determine a first hash index; identify an entry in the hash table associated with the first hash index; identify, from the hash table, one or more reference blocks that are previously encoded blocks from the same picture, the identified one or more reference blocks being indicated at the identified entry associated with the first hash index; select a prediction block from among the one or more reference blocks based on a comparison of the first block (405, 505) to the one or more reference blocks, the selected prediction block being used for reconstructing the first block (405, 505); encode the first block (405, 505) based on the selected prediction block, wherein after the first block (405, 505) is reconstructed the first block is added to the hash table as a newly available reference block for the prediction of later-encoded blocks within the same picture.