Commit Graph

209 Commits

Author SHA1 Message Date
Reimar Döffinger
0880503fbb mjpegdec: use av_fast_padded_malloc()
also check for allocation failure

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-02-01 14:37:47 -05:00
Michael Niedermayer
e37f161e66 Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
  movenc: Allow writing to a non-seekable output if using empty moov
  movenc: Support adding isml (smooth streaming live) metadata
  libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
  sunrast: Document the different Sun Raster file format types.
  sunrast: Add a check for experimental type.
  libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
  lavf: remove disabled FF_API_SET_PTS_INFO cruft
  lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
  lavf: remove disabled FF_API_REORDER_PRIVATE cruft
  lavf: remove disabled FF_API_SEEK_PUBLIC cruft
  lavf: remove disabled FF_API_STREAM_COPY cruft
  lavf: remove disabled FF_API_PRELOAD cruft
  lavf: remove disabled FF_API_NEW_STREAM cruft
  lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
  lavf: remove disabled FF_API_MUXRATE cruft
  lavf: remove disabled FF_API_FILESIZE cruft
  lavf: remove disabled FF_API_TIMESTAMP cruft
  lavf: remove disabled FF_API_LOOP_OUTPUT cruft
  lavf: remove disabled FF_API_LOOP_INPUT cruft
  lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
  ...

Conflicts:
	doc/APIchanges
	libavcodec/8bps.c
	libavcodec/avcodec.h
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/options.c
	libavcodec/sunrast.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/h264_deblock.asm
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavformat/avformat.h
	libavformat/avio.c
	libavformat/avio.h
	libavformat/aviobuf.c
	libavformat/dv.c
	libavformat/mov.c
	libavformat/utils.c
	libavformat/version.h
	libavformat/wtv.c
	libavutil/Makefile
	libavutil/file.c
	libswscale/x86/input.asm
	libswscale/x86/swscale_mmx.c
	libswscale/x86/swscale_template.c
	tests/ref/lavf/ffm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 07:53:34 +01:00
Anton Khirnov
99ace37e68 lavc: remove disabled FF_API_MJPEG_GLOBAL_OPTS cruft. 2012-01-27 10:38:34 +01:00
Reimar Döffinger
3b55429d56 Add and use av_fast_padded_malloc.
The same as av_fast_malloc but uses av_mallocz and keeps extra
always-0 padding.
This does not mean the memory will be 0-initialized after each call,
but actually only after each growth of the buffer.
However this makes sure that
a) all data anywhere in the buffer is always initialized
b) the padding is always 0
c) the user does not have to bother with adding the padding themselves
Fixes another valgrind warning about use of uninitialized data,
this time with fate-vsynth1-jpegls.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-17 20:16:35 +01:00
Michael Niedermayer
a91f206665 ljpegdec: reset restart interval for each plane of a non interleaved file.
Fixes Ticket907

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-15 00:53:59 +01:00
Michael Niedermayer
1843e6c8aa thp: Fix handling of restart interval
Fixes Ticket903

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-15 00:53:59 +01:00
Carl Eugen Hoyos
2c90204598 Fix decoding of progressive jpgs with unusual pixel formats.
Fixes ticket #892.
2012-01-12 23:20:33 +01:00
Michael Niedermayer
24be30de64 ljpegdec: Fix the left column of rgb24 decoding
Fixes Ticket894

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-10 23:12:18 +01:00
anonymous
7e2ba2df28 mjpeg: update whitespaces to qatar 2012-01-10 06:58:02 +01:00
Michael Niedermayer
b143562639 ljpegdec: Support MCU in ljpeg_decode_yuv_scan()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-09 00:06:23 +01:00
Daniel Huang
8549cf073b mjpegdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-08 23:33:00 +01:00
Michael Niedermayer
bbe25b4f3e ljpegdec: support non zero MCU for RGB. 2nd try
Fixes Ticket875
Compared to patch 1 this fixes a bright line at the right side.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-08 00:18:36 +01:00
Michael Niedermayer
12d8340f16 ljpeg: Fix bits != 8 or 16 support
Fixes 2nd half of Ticket889

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-07 00:11:43 +01:00
Michael Niedermayer
3edff185ab Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  ipmovie: do not read audio packets before the codec is known
  truemotion2: check size before GetBitContext initialisation
  avio: Only do implicit network initialization for network protocols
  avio: Add an URLProtocol flag for indicating that a protocol uses network
  adpcm: ADPCM Electronic Arts has always two channels
  matroskadec: Fix a bug where a pointer was cached to an array that might later move due to a realloc()
  fate: Add missing reference file from 9b4767e4.
  mov: Support MOV_CH_LAYOUT_USE_DESCRIPTIONS for labeled descriptions.
  4xm: Prevent buffer overreads.
  mjpegdec: parse RSTn to prevent skipping other data in mjpeg_decode_scan
  vp3: add fate test for non-zero last coefficient
  vp3: fix streams with non-zero last coefficient
  swscale: remove unused U/V arguments from yuv2rgb_write().
  timer: K&R formatting cosmetics
  lavf: cosmetics, reformat av_read_frame().
  lavf: refactor av_read_frame() to make it easier to understand.
  Report an error if pitch_lag is zero in AMR-NB decoder.
  Revert "4xm: Prevent buffer overreads."
  4xm: Prevent buffer overreads.
  4xm: pass the correct remaining buffer size to decode_i2_frame().
  ...

