aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-03 18:39:43 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-08 04:15:10 +0100
commitfefe69c5c9c6d4cfa2b1329a72a805ffd89a97c3 (patch)
tree43bd816db15c61d199908d19a6c5a20fa40ed3bd /libavfilter
parent0788a74876e5dffb7c41aef874ab7776b49f718c (diff)
downloadffmpeg-fefe69c5c9c6d4cfa2b1329a72a805ffd89a97c3.tar.gz
avcodec/jpeglsenc: Move check out of loop
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). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter')
0 files changed, 0 insertions, 0 deletions