A method of processing a stream of data values in a data processing system, the method comprising: processing, in each of a plurality of iterations, a respective particular data value of the stream by operating on a respective particular subset of data values of the stream, wherein a particular subset of data values represents a block of data values which includes and surrounds the corresponding particular data value, wherein the processing comprises, in each of the plurality of iterations: retrieving group indication data which indicates a range of values of at least one group defined for a previous subset of data values, wherein the particular subset of data values at least partially overlaps with the previous subset of data values; using the retrieved group indication data to define, for the particular subset of data values in the current iteration, a set of groups, each defined by a respective range of values, into which data values within the particular subset can be grouped; classifying each of the data values within the particular subset into one of the groups of the set of groups based on the value of that data value; processing the particular data value using one or more of the data values of the particular subset in dependence on the classification of the data values of the particular subset into the groups; and storing group indication data for at least one group of the set of groups defined for the particular subset of data values in the current iteration, for use in a subsequent iteration; wherein the method further comprises outputting the processed data values. processing, in each of a plurality of iterations, a respective particular data value of the stream by operating on a respective particular subset of data values of the stream, wherein a particular subset of data values represents a block of data values which includes and surrounds the corresponding particular data value, wherein the processing comprises, in each of the plurality of iterations: retrieving group indication data which indicates a range of values of at least one group defined for a previous subset of data values, wherein the particular subset of data values at least partially overlaps with the previous subset of data values; using the retrieved group indication data to define, for the particular subset of data values in the current iteration, a set of groups, each defined by a respective range of values, into which data values within the particular subset can be grouped; classifying each of the data values within the particular subset into one of the groups of the set of groups based on the value of that data value; processing the particular data value using one or more of the data values of the particular subset in dependence on the classification of the data values of the particular subset into the groups; and storing group indication data for at least one group of the set of groups defined for the particular subset of data values in the current iteration, for use in a subsequent iteration; retrieving group indication data which indicates a range of values of at least one group defined for a previous subset of data values, wherein the particular subset of data values at least partially overlaps with the previous subset of data values; using the retrieved group indication data to define, for the particular subset of data values in the current iteration, a set of groups, each defined by a respective range of values, into which data values within the particular subset can be grouped; classifying each of the data values within the particular subset into one of the groups of the set of groups based on the value of that data value; processing the particular data value using one or more of the data values of the particular subset in dependence on the classification of the data values of the particular subset into the groups; and storing group indication data for at least one group of the set of groups defined for the particular subset of data values in the current iteration, for use in a subsequent iteration; wherein the method further comprises outputting the processed data values.