summaryrefslogtreecommitdiff
path: root/libavfilter
Commit message (Collapse)AuthorAge
* lavfi/vf_drawtext.c: fix CID 1485003Ting Fu2021-06-09
| | | | | | | CID 1485003: Memory - illegal accesses (UNINIT) Using uninitialized value "sd". Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/vf_drawbox.c: fix CID 1485004Ting Fu2021-06-09
| | | | | | | CID 1485004: Uninitialized variables (UNINIT) Using uninitialized value "x" when calling "*pixel_belongs_to_region". Signed-off-by: Ting Fu <ting.fu@intel.com>
* avfilter/vf_dctdnoiz: Check threadsMichael Niedermayer2021-06-08
| | | | | | | Fixes: floating point division by 0 Fixes: Ticket 8269 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_ciescope: Fix undefined behavior in rgb_to_xy() with blackMichael Niedermayer2021-06-08
| | | | | | | | Fixes: floating point division by 0 Fixes: undefined behavior in handling NaN Fixes: Ticket 8268 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/overlay_cuda: add hsub and vsub compute x and y positionsSteven Liu2021-06-07
| | | | | | | | | | | | | | | | fix problem when set x to odd number in nv12 by cuda test step: 1. ffmpeg -f lavfi testsrc2=s=176x144 -pix_fmt nv12 -t 1 output_overlay.yuv 2. ffmpeg -f lavfi testsrc2=s=352x288 -pix_fmt nv12 -t 1 output_main.yuv before this patch: overlay_cuda=x=0:y=0 will right, overlay_cuda=x=3:y=0 will wrong, both will right after patch. Signed-off-by: Steven Liu <liuqi05@kuaishou.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avfilter/vf_hqdn3d: fix left shift of negative numbersValerii Zapodovnikov2021-06-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/dnn/dnn_io_proc.c: fix CID 1484955Guo Yejun2021-06-05
| | | | CID 1484955: Memory - corruptions (ARRAY_VS_SINGLETON)
* avfilter/yadif_cuda: Fix time base for large denominatorsPhilip Langdale2021-05-29
| | | | | | This is the same fix applied to regular yadif. Signed-off-by: Philip Langdale <philipl@overt.org>
* avfilter/bwdif: Fix time base for large denominatorsPhilip Langdale2021-05-29
| | | | | | This is the same fix applied to regular yadif. Signed-off-by: Philip Langdale <philipl@overt.org>
* avfilter/vf_yadif: Fix handing of tiny imagesMichael Niedermayer2021-05-29
| | | | | | | | Fixes: out of array access Fixes: Ticket8240 Fixes: CVE-2020-22021 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_vmafmotion: Check dimensionsMichael Niedermayer2021-05-29
| | | | | | | | | | Fixes: out of array access Fixes: Ticket8241 Fixes: Ticket8246 Fixes: CVE-2020-22019 Fixes: CVE-2020-22033 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_subtitles: allow using embedded fontsOneric2021-05-29
| | | | | ASS subtitles can have encoded fonts embedded into the subtitle file itself. Allow libass to load those, to render subs as intended.
* lavfi/dnn_backend_openvino.c: Correct Pointer Type while FreeingShubhanshu Saxena2021-05-28
| | | | | | | This commit corrects the type of pointer of elements from the inference queue in ff_dnn_free_model_ov. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* avfilter/yadif: Fix time base for large denominatorsTom Boshoven2021-05-27
| | | | | | | This fixes an issue where the yadif filter could cause the timebase denominator to overflow. Signed-off-by: Tom Boshoven <tom@jwplayer.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavfilter: vf_drawtext filter support draw text with detection bounding ↵Ting Fu2021-05-26
| | | | | | | | | | | | | | | boxes in side_data This feature can be used with dnn detection by setting vf_drawtext's option text_source=side_data_detection_bboxes, for example: ./ffmpeg -i face.jpeg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:\ input=data:output=detection_out:labels=face-detection-adas-0001.label,drawbox=box_source= side_data_detection_bboxes,drawtext=text_source=side_data_detection_bboxes:fontcolor=green:\ fontsize=40, -y face_detect.jpeg Please note, the default fontsize of vf_drawtext is 12, which may be too small to be seen clearly. Signed-off-by: Ting Fu <ting.fu@intel.com>
* libavfilter: vf_drawbox filter support draw box with detection bounding ↵Ting Fu2021-05-26
| | | | | | | | | | | | boxes in side_data This feature can be used with dnn detection by setting vf_drawbox's option box_source=side_data_detection_bboxes, for example: ./ffmpeg -i face.jpeg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:\ input=data:output=detection_out:labels=face-detection-adas-0001.label,\ drawbox=box_source=side_data_detection_bboxes -y face_detect.jpeg Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/drawbox: refine codeTing Fu2021-05-26
| | | | | | Extract common code of filter_frame() and drawgrid_filter_frame() to draw_region(). Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn: refine code to separate processing and detection in backendsGuo, Yejun2021-05-24
|
* lavfi/dnn_filter_common.h: make filter option 'options' as deprecatedGuo, Yejun2021-05-24
| | | | we'd use 'backend_configs' to avoid confusion.
* avfilter/vf_guided: Don't needlessly copy properties, fix potential NPDAndreas Rheinhardt2021-05-23
| | | | | | | | | ref_frame is owned by the framesync structure and should therefore not be modified; furthermore, these properties that are copied don't seem to be used at all, so copying is unnecessary. Finally copying when the destination frame is NULL gives a guaranteed segfault. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_guided: Fix leak of framesAndreas Rheinhardt2021-05-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_guided: Don't free frame we don't ownAndreas Rheinhardt2021-05-23
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfiltergraph: Remove NULL checks after dereferencesMichael Niedermayer2021-05-19
| | | | | | Fixes: CID1398579 Dereference before null check Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/vf_dnn_processing.c: fix CID 1460603Guo, Yejun2021-05-18
| | | | CID 1460603 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)
* lavfi/dnn/dnn_io_proc.c: fix Improper use of negative value (NEGATIVE_RETURNS)Guo, Yejun2021-05-18
| | | | fix coverity CID 1473511 and 1473566
* lavfi/dnn/dnn_io_proc.c: Fix Out-of-bounds access (ARRAY_VS_SINGLETON)Guo, Yejun2021-05-18
| | | | fix coverity CID 1473571, 1473577 and 1482089
* lavfi/dnn_backend_native_layer_mathunary.h: DocumentationShubhanshu Saxena2021-05-17
| | | | | | Add documentation for Unary Math Layer Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_native_layer_depth2space.h: DocumentationShubhanshu Saxena2021-05-17
| | | | | | Add documentation for Depth to Space Layer Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_native_layer_dense.h: DocumentationShubhanshu Saxena2021-05-17
| | | | | | Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_native_layer_conv2d.h: DocumentationShubhanshu Saxena2021-05-17
| | | | | | Add documentation for 2D Convolution Layer Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* avfilter/metadata: add intuitive labels for metadata valuesGyan Doshi2021-05-16
|
* avfilter/guided: reindent after 93ddb9b617Gyan Doshi2021-05-14
|
* avfilter/guided: simplify subsampling assignment.Gyan Doshi2021-05-14
| | | | | | | Reduce option ranges to effective values. Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro> Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* lavfi/dnn_backend_native_layer_avgpool.h: DocumentationShubhanshu Saxena2021-05-14
| | | | | | Add documentation for Average Pool Layer Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* GSoC: Support fast guided filter.Xuewei Meng2021-05-13
| | | | | | | | | | | | Two modes are supported in guided filter, basic mode and fast mode. Basic mode is the initial pushed guided filter without optimization. Fast mode is implemented based on the basic one by sub-sampling method. The sub-sampling ratio which can be defined by users controls the algorithm complexity. The larger the sub-sampling ratio, the lower the algorithm complexity. Signed-off-by: Xuewei Meng <xwmeng96@gmail.com> Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* avfilter/dnn/dnn_backend_tf: fix cross library usageLimin Wang2021-05-11
| | | | | | | | duplicate ff_hex_to_data() function from avformat and rename it to hex_to_data() as static function. Reviewed-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_dnn_classify: add result check for av_frame_get_side_dataSteven Liu2021-05-11
| | | | | | | | CID: 1482090 there can return null from av_frame_get_side_data, and will use sd->data after av_frame_get_side_data, so should check null return value. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* dnn/vf_dnn_detect.c: add tensorflow output parse supportTing Fu2021-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Testing model is tensorflow offical model in github repo, please refer https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2_detection_zoo.md to download the detect model as you need. For example, local testing was carried on with 'ssd_mobilenet_v2_coco_2018_03_29.tar.gz', and used one image of dog in https://github.com/tensorflow/models/blob/master/research/object_detection/test_images/image1.jpg Testing command is: ./ffmpeg -i image1.jpg -vf dnn_detect=dnn_backend=tensorflow:input=image_tensor:output=\ "num_detections&detection_scores&detection_classes&detection_boxes":model=ssd_mobilenet_v2_coco.pb,\ showinfo -f null - We will see the result similar as below: [Parsed_showinfo_1 @ 0x33e65f0] side data - detection bounding boxes: [Parsed_showinfo_1 @ 0x33e65f0] source: ssd_mobilenet_v2_coco.pb [Parsed_showinfo_1 @ 0x33e65f0] index: 0, region: (382, 60) -> (1005, 593), label: 18, confidence: 9834/10000. [Parsed_showinfo_1 @ 0x33e65f0] index: 1, region: (12, 8) -> (328, 549), label: 18, confidence: 8555/10000. [Parsed_showinfo_1 @ 0x33e65f0] index: 2, region: (293, 7) -> (682, 458), label: 1, confidence: 8033/10000. [Parsed_showinfo_1 @ 0x33e65f0] index: 3, region: (342, 0) -> (690, 325), label: 1, confidence: 5878/10000. There are two boxes of dog with cores 94.05% & 93.45% and two boxes of person with scores 80.33% & 58.78%. Signed-off-by: Ting Fu <ting.fu@intel.com> Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* lavfi/dnn_backend_tensorflow: support detect modelTing Fu2021-05-11
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn_backend_tensorflow: add multiple outputs supportTing Fu2021-05-11
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* dnn: add DCO_RGB color order to enum DNNColorOrderTing Fu2021-05-11
| | | | | | | Adding DCO_RGB color order to DNNColorOrder, since tensorflow model needs this kind of color oder as input. Signed-off-by: Ting Fu <ting.fu@intel.com>
* avfilter/vf_guided: Add missing constAndreas Rheinhardt2021-05-11
| | | | | | Forgotten in f8d910e90f599f338438833dfc92e2f1915ce414. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* GSoC: Add guided filterXuewei Meng2021-05-10
| | | | | | | | | Add examples on how to use this filter, and improve the code style. Implement the slice-level parallelism for guided filter. Add the basic version of guided filter. Signed-off-by: Xuewei Meng <xwmeng96@gmail.com> Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* lavfi/dnn_classify: add filter dnn_classify for classification based on ↵Guo, Yejun2021-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | detection bounding boxes classification is done on every detection bounding box in frame's side data, which are the results of object detection (filter dnn_detect). Please refer to commit log of dnn_detect for the material for detection, and see below for classification. - download material for classifcation: wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.bin wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.xml wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.1/emotions-recognition-retail-0003.label - run command as: ./ffmpeg -i cici.jpg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:input=data:output=detection_out:confidence=0.6:labels=face-detection-adas-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recognition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:labels=emotions-recognition-retail-0003.label:target=face,showinfo -f null - We'll see the detect&classify result as below: [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection bounding boxes: [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, 813) -> (1086, 905), label: face, confidence: 10000/10000. [Parsed_showinfo_2 @ 0x55b7d25e77c0] classify: label: happy, confidence: 6757/10000. [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) -> (967, 926), label: face, confidence: 6917/10000. [Parsed_showinfo_2 @ 0x55b7d25e77c0] classify: label: anger, confidence: 4320/10000. Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* lavfi/dnn: add classify support with openvino backendGuo, Yejun2021-05-06
| | | | Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* lavfi/dnn: refine dnn interface to add DNNExecBaseParamsGuo, Yejun2021-05-06
| | | | | | | | | | | | | Different function type of model requires different parameters, for example, object detection detects lots of objects (cat/dog/...) in the frame, and classifcation needs to know which object (cat or dog) it is going to classify. The current interface needs to add a new function with more parameters to support new requirement, with this change, we can just add a new struct (for example DNNExecClassifyParams) based on DNNExecBaseParams, and so we can continue to use the current interface execute_model just with params changed.
* lavfi/dnn_backend_openvino.c: move the logic for batch mode earlierGuo, Yejun2021-05-06
|
* lavfi/dnn_backend_openvino.c: add InferenceItem between TaskItem and RequestItemGuo, Yejun2021-05-06
| | | | | | | There's one task item for one function call from dnn interface, there's one request item for one call to openvino. For classify, one task might need multiple inference for classification on every bounding box, so add InferenceItem.
* lavfi/dnn_backend_openvino.c: unify code for infer request for sync/asyncGuo, Yejun2021-05-06
|
* lavfi/dnn_backend_native_layer_avgpool.c: Correct Spelling of PixelShubhanshu Saxena2021-05-06
| | | | | | Correct spelling of word `pixel` from `pxiels` Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>