[FFmpeg-devel] [PATCH v17 15/15] lavc/tiff: Enable decoding of LinearRaw images

2019-08-29 Thread Nick Renieris
From: Nick Renieris "LinearRaw" is a value that the PhotometricInterpretation tag can be set to on DNG images that contain color information for all channels instead of being bayer-encoded ("CFA" value). The DNG decoder is complete enough that we can enable this

[FFmpeg-devel] [PATCH v17 14/15] lavc/tiff: Default-initialize WhiteLevel DNG tag value

2019-08-29 Thread Nick Renieris
From: Nick Renieris Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --

[FFmpeg-devel] [PATCH v17 08/15] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-29 Thread Nick Renieris
From: Nick Renieris This fixes "X7 RAW" and "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/lib

[FFmpeg-devel] [PATCH v17 10/15] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-29 Thread Nick Renieris
From: Nick Renieris This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file c

[FFmpeg-devel] [PATCH v17 13/15] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-29 Thread Nick Renieris
From: Nick Renieris DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 --- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v17 11/15] lavc/tiff: Decode 10-bit and 14-bit DNG images

2019-08-29 Thread Nick Renieris
From: Nick Renieris 10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 23 +++ 1 file changed

[FFmpeg-devel] [PATCH v17 12/15] lavc/mjpegdec: Skip unknown APPx marker on bayer images

2019-08-29 Thread Nick Renieris
From: Nick Renieris Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c

[FFmpeg-devel] [PATCH v17 07/15] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-29 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 3bf2b3e557..28b8f42edd 100644 --- a/libavcodec/tiff.c +++ b

[FFmpeg-devel] [PATCH v17 06/15] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-29 Thread Nick Renieris
From: Nick Renieris When the height is equal to the tile length (full-height tile) after `height % tile_length` is applied with the current code, it results in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by: Nick Ren

[FFmpeg-devel] [PATCH v17 04/15] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-29 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index eb064eec5c..78b4bd5301 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c

[FFmpeg-devel] [PATCH v17 09/15] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-29 Thread Nick Renieris
From: Nick Renieris Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by:

[FFmpeg-devel] [PATCH v17 05/15] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-29 Thread Nick Renieris
From: Nick Renieris Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0&q

[FFmpeg-devel] [PATCH v17 03/15] lavc/tiff: Convert DNGs to sRGB color space

2019-08-29 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 4c6b835afe..eb064eec5c 100644 --- a/libavcodec/tiff.c +++ b/libavcodec

[FFmpeg-devel] [PATCH v17 02/15] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-29 Thread Nick Renieris
From: Nick Renieris Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - Blac

[FFmpeg-devel] [PATCH v17 01/15] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-29 Thread Nick Renieris
From: Nick Renieris Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs

Re: [FFmpeg-devel] [PATCH v16 05/15] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-29 Thread Nick Renieris
Στις Πέμ, 29 Αυγ 2019 στις 4:00 μ.μ., ο/η Michael Niedermayer έγραψε: > This looks unrelated Messed up when rebasing, will fix in a bit. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscri

[FFmpeg-devel] [PATCH v16 12/15] lavc/mjpegdec: Skip unknown APPx marker on bayer images

2019-08-28 Thread Nick Renieris
From: Nick Renieris Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c

[FFmpeg-devel] [PATCH v16 10/15] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-28 Thread Nick Renieris
From: Nick Renieris This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file c

[FFmpeg-devel] [PATCH v16 09/15] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-28 Thread Nick Renieris
From: Nick Renieris Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by:

[FFmpeg-devel] [PATCH v16 05/15] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-28 Thread Nick Renieris
From: Nick Renieris Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0&q

[FFmpeg-devel] [PATCH v16 07/15] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-28 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 3bf2b3e557..28b8f42edd 100644 --- a/libavcodec/tiff.c +++ b

[FFmpeg-devel] [PATCH v16 03/15] lavc/tiff: Convert DNGs to sRGB color space

2019-08-28 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 4c6b835afe..a2102f32b5 100644 --- a/libavcodec/tiff.c +++ b/libavcodec

[FFmpeg-devel] [PATCH v16 04/15] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-28 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index a2102f32b5..dd1295fad6 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c

[FFmpeg-devel] [PATCH v16 02/15] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-28 Thread Nick Renieris
From: Nick Renieris Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - Blac

[FFmpeg-devel] [PATCH v16 01/15] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-28 Thread Nick Renieris
From: Nick Renieris Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs

