Commit Graph

581 Commits

Author SHA1 Message Date
Derek Buitenhuis 730d2aabac Merge commit '0e9c4fe254073b209970df3e3cb84531bc388e99'
* commit '0e9c4fe254073b209970df3e3cb84531bc388e99':
  lavc: Move pre_me to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-03 16:54:20 +00:00
Derek Buitenhuis 43c0298208 Merge commit '5b6f42da98c26a8aee8d2c2edfcbd0633ad1c607'
* commit '5b6f42da98c26a8aee8d2c2edfcbd0633ad1c607':
  lavc: Move me_penalty_compensation to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-03 16:53:13 +00:00
Derek Buitenhuis f3af379b5c Merge commit '2862b63783b5556f7f3fb2d097629bc6879f833a'
* commit '2862b63783b5556f7f3fb2d097629bc6879f833a':
  lavc: Move prediction_method to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-03 16:49:19 +00:00
Derek Buitenhuis 899e19f177 Merge commit '936f0d98f864f9f6bb4f9e5458b78537e146bacd'
* commit '936f0d98f864f9f6bb4f9e5458b78537e146bacd':
  lavc: Move rtp_payload_size to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-31 13:19:50 +00:00
Derek Buitenhuis 0e3e3656d3 Merge commit '12b49769223234673db1003d9c43e7483ceb0282'
* commit '12b49769223234673db1003d9c43e7483ceb0282':
  lavc: Move mpeg_quant to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 16:44:59 +00:00
Derek Buitenhuis b986a4625d Merge commit '1482aff2048511b821ff9feac19426113cc641a2'
* commit '1482aff2048511b821ff9feac19426113cc641a2':
  lavc: Move noise_reduction to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 16:42:32 +00:00
Derek Buitenhuis 30c1bdb87c Merge commit '7c79587d7407dab4b9445d66b5f111fe657c8c4d'
* commit '7c79587d7407dab4b9445d66b5f111fe657c8c4d':
  lavc: Move scenechange_threshold to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 15:24:00 +00:00
Derek Buitenhuis 13be46c08e Merge commit '0ac9f33a9e69c64eee592791be3c5441a6a3d6b7'
* commit '0ac9f33a9e69c64eee592791be3c5441a6a3d6b7':
  lavc: Move frame_skip_* to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 15:08:10 +00:00
Derek Buitenhuis 4f32ccb618 Merge commit '84c4714f397c9c50eb9d49008cc1c08385f68f31'
* commit '84c4714f397c9c50eb9d49008cc1c08385f68f31':
  lavc: Move brd_scale to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 14:21:33 +00:00
Derek Buitenhuis 2e9b995e4f Merge commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92'
* commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92'
  lavc: Move b_frame_strategy and b_sensitivity to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 20:18:04 +00:00
Vittorio Giovara 0e9c4fe254 lavc: Move pre_me to codec private options
This option is only used by mpegvideoenc.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:40:28 -05:00
Vittorio Giovara 5b6f42da98 lavc: Move me_penalty_compensation to codec private options
This option is only used by mpegvideoenc.
It is a very codec-specific options, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 2862b63783 lavc: Move prediction_method to codec private options
This options is only used by huffyuv, ffvhuv, jpegls, mjpeg,
mpegvideoenc, png, utvideo.
It is a very codec-specific options, so deprecate the global variant.
Set proper limits to the maximum allowed values, and update utvideoenc
tests to use the new option name.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 936f0d98f8 lavc: Move rtp_payload_size to codec private options
This option is only used by mpegvideoenc and openh264.
It is a very codec-specific option, so deprecate the global variant.

The openh264 option is dropped altogether since it is just a fallback
for -max_nal_size anyway.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 12b4976922 lavc: Move mpeg_quant to codec private options
This option is only used by mpegvideoenc, and xvid.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 1482aff204 lavc: Move noise_reduction to codec private options
This option is only used by mpegvideoenc, x264, xavs, and vpx.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 7c79587d74 lavc: Move scenechange_threshold to codec private options
This option is only used by mpegvideoenc, x264, and xavs.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 0ac9f33a9e lavc: Move frame_skip_* to codec private options
These options are only used by mpegvideoenc and vpx.
They are very codec-specific options, so deprecate the global variants.

Add an allowed value to the private options for frame_skip_cmp which
seems to have been forgotten, but perfectly working.

