An apparatus for encoding a block of an image using intra-prediction coding comprising a processor, wherein the processor is configured to: obtain the block of the image; process data associated to the block using a convolutional neural network comprising a first convolutional layer, a second convolutional layer, a pooling layer, a first fully-connected layer and a second fully-connected layer, wherein the convolutional neural network is trained to select an intra-prediction mode from a set of pre-determined intra-prediction modes; perform intra-prediction processing for the block according to the selected intra-prediction mode; characterised in that: the first convolutional layer is configured to receive the data associated to the block and to apply first filter kernels with a first predetermined stride to obtain a first convolutional output data; the second convolutional layer is configured to receive the first convolutional output data and to apply second filter kernels with a second predetermined stride to obtain a second convolutional output data; the pooling layer is configured to receive the second convolutional output data and reduce spatial resolution of the second convolutional output data; the first fully-connected layer is configured to multiply the second convolutional output data by weights and summed per neuron; and the second fully-connected layer is configured to classify outputs of the first fully-connected layer into predetermined intra prediction modes wherein a size of the second filter kernel is dependent on a size of the block and the size of the second filter kernel in the case where the block is not smaller than 16 × 16 is larger than the size of the second filter kernel in the case where the block is smaller than 16 × 16. obtain the block of the image; process data associated to the block using a convolutional neural network comprising a first convolutional layer, a second convolutional layer, a pooling layer, a first fully-connected layer and a second fully-connected layer, wherein the convolutional neural network is trained to select an intra-prediction mode from a set of pre-determined intra-prediction modes; perform intra-prediction processing for the block according to the selected intra-prediction mode; characterised in that: the first convolutional layer is configured to receive the data associated to the block and to apply first filter kernels with a first predetermined stride to obtain a first convolutional output data; the second convolutional layer is configured to receive the first convolutional output data and to apply second filter kernels with a second predetermined stride to obtain a second convolutional output data; the pooling layer is configured to receive the second convolutional output data and reduce spatial resolution of the second convolutional output data; the first fully-connected layer is configured to multiply the second convolutional output data by weights and summed per neuron; and the second fully-connected layer is configured to classify outputs of the first fully-connected layer into predetermined intra prediction modes the first convolutional layer is configured to receive the data associated to the block and to apply first filter kernels with a first predetermined stride to obtain a first convolutional output data; the second convolutional layer is configured to receive the first convolutional output data and to apply second filter kernels with a second predetermined stride to obtain a second convolutional output data; the pooling layer is configured to receive the second convolutional output data and reduce spatial resolution of the second convolutional output data; the first fully-connected layer is configured to multiply the second convolutional output data by weights and summed per neuron; and the second fully-connected layer is configured to classify outputs of the first fully-connected layer into predetermined intra prediction modes wherein a size of the second filter kernel is dependent on a size of the block and the size of the second filter kernel in the case where the block is not smaller than 16 × 16 is larger than the size of the second filter kernel in the case where the block is smaller than 16 × 16.