Commit Graph

82329 Commits

Author SHA1 Message Date
Andreas Cadhalpun
484151df7c pnm: limit maxval to UINT16_MAX
From 'man ppm': The maximum color value (Maxval), again in ASCII decimal.
                Must be less than 65536.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-12 01:36:47 +01:00
Andreas Cadhalpun
360bc0d90a smvjpegdec: make sure cur_frame is not negative
This fixes a heap-buffer-overflow detected by AddressSanitizer.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-12 01:36:47 +01:00
Marton Balint
005d058f42 lavfi/loudnorm: add an internal libebur128 library
Also contains the following changes to the library:
- add ff_ prefix to functions
- remove cplusplus defines.
- add FF_ prefix to contants and some structs
- remove true peak calculation feature, since it uses its own resampler, and
  af_loudnorm does not need it.
- remove version info and some fprintf(stderr) functions
- convert to use av_malloc
- always use histogram mode for LRA calculation, otherwise LRA data is slowly
  consuming memory making af_loudnorm unfit for 24/7 operation. It also uses a
  BSD style linked list implementation which is probably not available on all
  platforms. So let's just remove the classic mode which not uses histogram.
- add ff_thread_once for calculating static histogram tables
- convert some functions to void which cannot fail
- remove intrinsics and some unused headers
- add support for planar audio
- remove channel / sample rate changer function, in ffmpeg usually we simply
  alloc a new context
- convert some static variables to defines
- declare static histogram variables as aligned
- convert some initalizations to mallocz
- add window size parameter to init function and remove window size setter
  function
- convert return codes to AVERROR
- fix indentation

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-11-11 19:37:54 +01:00
Marton Balint
7b8445f03d tools: add loudnorm script example to use loudnorm
Based on a patch by Kyle Swanson <k@ylo.ph>.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-11-11 19:22:52 +01:00
Lou Logan
872b358903 doc/encoders: sort list into alphabetical order
Signed-off-by: Lou Logan <lou@lrcd.com>
2016-11-10 14:41:37 -09:00
Tom Butterworth
48f0e41c30 doc/encoders: add documentation for the Hap encoder
Documents options and behaviour, noting when 'chunks' option will
not be honoured.

Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
Signed-off-by: Martin Vignali <martin.vignali@gmail.com>
2016-11-10 14:08:30 -09:00
Andreas Cadhalpun
89eb398c7f icodec: correctly check avio_read return value
It can read less than the requested amount, in which case buf contains
uninitialized data, causing problems like segmentation faults later on.

Also make sure that image->size is positive, so that it can't match a
negative error code.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-10 22:02:49 +01:00
Andreas Cadhalpun
c82b8ef0e4 dvbsubdec: fix division by zero in compute_default_clut
This problem was introduced in commit
4b90dcb849.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-10 21:01:59 +01:00
Andreas Cadhalpun
1e33035ee7 proresdec_lgpl: explicitly check coff[3] against slice_data_size
The implicit checks via v_data_size and a_data_size don't work in the case
'(hdr_size > 7) && !ctx->alpha_info'.

This fixes segmentation faults due to invalid reads.

This problem was introduced in commit
547c2f002a.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-10 21:00:44 +01:00
Sasi Inguva
18108f3618 lavc/utils.c: Make sure skip_samples never goes negative.
Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 17:44:47 +01:00
Sasi Inguva
c8dc11bb9e lavf/mov.c: Fallback to finding non-keyframe in fix_index, if keyframe search fails.
Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 17:44:47 +01:00
Tom Butterworth
bd6fa80d56 avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression
The secondary compression in Hap is optional, this change exposes that option to
the user as some use-cases favour higher bitrate files to reduce workload
decoding.
Adds "none" or "snappy" as options for "compressor". Selecting "none" disregards
"chunks" option: chunking is only of benefit decompressing Snappy.

Reviewed-by: Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
2016-11-10 14:27:38 +00:00
Carl Eugen Hoyos
08be65a075 lavc/hevc_ps: Fix an error message. 2016-11-10 08:22:26 +01:00
Carl Eugen Hoyos
edb8af6e92 lavc/hevc_ps: Use correct pix_fmt for 12bit 4:0:0.
Fixes part of ticket #5544.
2016-11-10 08:11:12 +01:00
Steven Liu
863ebe6f83 avformat/flvenc: add add_keyframe_index option
Add keyframe index metadata
Used to facilitate seeking; particularly for HTTP pseudo streaming.
 1. read live streaming or file by sequence
 2. if use add_keyframe_index option, add a mark flag at the position,
    use to insert new context at the last step.
 3. add the keyframes *offset* and *timestamp* into a list
 4. if use add_keyframe_index option, shift the metadata data from
    mark flag offset
 5. insert the keyframes *offset* and *timestamp* from the list by
    sequence
 6. free the list
 7. end.

