[FFmpeg-cvslog] avcodec/jpeglsdec: Implement the 4th (lossy) transform

Michael Niedermayer git at videolan.org
Fri Jul 12 17:53:03 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jul 11 19:37:29 2013 +0200| [8aea97a49d19a12691bc82ed97705053cfdb6ad2] | committer: Michael Niedermayer

avcodec/jpeglsdec: Implement the 4th (lossy) transform

Fixes remainder of Ticket893

Std deviation from the intended image is 0.11, max sample error +-1

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8aea97a49d19a12691bc82ed97705053cfdb6ad2
---

 libavcodec/jpeglsdec.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index d9eb8e8..0e344f5 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -391,6 +391,16 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
                         src[x+1] = g;
                     }
                     break;
+                case 4:
+                    for (x = off; x < w; x += 3) {
+                        int r    = src[x+0] - ((                       359 * (src[x+2]-128) + 490) >> 8);
+                        int g    = src[x+0] - (( 88 * (src[x+1]-128) - 183 * (src[x+2]-128) +  30) >> 8);
+                        int b    = src[x+0] + ((454 * (src[x+1]-128)                        + 574) >> 8);
+                        src[x+0] = av_clip_uint8(r);
+                        src[x+1] = av_clip_uint8(g);
+                        src[x+2] = av_clip_uint8(b);
+                    }
+                    break;
                 }
                 src += s->picture.linesize[0];
             }



More information about the ffmpeg-cvslog mailing list