Commit Graph

376 Commits

Author SHA1 Message Date
Michael Niedermayer
5c7899a483 avcodec/mjpegdec: Support AV_PIX_FMT_YUV420P16 with upscale_h
Fixes assertion failure
Fixes: test42f.jpg
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 16:20:55 +02:00
Przemysław Sobala
c68098ba4a avcodec/mjpegdec: add pix_fmt: 0x14121200
Fixes: _15801_F.jpg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 18:07:44 +02:00
Michael Niedermayer
ef7e8425e8 avcodec/mjpegdec: factorize some parts of the pix_fmt_id switch()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 23:28:18 +02:00
Michael Niedermayer
784e1cf76b avcodec/mjpegdec: handle luma upscale detection generically
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 23:26:19 +02:00
Michael Niedermayer
64d98dadc7 avcodec/mjpegdec: set upscale_h/upscale_v using generic code instead of hardcoding a list
Some code is left to handle corner cases

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 22:54:57 +02:00
Michael Niedermayer
7558e55345 avcodec/mjpegdec: Support pix_fmt_id==0x11222200
Fixes: 4858286_300.jpg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 22:12:20 +02:00
Michael Niedermayer
cd417d947e avcodec/mjpegdec: fix width for non chroma in rescaling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 22:09:19 +02:00
Michael Niedermayer
4e09300ffa mjpegdec: Support pix_fmt_id == 0x22112200
Fixes 4780490_300.jpg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 21:47:54 +02:00
Michael Niedermayer
581b5f0b9b Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'
* commit 'e3fcb14347466095839c2a3c47ebecff02da891e':
  dsputil: Split off IDCT bits into their own context

Conflicts:
	configure
	libavcodec/aic.c
	libavcodec/arm/Makefile
	libavcodec/arm/dsputil_init_arm.c
	libavcodec/arm/dsputil_init_armv6.c
	libavcodec/asvdec.c
	libavcodec/dnxhdenc.c
	libavcodec/dsputil.c
	libavcodec/dvdec.c
	libavcodec/dxva2_mpeg2.c
	libavcodec/intrax8.c
	libavcodec/mdec.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc_common.h
	libavcodec/mpegvideo.c
	libavcodec/ppc/dsputil_altivec.h
	libavcodec/ppc/dsputil_ppc.c
	libavcodec/ppc/idctdsp.c
	libavcodec/x86/Makefile
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/dsputil_mmx.c
	libavcodec/x86/dsputil_x86.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 15:22:11 +02:00
Diego Biurrun
e3fcb14347 dsputil: Split off IDCT bits into their own context 2014-06-30 07:58:46 -07:00
Derek Buitenhuis
2deb614272 mjpegdec: Properly set the context colorspace info
The JPEG spec requires it to be this.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-06-24 20:42:40 +01:00
Derek Buitenhuis
c11043aca7 mjpegdec: Properly set the context colorspace info
The JPEG spec requires it to be this.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-06-24 20:40:44 +01:00
Michael Niedermayer
0dceefc5fa Merge commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2'
* commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2':
  Add av_image_check_sar() and use it to validate SAR

Conflicts:
	libavcodec/dpx.c
	libavcodec/dvdec.c
	libavcodec/ffv1dec.c
	libavcodec/utils.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 22:20:28 +02:00
Justin Ruggles
9e500efdbe Add av_image_check_sar() and use it to validate SAR 2014-06-20 10:39:33 -04:00
Michael Niedermayer
2b05db4f81 Merge commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9'
* commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9':
  dsputil: Split clear_block*/fill_block* off into a separate context

Conflicts:
	configure
	libavcodec/asvdec.c
	libavcodec/dnxhddec.c
	libavcodec/dnxhdenc.c
	libavcodec/dsputil.h
	libavcodec/eamad.c
	libavcodec/intrax8.c
	libavcodec/mjpegdec.c
	libavcodec/ppc/dsputil_ppc.c
	libavcodec/vc1dec.c
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/dsputil_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 04:54:38 +02:00
Diego Biurrun
e74433a8e6 dsputil: Split clear_block*/fill_block* off into a separate context 2014-06-18 14:07:23 -07:00
Michael Niedermayer
0545ef7116 avcodec/mjpegdec: Improve intel jpeg flip heuristic
Fixes Ticket3698

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-06 01:32:22 +02:00
Michael Niedermayer
149be91374 avcodec/mjpegdec: request a AMV sample with non mod 16 height
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-01 04:00:47 +02:00
Michael Niedermayer
ec33f59fed avcodec/mjpegdec: Support pix_fmt_id== 0x42111100
Fixes: 538782_300.jpg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 16:36:04 +02:00
Michael Niedermayer
aff352be63 avcodec/mjpegdec: zero gb to silence warning about it being possibly uninitialized
The code is not speed relevant, also its more robust if the pointers are NULL instead of random.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-08 17:37:40 +02:00
Michael Niedermayer
8532566e80 avcodec/mjpegdec: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 18:26:28 +02:00
Michael Niedermayer
e31727bd53 avcodec/mjpegdec: make type of shift unsigned to avoid undefined behavior
Found-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-28 00:22:38 +02:00
Michael Niedermayer
b432960528 avcodec/mjpegdec: Fix undefined shift
Fixes CID1194388

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-27 05:32:56 +02:00
Carl Eugen Hoyos
ced0d6c14d Use correct msvc type specifiers for ptrdiff_t and size_t.
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472.

