summaryrefslogtreecommitdiff
path: root/libavfilter
Commit message (Collapse)AuthorAge
* avfilter/vf_showinfo: add const to the AVFrameSideData instanceLimin Wang2020-09-17
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* dnn_backend_native_layer_conv2d.c: refine code.Xu Jun2020-09-17
| | | | | | | Move thread area allocate out of thread function into main thread. Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
* dnn_backend_native_layer_conv2d.c: fix memory allocation bug in multithread ↵Xu Jun2020-09-17
| | | | | | | | | | | | | function. Before patch, memory was allocated in each thread functions, which may cause more than one time of memory allocation and cause crash. After patch, memory is allocated in the main thread once, an index was parsed into thread functions. Bug fixed. Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
* avfilter/f_interleave: fix some issues with interleavingPaul B Mahol2020-09-15
|
* avfilter/x86/vf_convolution_init: there is asm only for 8bit depthPaul B Mahol2020-09-15
|
* avfilter/avf_concat: check for possible integer overflowPaul B Mahol2020-09-14
| | | | | | | Also check that segment delta pts is always bigger than input pts. There is nothing much currently that can be done to recover from this situation so just return AVERROR_INVALIDDATA error code.
* avfilter/af_amix: do not leave unset PTS for frames after first stream is overPaul B Mahol2020-09-14
| | | | First stream is used only to get number of samples to put into each output frame.
* avfilter/vf_premultiply: add missing AV_PIX_FMT_YUVA444P12Mark Reid2020-09-14
| | | | query_formats says its supported, but is missing from switch statement leading to segfault
* avfilter/vf_showinfo: use av_timecode_make_smpte_tc_string2Marton Balint2020-09-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/asrc_anullsrc: actually return correct EOF ptsPaul B Mahol2020-09-13
|
* avfilter/asrc_anullsrc: give better limits to number of samples per framePaul B Mahol2020-09-13
|
* avfilter/asrc_anullsrc: make number of output samples match durationPaul B Mahol2020-09-13
|
* dnn/openvino: add input/output name infoTing Fu2020-09-12
| | | | | | | show all input/output names when the input or output name not correct Signed-off-by: Ting Fu <ting.fu@intel.com> Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* dnn/openvino: support run inference via GPUTing Fu2020-09-12
| | | | | | | | | | | | | for enabling OpenVINO GPU please: 1. install required OpenCL drivers, see: https://github.com/intel/compute-runtime/releases/tag/19.41.14441 2. build OpenVINO c lib with GPU enabled: use cmake config with: -DENABLE_CLDNN=ON 3. then make, and include the OpenVINO c lib in environment variables detailed steps please refer: https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md inference model with GPU please add: optioins=device=GPU Signed-off-by: Ting Fu <ting.fu@intel.com> Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* avfilter/formats: Remove pointless checksAndreas Rheinhardt2020-09-11
| | | | | | | | | | | | | | | ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to a pointer to an AVFilterFormats as arguments and adds the latter as an owner to the list pointed to by the former; the latter is hereby always the address of a list contained in an AVFilterFormatsConfig and can therefore not be NULL. So remove the check for whether it is NULL; also do the same for ff_channel_layouts_ref(). Also do the same for the unref functions where argument is never NULL because it is always the address of an existing lvalue. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Don't typedef structure a second timeAndreas Rheinhardt2020-09-11
| | | | | | | | | | | | | | | | | | | Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h contained no typedef for AVFilterChannelLayouts; all references to it were done using its struct tag. formats.h meanwhile contained the definition of the struct and a typedef for it. Said commit now added a typedef in avfilter.h, too, bringing it in line with AVFilterFormats; yet this means that there are two typedefs for AVFilterChannelLayouts (in contrast to AVFilterFormats which is only typedef'ed in avfilter.h). The problem is that older versions of GCC don't like this and error out: http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2 is one of the FATE boxes that now fail to compile. So just remove the typedef in formats.h. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools, libavcodec, libavfilter: Add const to some AVCodec *Andreas Rheinhardt2020-09-11
| | | | | | | | The user has no business modifying the underlying AVCodec. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_subtitles: Remove obsolete LIBAVCODEC_VERSION_INT checksAndreas Rheinhardt2020-09-11
| | | | | | | | libavcodec major version is already 58. Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_subtitles: Remove unnecessary initialization of AVPacketAndreas Rheinhardt2020-09-11
| | | | | | | | av_read_frame() can handle uninitialized packets. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_subtitles: Fix leaks on failureAndreas Rheinhardt2020-09-11
| | | | | | | | | | | | | init_subtitles() sometimes returned directly upon error without cleaning up after itself. The easiest way to trigger this is by using picture-based subtitles; it is also possible to run into this in case of missing decoders or allocation failures. Furthermore, return the proper error code in case of missing decoder. Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_uspp: Fix potential leak of dict on errorAndreas Rheinhardt2020-09-11
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/lavfutils: Avoid initializing packetAndreas Rheinhardt2020-09-11
| | | | | | | av_read_frame() can handle uninitialized packets. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/lavfutils: Fix memleak when avformat_find_stream_info() failsAndreas Rheinhardt2020-09-11
| | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/lavfutils: Don't use uninitialized pointers for freeingAndreas Rheinhardt2020-09-11
| | | | | | | | Happened on several error conditions, e.g. if there is just no decoder for the format (like with svg images). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Fix leak of packet upon errorAndreas Rheinhardt2020-09-10
| | | | | | | | | If allocating the AVFrame to contain a decoded frame fails, the AVPacket containing the data intended to be decoded leaks. This commit fixes this. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Remove unnecessary secondary AVPacketAndreas Rheinhardt2020-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The movie and amovie filters currently use two packets. One of the two, pkt0, is the owner of the returned packet; it is also the destination packet for av_read_frame(). The other one pkt is initially (i.e. after av_read_frame()) a copy of pkt0; copy means that the contents of both are absolutely the same: They both point to the same AVBufferRef and the same side data. This violation of the refcounted packet API is only possible because pkt is not considered to own its data. Only pkt0 is ever unreferenced. The reason for pkt's existence seems to be historic: The API used for decoding audio (namely avcodec_decode_audio4()) could consume frames partially, i.e. it could return multiple frames for one packet and therefore it returned how much of the input buffer had been consumed. The caller was then supposed to update the packet's data and size pointer to reflect this and call avcodec_decode_audio4() again with the updated packet to get the next frame. But before the introduction of refcounted AVPackets where knowledge and responsibility about what to free lies with the underlying AVBuffer such a procedure required a spare packet (or one would need to record the original data and size fields separately to restore them before freeing the packet; notice that this code has been written when AVPackets still had a destruct field). But these times are long gone, so just remove the secondary AVPacket. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/src_movie: Remove unneeded resetting of AVPacketAndreas Rheinhardt2020-09-10
| | | | | | | av_read_frame() already returns clean packets on error. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/avfilter: remove obsolete commentPaul B Mahol2020-09-10
|
* avfilter/vf_premultiply: add support for gbrapf32 formatMark Reid2020-09-10
|
* lavfi/buffersink: cast to uint64_t before shifting.Nicolas George2020-09-09
| | | | Fix CID 1466666.
* dnn/dnn_backend_native_layer_conv2d: Fix allocation sizeAndreas Rheinhardt2020-09-09
| | | | | | | Found via ASAN with the dnn-layer-conv2d FATE-test. Reviewed-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Don't check for clipping in separate loopAndreas Rheinhardt2020-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Remove pointless additionsAndreas Rheinhardt2020-09-09
| | | | | | | | buffer_length is a power-of-two and modulo is buffer_length - 1, so that buffer_length & modulo is zero. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Use more appropriate variable nameAndreas Rheinhardt2020-09-09
| | | | | | | | Also unify incrementing the variable containing the pointer to the currently used HRIR data. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid indirection for function pointerAndreas Rheinhardt2020-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid allocating arrayAndreas Rheinhardt2020-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Don't allocate unused element in arrayAndreas Rheinhardt2020-09-09
| | | | | | | | | | | The headphone filter uses an array with as many elements as the filter has inputs to store some per-input information; yet actually it only stores information for all inputs except the very first one (which is special for this filter). Therefore this commit modifies the code to remove this unused element. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Only keep one AVFrame at a timeAndreas Rheinhardt2020-09-09
| | | | | | | | | | | Despite the headphone filter only using one AVFrame at a time, it kept an array each of whose entries contained a pointer to an AVFrame at all times; the pointers were mostly NULL. This commit instead replaces them by using a single pointer to an AVFrame on the stack of the only function that actually uses them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid intermediate buffer IIIAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | The headphone filter allocates a pair of buffers to be used as intermediate buffers lateron: Before every use they are zeroed, then some elements of the buffer are set and lateron the complete buffers are copied into another, bigger buffer. These intermediate buffers are unnecessary as the data can be directly written into the bigger buffer. Furthermore, the whole buffer has been zeroed initially and because no piece of this buffer is set twice (due to the fact that duplicate channel map entries are skipped), it is unnecessary to rezero the part of the big buffer that is about to be written to. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Simplify finding channel indexAndreas Rheinhardt2020-09-09
| | | | | | | | | | | Before this commit, the headphone filter called av_channel_layout_extract_channel() in a loop in order to find out the index of a channel (given via its AV_CH_* value) in a channel layout. This commit changes this to av_get_channel_layout_channel_index() instead. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Fix channel assignmentAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation of the map argument of the headphone filter states: "Set mapping of input streams for convolution. The argument is a ’|’-separated list of channel names in order as they are given as additional stream inputs for filter." Yet this has not been honoured at all. Instead for the kth given HRIR channel pair it was checked whether there was a kth mapping and if the channel position so given was present in the channel layout of the main input; if so, then the given HRIR channel pair was matched to the kth channel of the main input. It should actually have been matched to the channel given by the kth mapping. A consequence of the current algorithm is that if N additional HRIR channel pairs are given, a permutation of the first N entries of the mapping does not affect the output at all. The old code might even set arrays belonging to streams that don't exist (i.e. whose index is >= the number of channels of the main input stream); these parts were not read lateron at all. The new code doesn't do this any longer and therefore the number of elements of some of the allocated arrays has been reduced (in case the number of mappings was bigger than the number of channels of the first input stream). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid intermediate buffers IIAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | When the headphone filter is configured to perform its processing in the frequency domain, it allocates (among other things) two pairs of buffers, all of the same size. One pair is used to store data in it during the initialization of the filter; the other pair is only allocated lateron. It is zero-initialized and yet its data is immediately overwritten by the content of the other pair of buffers mentioned above; the latter pair is then freed. This commit eliminates the pair of intermediate buffers. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid intermediate buffers IAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | The headphone filter has two modes; in one of them (say A), it needs certain buffers to store data. But it allocated them in both modes. Furthermore when in mode A it also allocated intermediate buffers of the same size, initialized them, copied their contents into the permanent buffers and freed them. This commit changes this: The permanent buffer is only allocated when needed; the temporary buffer has been completely avoided. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Remove delay fieldsAndreas Rheinhardt2020-09-09
| | | | | | | They seem to exist for an option that was never implemented. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Remove unused arraysAndreas Rheinhardt2020-09-09
| | | | | | | | | | The delay arrays were never properly initialized, only zero-initialized; furthermore these arrays duplicate fields in the headphone_inputs struct. So remove them. (Btw: The allocations for them have not been checked.) Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Avoid duplicating string needlesslyAndreas Rheinhardt2020-09-09
| | | | | | | | | The string given by an AVOption that contains the channel assignment is used only once; ergo it doesn't matter that parsing the string via av_strtok() is destructive. There is no need to make a copy. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Simplify parsing channel mapping stringAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing the channel mapping string (a string containing '|' delimited tokens each of which is supposed to contain a channel name like "FR"), the old code would at each step read up to seven uppercase characters from the input string and give this to av_get_channel_layout() to parse. The returned layout is then checked for being a layout with a single channel set by computing its logarithm. Besides being overtly complicated this also has the drawback of relying on the assumption that every channel name consists of at most seven uppercase letters only; but said assumption is wrong: The abbreviation of the second low frequency channel is LFE2. Furthermore it treats garbage like "FRfoo" as valid channel. This commit changes this by using av_get_channel_layout() directly; furthermore, av_get_channel_layout_nb_channels() (which uses popcount) is used to find out the number of channels instead of the custom code to calculate the logarithm. (As a consequence, certain other formats to specify the channel layouts are now accepted (like the hex versions of av_get_channel_layout()); but this is actually not bad at all.) Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Use uint64_t for channel mappingAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | The headphone filter has an option for the user to specify an assignment of inputs to channels (or from pairs of channels of the second input to channels). Up until now, these channels were stored in an int containing the logarithm of the channel layout. Yet it is not the logarithm that is used lateron and so a retransformation was necessary. Therefore this commit simply stores the uint64_t as is, avoiding the retransformation. This also has the advantage that unset channels (whose corresponding entry is zero) can't be mistaken for valid channels any more; the old code had to initialize the channels to -1 to solve this problem and had to check for whether a channel is set before the retransformation (because 1 << -1 is UB). The only downside of this approach is that the size of the context increases (by 256 bytes); but this is not exceedingly much. Finally, the array has been moved to the end of the context; it is only used a few times during the initialization process and moving it decreased the offsets of lots of other entries, reducing codesize. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Only attempt once to init coeffsAndreas Rheinhardt2020-09-09
| | | | | | | | | | | | | | | | | | | | | | The headphone filter does most of its initialization after its init function, because it can perform certain tasks only after all but its first input streams have reached eof. When this happens, it allocates certain buffers and errors out if an allocation fails. Yet the filter didn't check whether some of these buffers already exist (which may happen if an earlier attempt has been interrupted in the middle (due to an allocation error)) in which case the old buffers leak. This commit makes sure that initializing the buffers is only attempted once; if not successfull at the first attempt, future calls to the filter will error out. Trying to support resuming initialization doesn't seem worthwhile. Notice that some allocations were freed before a new allocation was performed; yet this effort was incomplete. Said code has been removed. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/af_headphone: Combine several loops when checking for EOFAndreas Rheinhardt2020-09-09
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>