Commit Graph

382 Commits

Author SHA1 Message Date
Michael Niedermayer 681868cbbe avcodec/mpegvideo: Fix psnr calculation with slice threads
This fixes a race condition and use of the wrong field, which become shared
instead of per thread during some AVFrame changes.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-13 13:16:27 +02:00
Michael Niedermayer 60ab6e2457 avcodec/mpegvideo_enc: fix padding for odd dimensions and interlaced video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-11 05:02:46 +02:00
Michael Niedermayer b3a647d9ce Merge commit 'd7705be9617ed691c7a2924a2088de2d96f38af1'
* commit 'd7705be9617ed691c7a2924a2088de2d96f38af1':
  mpegvideoenc: check color_range

Conflicts:
	libavcodec/mpegvideo_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-11 02:57:08 +02:00
Vittorio Giovara d7705be961 mpegvideoenc: check color_range
Rework the comparison into something simpler to understand.
2014-06-10 19:41:59 -04:00
Reimar Döffinger 6d695d7acc Fix nonsense non-mod16 AMV flipping code.
It is obviously nonsense since it produces wrong results
or even crashes (crashes should be encode-only though).
Fixes trac issue #1092.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-01 19:47:07 +02:00
Michael Niedermayer 98a6806fdd Merge commit '368f50359eb328b0b9d67451f56fda20b3255f9a'
* commit '368f50359eb328b0b9d67451f56fda20b3255f9a':
  dsputil: Split off quarterpel bits into their own context

Conflicts:
	configure
	libavcodec/dsputil.c
	libavcodec/h263dec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/vc1dec.c
	libavcodec/vc1dsp.c
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/qpeldsp.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-30 02:43:34 +02:00
Diego Biurrun 368f50359e dsputil: Split off quarterpel bits into their own context 2014-05-29 06:48:31 -07:00
Michael Niedermayer e77b9853ea Merge commit 'a2941c8cb216bdc144953cace64973f5600ffa2d'
* commit 'a2941c8cb216bdc144953cace64973f5600ffa2d':
  lavc: move CODEC_FLAG_MV0 to mpegvideo

Conflicts:
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 17:03:59 +02:00
Michael Niedermayer 1851643987 Merge commit 'b2c31710c96fa47d9dcd40b64d39663e8957f683'
* commit 'b2c31710c96fa47d9dcd40b64d39663e8957f683':
  lavc: move CODEC_FLAG_NORMALIZE_AQP to mpegvideo

Conflicts:
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 16:46:38 +02:00
Michael Niedermayer cac07d0e10 Merge commit '5fccedaa67390ccddd6347c8e1c71b7664558bcd'
* commit '5fccedaa67390ccddd6347c8e1c71b7664558bcd':
  lavc: deprecate CODEC_FLAG_INPUT_PRESERVED

Conflicts:
	doc/APIchanges

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 16:41:41 +02:00
Anton Khirnov a2941c8cb2 lavc: move CODEC_FLAG_MV0 to mpegvideo 2014-05-01 09:24:18 +02:00
Anton Khirnov b2c31710c9 lavc: move CODEC_FLAG_NORMALIZE_AQP to mpegvideo 2014-05-01 09:23:19 +02:00
Anton Khirnov 5fccedaa67 lavc: deprecate CODEC_FLAG_INPUT_PRESERVED
The addition of reference-counted frames makes it pointless.
2014-05-01 09:22:47 +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
Michael Niedermayer 1c7b71a5bd mpegvideo: Use the current_picture pts
The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-04-21 21:58:58 +02:00
Michael Niedermayer 66e959682c avcodec/mpegvideo_enc: override bitrate tolerance when its value is too small
Fixes Ticket3257

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-12 01:29:20 +02:00
Michael Niedermayer 849d40dce6 avcodec/mpegvideo_enc: change some asserts to av_asserts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09 23:57:18 +02:00
Michael Niedermayer 59a53842d3 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo: operate with pointers to AVFrames instead of whole structs

Conflicts:
	libavcodec/h261dec.c
	libavcodec/h263dec.c
	libavcodec/intrax8.c
	libavcodec/mpeg12enc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo.h
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/mpegvideo_xvmc.c
	libavcodec/msmpeg4.c
	libavcodec/ratecontrol.c
	libavcodec/vaapi.c
	libavcodec/vc1dec.c
	libavcodec/vdpau_vc1.c