Conflicts:
	libavcodec/4xm.c
	libavcodec/mjpegdec.c
	libavcodec/truemotion2.c
	libavformat/ipmovie.c
	libavformat/mov_chan.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-06 02:45:12 +01:00
Carl Eugen Hoyos
d185278c36 Support decoding of some unusual jpeg samples.
Avoid unsupported pix_fmts by upscaling chroma.

Fixes ticket #878.
2012-01-06 00:51:31 +01:00
Janne Grunau
e268a352af mjpegdec: parse RSTn to prevent skipping other data in mjpeg_decode_scan
Check explicitly if enough bits are left to prevent an infinite loop
when the bitstream buffer is not followed by zero-padding.

Based on patches by Michael Niedermayer <michaelni@gmx.at>.
2012-01-05 18:20:35 +01:00
Michael Niedermayer
15b219fae9 jpegdec: Fix vlc table check for progressive jpegs.
Fixes Ticket834

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-04 05:03:15 +01:00
Michael Niedermayer
45552371e3 jpegdec: non interleaved rgb ljpeg support.
Fixes Ticket856

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-02 19:06:46 +01:00
Michael Niedermayer
465eb0eb48 jpegdec: 9-16 bit yuv/gray ljpeg support.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-02 17:53:41 +01:00
Michael Niedermayer
24964f21e4 jpegdec: Only enable rgb mode when there are 3 components.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-02 17:53:40 +01:00
Michael Niedermayer
b0143da806 ljpegdec: fix point transform injection.
Fix Ticket842

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-30 05:12:38 +01:00
Carl Eugen Hoyos
387d86077f Support decoding yuv442 and yuv421 jpeg images.
Fixes ticket #787.
2011-12-27 18:21:38 +01:00
Michael Niedermayer
d1c28e3530 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  build: fix standalone compilation of OMA muxer
  build: fix standalone compilation of Microsoft XMV demuxer
  build: fix standalone compilation of Core Audio Format demuxer
  kvmc: fix invalid reads
  4xm: Add a check in decode_i_frame to prevent buffer overreads
  adpcm: fix IMA SMJPEG decoding
  options: set minimum for "threads" to zero
  bsd: use number of logical CPUs as automatic thread count
  windows: use number of CPUs as automatic thread count
  linux: use number of CPUs as automatic thread count
  pthreads: reset active_thread_type when slice thread_init returrns early
  v410dec: include correct headers
  Drop ALT_ prefix from BITSTREAM_READER_LE name.
  lavfi: always build vsrc_buffer.
  ra144enc: zero the reflection coeffs if the filter is unstable
  sws: readd PAL8 to isPacked()
  mov: Don't stick the QuickTime field ordering atom in extradata.
  truespeech: fix invalid reads in truespeech_apply_twopoint_filter()