[FFmpeg-devel] [PATCH v16 08/15] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-28 Thread Nick Renieris
From: Nick Renieris This fixes "X7 RAW" and "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/lib

[FFmpeg-devel] [PATCH v16 11/15] lavc/tiff: Decode 10-bit and 14-bit DNG images

2019-08-28 Thread Nick Renieris
From: Nick Renieris 10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 23 +++ 1 file changed

[FFmpeg-devel] [PATCH v16 06/15] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-28 Thread Nick Renieris
From: Nick Renieris When the height is equal to the tile length (full-height tile) after `height % tile_length` is applied with the current code, it results in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by: Nick Ren

[FFmpeg-devel] [PATCH v16 13/15] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-28 Thread Nick Renieris
From: Nick Renieris DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 --- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v16 15/15] lavc/tiff: Enable decoding of LinearRaw images

2019-08-28 Thread Nick Renieris
From: Nick Renieris "LinearRaw" is a value that the PhotometricInterpretation tag can be set to on DNG images that contain color information for all channels instead of being bayer-encoded ("CFA" value). The DNG decoder is complete enough that we can enable this

[FFmpeg-devel] [PATCH v16 14/15] lavc/tiff: Default-initialize WhiteLevel DNG tag value

2019-08-28 Thread Nick Renieris
From: Nick Renieris Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --

[FFmpeg-devel] [PATCH v15 05/15] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-20 Thread Nick Renieris
n. In all known files, the 2 codes are mapped to symbol 0 so only that case is checked. --- [1]: Embedded JPEGs in "X7 RAW" and "X7 CinemaDNG" samples here: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/jpegtables.c | 17 +++

[FFmpeg-devel] [PATCH v15 01/15] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-20 Thread Nick Renieris
-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 52 +-- libavcodec/mjpegdec.h | 1 + 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index a65bc8df15..6391107f78 100644 --- a/libavcodec

[FFmpeg-devel] [PATCH v15 03/15] lavc/tiff: Convert DNGs to sRGB color space

2019-08-20 Thread Nick Renieris
Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 4c6b835afe..a2102f32b5 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -731,14 +731,23

[FFmpeg-devel] [PATCH v15 13/15] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-20 Thread Nick Renieris
DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 --- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/libavcodec/tiff.c b

[FFmpeg-devel] [PATCH v15 07/15] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-20 Thread Nick Renieris
Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 257230c386..1ca9a59dbf 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1780,7

[FFmpeg-devel] [PATCH v15 02/15] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-20 Thread Nick Renieris
ecified in the DNG Specification - Chapter 5 Signed-off-by: Nick Renieris --- configure | 1 + libavcodec/Makefile | 2 +- libavcodec/tiff.c | 313 +++- libavcodec/tiff.h | 2 + 4 files changed, 310 insertions(+), 8 deletions(-) di

[FFmpeg-devel] [PATCH v15 09/15] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-20 Thread Nick Renieris
Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by: Nick Ren

[FFmpeg-devel] [PATCH v15 04/15] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-20 Thread Nick Renieris
Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index a2102f32b5..dd1295fad6 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -556,6 +556,7 @@ static

[FFmpeg-devel] [PATCH v15 14/15] lavc/tiff: Default-initialize WhiteLevel DNG tag value

2019-08-20 Thread Nick Renieris
Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcode

[FFmpeg-devel] [PATCH v15 08/15] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-20 Thread Nick Renieris
Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 1ca9a59dbf..d9750891d4 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1038,6 +1038,18 @@ static int init_image(TiffContext

[FFmpeg-devel] [PATCH v15 15/15] lavc/tiff: Enable decoding of LinearRaw images

2019-08-20 Thread Nick Renieris
amples.ch/raws/nikon/SCANNER_NIKON_LS5000.DNG Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 377662c897..3166a3e5c8 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1495,6 +

[FFmpeg-devel] [PATCH v15 12/15] lavc/mjpegdec: Skip unknown APPx marker on bayer images

2019-08-20 Thread Nick Renieris
Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec

[FFmpeg-devel] [PATCH v15 11/15] lavc/tiff: Decode 10-bit and 14-bit DNG images

2019-08-20 Thread Nick Renieris
10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 23 +++ 1 file changed, 15 insertions(+), 8

[FFmpeg-devel] [PATCH v15 10/15] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-20 Thread Nick Renieris
This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file changed, 51 insertions(+), 10

[FFmpeg-devel] [PATCH v15 06/15] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-20 Thread Nick Renieris
In an image [1], the height was equal to the tile length (full-height tile) and after `height % tile_length` was applied to them with the current code, it resulted in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by:

[FFmpeg-devel] [PATCH v14 13/14] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-11 Thread Nick Renieris
From: Nick Renieris DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 --- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v14 14/14] lavc/tiff: Default-initialize WhiteLevel DNG tag value

