diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-03 19:02:59 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-08 04:28:52 +0100 |
commit | 3aee27a9751bcf6c35e89e7a1a01e67e5f6351f7 (patch) | |
tree | ac38e75f94b69c454e6b3dc3a441ba462c2fa4ab /libavfilter | |
parent | fefe69c5c9c6d4cfa2b1329a72a805ffd89a97c3 (diff) | |
download | ffmpeg-3aee27a9751bcf6c35e89e7a1a01e67e5f6351f7.tar.gz |
avcodec/jpeglsenc: Only use one line at a time as spare buffer
ls_encode_line() encodes one line of input from left to right and
to do so it uses the values of the left, upper left, upper and upper
right pixels for prediction (i.e. the values that a decoder gets when it
decodes the already encoded part of the picture). So a simple algorithm
would use a buffer that can hold two lines, namely the current line as
well as the last line and swap the pointers to the two lines after
decoding each line. Yet if one is currently encoding the pixel with
index k of a line, one doesn't need any pixel with index < k - 1 of the
last line at all and similarly, no pixels with index >= k have been
written yet. So the overlap in the effective lifetime is pretty limited
and since the last patch (which stopped reading the upper left pixel and
instead reused the value of the upper pixel from the last iteration of
the loop) it is inexistent. Ergo one only needs one line and doesn't
need to swap the lines out.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter')
0 files changed, 0 insertions, 0 deletions