Conflicts:
	configure
	libavcodec/4xm.c
	libavcodec/avcodec.h
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavformat/Makefile
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 03:25:51 +01:00
Alex Converse
4bf3c8f226 mov: Don't stick the QuickTime field ordering atom in extradata.
The 'fiel' atoms can be found in H.264 tracks clobbering the extradata.
MJPEG supports non field based extradata, and this data should be
preserved when copying.
2011-12-21 22:04:37 -08:00
Michael Niedermayer
484b1cdd53 jpegdec: check return value of mjpeg_decode_dc()
Fixes Ticket754

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-15 15:23:38 +01:00
Michael Niedermayer
f129f593f7 ljpeg: Check that lowres is 0 as lowres is not possible with ljpeg.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-14 22:50:49 +01:00
Michael Niedermayer
7fad19a63d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: cabac: replace explicit memory references with "m" operands
  avplay: don't request a stereo downmix
  wmapro: use av_float2int()
  lavc: avoid invalid memcpy() in avcodec_default_release_buffer()
  lavu: replace int/float punning functions
  lavfi: install libavfilter/vsrc_buffer.h
  Remove extraneous semicolons
  sdp: Restore the original mp4 format h264 extradata if converted
  rtpenc: Add support for mp4 format h264
  rtpenc: Simplify code by introducing a separate end pointer
  movenc: Use the actual converted sample for RTP hinting
  Fix a bunch of common typos.

Conflicts:
	doc/developer.texi
	doc/eval.texi
	doc/filters.texi
	doc/protocols.texi
	ffmpeg.c
	ffplay.c
	libavcodec/mpegvideo.h
	libavcodec/x86/cabac.h
	libavfilter/Makefile
	libavformat/avformat.h
	libavformat/cafdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/gxfenc.c
	libavformat/img2.c
	libavformat/movenc.c
	libavformat/mpegts.c
	libavformat/rtpenc_h264.c
	libavformat/utils.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-12 01:25:37 +01:00
Diego Biurrun
da9cea77e3 Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
Carl Eugen Hoyos
51d7cd3596 Decode RGB ljpeg to RGB24.
No alpha channel is decoded, the output used to be completely transparent.
2011-12-08 02:45:53 +01:00
Michael Niedermayer
c36edf3899 jpeg: rgb support
Fixes Ticket297

Based on a patch by Carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-02 02:26:28 +01:00
Michael Niedermayer
f97faf6751 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  id3v2: fix doxy comment - 'machine byte order' makes no sense on char arrays
  VC1: restore mistakenly removed code
  twinvq: check output buffer size before decoding
  twinvq: return an error when the packet size is too small
  lavf: export some forgotten symbols with non-av prefixes.
  swscale: update altivec yuv2planeX asm to new per-plane API.
  swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware.
  yuv2planeX10 SIMD
  swscale: decide whether to use yuv2plane1/X on a per-plane basis.
  swscale: reintroduce full precision in 16-bit output.
  Split up yuv2yuvX functions
  Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions
  lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition
  lavc: translate non-flag-based er options into flag-based ef options at codec open
  add -err_filter AVOptions to access flag-based error recognition
  h264_weight: initialize "height" function argument properly.
  presets: spelling error in libvpx 1080p50_60
  avplay: fix fullscreen behaviour with SDL 1.2.14 on Mac OS X

Conflicts:
	ffplay.c
	libavformat/libavformat.v
	libswscale/swscale.c
	libswscale/x86/swscale_template.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 05:13:56 +02:00
Dustin Brody
9abc98737f lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-22 14:49:55 +02:00
Michael Niedermayer
f884ef00de Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  tiffenc: initialize forgotten avctx.
  avplay: free the active audio packet at exit.
  avplay: free rdft data used for spectrogram analysis.
  log.h: make AVClass a named struct
  fix ac3 encoder documentation
  vc1: more prettyprinting cosmetics
  vc1: prettyprint some tables
  vc1: K&R formatting cosmetics
  AVOptions: bump minor and add APIchanges entry.
  cmdutils/avtools: simplify show_help() by using av_opt_child_class_next()
  AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
  Remove all uses of deprecated AVOptions API.
  AVOptions: add av_opt_next, deprecate av_next_option.
  AVOptions: add functions for evaluating option strings.
  AVOptions: split get_number().
  AVOptions: add av_opt_get*, deprecate av_get*.
  AVOptions: add av_opt_set*().
  AVOptions: add new API for enumerating children.
  rv34: move inverse transform functions to DSP context
  flvenc: Write the right metadata entry count
  ...

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffplay.c
	ffprobe.c
	libavcodec/ac3dec.c
	libavcodec/h264.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options.c
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavfilter/vf_drawtext.c
	libavformat/flvdec.c
	libavformat/mpegtsenc.c
	libavformat/options.c
	libavutil/avutil.h
	libavutil/opt.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-13 06:00:03 +02:00