2019-08-11 Thread Nick Renieris
From: Nick Renieris Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --

[FFmpeg-devel] [PATCH v14 12/14] lavc/mjpegdec: Skip unknown APPx marker on bayer images

2019-08-11 Thread Nick Renieris
From: Nick Renieris Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c

[FFmpeg-devel] [PATCH v14 11/14] lavc/tiff: Decode 14-bit DNG images

2019-08-11 Thread Nick Renieris
From: Nick Renieris Sample file: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec

[FFmpeg-devel] [PATCH v14 10/14] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-11 Thread Nick Renieris
From: Nick Renieris This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file c

[FFmpeg-devel] [PATCH v14 08/14] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-11 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index ff9ac30b3f..709bbfb301 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1038,6 +1038,18 @@ static int

[FFmpeg-devel] [PATCH v14 05/14] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-11 Thread Nick Renieris
From: Nick Renieris Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0&q

[FFmpeg-devel] [PATCH v14 09/14] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-11 Thread Nick Renieris
From: Nick Renieris Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by:

[FFmpeg-devel] [PATCH v14 07/14] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-11 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 14928ed3d5..ff9ac30b3f 100644 --- a/libavcodec/tiff.c +++ b

[FFmpeg-devel] [PATCH v14 03/14] lavc/tiff: Convert DNGs to sRGB color space

2019-08-11 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 4c6b835afe..a2102f32b5 100644 --- a/libavcodec/tiff.c +++ b/libavcodec

[FFmpeg-devel] [PATCH v14 04/14] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-11 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index a2102f32b5..040e83ba7c 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c

[FFmpeg-devel] [PATCH v14 01/14] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-11 Thread Nick Renieris
From: Nick Renieris Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs

[FFmpeg-devel] [PATCH v14 02/14] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-11 Thread Nick Renieris
From: Nick Renieris Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - Blac

[FFmpeg-devel] [PATCH v14 06/14] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-11 Thread Nick Renieris
From: Nick Renieris In an image [1], the height was equal to the tile length (full-height tile) and after `height % tile_length` was applied to them with the current code, it resulted in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's nece

[FFmpeg-devel] [PATCH v13 14/14] lavc/tiff: Default-initialize WhiteLevel DNG tag value

2019-08-10 Thread Nick Renieris
From: Nick Renieris Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --

[FFmpeg-devel] [PATCH v13 12/14] lavc/mjpegdec: Skip unknown APPx marker on bayer images

2019-08-10 Thread Nick Renieris
From: Nick Renieris Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c

[FFmpeg-devel] [PATCH v13 11/14] lavc/tiff: Decode 14-bit DNG images

2019-08-10 Thread Nick Renieris
From: Nick Renieris Sample file: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec

[FFmpeg-devel] [PATCH v13 08/14] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-10 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 174ca168c6..9d20763186 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1038,6 +1038,18 @@ static int

[FFmpeg-devel] [PATCH v13 13/14] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-10 Thread Nick Renieris
From: Nick Renieris DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 73 +++ 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v13 09/14] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-10 Thread Nick Renieris
From: Nick Renieris Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by:

[FFmpeg-devel] [PATCH v13 10/14] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-10 Thread Nick Renieris
From: Nick Renieris This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file c

[FFmpeg-devel] [PATCH v13 07/14] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-10 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 37fda15162..174ca168c6 100644 --- a/libavcodec/tiff.c +++ b

[FFmpeg-devel] [PATCH v13 06/14] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-10 Thread Nick Renieris
From: Nick Renieris In an image [1], the height was equal to the tile length (full-height tile) and after `height % tile_length` was applied to them with the current code, it resulted in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's nece

[FFmpeg-devel] [PATCH v13 01/14] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-10 Thread Nick Renieris
From: Nick Renieris Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs

[FFmpeg-devel] [PATCH v13 02/14] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-10 Thread Nick Renieris
From: Nick Renieris Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - Blac

[FFmpeg-devel] [PATCH v13 03/14] lavc/tiff: Convert DNGs to sRGB color space