The libvpx frame dropping feature uses one of such option
(frame_skip_threshold) without the other three. For this reason rename
the option to something more consistent with the other libvpx variables.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 84c4714f39 lavc: Move brd_scale to codec private options
This option is only used by mpegvideoenc,
It is a very codec-specific option, so deprecate the global variant.
Set proper limits to the maximum allowed values.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara 0e6c853221 lavc: Move b_frame_strategy and b_sensitivity to codec private options
The b_frame_strategy option is only used by mpegvideoenc, qsv, x264, and
xavs, while b_sensitivity is only used by mpegvideoenc.

These are very codec-specific options, so deprecate the global variants.
Set proper limits to the maximum allowed values.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Michael Niedermayer b65efbc0f4 avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
Fixes assertion failure
Fixes: 6568d187979ce17878b6fe5fbbb89142/signal_sigabrt_7ffff6ae7cb7_7176_564bbc6741bdcf907f5c4e685c9a77a2.mpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-21 15:56:11 +01:00
Michael Niedermayer 7c97946d61 avcodec/mpeg4video: Check time_incr
Fixes assertion failure
Fixes out of memory access

Fixes: test_casex.ivf

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 03:35:29 +01:00
Michael Niedermayer 13f266b50c avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
Fixes out of array read
Fixes: test_case-mdc.264 (b47be15a120979f5a1a945c938cbef33)

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-07 00:41:21 +01:00
Michael Niedermayer 5b4da8a38a avcodec/motion_est: Fix mv_penalty table size
Fixes out of array read

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-05 18:10:34 +01:00
Hendrik Leppkes 06d69a2d22 Merge commit '458e53f51fc75d08df884f8e9eb3d7ded23e97b3'
* commit '458e53f51fc75d08df884f8e9eb3d7ded23e97b3':
  mpegvideo_enc: actually add the side data with vbv_delay to the packet

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-18 14:53:19 +01:00
Hendrik Leppkes 362028cac9 Merge commit '16216b713f9a21865cc07993961cf5d0ece24916'
* commit '16216b713f9a21865cc07993961cf5d0ece24916':
  lavc: Drop exporting 2-pass encoding stats

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-18 14:39:15 +01:00
Hendrik Leppkes 31ae2308b3 Merge commit '2507b5dd674834be7261772996f47ae3b95cca69'
* commit '2507b5dd674834be7261772996f47ae3b95cca69':
  mpegvideo_enc: export vbv_delay in side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:36:09 +01:00
Hendrik Leppkes b799619f48 Merge commit '3f5c99fcbb2c366d7bdef8500c19f43a33bdb6b9'
* commit '3f5c99fcbb2c366d7bdef8500c19f43a33bdb6b9':
  mpegvideo_enc: export CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:35:34 +01:00
Anton Khirnov 458e53f51f mpegvideo_enc: actually add the side data with vbv_delay to the packet
Fixes 2507b5dd67
2015-12-12 21:16:41 +01:00
Vittorio Giovara 16216b713f lavc: Drop exporting 2-pass encoding stats
These variables are coming from mpegvideoenc where are supposedly used
as bit counters on various frame properties. However their use is
unclear as they lack documentation, are available only from a very small
subset of encoders, and they are hardly used in the wild. Also frame_bits
in aacenc is employed in a similar way.

Remove this functionality from AVCodecContex, these variable are mostly
frame properties, and too few encoders support setting them with anything
useful.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:27:42 -05:00
Anton Khirnov 2507b5dd67 mpegvideo_enc: export vbv_delay in side data
Deprecate AVCodecContext.vbv_delay
2015-12-06 10:25:23 +01:00
Anton Khirnov 3f5c99fcbb mpegvideo_enc: export CPB props side data 2015-12-06 10:25:08 +01:00
Clément Bœsch fb99ef0bd3 avcodec: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:37:05 +01:00
Hendrik Leppkes 93fb4a4629 Merge commit '462a54e2291e1fa18e1f1254d09739dfbb795617'
* commit '462a54e2291e1fa18e1f1254d09739dfbb795617':
  lavc: Deprecate avctx.rtp_callback field

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-29 15:26:51 +01:00
Michael Niedermayer 13834c1016 avcodec/mpegvideo_enc: Remove slice structured mode from H.263 as well as the code automatically enabing it
There is no such thing as a slice structured mode in the original version 1  H.263,
that mode was added in H.263+ in 1998. Also the headers for slice structured mode
are not part of the older version 1 and this would result in unplayable files

