Commit Graph

77 Commits

Author SHA1 Message Date
Reinhard Tartler
7ffe76e540 Merge libavcore into libavutil
Done to keep ABI compatible. Otherwise this is just silly
2011-02-16 23:00:30 +01:00
Carl Eugen Hoyos
27a275e4bb Set maximum lowres value for the MJPEG decoder to 3.
While 4 works for some samples, 3 is the correct value since 8x8
DCT is used by (m)jpeg.
2011-02-12 15:38:26 +01:00
Luca Barbato
9ef5a9deaf Replace dprintf with av_dlog
dprintf clashes with POSIX.1-2008
(cherry picked from commit dfd2a005eb)
2011-01-30 03:41:48 +01:00
Diego Elio Pettenò
e7e2df27f8 Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
None of these symbols should be accessed directly, so declare them as
hidden.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d36beb3f69)
2011-01-28 03:15:34 +01:00
Mans Rullgard
d232e09d51 Sanitise get_bits macros, part 1
Some of the macros in get_bits.h include a final semicolon,
some do not.  This removes these or adds do {} while(0) around
the macros as appropriate and adds semicolons where needed in
calling code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit bf5f9b528b)
2011-01-23 19:32:08 +01:00
Carl Eugen Hoyos
a0f593d00d Values >4 for lowres corrupt output.
Originally committed as revision 26386 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-16 12:45:59 +00:00
Michael Niedermayer
4c3267aaad Fix memleak in mjpeg decoder.
Originally committed as revision 25549 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-22 02:25:26 +00:00
Michael Niedermayer
a2d4dfd493 Optimize EOB check in mjpeg decode_block() by adjusting the VLC symbol.
Originally committed as revision 25548 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:51 +00:00
Michael Niedermayer
e4463f21ee Simplify last coeff check in mjpeg decode_block()
Originally committed as revision 25547 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:47 +00:00
Michael Niedermayer
2111a191eb Check index in mjpeg AC decode against overflowing.
This fixes a possibly exploitable buffer overflow and it will likely also be needed for future overreading fixes.

Originally committed as revision 25546 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:44 +00:00
Michael Niedermayer
5675a11f92 Add a seperate VLC table for progressive jpeg so we dont have to subtract 16 in the inner loop.
Originally committed as revision 25545 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:41 +00:00
Michael Niedermayer
8870b25140 Factor code&0xf out of if() in decode_block_progressive().
Originally committed as revision 25544 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:37 +00:00
Michael Niedermayer
7f4a1e8f6c Cleanup decode_block_progressive()
Originally committed as revision 25543 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:34 +00:00
Michael Niedermayer
614252863d Factorize ((unsigned) code) >> 4 out of decode_block_progressive() in jpeg.
Originally committed as revision 25542 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:31 +00:00
Michael Niedermayer
76c80ef569 Move if() in mjpeg decode_block() to simplify condition.
Originally committed as revision 25541 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:28 +00:00
Michael Niedermayer
1932182498 Simplify build_vlc() by using init_vlc_sparse() in mjpeg.
Originally committed as revision 25540 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 22:44:18 +00:00
Stefano Sabatini
e16f217ceb Use new imgutils.h API names, fix deprecation warnings.
Originally committed as revision 25058 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-07 19:15:29 +00:00
Alex Converse
4c399dc82b Fix undefined expressions that use multiple calls to get_bits().
Because the order of evaluation of subexpressions is undefined, two
get_bits() calls may not be part of the same expression.

See also r24902.

Originally committed as revision 24906 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-24 16:10:25 +00:00
Stefano Sabatini
6ce9b4310c Remove use of the deprecated function avcodec_check_dimensions(), use
av_check_image_size() instead.

Originally committed as revision 24711 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-06 09:37:04 +00:00
Måns Rullgård
8fc0162ac4 Add av_ prefix to bswap macros
Originally committed as revision 24170 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-10 22:12:30 +00:00
Måns Rullgård
e6b22522c9 bswap: change ME to NE in macro names
Other parts of FFmpeg use NE (native endian) rather than ME (machine).
This makes it consistent.

Originally committed as revision 24169 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-10 22:09:01 +00:00
Carl Eugen Hoyos
0fd0ef7947 Add new decoder property max_lowres and do not init decoder if requested value is higher.
Originally committed as revision 24098 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-07 21:23:36 +00:00
Diego Biurrun
ba87f0801d Remove explicit filename from Doxygen @file commands.
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Stefano Sabatini
72415b2adb Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-30 23:30:55 +00:00
Stefano Sabatini
e8a9d01846 Fix misc typos, patch by
Fabian Greffrath base64_decode(PGZhYmlhbkBncmVmZnJhdGguY29tPg==).

Originally committed as revision 21473 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-27 00:31:52 +00:00
Carl Eugen Hoyos
ddee80f384 Metasoft MJPEG codec has Cb and Cr swapped, fixes issue 1611.
Originally committed as revision 21451 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-26 10:30:24 +00:00
Michael Niedermayer
021dccba1f Fix heap overflow due to lack of nb_components check.
Originally committed as revision 21450 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-25 13:26:10 +00:00
Carl Eugen Hoyos
ab176fdffb (Partly) support Metasoft MJPEG Codec, fixes half of issue 1611.
Originally committed as revision 20796 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-10 23:06:23 +00:00
Michael Niedermayer
3c3c01d949 Flip red and blue in rct-less lossless jpeg.
Fixes issue1466, and decoding of plain lossless jpeg.

