aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* dnn/native: add native support for avg_poolTing Fu2020-08-107-3/+223
| | | | | | | Not support pooling strides in channel dimension yet. Signed-off-by: Ting Fu <ting.fu@intel.com> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
* avformat/hlsenc: write temp file for append single file by encryption modeSteven Liu2020-08-101-2/+68
| | | | | | | | | | | | fix ticket: 8783 Because in single file by encryption mode, it cannot get the last one block of the file, it need ff_format_io_close for get full file size, then hlsenc can get the total size of the encryption content, so write the content into temp file first, and get the temp file content append the temp file content into append to single file, then hlsenc can get the correct file/content size and offset. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/hls: support avio_seek in encryption modeSteven Liu2020-08-101-1/+1
| | | | Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* kmsgrab: Add more supported formatsMark Thompson2020-08-091-0/+9
| | | | | | | X2RGB10 tested on both Intel Gen9 and AMD Polaris 11. NV12 tested on Intel Gen9 only - since it has multiple planes, this requires GetFB2. Also add some comments to split the list up a bit.
* doc/indevs: Note improved behaviour of kmsgrab with Linux 5.7Mark Thompson2020-08-091-2/+6
|
* kmsgrab: Don't require the user to set framebuffer formatMark Thompson2020-08-091-15/+40
| | | | | This is provided by GetFB2, but we still need the option for cases where that isn't available.
* kmsgrab: Use GetFB2 if availableMark Thompson2020-08-092-19/+203
| | | | | | | | | | | | The most useful feature here is the ability to automatically extract the framebuffer format and modifiers. It also makes support for multi-plane framebuffers possible, though none are added to the format table in this patch. This requires libdrm 2.4.101 (from April 2020) to build, so it includes a configure check to allow compatibility with existing distributions. Even with libdrm support, it still won't do anything at runtime if you are running Linux < 5.7 (before June 2020).
* kmsgrab: Refactor and clean error casesMark Thompson2020-08-091-61/+100
|
* avformat/sierravmd: Don't return packets for non-existing streamAndreas Rheinhardt2020-08-091-0/+4
| | | | | | | It leads to an assert in ff_read_packet(). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/vividas: Check allocation for successAndreas Rheinhardt2020-08-091-8/+9
| | | | | Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/vividas: Check return value before storing it in smaller typeAndreas Rheinhardt2020-08-091-4/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cfhd: improve SampleIndex tag outputPaul B Mahol2020-08-091-5/+4
| | | | This tag is used for jumping to different channels in bitstream.
* avcodec/cfhd: log version tags tooPaul B Mahol2020-08-092-0/+15
|
* avcodec/cfhd: read prescale table tagPaul B Mahol2020-08-092-7/+5
| | | | | Currently unused. Remove prescale shift tag as it is not part of this codec.
* avcodec/cfhd: use init_get_bits8()Paul B Mahol2020-08-091-1/+3
|
* avcodec/cfhd: reindentPaul B Mahol2020-08-091-186/+186
|
* avcodec/cfhd: check if band encoding is validPaul B Mahol2020-08-091-2/+6
| | | | | Also simplify lossless check as value of 5 for band encoding always specify lossless mode.
* libavcodec/j2kenc: Support for all Progression ordersGautam Ramakrishnan2020-08-091-1/+222
| | | | | | | | | This patch allows for selecting the progression order in the j2k encoder. However, all components and resolution levels will use the same progression order and will not feature the use of progression order change markers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cfhdenc: free alpha buffer on closingPaul B Mahol2020-08-081-0/+5
|
* avcodec/cfhdenc: add gbrap12 pixel format supportPaul B Mahol2020-08-081-5/+39
|
* avcodec/cfhdenc: compand coefficientsPaul B Mahol2020-08-081-47/+98
| | | | Also use -quality private option and add more modes.
* avcodec/cfhd: add 3d transform supportPaul B Mahol2020-08-082-79/+622
| | | | Based on Gagandeep Singh patch.
* avcodec/cfhd: remove some unused or only write itemsPaul B Mahol2020-08-082-9/+0
|
* avcodec/cfhdenc: also write FrameNumber tagPaul B Mahol2020-08-082-1/+5
|
* swscale: do not drop half of bits from 16bit bayer formatsPaul B Mahol2020-08-084-2/+163
|
* doc/fftools-common-opts: document ffmpeg -h protocol=protocol_nameJun Zhao2020-08-081-0/+4
| | | | | | | document ffmpeg -h protocol=protocol_name Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* doc/fftools-common-opts: fix typo (name => named)Jun Zhao2020-08-081-2/+2
| | | | | | | fix typo (name => named) Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* doc/filters: update filter buffer/abuffer interface file nametomajsjiang2020-08-081-2/+2
| | | | | | | | | Update filter buffer/abuffer interface file name, from libavfilter/{vsrc|asrc_buffer.h} to libavfilter/buffersrc.h Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: tomajsjiang <tomajsjiang@tencent.com>
* avcodec/put_bits: Make skip_put_bits() less dangerousAndreas Rheinhardt2020-08-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before c63c303a1f2b58677d480505ec93a90f77dd25b5 (the commit which introduced a typedef for the type of the buffer of a PutBitContext) skip_put_bits() was as follows: static inline void skip_put_bits(PutBitContext *s, int n) { s->bit_left -= n; s->buf_ptr -= 4 * (s->bit_left >> 5); s->bit_left &= 31; } If s->bit_left was negative after the first subtraction, then the next line will divide this by 32 with rounding towards -inf and multiply by four; the result will be negative, of course. The aforementioned commit changed this to: static inline void skip_put_bits(PutBitContext *s, int n) { s->bit_left -= n; s->buf_ptr -= sizeof(BitBuf) * ((unsigned)s->bit_left / BUF_BITS); s->bit_left &= (BUF_BITS - 1); } Casting s->bit_left to unsigned meant that the rounding is still towards -inf; yet the right side is now always positive (it transformed the arithmetic shift into a logical shift), so that s->buf_ptr will always be decremented (by about UINT_MAX / 8 unless n is huge) which leads to segfaults on further usage and is already undefined pointer arithmetic before that. This can be reproduced with the mpeg4 encoder with the AV_CODEC_FLAG2_NO_OUTPUT flag set. Furthermore, the earlier version as well as the new version share another bug: s->bit_left will be in the range of 0..(BUF_BITS - 1) afterwards, although the assumption throughout the other PutBitContext functions is that it is in the range of 1..BUF_BITS. This might lead to a shift by BUF_BITS in little-endian mode. This has been fixed, too. The new version is furthermore able to skip zero bits, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fate: cosmeticsZane van Iperen2020-08-071-8/+8
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* fate: add adpcm_argo testZane van Iperen2020-08-072-0/+6
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: add argo_asf muxerZane van Iperen2020-08-075-2/+130
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add adpcm_argo encoderZane van Iperen2020-08-077-3/+91
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_argo: add ff_adpcm_argo_expand_nibble() and cleanup parametersZane van Iperen2020-08-072-5/+7
| | | | | | Replaces adpcm_argo_expand_nibble(). Preparation for the encoder. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: check sample count in demuxerZane van Iperen2020-08-071-1/+8
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/tiff: Check bpp/bppcount for 0Michael Niedermayer2020-08-071-3/+3
| | | | | | | | Fixes: division by zero Fixes: 24253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6250318007107584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/snowdec: Sanity check hcoeffMichael Niedermayer2020-08-071-1/+4
| | | | | | | | Fixes: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int' Fixes: 24011/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5486376610168832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnn_backend_native_layer_mathunary: add floor supportMingyu Yin2020-08-075-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be tested with the model generated with below python script: import tensorflow as tf import os import numpy as np import imageio from tensorflow.python.framework import graph_util name = 'floor' pb_file_path = os.getcwd() if not os.path.exists(pb_file_path+'/{}_savemodel/'.format(name)): os.mkdir(pb_file_path+'/{}_savemodel/'.format(name)) with tf.Session(graph=tf.Graph()) as sess: in_img = imageio.imread('detection.jpg') in_img = in_img.astype(np.float32) in_data = in_img[np.newaxis, :] input_x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in') y_ = tf.math.floor(input_x*255)/255 y = tf.identity(y_, name='dnn_out') sess.run(tf.global_variables_initializer()) constant_graph = graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out']) with tf.gfile.FastGFile(pb_file_path+'/{}_savemodel/model.pb'.format(name), mode='wb') as f: f.write(constant_graph.SerializeToString()) print("model.pb generated, please in ffmpeg path use\n \n \ python tools/python/convert.py {}_savemodel/model.pb --outdir={}_savemodel/ \n \nto generate model.model\n".format(name,name)) output = sess.run(y, feed_dict={ input_x: in_data}) imageio.imsave("out.jpg", np.squeeze(output)) print("To verify, please ffmpeg path use\n \n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model={}_savemodel/model.pb:input=dnn_in:output=dnn_out:dnn_backend=tensorflow -f framemd5 {}_savemodel/tensorflow_out.md5\n \ or\n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model={}_savemodel/model.pb:input=dnn_in:output=dnn_out:dnn_backend=tensorflow {}_savemodel/out_tensorflow.jpg\n \nto generate output result of tensorflow model\n".format(name, name, name, name)) print("To verify, please ffmpeg path use\n \n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model={}_savemodel/model.model:input=dnn_in:output=dnn_out:dnn_backend=native -f framemd5 {}_savemodel/native_out.md5\n \ or \n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model={}_savemodel/model.model:input=dnn_in:output=dnn_out:dnn_backend=native {}_savemodel/out_native.jpg\n \nto generate output result of native model\n".format(name, name, name, name)) Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
* avformat/mxfdec: Read color metadata from MXFHarry Mallon2020-08-0610-8/+75
| | | | | | | Reads color_primaries, color_trc and color_space from mxf headers. ULs are from https://registry.smpte-ra.org/ site. Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avcodec/libx264: fix chroma quantizer offset usageTakio Yamaoka2020-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default for the chromaoffset field in AVCodecContext is zero, which until now always ended up overriding the AVOption-set value, thus leading to the AVOption not working. Additionally, the previous usage prevented the usage of negative values, while both the variable as well as x264's API would successfully handle such. Thus, the default value of the AVOption is changed to match the default of x264 (and what is currently the default for the AVCodecContext chromaoffset field), and the checks are changed to check for nonzero values. This way: 1. the library default is still utilized if the value is zero. 2. both negative and positive values are correctly passed to x264. For historical context, this was initially similarly implemented in 5764d38173661c29d954711dd5abfddf709e9ba4, and then b340bd8a58c32453172404a8e4240e3317e341da broke the value. Partially reverts commit b340bd8a58c32453172404a8e4240e3317e341da. Signed-off-by: Takio Yamaoka <y.takio@gmail.com>
* avcodec/mpegaudiodec_template: Fix some whitespace issuesMichael Niedermayer2020-08-061-20/+20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Handle reducedresno of 32Michael Niedermayer2020-08-062-14/+14
| | | | | | | | | Fixes: shift exponent 32 is too large for 32-bit type 'int' Fixes: 24566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6033783737024512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/j2kenc: Allow Encoder to use SOP and EPH markersGautam Ramakrishnan2020-08-061-6/+22
| | | | | | | | This patch allows the encoder to use SOP and EPH markers. This would be useful as these markers provide better error detection mechanisms. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dv: Avoid allocation for reading timecodeAndreas Rheinhardt2020-08-061-9/+4
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dv: Avoid alloction of DVDemuxContextAndreas Rheinhardt2020-08-061-41/+32
| | | | | | | | | This commit avoids allocating a DVDemuxContext when demuxing raw DV by making it part of the demuxer's context. This also allows to remove dv_read_close(). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/3dostr: Return directly after having read packetAndreas Rheinhardt2020-08-051-9/+4
| | | | | | | Avoids an avio_skip(s->pb, 0). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc/libopenh264enc: use framerate if availableJun Zhao2020-08-051-1/+10
| | | | | | | | | | Respecting the framerate in the libopenh264enc codec context. Both the libx264 and libx265 encoders already contain similar logic to first check the framerate before falling back to the timebase. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/mov: Check comp_brand_sizeMichael Niedermayer2020-08-041-1/+1
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 24457/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5760093644390400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegaudiodec_template: Check CRCs for layer1 and layer2Michael Niedermayer2020-08-041-17/+44
| | | | | | | | | | | This differs from the MPEG specification as the actual real world files do compute their CRC over variable areas and not the fixed ones listed in the specification. This is also the reason for the complexity of this code and the need to perform the CRC check for layer2 in the middle of layer2 decoding. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnn_backend_native_layer_mathunary: add ceil supportMingyu Yin2020-08-045-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be tested with the model generated with below python script: import tensorflow as tf import os import numpy as np import imageio from tensorflow.python.framework import graph_util name = 'ceil' pb_file_path = os.getcwd() if not os.path.exists(pb_file_path+'/{}_savemodel/'.format(name)): os.mkdir(pb_file_path+'/{}_savemodel/'.format(name)) with tf.Session(graph=tf.Graph()) as sess: in_img = imageio.imread('detection.jpg') in_img = in_img.astype(np.float32) in_data = in_img[np.newaxis, :] input_x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in') y = tf.math.ceil( input_x, name='dnn_out') sess.run(tf.global_variables_initializer()) constant_graph = graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out']) with tf.gfile.FastGFile(pb_file_path+'/{}_savemodel/model.pb'.format(name), mode='wb') as f: f.write(constant_graph.SerializeToString()) print("model.pb generated, please in ffmpeg path use\n \n \ python tools/python/convert.py ceil_savemodel/model.pb --outdir=ceil_savemodel/ \n \n \ to generate model.model\n") output = sess.run(y, feed_dict={ input_x: in_data}) imageio.imsave("out.jpg", np.squeeze(output)) print("To verify, please ffmpeg path use\n \n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model=ceil_savemodel/model.pb:input=dnn_in:output=dnn_out:dnn_backend=tensorflow -f framemd5 ceil_savemodel/tensorflow_out.md5\n \n \ to generate output result of tensorflow model\n") print("To verify, please ffmpeg path use\n \n \ ./ffmpeg -i detection.jpg -vf format=rgb24,dnn_processing=model=ceil_savemodel/model.model:input=dnn_in:output=dnn_out:dnn_backend=native -f framemd5 ceil_savemodel/native_out.md5\n \n \ to generate output result of native model\n") Signed-off-by: Mingyu Yin <mingyu.yin@intel.com> Reviewed-by: Guo, Yejun <yejun.guo@intel.com>