See: fc567ac49e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09 15:18:46 +02:00
wm4 f6774f905f mpegvideo: operate with pointers to AVFrames instead of whole structs
The most interesting parts are initialization in ff_MPV_common_init() and
uninitialization in ff_MPV_common_end().

ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL
checks for Picture.f, because these functions can be called on
uninitialized or partially initialized Pictures.

NULL pointer checks are added to ff_thread_release_buffer() stub function.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-04-09 02:12:19 +02:00
Michael Niedermayer e92a78a409 avcodec/mpegvideo: make mc_mb_var_sum / mb_var_sum 64bit
This avoids a hypothetical integer overflow with very high resolution video

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-21 18:24:56 +01:00
Michael Niedermayer 9517900bef Merge commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b'
* commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b':
  mpegvideo: move mpegvideo formats-related defines to mpegutils.h

Conflicts:
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_mvpred.h
	libavcodec/svq1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 12:36:48 +01:00
Vittorio Giovara e0c16e4e32 mpegvideo: move mpegvideo formats-related defines to mpegutils.h 2014-03-16 23:04:41 +01:00
Michael Niedermayer 06a3185e38 avcodec/mpegvideo_enc: dont use direct mode for unaligned input
Fixes Ticket3456

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 14:56:42 +01:00
Michael Niedermayer 6016b8329b Merge commit '05563ccacc98fd185affdbf8cbaf094caf36b852'
* commit '05563ccacc98fd185affdbf8cbaf094caf36b852':
  dsputil: cosmetics: Lose camelCase on ff_cropTbl and ff_squareTbl names

Conflicts:
	libavcodec/bit_depth_template.c
	libavcodec/motionpixels_tablegen.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-14 00:39:51 +01:00
Diego Biurrun 05563ccacc dsputil: cosmetics: Lose camelCase on ff_cropTbl and ff_squareTbl names
Also switch from "tbl" to "tab" name suffixes.
2014-03-13 08:12:44 -07:00
Diego Biurrun 9103185bd1 dsputil: Drop ff_check_alignment() function
The function is supposed to confirm that the compiler provided enough
alignment, but in practice it is only run in certain code paths and
insufficient alignment problems are restricted to legacy compilers.
2014-03-13 05:50:28 -07:00
Michael Niedermayer cbcfd7da4d avcodec: support setting the chroma intra matrix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-18 18:19:27 +01:00
Lukasz Marek 3f47e24cbe lavc/mpegvideo: add missing const
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-08 02:55:51 +01:00
Michael Niedermayer 965fa6b0d9 Merge commit 'fb0c9d41d685abb58575c5482ca33b8cd457c5ec'
* commit 'fb0c9d41d685abb58575c5482ca33b8cd457c5ec':
  avutil: remove timer.h include from internal.h

Conflicts:
	libavcodec/ffv1dec.c
	libavutil/internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-26 01:54:55 +01:00
Janne Grunau fb0c9d41d6 avutil: remove timer.h include from internal.h
Added libavutil/timer.h include to all files with {START,STOP}_TIMER.
2014-01-25 21:50:20 +01:00
Michael Niedermayer 0269b30fef Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo_enc: Don't call ff_h263dsp_init unconditionally

Conflicts:
	libavcodec/mpegvideo_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-22 23:36:33 +01:00
Martin Storsjö cff480e49d mpegvideo_enc: Don't call ff_h263dsp_init unconditionally
This fixes builds with e.g. --disable-decoders --disable-encoders
--enable-encoder=mjpeg.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-22 18:42:38 +02:00
Michael Niedermayer d08dd32863 avcodec/mpegvideo_enc: disable direct mode in load_input_picture() for dimensions%16 != 0
We currently read a whole 16x16 block from the input at a few places

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-20 17:04:57 +01:00
Michael Niedermayer 0117ba5594 avcodec/mpegvideo_enc: fix custom matrixes with jpeg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-18 06:33:45 +01:00
Michael Niedermayer 3ca7085ae2 avcodec: make "bitrate tolerance too small for bitrate" error more verbose
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-17 03:10:42 +01:00
Michael Niedermayer b8ff951ce0 avcodec/mpegvideo_enc: init chroma matrix for mjpeg
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-11 21:38:11 +01:00
Michael Niedermayer 859d74040e avcodec/mjpegenc: pass chroma quantization matrix through as well, not just luma
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-11 21:26:51 +01:00
Michael Niedermayer 2830f287e2 Merge commit 'ebfe622bb1ca57cecb932e42926745cba7161913'
* commit 'ebfe622bb1ca57cecb932e42926745cba7161913':
  mpegvideo: drop support for real (non-emulated) edges