Originally committed as revision 20790 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-10 18:18:57 +00:00
Michael Niedermayer
49b19191bc Lossless jpeg expects and uses BGRA not RGB32 (this probably caused a problem on
big endian)

Originally committed as revision 20789 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-10 18:14:26 +00:00
Michael Niedermayer
98c82d6910 Allocate pictures with enough padding for jpeg.
Ensure that jpeg does not use mbs that could require larger padding.
This might have been exploitable.

Originally committed as revision 20566 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-20 22:14:37 +00:00
Reimar Döffinger
b711aaa2d8 Disable image flipping during JPEG decoding if CODEC_FLAG_EMU_EDGE is set
instead of either aborting on the assert or crashing due to writing beyond
the array due to insufficient padding.

Originally committed as revision 20552 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-19 11:49:03 +00:00
Michael Niedermayer
ad9feac9fb Avoid huge array for rgb ljpeg on the stack.
Code tested with an ljpeg i had laying around.

Originally committed as revision 20433 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-02 14:12:25 +00:00
Carl Eugen Hoyos
643fc8f107 Flip (M)JPEG frames encoded by Intel JPEG library.
Fixes issues 1464 and 1468.

Originally committed as revision 20312 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-19 15:41:28 +00:00
Carl Eugen Hoyos
0b7f39c9d4 Release unreleased buffers found by make test.
Originally committed as revision 20251 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-16 14:50:08 +00:00
Kostya Shishkov
8355572f91 lavc MJPEG decoder is capable of decoding some extended sequential
Huffman-compressed JPEG files, so make it decode those files
(samples are welcome).
This fixes issue 1420

Originally committed as revision 20113 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-01 05:52:38 +00:00
Diego Biurrun
8b44de14d1 Change av_log() calls surrounded by '#ifdef DEBUG' into dprintf macros.
Originally committed as revision 19550 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-30 21:00:08 +00:00
Reimar Döffinger
82c9182fe3 If the end of the input buffer is reached while decoding MJPEG and at least
a valid SOF was found, emulate an EOI.
This allows e.g. to at least decode the available part of incomplete MJPEG frames.

Originally committed as revision 19344 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-04 18:24:43 +00:00
Reimar Döffinger
1496b04c28 Make the MJPEG decoder return -1 when no image was decoded so that decode
errors are actually recognizable as such.

Originally committed as revision 19343 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-04 18:22:33 +00:00
Reimar Döffinger
643fd8a198 Add a got_picture flag to MJpegDecodeContext which indicates if its picture
element is valid. Skip the code handling SOS and EOI if not, since it can not
work without a valid AVPicture.
This fixes a crash with mjpeg/smclockmjpeg.avi.1.0 from issue 1240 where the
decoder returned an invalid AVPicture.

Originally committed as revision 19342 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-04 18:20:35 +00:00
Reimar Döffinger
b27bf2a7b4 mjpegdec: check that the coded dc_index and ac_index have a valid associated VLC table.
Removes some disabled dc_index/ac_index checking code that seems to have had
some undocumented issues and should not really be necessary anymore now.
Fixes from issue 1240 the files mjpeg/smclockmjpeg.avi.1.10 and mjpeg/smclockmjpeg.avi.1.171.

Originally committed as revision 19341 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-07-04 12:54:36 +00:00
Baptiste Coudurier
47b5b0e8b6 honor restart interval in mjpeg, fix #861, SpectralFan.mov still decodes correctly
Originally committed as revision 18937 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-05-25 02:34:31 +00:00
David Conrad
580a7465fb Add a chroma_sample_location field to define positioning of chroma samples
Originally committed as revision 18795 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-05-11 04:34:23 +00:00
Michael Niedermayer
806d5e61dc Remove unused variables from ff_mjpeg_decode_sos() found by CSA.
Originally committed as revision 18548 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-17 13:03:56 +00:00
Thilo Borgmann
7a00bbad21 Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows
passing of packet-specific flags from demuxer to decoder, such as the keyframe
flag, which appears necessary to playback corePNG P-frames.

Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread
"Google Summer of Code participation" on the mailinglist.

Originally committed as revision 18351 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-07 15:59:50 +00:00
Diego Biurrun
bad5537e2c Use full internal pathname in doxygen @file directives.
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.

Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-01 02:00:19 +00:00
Diego Biurrun
406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Aurelien Jacobs
2bb6eba21d remove ff_get_fourcc() and use AV_RL32() instead
Originally committed as revision 16654 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-17 12:21:01 +00:00
Aurelien Jacobs
49fb20cb8a replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
and remove all ENABLE_ definitions.

Originally committed as revision 16600 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-14 17:19:17 +00:00
Loren Merritt
5fecfb7d58 clear_block mmx
Originally committed as revision 16045 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-10 21:35:17 +00:00