Anton Khirnov
145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Michael Niedermayer
bfadca1faf mjpegdec: print nb_components too in pict debug info
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-17 01:38:58 +02:00
Michael Niedermayer
b002184fa1 mjpegdec: make sure we dont interpret things after the bitstream buffer as resync marker
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-17 01:38:58 +02:00
Michael Niedermayer
b6c04b6821 mjpegdec: Remove buggy avid hacks, they dont do anything good with any file i found
Fix multi plane jpeg
Fixes ticket471

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-16 23:09:12 +02:00
Michael Niedermayer
d55b06b8e7 mjpeg: interlaced buggy avid fix
Fix Ticket362

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-15 04:20:11 +02:00
Michael Niedermayer
e009432b50 mjpegdec: fix len for AVI1 reader
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-15 04:18:32 +02:00
Michael Niedermayer
b34c7a5656 Revert "MJPEG: emulate EOI also on two consecutive SOI."
This causes Ticket463, fix will be in the next commits

This reverts commit 5e2ea138b7.
2011-09-15 04:17:26 +02:00
Michael Niedermayer
be7eed72c8 mjpegdec; even better RSTn skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-06 18:20:34 +02:00
Michael Niedermayer
fea20d1ddc Revert "mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested"
This broke mplayer

This reverts commit a18e04bcf9.
2011-09-02 01:18:22 +02:00
Michael Niedermayer
94c2478d90 jpegdec: better rst skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-02 01:09:39 +02:00
Reimar Döffinger
5e2ea138b7 MJPEG: emulate EOI also on two consecutive SOI.
Fixes issue #362.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-09-01 22:54:35 +02:00
Reimar Döffinger
55a1fe7a80 Reset cur_scan at more appropriate places.
Reset it when we actually process an EOI, not when we actually
decide to ignore it for bug-workarounds, and reset it on
SOF to make it more reliable in case of missing EOI.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-09-01 22:54:35 +02:00
Gavin Kinsey
2f870e262e jpegdec: set color_range 2011-09-01 16:18:22 +02:00
Michael Niedermayer
0ed7bc49a3 Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  libx264: set default thread count to 0 (auto)
  lavc: cosmetics, group deprecated codec flags
  mpeg12: add 'scan_offset' private option.
  h263/p encoder: add 'structured_slices' private option.
  h263/p encoder: add 'obmc' private option.
  h263p encoder: add 'aiv' private option.
  h263p encoder: add 'umv' private option.
  mpeg12enc/mpeg4videoenc: add 'alternate_scan' private option.
  mjpegdec: add 'extern_huff' private option.
  mpeg4enc: add 'data_partitioning' private option.
  snow: add 'memc_only' private option.
  libx264: add 'mbtree' private option.
  libx264: add 'psy' private option.
  libmp3lame: add 'reservoir' private option.
  mpeg2enc: add 'non_linear_quant' private option
  mpeg12enc: add drop_frame_timecode private option.
  mpeg12enc: add intra_vlc private option.
  VC1: Support dynamic dimension changes
  mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested
  lavc: deprecate CODEC_FLAG2_BRDO
  ...

Conflicts:
	avconv.c
	libavcodec/libmp3lame.c
	libavcodec/libx264.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12enc.c
	libavcodec/mpegvideo.h
	libavcodec/vc1.c
	libavcodec/vc1dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-01 00:01:21 +02:00
