diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-06 17:45:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-08 00:18:36 +0100 |
commit | 2d6f317d7183d043dafecc7ec76f5ec5bcb07bf9 (patch) | |
tree | 1ae09350a1c2be1a58b6cb73c418194e2ea6ca2a /libavcodec/jpeglsdec.c | |
parent | bbe25b4f3ebb5f7436d066a787e9ebf964aca1d0 (diff) | |
download | ffmpeg-2d6f317d7183d043dafecc7ec76f5ec5bcb07bf9.tar.gz |
jpegdec: support ilv=1 grayscale jpeg-ls.
Fixes Ticket851
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeglsdec.c')
-rw-r--r-- | libavcodec/jpeglsdec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 5e98b64644..0139c8860f 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -309,11 +309,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor } else if(ilv == 1) { /* line interleaving */ int j; int Rc[3] = {0, 0, 0}; + stride = (s->nb_components > 1) ? 3 : 1; memset(cur, 0, s->picture.linesize[0]); - width = s->width * 3; + width = s->width * stride; for(i = 0; i < s->height; i++) { - for(j = 0; j < 3; j++) { - ls_decode_line(state, s, last + j, cur + j, Rc[j], width, 3, j, 8); + for(j = 0; j < stride; j++) { + ls_decode_line(state, s, last + j, cur + j, Rc[j], width, stride, j, 8); Rc[j] = last[j]; if (s->restart_interval && !--s->restart_count) { |