Add FATE test case;

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Steven Liu <liuqi@gosun.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 10:30:48 +08:00
Michael Niedermayer
2bc66d9e43 nut: add gray12 support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 01:18:43 +01:00
Luca Barbato
19be5fb728 swscale: Add GRAY12
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:49:29 +01:00
Luca Barbato
638b216d4f pixfmt: Add GRAY12
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:42:48 +01:00
Michael Niedermayer
b828788d58 swscale: Add GBRAP10 output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Luca Barbato
2c7d8cbd66 swscale: Add the GBRAP12 output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer
873d06c76e swscale/output: Fix alpha shift in yuv2gbrp_full_X_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer
a340cfef82 swscale/input: Fix alpha bswap for set readAlpPlanar
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer
d736b52a04 swscale: Drop is9_OR_10BPS() use, its name is not correct
Found-by: Luca Barbato
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Andreas Cadhalpun
226d35c845 escape124: reject codebook size 0
It causes a cb_depth of 32, leading to assertion failures in get_bits.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-09 21:10:59 +01:00
Andreas Cadhalpun
d54c95a143 icodec: add ico_read_close to fix leaking ico->images
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-09 21:10:41 +01:00
Andreas Cadhalpun
467eece1be icodec: fix leaking pkt on error
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-09 21:10:35 +01:00
Steven Liu
ab6ffc2a08 MAINTAINERS: Add myself to flvenc
Signed-off-by: Steven Liu <liuqi@gosun.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-09 17:49:19 +01:00
Andreas Cadhalpun
1bbb18fe82 mpegts: prevent division by zero
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-08 22:27:11 +01:00
Andreas Cadhalpun
ff100c9dd9 matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header
The code assumes that s->streams[0] is valid.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-08 20:17:31 +01:00
Tom Butterworth
0a24587588 avcodec/hap: pass texture-compression destination as argument, not in context
This allows a subsequent change to compress directly into the output packet when possible.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
2016-11-08 17:05:27 +00:00
James Almer
70c6a1bcf0 avformat/matroskadec: fix DiscardPadding element parsing
If the value is negative then it means padding at the start of the packet
instead of at the end.

Based on a patch by Hendrik Leppkes.

Reviewed-by: James Zern <jzern-at-google.com@ffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-08 13:43:53 -03:00
Rostislav Pehlivanov
317be31eaf opus: move the entropy decoding functions to opus_rc.c
The intention is to have both encoding and decoding functions
in opus_rc.c.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-11-08 14:18:59 +00:00
Rostislav Pehlivanov
0660a09dd1 opus: move all tables to a separate file
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-11-08 14:18:59 +00:00
Vittorio Giovara
a765ba647d avformat/mov: Read multiple stsd from DV
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 14:07:41 +01:00
Reynaldo H. Verdejo Pinochet
6f0a1710d7 ffserver: use AVStream.codecpar in open_input_stream()
AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:12:19 +01:00
Reynaldo H. Verdejo Pinochet
822e3e2ddb ffserver: user AVStream.codecpar in compute_status()
AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:12:15 +01:00
Reynaldo H. Verdejo Pinochet
afcbadf0ed ffserver: use AVStream.codecpar in find_stream_in_feed()
AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:12:12 +01:00
Reynaldo H. Verdejo Pinochet
1323349bef ffserver: get time_base from AVStream in print_stream_params()
AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:12:09 +01:00
Reynaldo H. Verdejo Pinochet
689f648a95 ffserver: use .codecpar instead of .codec in print_stream_params()
AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:12:04 +01:00
Reynaldo H. Verdejo Pinochet
311107a65d ffserver: check for codec match using AVStream.codecpar
Compare using AVCodecParameters instead of the deprecated
AVStream.codec field

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 12:11:57 +01:00
Steven Liu
acd87dfc05 cmdutils: add show_demuxers and show_muxers
add -muxers and -demuxers parameters to list the dexmuers and muxers

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-08 01:56:31 +01:00
Rostislav Pehlivanov
0cf6853804 aacenc: quit when the audio queue reaches 0 rather than keeping track of empty frames
The libopus encoder does the same thing and its better than
keeping track of when the empty flush frames appear.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-11-08 00:50:51 +00:00
Michael Niedermayer
ef6a786401 ffserver: Fix one AVFormatContext misuse
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-07 20:41:44 +01:00
Andreas Cadhalpun
2c90316b46 hls: fix leaking avio_opts on hls_read_header error
Use the hls_close function to reduce code duplication.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-07 19:44:41 +01:00
Andreas Cadhalpun
a305e0e5c0 hls: move hls_close above hls_read_header
This is needed for the following commit.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-07 19:43:43 +01:00
Andreas Cadhalpun
5249706e9d mpegaudio_parser: don't return AVERROR_PATCHWELCOME
The API does not allow returning AVERROR codes.

It triggers an assert in av_parser_parse2.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-07 19:41:17 +01:00
Michael Niedermayer
73ce1d864c ffserver: steal SPACE_CHARS, remove one reason for internal.h that way
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-07 19:27:40 +01:00
Michael Niedermayer
ecb40dee32 ffserver: eliminate hardcoded literal and duplicated array size
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-07 19:27:40 +01:00
Michael Niedermayer
10019c13e0 ffserver: use av_freep() for a case that is not clearly at the end of a function
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-07 19:27:40 +01:00
Michael Niedermayer
f67d22f0fd ffserver: Throw ffm.h out its not used except for a constant that is part of the format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-07 19:27:40 +01:00