Anton Khirnov
1f0c7020a1 mjpegdec: add 'extern_huff' private option.
Deprecate CODEC_FLAG_EXTERN_HUFF
2011-08-31 13:25:54 +02:00
Dustin Brody
a18e04bcf9 mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-31 10:28:29 +02:00
Reimar Döffinger
b118255e91 Replace goto by break, it has the same effect.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-08-27 22:17:23 +02:00
Michael Niedermayer
0cb233cf46 Merge commit 'b2c087871dafc7d030b2d48457ddff597dfd4925'
* commit 'b2c087871dafc7d030b2d48457ddff597dfd4925':
  Move x86util.asm from libavcodec/ to libavutil/.
  Move x86inc.asm to libavutil/.
  APIchanges: note error_recognition in lavf
  lavf: add support for error_recognition, use it in avidec, and bump minor API version
  avconv: change semantics of -map
  avconv: get rid of new* options.
  cmdutils: allow precisely specifying a stream for AVOptions.
  configure: add missing CFLAGS to fix building on the HURD
  libx264: Include hint for possible values for configuring libx264
  cmdutils: allow ':'-separated modifiers in option names.
  avconv: make -map_metadata work consistently with the other options
  avconv: remove deprecated options.
  avconv: make -map_chapters accept only the input file index.
  Make a copy of ffmpeg under a new name -- avconv.
  ffmpeg: add a warning stating that the program is deprecated.
  Add weighted motion compensation for RV40 B-frames
  RV3/4: calculate B-frame motion weights once per frame
  Move RV3/4-specific DSP functions into their own context
  mjpeg: propagate decode errors from ff_mjpeg_decode_sos and ff_mjpeg_decode_dqt
  h264: notice memory allocation failure

Conflicts:
	.gitignore
	Makefile
	cmdutils.c
	configure
	doc/ffplay.texi
	doc/ffprobe.texi
	doc/ffserver.texi
	libavcodec/libx264.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/version.h
	tests/lavf-regression.sh
	tests/lavfi-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-13 02:56:08 +02:00
Dustin Brody
21d7037234 mjpeg: propagate decode errors from ff_mjpeg_decode_sos and ff_mjpeg_decode_dqt
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-08-11 16:02:18 -07:00
Michael Niedermayer
faba79e080 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mxfdec: Include FF_INPUT_BUFFER_PADDING_SIZE when allocating extradata.
  H.264: tweak some other x86 asm for Atom
  probe: Fix insane flow control.
  mpegts: remove invalid error check
  s302m: use nondeprecated audio sample format API
  lavc: use designated initialisers for all codecs.
  x86: cabac: add operand size suffixes missing from 6c32576

Conflicts:
	libavcodec/ac3enc_float.c
	libavcodec/flacenc.c
	libavcodec/frwu.c
	libavcodec/pictordec.c
	libavcodec/qtrleenc.c
	libavcodec/v210enc.c
	libavcodec/wmv2dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-30 06:46:08 +02:00
Anton Khirnov
ec6402b7c5 lavc: use designated initialisers for all codecs.
It's more readable and less prone to breakage.
2011-07-29 08:42:34 +02:00
Michael Niedermayer
14d5e214bf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  jpegdec: actually search for and parse RSTn

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-25 01:19:40 +02:00
Michael Niedermayer
8c0fa61a97 jpegdec: actually search for and parse RSTn
Fixes decoding of MJPEG files produced by some UVC Logitec web cameras,
such as "Notebook Pro" and "HD C910".

References:
http://trac.videolan.org/vlc/ticket/4215
http://ffmpeg.org/trac/ffmpeg/ticket/267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Reviewed-by: Kostya <kostya.shishkov@gmail.com>
(cherry picked from commit 7b8ed831eb)
2011-07-23 19:19:13 +02:00
Michael Niedermayer
15285d8fc5 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  arm: remove disabled function dct_unquantize_h263_inter_iwmmxt()
  Remove commented-out call to non-existing function print_pow1().
  Do not decode RV30 files if the extradata is too small
  flashsv: split flashsv_decode_block() off from flashsv_decode_frame().
  ppc: remove disabled code
  libspeexdec: Drop const qualifier to silence compiler warning.
  libopenjpeg: Drop const qualifier to silence compiler warning.
  alac: Remove unused dummy code.
  Remove unused structs and tables.
  vaapi: do not assert on value read from input bitstream
  flashsvenc: replace bitstream description by a link to the specification
  flashsvenc: drop unnecessary cast
  flashsvenc: improve some variable names and fix corresponding comments
  flashsvenc: merge two consecutive if-conditions
  flashsvenc: merge variable declarations and initializations
  flashsvenc: convert some debug av_log() to av_dlog()
  flashsvenc: whitespace cosmetics
  flashsvenc: drop some unnecessary parentheses
  flashsvenc: fix some comment typos
  aacps: skip some memcpy() if src and dst would be equal
  ...

Conflicts:
	libavcodec/vaapi_mpeg2.c
	libavformat/aviobuf.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-16 19:43:35 +02:00
