On Sat, Sep 05, 2020 at 01:17:11AM +0200, Andreas Rheinhardt wrote: > ls_encode_line() encodes a line of input, going from left to right. In > order to calculate a predicted value it uses the left and upper-left > value of the output picture (that is, it uses how a decoder would see > the already encoded part of the picture), unless this is the very first > pixel of this line in which case one uses the first pixel of the last > (upper) line and the line before the last line. Therefore the loop > contained a check for whether this is the beginning of a new line. This > commit moves said check out of the loop by initializing these values > before the loop and by updating these values at the end of the loop > body; already read/calculated values are reused for this (the prediction > also needs the value of the upper pixel and this can be reused for the > upper left value of the next iteration of the loop). > > Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> > --- > libavcodec/jpeglsenc.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) >
probably ok _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".