a method of encoding one or more parent blocks of values , the number of values being the length of each block , the method comprising for each parent block : determining a first sum of values in the parent block ; 1 splitting the parent block into smaller subblocks ; for at least one of the subblocks , determining a second sum of the values in the subblock , selecting a likelihood table from the plurality of likelihood tables based on said first sum of values in the parent block and encoding the second sum using the likelihood table ; designating each subblock a parent block ; carrying out steps , , and until at least one parent block reaches a predetermined condition .