2019-08-10 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index d5673abb19..a118c37c41 100644 --- a/libavcodec/tiff.c +++ b/libavcodec

[FFmpeg-devel] [PATCH v13 05/14] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-10 Thread Nick Renieris
From: Nick Renieris Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0&q

[FFmpeg-devel] [PATCH v13 04/14] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-10 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index a118c37c41..4620508d53 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c

Re: [FFmpeg-devel] [PATCH v12 10/14] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-10 Thread Nick Renieris
> after this commit the code dies when used with ffplay with floating point > exceptions I tried this on Ubuntu and I can't repro, it works fine. Maybe something I changed locally fixed it, please re-test on the new revision I'll send in a bit. ___ ffmpe

Re: [FFmpeg-devel] [PATCH v12 01/14] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-10 Thread Nick Renieris
first line outside. 3) It depends on mjpeg_decode_dc being called for the first-line case, I'm not sure how I'd handle that either (even just to take it outside the "component" loop). Στις Σάβ, 10 Αυγ 2019 στις 3:30 μ.μ., ο/η Michael Niedermayer έγραψε: > > On Fri, Aug

Re: [FFmpeg-devel] [PATCH v12 12/14] lavc/mjpegdec: Skip useless APPx marker on bayer images

2019-08-10 Thread Nick Renieris
The data the marker contains is only 2 bytes and they're 0x in the samples above. I don't know what they're for. Στις Σάβ, 10 Αυγ 2019 στις 3:16 μ.μ., ο/η Michael Niedermayer έγραψε: > > On Fri, Aug 09, 2019 at 07:29:57PM +0300, Nick Renieris wrote: > > From: Nic

Re: [FFmpeg-devel] [PATCH v12 05/14] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-10 Thread Nick Renieris
7:29:50PM +0300, Nick Renieris wrote: > > From: Nick Renieris > > > > Some JPEGs [1] have incorrect DHT entries that map 2 codes to > > the same value. > > > > The second (last) mapping does not ever actually appear in the > > code stream, therefore ignoring any ma

Re: [FFmpeg-devel] [PATCH v12 03/14] lavc/tiff: Convert DNGs to sRGB color space

2019-08-10 Thread Nick Renieris
> Why do you put all this color space convertion code into the decoders ? The color space conversion needs to happen, camera sensor data is linear. If it's not done images looks really dark as result. > Colorspace and pixel format convertion is generally done outside decoders. > The specification

[FFmpeg-devel] [PATCH v12 09/14] lavc/mjpegdec: Enable decoding of single-component bayer images

2019-08-09 Thread Nick Renieris
From: Nick Renieris Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by:

[FFmpeg-devel] [PATCH v12 04/14] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-09 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index a118c37c41..4620508d53 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c

[FFmpeg-devel] [PATCH v12 13/14] lavc/tiff: Support DNGs with striped (non-tiled) JPEGs images

2019-08-09 Thread Nick Renieris
From: Nick Renieris DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 73 +++ 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v12 03/14] lavc/tiff: Convert DNGs to sRGB color space

2019-08-09 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index d5673abb19..a118c37c41 100644 --- a/libavcodec/tiff.c +++ b/libavcodec

[FFmpeg-devel] [PATCH v12 02/14] lavc/tiff: Decode embedded JPEGs in DNG images

2019-08-09 Thread Nick Renieris
From: Nick Renieris Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - Blac

[FFmpeg-devel] [PATCH v12 11/14] lavc/tiff: Decode 14-bit DNG images

2019-08-09 Thread Nick Renieris
From: Nick Renieris Sample file: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec

[FFmpeg-devel] [PATCH v12 12/14] lavc/mjpegdec: Skip useless APPx marker on bayer images

2019-08-09 Thread Nick Renieris
From: Nick Renieris Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris --- libavcodec/mjpegdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c

[FFmpeg-devel] [PATCH v12 14/14] lavc/tiff: Initialize WhiteLevel DNG tag value

2019-08-09 Thread Nick Renieris
From: Nick Renieris Inited to (2^BitsPerSample)-1 as per the DNG Specification This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 13 ++--- 1 file changed, 10 insert

[FFmpeg-devel] [PATCH v12 07/14] lavc/tiff: Don't apply strips-related logic to tiled images

2019-08-09 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 37fda15162..174ca168c6 100644 --- a/libavcodec/tiff.c +++ b