An alternative to this patch would be to merge the H263 and H263P AVCodecs and use
other means to distinguish the older and newer versions.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-23 22:47:41 +01:00
Derek Buitenhuis 09f9ef8536 Merge commit 'f6c94457b44f41d900cd0991857f54e1f0ccedd6'
* commit 'f6c94457b44f41d900cd0991857f54e1f0ccedd6':
  mpegvideo_enc: enable rtp_mode when multiple slices are used

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-22 17:46:26 +00:00
Derek Buitenhuis 819a99ef21 Merge commit 'd80f0a4ad634b3949b91b85f21fd608c0cddeef7'
* commit 'd80f0a4ad634b3949b91b85f21fd608c0cddeef7':
  mpevideo_enc: disallow multiple slices for h261 and flv

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-22 17:43:26 +00:00
Vittorio Giovara 462a54e229 lavc: Deprecate avctx.rtp_callback field
This function returns the encoded data of a frame, one slice at a time
directly when that slice is encoded, instead of waiting for the full
frame to be done. However this field has a debatable usefulness, since
it looks like it is just a convoluted way to get data at lowest
possible latency, or a somewhat hacky way to store h263 in RFC-2190
rtp encapsulation.

Moreover when multi-threading is enabled (which is by default) the order
of returned slices is not deterministic at all, making the use of this
function not reliable at all (or at the very least, more complicated
than it should be).

So, for the reasons stated above, and being used by only a single encoder
family (mpegvideo), this field is deemed unnecessary, overcomplicated,
and not really belonging to libavcodec. Libavformat features a complete
implementation of RFC-2190, for any other case.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-20 21:05:20 +01:00
Anton Khirnov f6c94457b4 mpegvideo_enc: enable rtp_mode when multiple slices are used
Currently, multiple slices with just one thread produce corrupted
output.

Additionally, enable slice structured mode for h263(+)

Bug-Id: 912
CC: libav-stabl@libav.org
2015-11-20 09:22:59 +01:00
Anton Khirnov d80f0a4ad6 mpevideo_enc: disallow multiple slices for h261 and flv
They do not work and produce corrupted output.

CC: libav-stable@libav.org
2015-11-20 09:22:48 +01:00
Hendrik Leppkes 7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Hendrik Leppkes 0a830b95d5 Merge commit '447b5b278c689b21bbb7b5747c8773145cbd9448'
* commit '447b5b278c689b21bbb7b5747c8773145cbd9448':
  mpegvideo_enc: Fix encoding videos with less frames than the delay of the encoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:04:47 +01:00
Luca Barbato ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Alexis Ballier 447b5b278c mpegvideo_enc: Fix encoding videos with less frames than the delay of the encoder
When the encoder is fed with less frames than its delay, the picture list
looks like { NULL, NULL, ..., frame, frame, frame }. When flushing the
encoder (input frame == NULL), we need to ensure the picture list is
shifted enough so that we do not return an empty packet, which would
mean the encoder has finished, while it has not encoded any frame.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-25 22:43:30 +01:00
Michael Niedermayer 27eeee76b2 mpegvideo_enc: Merge ifs with identical conditions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-25 22:24:13 +01:00
Michael Niedermayer f0a88d4d2a mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-25 22:23:51 +01:00
Alexis Ballier 6e8d856ad6 libavcodec/mpegvideo_enc.c: Fix encoding videos with less frames than the delay of the encoder.
When the encoder is fed with less frames than its delay, the picture list looks like { NULL, NULL, ..., frame, frame, frame }. When flushing the encoder (input frame == NULL), we need to ensure the picture list is shifted enough so that we do not return an empty packet, which would mean the encoder has finished, while it has not encoded any frame.

Before the patch, the command:
'./ffmpeg_g -loglevel debug -f lavfi -i "testsrc=d=0.01" -bf 2 -vcodec mpeg2video out.mxf' prints:

Output stream #0:0 (video): 1 frames encoded; 0 packets muxed (0 bytes);

After:

Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (8058 bytes);

Relates to ticket #4817.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-18 11:55:40 +02:00
Michael Niedermayer fd46d6deac avcodec/mpegvideo_enc: Merge ifs with identical conditions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-18 11:44:42 +02:00
Michael Niedermayer b379e1d6df avcodec/mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-18 11:42:32 +02:00
Christophe Gisquet 9f3bfe30dd mpegvideo: dnxhdenc: permute 10bits content
Dequant or encoding were trying to reverse a scan that hadn't been
applied...

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-13 00:01:39 +02:00