1. A method for coding, in a video encoder, a block of pixels, called the current block, comprising: determining a prediction pixel for each pixel of said current block, extracting from said current block a prediction block formed of said prediction pixels to generate a residue block, coding said residue block, wherein the determining a prediction pixel for each pixel of said current block comprises: applying a first transform on a window covering at least said pixel of said current block to obtain coefficients; thresholding the obtained coefficients with a current threshold value; and applying an inverse transform of said first transform on said obtained coefficients to obtain said prediction pixel; said method for coding further comprising: determining, for each reconstructed pixel in a causal neighboring area of the current block, a prediction pixel by thresholding, with a threshold value of a plurality of threshold values, of coefficients resulting from a transformation applied on a window covering at least said reconstructed pixel and by inverse transformation applied to said thresholded coefficients, iterating, with each threshold value of said plurality of threshold values, said determining of a prediction pixel for each pixel of said causal neighboring area, selecting, from among the plurality of threshold values, a threshold value for which a prediction error calculated between the reconstructed pixels of the causal neighboring area of the current block and the corresponding prediction pixels is the smallest; and coding said current threshold value from said selected threshold value.