summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/libaomenc: fix build w/libaom v1.0.0James Zern2020-07-08
| | | | | | | | broken since: aa5c6f382b avcodec/libaomenc: Add command-line options to control the use of partition tools Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avfilter/vf_showinfo: add dump_s12m_timecode() helper functionLimin Wang2020-07-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_showinfo: check sd->size before reference the sd->dataLimin Wang2020-07-08
| | | | | | | Or it'll cause null pointer dereference if size < sizeof(uint32_t), also in case tc[0] > 3, the code will report error directly. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/gifdec: -1 -> AV_BPRINT_SIZE_UNLIMITEDLimin Wang2020-07-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/dvbsubdec: CosmeticsLimin Wang2020-07-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/dvbsubdec: prefer to use variable instead of type for sizeofLimin Wang2020-07-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/dvbsubdec: simplify code by using OFFSET() macroLimin Wang2020-07-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter: add chromanr video filterPaul B Mahol2020-07-08
|
* avformat/mov: Fix unaligned read of uint32_t and endian-dependance in ↵Zhao Zhili2020-07-07
| | | | | | | mov_read_default Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Fix undefined integer overflow with 24bitMichael Niedermayer2020-07-07
| | | | | | | | Fixes: signed integer overflow: 8683744 * 256 cannot be represented in type 'int' Fixes: 23527/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679885932822528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/loco: Fix integer overflow with large values from loco_get_rice()Michael Niedermayer2020-07-07
| | | | | | | | Fixes: signed integer overflow: 155 + 2147483647 cannot be represented in type 'int' Fixes: 23421/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5652849097965568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/smjpegdec: Check the existence of referred streamsMichael Niedermayer2020-07-07
| | | | | | | | Fixes: Assertion failure Fixes: 23758/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5160954605338624.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* pthread_frame: change the criterium for updating thread contextsAnton Khirnov2020-07-07
| | | | | | | | | | | Currently the next thread's context is updated from the previous one's if the codec descriptor is not marked as intra-only. That is not entirely correct, since that property does not necessarily imply anything about how a specific decoder implementation behaves. Instead, use the presence of the update_thread_context() callback to decide whether an update should be performed. Fixes races in CFHD, should cause no behaviour change in any other decoders.
* codec_desc: drop the INTRA_ONLY property from TAKAnton Khirnov2020-07-07
| | | | It has key frames and non-key frames, so it is not intra-only.
* tests/fate/hlsenc: add testcase of ac3 surround sound input in hlsencSteven Liu2020-07-07
| | | | | | | add probeaudiostream for get audio stream's codec_name,codec_time_base, sample_fmt,channels and channel_layout. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: check fragment size plus start_pos large than hls_segment_sizeSteven Liu2020-07-07
| | | | | | if vs->size + vs->start_pos > hls->max_seg_size, should split segment. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avfilter/vf_edgedetect: properly implement double_threshold()Valery Kot2020-07-06
| | | | | | | | | | | | | | Important part of this algorithm is the double threshold step: pixels above "high" threshold being kept, pixels below "low" threshold dropped, pixels in between (weak edges) are kept if they are neighboring "high" pixels. The weak edge check uses a neighboring context and should not be applied on the plane's border. The condition was incorrect and has been fixed in the commit. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/h26[45]_metadata_bsf: Use separate contexts for reading/writingAndreas Rheinhardt2020-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, both bsfs used the same CodedBitstreamContext for reading and writing; as a consequence, the state of the writer's context at the beginning of writing a fragment is exactly the state of the reader after having read the fragment; in particular, the writer might not have encountered one of its active parameter sets yet. This is not nice and may lead to invalid output even when the input is completely spec-compliant: Think of an access unit containing a primary coded picture referencing a PPS with id id (that is known from an earlier access unit/from extradata), then a new version of the PPS with id id and then a redundant coded picture that is also referencing the PPS with id id. This is spec-compliant, as the standard allows to overwrite a PPS with a different PPS in between coded pictures and not only at the beginning of an access unit. In this scenario, the reader would read the primary coded picture with the old PPS and the redundant coded picture with the new PPS (as it should); yet the writer would write both with the new PPS as extradata which might lead to errors or to invalid data being output without any error (e.g. if the two PPS differed in redundant_pic_cnt_present_flag). The above scenario does not directly translate to HEVC as long as one restricts oneself to input with nuh_layer_id == 0 only (as cbs_h265 does: it currently strips away any NAL unit with nuh_layer_id > 0 when decomposing); if one doesn't the same issue as above can happen. If one also allowed input packets to contain more than one access unit, issues like the above can happen even without redundant coded pictures/multiple layers. Therefore this commit uses separate contexts for reader and writer. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs: Remove unused function parametersAndreas Rheinhardt2020-07-07
| | | | | | | | Several cbs-functions had an unused CodedBitstreamContext parameter. This commit removes these. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Speedhq: Decode field 2 correctlyJean-Baptiste Kempf2020-07-06
| | | | This is similar to field 1 (effd2e72)
* avcodec/h264: support sps/pps AV_PKT_DATA_NEW_EXTRADATAOliver Woodman2020-07-06
| | | | | | | | | | | Commit 601c238854 added support for AV_PKT_DATA_NEW_EXTRADATA, but only for avcC extradata. This commit adds support for sps/pps extradata as well. This makes support consistent for passing new extradata consistent with the types of extradata that can be passed when initializing the decoder. Signed-off-by: Oliver Woodman <ollywoodman@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* dnn_backend_native: Add overflow check for length calculation.Reimar Döffinger2020-07-06
| | | | | | | | | We should not silently allocate an incorrect sized buffer. Fixes trac issue #8718. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
* libavformat/hlsenc: Remove duplicate close of the output stream.Andrey Semashev2020-07-06
| | | | | The result of the first close attempt is ignored and may be lost. By removing it we ensure the close result code is properly analyzed.
* dnn-layer-math-unary-test: add unit test for atanhTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add atanh supportTing Fu2020-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be tested with the model generated with below python script: import tensorflow as tf import numpy as np import imageio in_img = imageio.imread('input.jpeg') in_img = in_img.astype(np.float32)/255.0 in_data = in_img[np.newaxis, :] x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in') please uncomment the part you want to test x_sinh_1 = tf.sinh(x) x_out = tf.divide(x_sinh_1, 1.176) # sinh(1.0) x_cosh_1 = tf.cosh(x) x_out = tf.divide(x_cosh_1, 1.55) # cosh(1.0) x_tanh_1 = tf.tanh(x) x__out = tf.divide(x_tanh_1, 0.77) # tanh(1.0) x_asinh_1 = tf.asinh(x) x_out = tf.divide(x_asinh_1, 0.89) # asinh(1.0/1.1) x_acosh_1 = tf.add(x, 1.1) x_acosh_2 = tf.acosh(x_acosh_1) # accept (1, inf) x_out = tf.divide(x_acosh_2, 1.4) # acosh(2.1) x_atanh_1 = tf.divide(x, 1.1) x_atanh_2 = tf.atanh(x_atanh_1) # accept (-1, 1) x_out = tf.divide(x_atanh_2, 1.55) # atanhh(1.0/1.1) y = tf.identity(x_out, name='dnn_out') #please only preserve the x_out you want to test sess=tf.Session() sess.run(tf.global_variables_initializer()) graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out']) tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False) print("image_process.pb generated, please use \ path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n") output = sess.run(y, feed_dict={x: in_data}) imageio.imsave("out.jpg", np.squeeze(output)) Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn-layer-math-unary-test: add unit test for acoshTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add acosh supportTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn-layer-math-unary-test: add unit test for asinhTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add asinh supportTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn-layer-math-unary-test: add unit test for tanhTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add tanh supportTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn-layer-math-unary-test: add unit test for coshTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add cosh supportTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn-layer-math-unary-test: add unit test for sinhTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn_backend_native_layer_mathunary: add sinh supportTing Fu2020-07-06
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* libavcodec/jpeg2000dec.c: Enable image offsetsGautam Ramakrishnan2020-07-06
| | | | | | This patch enables support for image offsets. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec: Enhance pix fmt selectionGautam Ramakrishnan2020-07-06
| | | | | | | This patch assigns default pix format values when a match does not take place. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tiff: Check frame parameters before blit for DNGMichael Niedermayer2020-07-05
| | | | | | | | Fixes: out of array access Fixes: 23888/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6021365974171648.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpegdec: Limit bayer to single plane outputting formatMichael Niedermayer2020-07-05
| | | | | | | This reduces the number of paths reachable with DNG and should improve security Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pnmdec: Fix misaligned readsMichael Niedermayer2020-07-05
| | | | | Found-by: "Steinar H. Gunderson" <steinar+ffmpeg@gunderson.no> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/qsvenc_hevc: add qmax/qmin support for HEVC encodingLinjie Fu2020-07-05
| | | | | | | | | | | | Add qmax/qmin support for HEVC software bitrate control(SWBRC). Limitations: - RateControlMethod != MFX_RATECONTROL_CQP - with EXTBRC ON Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
* avcodec/h264_metadata_bsf: Fix invalid av_freepAndreas Rheinhardt2020-07-04
| | | | | | | This bug was introduced in 3c8a2a1180f03ca6b299ebc27eef21ae86635ca0. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: CosmeticsAndreas Rheinhardt2020-07-04
| | | | | | Mainly reindentation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Use st->priv_data to store arrayAndreas Rheinhardt2020-07-04
| | | | | | It simplifies freeing and allows to completely remove smacker_read_close. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Don't read only one byte at a timeAndreas Rheinhardt2020-07-04
| | | | | | | | Instead use ffio_read_size to read data into a buffer. Also check that the desired size was actually successfully read and combine the check with the check for reading the extradata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Don't allocate arrays separatelyAndreas Rheinhardt2020-07-04
| | | | | | | Allocating two arrays with the same number of elements together simplifies freeing them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Improve timestampsAndreas Rheinhardt2020-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Smacker file can contain up to seven audio tracks. Up until now, the pts for the i. audio packet contained in a Smacker frame was simply the end timestamp of the last i. audio packet contained in an earlier Smacker frame. The problem with this is that a Smacker stream need not contain data in every Smacker frame and so the current i. audio packet present may come from a different underlying stream than the last i. audio packet contained in an earlier frame. The sample hypnotix.smk* exhibits this. It has three audio tracks and the first of the three has a longer first packet, so that the audio for the first track is contained in only 235 packets contained in the first 235 Smacker frames; the end timestamp of this track is 166696 (about 7.56s at a timebase of 1/22050); the other two audio tracks both have 253 packets contained in the first 253 Smacker frames. Up until now, the 236th packet of the second track being the first audio packet in the 236th Smacker frame would get the end timestamp of the last first audio packet from the last Smacker frame containing a first audio packet and said last audio packet is the first audio packet from the 235th Smacker frame from the first audio track, so that the timestamp is 166696. In contrast, the 236th packet from the third track (whose packets contain the same number of samples as the packets from the second track) has a timestamp of 156116 (because its timestamp is derived from the end timestamp of the 235th packet of the second audio track). In the end, the second track ended up being 177360/22050 s = 8.044s long; in contrast, the third track was 166780/22050 s = 7.56s long which also coincided with the video. This commit fixes this by not using timestamps from other tracks for a packet's pts. *: https://samples.ffmpeg.org/game-formats/smacker/wetlands/hypnotix.smk Reviewed-by: Timotej Lazar <timotej.lazar@araneo.si> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Stop caching and copying audio framesAndreas Rheinhardt2020-07-04
| | | | | | | | | | | | | | | | | | | | | The layout of a Smacker frame is as follows: For some frames, the beginning of the frame contained a palette for the video stream; then there are potentially several audio frames, followed by the data for the video stream. The Smacker demuxer used to read the palette, then cache every audio frame into a buffer (that gets reallocated to the desired size every time a frame is read into this buffer), then read and return the video frame (together with the palette). The cached audio frames are then returned by copying the data into freshly allocated buffers; if there are none left, the next frame is read. This commit changes this: At the beginning of a frame, the palette is read and cached as now. But audio frames are no longer cached at all; they are returned immediately. This gets rid of copying and also allows to remove the code for the buffer-to-AVStream correspondence. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Check audio frame sizeAndreas Rheinhardt2020-07-04
| | | | | | | The first four bytes of smacker audio are supposed to contain the number of samples, so treat audio frames smaller than that as invalid. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/smacker: Avoid potential inifinite loop on errorAndreas Rheinhardt2020-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | When reading a new frame, the Smacker demuxer seeks to the next frame position where it excepts the next frame; then it (potentially) reads the palette, the audio packets associated with the frame and finally the actual video frame. It is only at the end that the frame counter as well as the position where the next frame is expected get updated. This has a downside: If e.g. invalid data is encountered when reading the palette, the demuxer returns immediately (with an error) and if the caller calls av_read_frame again, the demuxer seeks to the position where it already was, reads the very same palette data again and therefore will return an error again. If the caller calls av_read_frame repeatedly (say, until a packet is received or until EOF), this meight become an infinite loop. This could also happen if e.g. the size of one of the audio frames was invalid or if the frame size was gigantic. This commit changes this by skipping a frame if it turns out to be invalid or an error happens otherwise. This ensures that EOF will be returned eventually in the above scenario. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>