[FFmpeg-devel] [PATCH v12 08/14] lavc/tiff: Force DNG pixel data endianness on an edge case

2019-08-09 Thread Nick Renieris
From: Nick Renieris Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 174ca168c6..9d20763186 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1038,6 +1038,18 @@ static int

[FFmpeg-devel] [PATCH v12 05/14] lavc/jpegtables: Handle multiple mappings to the same value

2019-08-09 Thread Nick Renieris
From: Nick Renieris Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0&q

[FFmpeg-devel] [PATCH v12 06/14] lavc/tiff: Fix edge case with full-length/width tiles

2019-08-09 Thread Nick Renieris
From: Nick Renieris In an image [1], the height was equal to the tile length (full-height tile) and after `height % tile_length` was applied to them with the current code, it resulted in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's nece

[FFmpeg-devel] [PATCH v12 10/14] lavc/tiff: Support decoding of DNGs with single-component JPEGs

2019-08-09 Thread Nick Renieris
From: Nick Renieris This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris --- libavcodec/tiff.c | 61 +++ 1 file c

[FFmpeg-devel] [PATCH v12 01/14] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-09 Thread Nick Renieris
From: Nick Renieris Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs

Re: [FFmpeg-devel] [PATCH v10 04/13] lavc/tiff: Apply color scaling to uncompressed DNGs

2019-08-08 Thread Nick Renieris
Thanks for the review Michael, pushing fixes and a commit that makes some more images compatible. Στις Πέμ, 8 Αυγ 2019 στις 1:22 π.μ., ο/η Michael Niedermayer έγραψε: > > On Wed, Aug 07, 2019 at 06:27:14PM +0300, velocit...@gmail.com wrote: > > From: Nick Renieris > > >

Re: [FFmpeg-devel] [PATCH v9 1/2] lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGs

2019-08-07 Thread Nick Renieris
Going to post a new patchset with my latest work. It includes these 2 commits (one slightly modified) and 11 more. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or

Re: [FFmpeg-devel] [PATCH v7 2/2] lavc/tiff: Decode embedded JPEGs in DNG images

2019-07-28 Thread Nick Renieris
's no guarantee this is happening with the actual version of course (it could be slower, or even faster if it also optimizes it through dng_blit). I could check the actual disasm in FFmpeg, but I don't think it's worth it at this point (my mentor agrees). Στις Κυρ, 28 Ιουλ 2019 στις

Re: [FFmpeg-devel] [PATCH v7 2/2] lavc/tiff: Decode embedded JPEGs in DNG images

2019-07-28 Thread Nick Renieris
Στις Κυρ, 28 Ιουλ 2019 στις 1:30 π.μ., ο/η Reimar Döffinger έγραψε: > > Huh? Are you thinking of templates? always_inline can usually be used the > same way. > I haven't looked into the how or anything, it was just a comment in principle. You're totally right (I checked on godbolt just to make s

Re: [FFmpeg-devel] [PATCH v7 2/2] lavc/tiff: Decode embedded JPEGs in DNG images

2019-07-26 Thread Nick Renieris
Στις Παρ, 26 Ιουλ 2019 στις 2:21 π.μ., ο/η Reimar Döffinger έγραψε: > > On 25.07.2019, at 17:35, velocit...@gmail.com wrote: > > > +// Lookup table lookup > > +if (lut) > > +value = lut[value]; > > As this function is in the innermost loop, doing the if here instead of > having 2

Re: [FFmpeg-devel] [PATCH v6 2/2] lavc/tiff: Decode embedded JPEGs in DNG images

2019-07-25 Thread Nick Renieris
Thanks for the review Moritz, pushed fixes. "outputted" is a word actually :) https://forum.wordreference.com/threads/is-outputted-a-word.2707379 Στις Πέμ, 25 Ιουλ 2019 στις 4:57 μ.μ., ο/η Moritz Barsnick έγραψε: > > On Thu, Jul 25, 2019 at 15:12:53 +0300, velocit...@gmail.com wrote: > > Nit: >

Re: [FFmpeg-devel] [PATCH] lavc/tiff: Decode embedded JPEGs in DNG images

2019-07-24 Thread Nick Renieris
, I will talk with my mentor on whether to prioritize it (a lot of images look fine without it). Στις Τετ, 24 Ιουλ 2019 στις 1:06 μ.μ., ο/η έγραψε: > > From: Nick Renieris > > Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. > > This commit adds support

  1   2   >