[FFmpeg-devel] [PATCH] avcodec/jpeglsdec: Implement the 4th transform

Michael Niedermayer michaelni at gmx.at
Thu Jul 11 19:38:56 CEST 2013


Fixes remainder of Ticket893

Some artifacts remain

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/jpeglsdec.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index d9eb8e8..8e6ef3a 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -391,6 +391,15 @@ 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]                            - 1.402   * (src[x+2]-128) + 0.5;
+                        int g    = src[x+0] - 0.34413 * (src[x+1]-128) + 0.71414 * (src[x+2]-128) + 0.5;
+                        src[x+2] = src[x+0] + 1.772   * (src[x+1]-128) + 0.5;
+                        src[x+0] = r;
+                        src[x+1] = g;
+                    }
+                    break;
                 }
                 src += s->picture.linesize[0];
             }
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list