Conflicts:
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_motion.c
	libavcodec/wmv2.c

If this is slower on a major platform then it should be investigated
and potentially reverted.

See: 8fc52a5ef9
See: 3969b4b861
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-09 14:19:24 +01:00
Anton Khirnov ebfe622bb1 mpegvideo: drop support for real (non-emulated) edges
Several decoders disable those anyway and they are not measurably faster
on x86. They might be somewhat faster on other platforms due to missing
emu edge SIMD, but the gain is not large enough (and those decoders
relevant enough) to justify the added complexity.
2014-01-09 09:41:19 +01:00
Michael Niedermayer fb17f03dad Merge commit 'aec25b1c4650944d32706bfd40eb02bbd5587303'
* commit 'aec25b1c4650944d32706bfd40eb02bbd5587303':
  mpegvideo: split the encoding-only parts of frame_start() into a separate function

Conflicts:
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 02:56:29 +01:00
Anton Khirnov aec25b1c46 mpegvideo: split the encoding-only parts of frame_start() into a separate function
This introduces some code duplication. However, much of it should go
away once the decoders stop using MpegEncContext.
2014-01-03 16:52:49 +01:00
Michael Niedermayer 46b06bd894 avcodec/mpegvideo_enc: implement frame skip score normalization
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:46:39 +01:00
Michael Niedermayer 34fe125f4b avcodec/mpegvideo_enc: fix frame skipping with intra only codecs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 15:04:40 +01:00
Michael Niedermayer 241eccd628 avcodec/mpegvideo_enc: fix integer overflow with -skip_exp >= 2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 14:10:34 +01:00
Michael Niedermayer 535af2c222 avcodec/mpegvideo_enc/frame_end(): remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 14:19:33 +01:00
Michael Niedermayer 93947d88f2 Merge commit '24abd806ea0cfb0d988d2f0044eac79cff12918c'
* commit '24abd806ea0cfb0d988d2f0044eac79cff12918c':
  ljpegenc: deMpegEncContextize

Conflicts:
	libavcodec/ljpegenc.c
	libavcodec/mpegvideo.h
	libavcodec/mpegvideo_enc.c
	tests/ref/vsynth/vsynth1-ljpeg
	tests/ref/vsynth/vsynth2-ljpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 13:30:23 +01:00
Michael Niedermayer b342ea603f Merge commit '3360ad995530ea6967b1e83981b4aa8240fbb0ed'
* commit '3360ad995530ea6967b1e83981b4aa8240fbb0ed':
  mjpegenc: do not pass MpegEncContext to ff_mjpeg_encode_picture_trailer()

Conflicts:
	libavcodec/ljpegenc.c
	libavcodec/mjpegenc.c
	libavcodec/mjpegenc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 11:33:07 +01:00
Michael Niedermayer d8fb209a7f Merge commit '058d5f2feb730846f22c1812e433f92f670ad751'
* commit '058d5f2feb730846f22c1812e433f92f670ad751':
  mjpegenc: do not pass MpegEncContext to ff_mjpeg_encode_picture_header()

Conflicts:
	libavcodec/mjpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 11:16:05 +01:00
Michael Niedermayer 08667c2678 Merge commit '0b0a7a751de02464a33717e70352f696372ba1c4'
* commit '0b0a7a751de02464a33717e70352f696372ba1c4':
  mpegvideo: move encode-only parts of common_end() to encode_end()

Conflicts:
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 03:12:10 +01:00
Michael Niedermayer b6e7834ac6 avcodec/mpegvideo_enc: fix linesizes in frame_end()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 02:53:10 +01:00