Diego Biurrun
356be9307c Remove unused structs and tables. 2011-07-16 01:08:31 +02:00
Michael Niedermayer
976a8b2179 Merge remote-tracking branch 'qatar/master'
* qatar/master: (40 commits)
  H.264: template left MB handling
  H.264: faster fill_decode_caches
  H.264: faster write_back_*
  H.264: faster fill_filter_caches
  H.264: make filter_mb_fast support the case of unavailable top mb
  Do not include log.h in avutil.h
  Do not include pixfmt.h in avutil.h
  Do not include rational.h in avutil.h
  Do not include mathematics.h in avutil.h
  Do not include intfloat_readwrite.h in avutil.h
  Remove return statements following infinite loops without break
  RTSP: Doxygen comment cleanup
  doxygen: Escape '\' in Doxygen documentation.
  md5: cosmetics
  md5: use AV_WL32 to write result
  md5: add fate test
  md5: include correct headers
  md5: fix test program
  doxygen: Drop array size declarations from Doxygen parameter names.
  doxygen: Fix parameter names to match the function prototypes.
  ...

Conflicts:
	libavcodec/x86/dsputil_mmx.c
	libavformat/flvenc.c
	libavformat/oggenc.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-04 00:45:21 +02:00
Mans Rullgard
b27565b143 Remove statements immediately following unconditional jumps
This removes a number of compiler warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 03:15:53 +01:00
Mans Rullgard
050f2b3e7f mjpeg: remove pointless braces around block of code
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 03:15:48 +01:00
Michael Niedermayer
9291faeb67 jpegdec: include mjpb_skiptosod in debug output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-19 03:54:16 +02:00
Michael Niedermayer
a09a3e8213 jpegdec: fix CJPG decoding.
Fixes ticket133

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-19 03:54:16 +02:00
Michael Niedermayer
7b8ed831eb jpegdec: actually search for and parse RSTn
Fixes Ticket267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-09 03:35:50 +02:00
Reimar Döffinger
3b6bbfa063 Check syntax even if DEBUG is not defined. 2011-05-11 12:26:25 +02:00
Stefano Sabatini
01042d4123 lavc: set defaults in internal codec frames
This is required specifically for setting frame->format to -1,
otherwise it will be set to 0 = PIX_FMT_YUV420P and code reading
the format from the output decoded frame will get misled.

In particular fix regressions occurring with the pending vsrc_buffer
patch.
2011-05-07 12:03:59 +02:00
Stefano Sabatini
ce5e49b0c2 replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_* 2011-05-02 16:41:41 +02:00
Stefano Sabatini
975a1447f7 Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-02 12:18:44 +02:00
anatoly
dd1e5bfd5e Add support for picture_ptr field in MJpegDecodeContext
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-26 22:06:13 +02:00
anatoly
7e6a9e6444 Move MJPEG's input buffer preprocessing in separate public function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-26 22:06:13 +02:00
anatoly
34686566f3 Support reference picture defined by bitmask in MJPEG's SOS decoder
With cleanup & simplification by me

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-26 22:06:13 +02:00
Michael Niedermayer
76cd98b445 mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Ronald S. Bultje <rbultje@google.com>
2011-04-26 09:29:08 +02:00
Michael Niedermayer
73a51e00a7 mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-21 22:44:55 +02:00
anatoly
e0e3b8b297 Add support for picture_ptr field in MJpegDecodeContext
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-03-30 07:18:34 +02:00
anatoly
f16055eedf Move MJPEG's input buffer preprocessing in separate public function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-03-30 07:18:34 +02:00
anatoly
8f0bd2c07d Support reference picture defined by bitmask in MJPEG's SOS decoder
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-03-30 07:18:34 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Carl Eugen Hoyos
2e3c56a29f 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.

Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-16 23:05:46 +01:00
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
Reinhard Tartler
737eb5976f Merge libavcore into libavutil
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-02-15 16:18:21 +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
Luca Barbato
dfd2a005eb Replace dprintf with av_dlog
dprintf clashes with POSIX.1-2008
2011-01-29 23:55:37 +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
Diego Elio Pettenò
d36beb3f69 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>
2011-01-26 16:08:45 +00: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
Mans Rullgard
bf5f9b528b 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>
2011-01-23 13:57:56 +00: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