Reviewed-by: Ronald Bultje
2014-04-24 18:01:30 +02:00
Justin Ruggles
591c0c26b5 mjpeg: cosmetics: indentation
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-18 12:41:17 -04:00
Justin Ruggles
39ef000e19 mjpeg: Do not fail jpeg decoding on bad EXIF data.
It is not required to correctly decode the image.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-18 12:41:10 -04:00
Thilo Borgmann
8c161d7884 lavc/exif: Make EXIF IFD decoding part of private API/ABI.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-05 03:31:56 +02:00
Michael Niedermayer
254f653b24 avcodec/jpeglsdec: add PAL8 support
Fixes Ticket3478

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-01 13:43:44 +02:00
Michael Niedermayer
d56c373391 avcodec/mjpegdec: fix cmyk 420 with adobe_transform == 2
Fixes Ticket3516

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-01 01:14:26 +02:00
Michael Niedermayer
559c8b9ee9 avcodec/mjpegdec: support subsampled 420 CMYK
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-31 17:47:04 +02:00
Michael Niedermayer
798490812a avcodec/mjpegdec: upgrade upscale_v to support multiple planes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-31 17:47:04 +02:00
Michael Niedermayer
f9059ce794 avcodec/mjpegdec: upgrade upscale_h to support multiple planes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-31 17:47:04 +02:00
Michael Niedermayer
dde16f5aae avcodec/mjpegdec: Switch default interlaced polarity for MJPG to 1
Fixes Ticket3229

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 18:16:42 +01:00
Michael Niedermayer
493296800c avcodec/mjpegdec: parse avid data from extradata
Makes no difference for any file tested but is needed
for following bug-fix

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 18:16:42 +01:00
Michael Niedermayer
046a75eea0 avcodec/mjpeg: print info from parse_avid() if requested
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 18:16:42 +01:00
Michael Niedermayer
98f9aa389b avcodec/mjpegdec: switch interlaced_polarity to 0 for PAL AVID
0 should have been the default, this change should make no difference
but this is needed for the following bugfix

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 18:16:42 +01:00
Michael Niedermayer
1083c479eb avcodec/mjpegdec: factorize parse_avid out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 18:16:42 +01:00
Vittorio Giovara
1c1fbc70ca mjpeg: set color_range 2014-03-16 23:31:30 +01:00
Michael Niedermayer
e161c1bbfc avcodec/mjpegdec: support adob transform 2
Fixes Ticket3426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 04:20:23 +01:00
Michael Niedermayer
a05635ee01 avcodec/mjpegdec: convert CMYK to GBRAP
Fixes Ticket2799

This should be moved into swscale once we have a CMYK pixel format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 22:18:34 +01:00
Michael Niedermayer
501beae6f9 avcodec/mjpegdec: fix decoding 4th plane
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 21:49:46 +01:00
Michael Niedermayer
6904168c79 avcodec/mjpegdec: Print error in case of CMYK
Also fail if AV_EF_EXPLODE is set.
We do not fail by default, but rather return some image as it may be usefull to the
end user to see what is on the image, for example text could be read quite fine and
objects recognized.

Possibly fixes Ticket3424

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 20:24:39 +01:00
Michael Niedermayer
681e72a668 avcodec/mjpegdec: parse adobe_transform
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 20:13:48 +01:00
Michael Niedermayer
7e8be7081f avcodec/mjpegdec: Print human readable string for APPx
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 19:35:37 +01:00
Michael Niedermayer
19b41f8645 avcodec/mjpegdec: use the correct linesize in the flipping code
Fixes out of array access
No releases should be affected
Depends on 7c3700cd1d, do not backport without this one

Fixes: asan_heap-oob_14a37fe_9111_cov_1692584941_test4.amv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 21:47:44 +01:00
Michael Niedermayer
2884688bd5 avcodec/mjpegdec: pass into ff_mjpeg_decode_sos() and check bitmask size
Fixes: heap array overread
Fixes: asan_heap-oob_149b2bc_6577_m1.mxg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-31 18:34:08 +01:00
Michael Niedermayer
b80073c05f avcodec/mjpegdec: use av_freep() instead of av_free()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-30 00:50:43 +01:00
Michael Niedermayer
ed56c021e7 avcodec/mjpegdec Fix potential memleak of stereo3D at the end in case of decoding failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-30 00:25:04 +01:00
Kirill Gavrilov
e9e7e68516 mjpegdec: parse JPS extension and save relevant stereo3d information
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-30 00:17:02 +01:00
Michael Niedermayer
ad8d063f23 avcodec/mjpegdec: Dont skip picture allocation if theres no picture allocated
Fixes Ticket 3245
2014-01-19 17:30:22 +01:00