1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Compare commits

...

1998 Commits

Author SHA1 Message Date
Alexander Alekhin 01b2c5a77c release: OpenCV 4.3.0 2020-04-03 11:45:28 +00:00
Alexander Alekhin 3a45a65625 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-03 11:44:22 +00:00
Alexander Alekhin 0812207db7 Merge tag '3.4.10' 2020-04-03 11:24:31 +00:00
Alexander Alekhin cf2a3c8e74 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-02 21:52:32 +00:00
Alexander Alekhin 1cc1e6fa56 release: OpenCV 3.4.10 2020-04-02 19:59:58 +00:00
Maxim Pashchenkov 277f0d270f Merge pull request #16745 from Volskig:mp/ocv-gapi-standalone-size
G-API: Unification of own:: structures with cv:: (Size, Point, Rect)

* deowned Size Rect Point

* Deownded Size Rect Point

* With Scalar
2020-04-02 18:19:45 +00:00
Alexander Alekhin 6216bf9221 Merge pull request #16959 from alalek:winpack_dldt_update 2020-04-02 18:13:58 +00:00
Alexander Alekhin 388a7ce86e Merge pull request #16956 from alalek:ocl_control_buffer_mapping 2020-04-02 17:56:50 +00:00
Alexander Alekhin 5d95a500ad winpack_dldt: readme update 2020-04-02 16:52:46 +00:00
Alexander Alekhin 95341c2b1b Merge pull request #16953 from mshabunin:fix-msmf-writer-fps 2020-04-02 13:06:34 +00:00
Alexander Alekhin 54063c40de core(ocl): options to control buffer access flags
- control using of clEnqueueMapBuffer or clEnqueueReadBuffer[Rect]
- added benchmarks with OpenCL buffer access use cases
2020-04-02 11:11:06 +00:00
Maksim Shabunin 585593e9fc videoio: fixed MSMF writer fps handling 2020-04-02 12:52:38 +03:00
Alexander Alekhin f15e885baf Merge pull request #16950 from alalek:fix_16945 2020-04-02 09:26:09 +00:00
Alexander Alekhin 9109cb1ec6 Merge pull request #16948 from alalek:warning_16739 2020-04-02 09:25:47 +00:00
Alexander Alekhin dc9ee53ff5 stitching: fix range check in DpSeamFinder::computeCosts 2020-04-02 03:51:17 +00:00
Alexander Alekhin 1485968fc4 Merge pull request #16947 from mshabunin:fix-msmf-convert-format 2020-04-01 18:50:12 +00:00
Maxim Pashchenkov 557ac3dbaf Merge pull request #16805 from Volskig:mp/ocv-gapi-standalone-scalar
G-API: Unification of own:: Scalar with cv:: Scalar

* cvdefs.hpp

* Small changes

* Deowned Scalar. Does't work

* Something

* Removed to_ocv for Scalar

* Clear code

* Deleted whitespaces

* Added include<..own/scalar.hpp in cvdefs.hpp.

* Long string split on two now

* Comment about scalar

* Comment about crutch

* Removed second varible in scalar_wrapper

* Changed wrapper for scalar, alignment

* Alignment

* Whitespaces

* Removed scalar_wrapper
2020-04-01 18:40:38 +00:00
Alexander Alekhin 09134ac881 core: emit warning ONCE on ambiguous MatExpr processing 2020-04-01 18:34:20 +00:00
Maksim Shabunin 433c5199fd videoio: fixed conversion in MSMF backend 2020-04-01 14:40:11 +03:00
Alexander Alekhin d448a636f8 Merge pull request #16943 from alalek:winpack_samples_update_master 2020-04-01 01:46:26 +03:00
Alexander Alekhin 396f43d674 Merge pull request #16938 from alalek:winpack_samples_update 2020-04-01 01:46:13 +03:00
Alexander Alekhin 3c5fec6746 build: updates for winpack dldt 2020-03-31 22:18:21 +00:00
Alexander Alekhin e12b1c2209 build: updates for winpack dldt 2020-03-31 20:29:11 +00:00
Alexander Alekhin f6b2b49e4a Merge pull request #16932 from alalek:imgproc_resize_nn_cleanup 2020-03-30 15:38:40 +00:00
Alexander Alekhin e1322cf503 Merge pull request #16928 from alalek:fix_15075 2020-03-30 13:07:35 +00:00
Alexander Alekhin 67dfdee33f Merge pull request #16922 from alalek:imgcodecs_test_io_grayscale 2020-03-29 16:36:06 +00:00
Alexander Alekhin 61c4cfd896 imgproc(resize): drop unused 'pix_size4' 2020-03-29 02:41:50 +00:00
Alexander Alekhin be17f532e1 imgproc(resize): fix resizeNNInvoker handling of generic pixel size 2020-03-29 02:41:41 +00:00
Alexander Alekhin 6d85fa3fd2 imgcodecs(test): rework common I/O test, added grayscale mode 2020-03-27 21:34:51 +00:00
Alexander Alekhin 95a07ca11c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-27 16:49:59 +00:00
Alexander Alekhin 222a48577f Merge pull request #16919 from alalek:backport_16860 2020-03-27 16:44:05 +00:00
Alexander Alekhin 353273579b Merge pull request #16918 from alalek:build_warnings_3.4 2020-03-27 16:43:23 +00:00
Alexander Alekhin 72c5ac37de Merge pull request #16915 from alalek:build_warnings 2020-03-27 16:42:53 +00:00
Alexander Alekhin 1eba7f60c2 Merge pull request #16913 from alalek:gapi_simd_initialization 2020-03-27 16:42:14 +00:00
Alexander Alekhin 7373ef0983 Merge pull request #16847 from alalek:build_opencv_winpack_dldt 2020-03-27 16:06:19 +00:00
Moritz Fischer-Gundlach 2740901378 -calib3d updates documentation
backporting commit 99436bb8cf
2020-03-27 16:02:29 +00:00
Alexander Alekhin 0c00d082cf Merge pull request #16860 from FischerGundlach:rework_docu 2020-03-27 16:00:48 +00:00
Alexander Alekhin e661ad2a67 eliminate build warnings 2020-03-27 11:39:07 +00:00
Alexander Alekhin 3a4b79173b Merge pull request #16916 from cyyever:fix_freebsd_build 2020-03-27 11:38:57 +00:00
cyy bdc29cccb6 fix freebsd build 2020-03-27 18:12:10 +08:00
StefanBruens 8d78400052 Merge pull request #16494 from StefanBruens:jpeg2000_openjpeg_port
Jpeg2000 OpenJPEG port

* OpenJPEG based JPEG2000 decoder implementation

Currently, the following input color spaces and depth conversions are
supported:

- 8 bit -> 8 bit
- 16 bit -> 16 bit (IMREAD_UNCHANGED, IMREAD_ANYDEPTH)

- RGB(a) -> BGR
- RGBA -> BGRA (IMREAD_UNCHANGED)
- Y(a) -> Y(a) (IMREAD_ANYCOLOR, IMREAD_GRAY, IMREAD_UNCHANGED))
- YCC -> Y (IMREAD_GRAY)

* Check for OpenJPEG availability

This enables OpenJPEG based JPEG2000 imread support by default, which
can be disabled by -DWITH_OPENJPEG=OFF. In case OpenJPEG is enabled
and found, any checks for Jasper are skipped.

* Implement precision downscaling for precision > 8 without IMREAD_UNCHANGED

With IMREAD_UNCHANGED, values are kept from the input image, without it
components are downscaled to CV_8U range.

* Enable Jpeg2K tests when OpenJPEG is available

* Add support for some more color conversions

Support IMREAD_GRAY when input color space is RGB or unspecified.
Support YUV input color space for BGR output.

* fix: problems with unmanaged memory

* fix: CMake warning - HAVE_OPENJPEG is undefined

Removed trailing whitespaces

* fix: CMake find_package OpenJPEG add minimal version

* Basic JPEG2K encoder

Images with depth CV_8U and CV_16U are supported, with 1 to 4 channels.

* feature: Improved code for OpenJPEG2000 encoder/decoder

 - Removed code duplication
 - Added error handlers
 - Extracted functions

* feature: Update conversion openjpeg array from/to Mat

* feature: Extend ChannelsIterator to fulfill RandomAccessIterator named requirements

 - Removed channels split in copyFromMatImpl. With ChannelsIterator no allocations are performed.
 - Split whole loop into 2 parts in copyToMat -> where std::copy and std::transforms are called.

* fix: Applied review comments.

 - Changed `nullptr` in CV_LOG* functions to `NULL`
 - Added `falls through` comment in decoder color space `switch`
 - Added warning about unsupported parameters for the encoder

* feature: Added decode from in-memory buffers.

Co-authored-by: Vadim Levin <vadim.levin@xperience.ai>
2020-03-27 07:18:58 +00:00
Alexander Alekhin b4b4d21212 eliminate build warnings 2020-03-26 19:18:09 +00:00
Alexander Alekhin 99502e99cc gapi(simd): initialize accumulator values 2020-03-26 16:48:21 +00:00
Moritz Fischer-Gundlach 99436bb8cf -calib3d updates documentation 2020-03-26 15:22:39 +01:00
Alexander Alekhin 7465125f67 build: add winpack_dldt build scripts 2020-03-25 21:26:41 +00:00
Alexander Alekhin 340df65fb4 Merge pull request #16903 from alalek:fix_16823_3.4 2020-03-25 15:53:08 +00:00
Alexander Alekhin 9a463b74dc Merge pull request #16901 from alalek:cmake_ie_find_extra_libs 2020-03-25 15:52:15 +00:00
Anatoliy Talamanov c303aaa94d Merge pull request #16841 from TolyaTalamanov:at/warp-perspective
G-API: Implement WarpPerspective

* Implement WarpPerspective kernel

* Fix comment to review
2020-03-25 11:23:32 +00:00
Alexander Alekhin c920b45fb8 core(persistence): fix resource leaks - force closing files
backporting commit 673eb2b006
2020-03-25 10:49:16 +00:00
Alexander Alekhin 2a9a2fff66 cmake: fix find process for InferenceEngine extra libraries 2020-03-25 02:43:42 +00:00
Alexander Alekhin b0563ce368 Merge pull request #16895 from alalek:fix_16823 2020-03-24 16:15:15 +03:00
Alexander Alekhin 673eb2b006 core(persistence): fix resource leaks - force closing files 2020-03-24 11:38:09 +00:00
Alexander Alekhin ef395c3866 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-24 11:12:11 +00:00
Anatoliy Talamanov 4d3d6230c5 Merge pull request #16803 from TolyaTalamanov:at/yuv-to-gray
* Implement NV12toGray

* Snapshot

* Implement NV12toGray as compound kernel

* Update gapi_imgproc_tests_inl.hpp

* Remove YUV2Gray from public API
2020-03-24 10:51:18 +00:00
Alexander Alekhin a28a520c7f Merge pull request #16897 from mshabunin:fix-kw-issues-2 2020-03-24 10:48:41 +00:00
Maksim Shabunin 0aac17d9f7 calib3d: check input values in dls 2020-03-24 12:22:26 +03:00
Alexander Alekhin ea34b2fefb Merge pull request #16888 from YashasSamaga:cuda4dnn-redundant-act-fusion-check 2020-03-24 08:41:11 +00:00
Alexander Alekhin f44a0960df Merge pull request #16894 from alalek:update_tbb 2020-03-24 08:40:46 +00:00
Alexander Alekhin b1ed003d08 Merge pull request #16893 from alalek:update_libwebp
* 3rdparty: update libwebp 1.0.3 => 1.1.0

- https://github.com/webmproject/libwebp/releases/tag/v1.1.0

* 3rdparty(libwebp): re-apply OpenCV patches
2020-03-24 08:40:18 +00:00
Alexander Alekhin 22d930998b Merge pull request #16892 from alalek:update_libtiff 2020-03-24 08:39:39 +00:00
Alexander Alekhin d2b0953735 Merge pull request #16891 from alalek:update_libjpeg-turbo 2020-03-24 08:39:06 +00:00
Alexander Alekhin 978666c816 Merge pull request #16849 from anton-potapov:ap/variant__assignment_operator_compile_error 2020-03-23 22:04:48 +00:00
Alexander Alekhin fa002bde01 3rdparty: update TBB 2020.0 => 2020.1 2020-03-23 20:37:08 +00:00
Alexander Alekhin 13c4dc0e69 3rdparty: update libtiff 4.0.10 => 4.1.0
- https://gitlab.com/libtiff/libtiff/-/tags/v4.1.0
2020-03-23 18:43:45 +00:00
Alexander Alekhin ad4e5dbd3d 3rdparty: libjpeg-turbo 2.0.2 => 2.0.4
- https://github.com/libjpeg-turbo/libjpeg-turbo/releases/tag/2.0.4
2020-03-23 18:26:18 +00:00
Alexander Alekhin 0b4c101e8a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-23 16:54:35 +00:00
Alexander Alekhin 2d63861c09 Merge pull request #16885 from mshabunin:fix-msvc-warn 2020-03-23 16:23:37 +00:00
Alexander Alekhin e8c7d61752 Merge pull request #16817 from dkurt:dnn_onnx_lstm 2020-03-23 16:22:17 +00:00
YashasSamaga 4e8cd4629c fix CUDNN_STATUS_NOT_SUPPORTED, remove redundant fusion checks 2020-03-23 19:47:00 +05:30
Dmitry Kurtaev 467c3ef0ac Add checks for LSTM initial h and c 2020-03-23 16:28:55 +03:00
Alexander Alekhin b1f390b170 Merge pull request #16883 from alalek:cmake_cmp0066 2020-03-23 12:58:44 +00:00
Alexander Alekhin 154fdef965 Merge pull request #16882 from alalek:cmake_apps_install_list 2020-03-23 12:58:23 +00:00
Maksim Shabunin 2f665ec589 calib3d: fixed VS2019 warning C4756 2020-03-23 14:46:21 +03:00
Alexander Alekhin 801f26c35d cmake: set CMP0066 => NEW 2020-03-23 01:15:49 +00:00
Alexander Alekhin 6db9f00fd1 cmake(apps): support OPENCV_INSTALL_APPS_LIST
Usage:
- cmake -DOPENCV_INSTALL_APPS_LIST=opencv_version ...
2020-03-23 00:06:42 +00:00
Alexander Alekhin 39b64fc7d7 Merge pull request #16864 from alalek:issue_16857 2020-03-22 23:15:57 +03:00
Alexander Alekhin 4dfa798e75 Merge pull request #16868 from YashasSamaga:cuda4dnn-scale-fix_and_improvements 2020-03-22 20:15:11 +00:00
YashasSamaga 2aeb32d2d1 fix segfaults, support bias in untrainable mode, support batches in untrainable mode 2020-03-22 22:18:52 +05:30
Dmitry Kurtaev 8433620295 Bidirectional LSTM 2020-03-22 00:56:48 +03:00
Alexander Alekhin 760e9e0943 Merge pull request #16859 from dmatveev:dm/gapi_android 2020-03-21 17:06:01 +00:00
Alexander Alekhin 7b82ad2918 Merge pull request #16867 from bencsikandrei:fix_typo_cmake_detect_python 2020-03-21 17:04:34 +00:00
Alexander Alekhin 49d8c0bd52 Merge pull request #16865 from alalek:doc_fix_wrong_see_also 2020-03-21 17:04:09 +00:00
Andrei-Florin BENCSIK 8253562794 fix: minor typo in CMakeCVDetectPython 2020-03-21 11:15:07 +02:00
Alexander Alekhin d7e839b8c5 objdetect(QR): avoid bug with empty input 2020-03-21 01:35:30 +00:00
Alexander Alekhin 2fb1d9d02e doc: fix misused "see also" doxygen command 2020-03-21 00:25:49 +00:00
Alexander Alekhin 4cdb4652cf Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-20 21:41:15 +00:00
Alexander Alekhin 0fb4f2cc9c imgproc: add src.empty() checks in filter operations 2020-03-20 21:04:29 +00:00
Alexander Alekhin 183e4d50ed Merge pull request #16858 from alalek:core_fix_empty_iterator_begin_end 2020-03-20 19:32:55 +00:00
Dmitry Matveev 020be63df5 Try to enable G-API build on Android 2020-03-20 17:20:01 +03:00
Alexander Alekhin 377dd04224 core: fix .begin()/.end() of empty Mat 2020-03-20 14:08:45 +00:00
Anton Potapov 31d624f9a8 G-API utils - fix compilation error in variant::operator= 2020-03-20 14:46:13 +03:00
NesQl bf224e61a9 Merge pull request #16832 from liqi-c:3.4-tengine-android
* Add android support for tengine

* modify tengine download use commit id

* Del some invalid log in Tengine

* Test. default enable tengine

* ndk version judegment

* Close test . set Tengine default OFF

* Logic problem

* test .Android NDK judgement .

* Cmake error modify.

* cmake: cleanup tengine scripts

* cmake: use tengine target name

* cmake: disable testing of BUILD_ANDROID_PROJECTS=OFF

* Close test .
2020-03-20 10:10:39 +00:00
Dizhenin Vlad 8ac333697d Merge pull request #16853 from SimpleVlad:note
Add link to article for sample "Intelligent scissors"

* Add link to article

* Add autors name

* Fix whitespace
2020-03-19 21:39:54 +00:00
Alexander Alekhin dbb30134bc Merge pull request #16835 from YashasSamaga:cuda4dnn-hotfix-memory-lock 2020-03-19 16:50:39 +00:00
Alexander Alekhin 847190b5b8 Merge pull request #16828 from paroj:nmspy 2020-03-19 16:43:43 +00:00
Alexander Alekhin 0f31231872 Merge pull request #16846 from alalek:cmake_python_limited_api 2020-03-19 16:43:16 +00:00
Alexander Alekhin b76aeb40fb Merge pull request #16842 from mshabunin:ignore-vs-config 2020-03-19 16:42:55 +00:00
Anatoliy Talamanov 8fe9674301 Merge pull request #16768 from TolyaTalamanov:at/add-warp-affine
G-API: Implement WarpAffine

* Add WarpAffine

* Ban BORDER_TRANSPARENT

* Fix doc
2020-03-19 12:12:09 +00:00
Pavel Rojtberg 66cf55ea1f dnn: expose only float variant of NMSBoxes for bindings
the float variant was always shadowed by the int version as
Rect2d is implicitly convertible to Rect.
This swaps things which is fine, as the vector of boxes was always
copied and the computation was done in double.
2020-03-19 12:36:35 +01:00
Alexander Alekhin 4b47c7dbd2 cmake(python): handle PYTHON3_LIMITED_API
- python-3.x => python-3
- config-3.x.py => config-3.py
2020-03-18 23:10:06 +00:00
Elizarov Ilya 221ddec845 Merge pull request #16554 from ieliz:tracker
Added DaSiamRPN tracker

* added DaSiamRPN tracker

* whitespace trouble handled

* Fixes for PR

* Fixes for PR

* Fixes for PR

* added new line in the end of the file and x_crop fix

* removed cxy_wh_2_rect function

* removed loop from sofrmax function

* more  detailed discription about absolute paths to onnx models

* removed nested while loop, initialization moved from main tracking loop

* added assert message for small init bb

* initial bounding box on videostream

* selection of initial bounding box improved

* created tracker class, fixed initializing bounding box

* fix round of value

* names fix

* private methods renamed

* names fixed, case for video WIP

* fix case with video

* removed hardcoded size of window

* whitespace fix

* links to models fixed

* bounding box drawing fix

* changes does not required

* code style fixes

* fixes

* frame checker added in tracking loop

* fixed import sys
2020-03-18 15:46:43 +00:00
Pratik Raj 2160f9b20e Merge pull request #16733 from Rajpratik71:master
Some debian package manager tweaks
2020-03-18 15:19:55 +00:00
iteal e63af185de Merge pull request #16818 from iteal:master
Update template_matching.markdown

Fixed "template image" should be "source image" in two sentences explaining template matching.
2020-03-18 08:45:09 +00:00
Dmitry Kurtaev 11d565ca62 Fix LSTM from ONNX with batch==1 2020-03-18 00:00:24 +03:00
Dmitry Kurtaev 8d69dbdf49 LSTM from ONNX works 2020-03-17 22:05:57 +03:00
Dmitry Kurtaev 14da5ec311 LSTM scalar 2020-03-17 22:01:49 +03:00
Maksim Shabunin 9cc9237522 Ignore Visual Studio cmake configuration file 2020-03-17 21:12:54 +03:00
Alexander Alekhin 25ab141b93 Merge pull request #16836 from alalek:stitching_avoid_nonfree_by_default 2020-03-17 16:29:44 +00:00
Liubov Batanina 718d7e4b04 Merge pull request #16715 from l-bat:slice_onnx
* Support Slice layer with multiple inputs

* Add test

* Supported Resize from PyTorch

* Rewrite test

* Remove Cast layer (supported in #16735)

* Support ConstantOfShape

* Fix tests

* Fix coments

* Remove useless condition

* Fixed failed tests
2020-03-17 17:31:01 +03:00
Alexander Alekhin ca68fac4b2 stitching: don't use nonfree by default 2020-03-17 15:09:23 +03:00
YashasSamaga 034a43e7f7 release and relock on wrapper resize 2020-03-17 16:08:04 +05:30
Alexander Alekhin ca23c0e630 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-17 13:23:33 +03:00
Alexander Alekhin 1d7bfcc958 Merge pull request #16827 from alalek:update_buffer_area 2020-03-17 10:12:47 +00:00
Alexander Alekhin 01ea055d79 Merge pull request #16825 from mshabunin:fix-qrcode-tests 2020-03-16 18:52:15 +00:00
Alexander Alekhin df74eb4ff6 Merge pull request #16826 from mshabunin:fix-kw-issues-34 2020-03-16 18:48:19 +00:00
Alexander Alekhin c48473dfe4 Merge pull request #16824 from mshabunin:fix-kw-issues 2020-03-16 18:47:36 +00:00
Alexander Alekhin 77d1c20fb7 core(buffer_area): handle 'OPENCV_ENABLE_MEMORY_SANITIZER=ON' case 2020-03-16 19:34:08 +03:00
Maksim Shabunin 05d4975619 objdetect: fix QRCode tests with disabled QUIRC 2020-03-16 19:20:34 +03:00
Maksim Shabunin d4d95bd70d Fixs several problems found by static analysis 2020-03-16 19:15:26 +03:00
Maksim Shabunin 7e7bb3027c Fixs several problems found by static analysis 2020-03-16 19:03:24 +03:00
Alexander Alekhin 8f49b820db Merge pull request #16820 from dkurt:fix_16811 2020-03-16 15:04:49 +00:00
RAJKIRAN NATARAJAN 3b2e409fa7 Merge pull request #16779 from saskatchewancatch:issue-16777
* Fixes issue 16777.

* core: update Concurrency getNumThreads()
2020-03-16 17:12:29 +03:00
Dizhenin Vlad 1c2ed2876f Merge pull request #16695 from SimpleVlad:intelligent_scissors
Intelligent scissors

* Start

* Remove whitespace

* Re onMouse

* replased double to float

* Draw contours

* CV_FILLED -> FILLED

* Remove line 210

* Change 'about'

* Remove M_PI

* Remove warning

* CP_PI

* double to float

* CV_PI to Float

* Add struct for data

* line 172, 191 whitespace

* Change name

* Fix Warnings

* Set const

* line 180

* rewrite keys

* &img = param->img
2020-03-16 17:10:25 +03:00
Dmitry Kurtaev 7f0d90a525 Fix memory leak in Python custom dnn layers 2020-03-16 16:54:55 +03:00
Alexander Alekhin 71ec112093 Merge pull request #16786 from alalek:issue_16398 2020-03-15 19:49:50 +00:00
Alexander Alekhin e021b85b36 Merge pull request #16812 from seiko2plus:vsx_improve_broadcast 2020-03-14 22:00:18 +00:00
Sayed Adel 9ea62bfddb core:vsx reimplement v_broadcast_element()
There's no need to use `vec_perm()` instead of `vec_splat()`,
  since instruction `vperm` is quite heavy compared to `vsplt[b,h,w]`.
2020-03-14 22:54:22 +02:00
Alexander Alekhin 00925ad795 Merge pull request #16809 from alalek:dnn_ie_separate_core_instances 2020-03-14 13:47:50 +00:00
Alexander Alekhin 683910f579 Merge pull request #16760 from dkurt:dnn_mobilenet_v3 2020-03-14 13:38:06 +00:00
Liubov Batanina 2645ee90ca Merge pull request #16735 from l-bat:flatten_const_onnx
* Supported Flatten for constant nodes

* Added default axis

* Refactoring

* Refactoring

* Added cast layer

* Fix comments

* Add Cast for layers
2020-03-14 11:05:49 +00:00
Alexander Alekhin 0e6ce50131 Merge pull request #16798 from alalek:opencv_version_threads 2020-03-14 10:59:27 +00:00
Alexander Alekhin ff70b02efc Merge pull request #16797 from alalek:cmake_warning_python_standalone 2020-03-13 18:02:50 +00:00
Alexander Alekhin 9b64eadcb6 dnn(ie): separate IECore for different devices
- HETERO plugin doesn't switch well between devices
2020-03-13 18:49:28 +03:00
Alexander Alekhin 2a52e44bc6 Merge pull request #16806 from anton-potapov:kw_fixes_own_mat_total_overflow 2020-03-13 11:49:01 +00:00
Anton Potapov 3af63fe052 GAPI - KW fixes
- avoid overflow in own::Mat::total() and according tests, part 2
2020-03-13 12:46:18 +03:00
Alexander Alekhin 3d36f9044d opencv_version: dump threads information 2020-03-12 16:41:03 +03:00
Alexander Alekhin a1230ad0a0 Merge pull request #16796 from anton-potapov:kw_fixes_own_mat_total_overflow 2020-03-12 13:05:52 +00:00
Alexander Alekhin 448a5452d0 Merge pull request #16793 from anton-potapov:kw_fixes_bitwise_op_on_bools 2020-03-12 12:10:32 +00:00
Alexander Alekhin 4cebef9090 Merge pull request #16792 from alalek:fixup_merge_dnn 2020-03-12 12:04:47 +00:00
Alexander Alekhin 7080c783d1 cmake: fix missing project() warning in Python standalone builds 2020-03-12 14:29:31 +03:00
Anton Potapov d3b68b059b GAPI - KW fixes
- avoid overflow in own::Mat::total() and according tests
2020-03-12 13:29:54 +03:00
Alexander Alekhin 866b15ddb8 Merge pull request #16787 from D-Alex:master 2020-03-12 10:12:24 +00:00
Alexander Alekhin 7d1c42afe1 dnn: fix merge mistake in scale_layer.cpp 2020-03-12 13:07:33 +03:00
Alexander Duda d594e72586 fix: estimateChessboardSharpness triggers out of range test
Problem is that iter1 += tcols, iter2 += tcols are called without check.
row < trows - 1 check is processed after increment in "for" statements.
2020-03-11 22:04:54 +01:00
Alexander Alekhin 4e56c1326f core: adjust type of allocator_stats counter, allow to disable 2020-03-11 20:12:29 +03:00
Anton Potapov 3ba6b41961 GAPI - KW fixes
- replaced bitwise &= on bools, with explicit && to make KW happy
2020-03-11 18:16:56 +03:00
Alexander Alekhin 034a5f140c Merge pull request #16784 from alalek:update_ffmpeg_master 2020-03-11 12:57:15 +00:00
Alexander Alekhin 3a99ebb446 Merge pull request #16756 from alalek:cmake_opencv_test_extra_compile_options 2020-03-11 12:38:45 +00:00
Alexander Alekhin c1a8fb72b7 Merge pull request #16498 from etrulls:3.4.9-maxIters 2020-03-11 12:35:33 +00:00
Alexander Alekhin 11b08b5ff3 ffmpeg/4.x: update FFmpeg plugin 2020-03-11 10:57:47 +00:00
Alexander Alekhin 850414a501 Merge pull request #16771 from alalek:update_version_4.3.0-pre 2020-03-11 10:24:56 +00:00
Alexander Alekhin a560ebf09d Merge pull request #16782 from anton-potapov:kw_fixes 2020-03-11 10:08:55 +00:00
Anton Potapov 72fedbe096 GAPI - KW fixes
- replace "unsafe" memcpy with "safe" :) std::copy_n to make KW happy
2020-03-11 11:23:15 +03:00
Alexander Alekhin d00e58cdb0 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-10 22:49:51 +00:00
Alexander Alekhin 9f82b74788 Merge pull request #16774 from alalek:core_update_cpus_detection 2020-03-10 22:39:30 +00:00
Alexander Alekhin 764e8ac2c4 Merge pull request #16773 from alalek:update_ffmpeg_3.4 2020-03-10 22:30:51 +00:00
Alexander Alekhin 612746b4e5 Merge pull request #16744 from alalek:fix_mat_aug_operators_use_after_free 2020-03-10 22:02:47 +00:00
Alexander Alekhin 83e1d79403 core: update CPUs detection
- cache value, evaluate once
- better support for MINGW
- anything in 'cv' namespace
- test: dump number of active threads
2020-03-10 21:29:08 +00:00
Alexander Alekhin 155b751a75 ffmpeg/3.4: update FFmpeg wrapper
- FFmpeg 3.4.7
2020-03-10 19:05:50 +00:00
Alexander Alekhin 4966186e10 Merge pull request #16770 from alalek:update_version_3.4.10-pre 2020-03-10 18:34:39 +00:00
Alexander Alekhin 510a8520c7 Merge pull request #16746 from alalek:dnn_switch_ie_backend_ngraph 2020-03-10 13:52:33 +00:00
Vadim Levin 09fe66e87f Merge pull request #16713 from VadimLevin:dev/vlevin/ffmpeg_video_capture_bitrate
* feature: Add video capture bitrate read-only property for FFMPEG backend

* test: For WIN32 property should be either expected or 0.

Added `IsOneOf` helper function, enabled only for _WIN32.
2020-03-10 16:44:22 +03:00
Alexander Alekhin 3c85745e22 pre: OpenCV 4.3.0 (version++) 2020-03-10 15:00:03 +03:00
Alexander Alekhin b7ecaceda8 pre: OpenCV 3.4.10 (version++)
- Android Manager version is not increased (stuck on 3.49)
2020-03-10 14:53:43 +03:00
Maxim Pashchenkov 3befdb4ae8 Merge pull request #16604 from Volskig:mp/ocv-gapi-zero-height-mat
G-API: Zero-height mat is cause of crash

* Added check for zero-height Mat case

* Refactoring, added validate_input_arg func

* No bool function now
2020-03-10 14:44:16 +03:00
Alexander Alekhin db95aec4a7 dnn(ie): switch to nGraph backend by default 2020-03-10 14:33:22 +03:00
Yashas Samaga B L 490908f0ff Merge pull request #16436 from YashasSamaga:feature-enetb0-yolo
dnn(darknet-importer): add grouped convolutions, sigmoid, swish, scale_channels

* update darknet importer to support enetb0-yolo

* remove dropout (pr16438) and fix formatting

* add test for scale_channels

* disable batch testing for scale channels

* do not set LayerParams::name

* merge all activations into setActivation
2020-03-10 12:45:19 +03:00
Alexander Alekhin 27b71d6368 Merge pull request #16625 from D-Alex:findChessboard 2020-03-09 22:21:29 +00:00
Alexander Alekhin 9b3be01b83 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-09 20:27:34 +00:00
NesQl 0bcdf7d03e Merge pull request #16724 from liqi-c:3.4-tengine
* Add Tengine support .

* Modify printf to CV_LOG_WARNING

* a few minor fixes in the code

* Renew Tengine version

* Add header file for CV_LOG_WARNING

* Add #ifdef HAVE_TENGINE in tengine_graph_convolution.cpp

* remove trailing whitespace

* Remove trailing whitespace

* Modify for compile problem

* Modify some code style error

* remove whitespace

* Move some code style problem

* test

* add ios limit and build problem

* Modified as alalek suggested

* Add cmake 2.8 support

* modify cmake 3.5.1 problem

* test and set BUILD_ANDROID_PROJECTS OFF

* remove some compile error

* remove some extra code in tengine

* close test.

* Test again

* disable android.

* delete ndk version judgement

* Remove setenv() call . and add License information

* Set tengine default OFF. Close test .

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2020-03-09 14:59:23 +00:00
Alexander Duda 44560c3e50 calib3d: add estimateChessboardSharpness
Image sharpness, as well as brightness, are a critical parameter for
accuracte camera calibration. For accessing these parameters for
filtering out problematic calibraiton images, this method calculates
edge profiles by traveling from black to white chessboard cell centers.
Based on this, the number of pixels is calculated required to transit
from black to white. This width of the transition area is a good
indication of how sharp the chessboard is imaged and should be below
~3.0 pixels.

Based on this also motion blur can be detectd by comparing sharpness in
vertical and horizontal direction. All unsharp images should be excluded
from calibration as they will corrupt the calibration result. The same
is true for overexposued images due to a none-linear sensor response.
This can be detected by looking at the average cell brightness of the
detected chessboard.
2020-03-09 08:58:18 +01:00
Dmitry Kurtaev b927ce18b2 Support for MobileNetV3-SSD from TensorFlow 2020-03-08 21:09:21 +03:00
Alexander Alekhin 969cc3dd95 Merge pull request #16743 from alalek:ts_dump_exception_content 2020-03-07 19:07:18 +00:00
Alexander Alekhin 198b5096aa Merge pull request #16754 from alalek:issue_16752
* core(test): FP16 norm test

* core: norm()-FP16 disable OpenCL

* core(norm): fix 16f32f local buffer size
2020-03-07 19:06:47 +00:00
Alexander Alekhin e0a9468488 cmake: allow extra compile options for tests 2020-03-07 15:37:21 +00:00
Eduard Trulls 7e637c134f Expose maxIters in findFundamentalMat
Lets the user choose the maximum number of iterations the robust
estimator runs for, similary to findHomography. This can significantly
improve performance (at a computational cost).
2020-03-07 18:03:44 +03:00
Alexander Alekhin 619180dffd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-06 20:41:30 +00:00
Alexander Alekhin 6d113bd03f Merge pull request #16751 from alalek:core_coverity_issues 2020-03-06 19:07:21 +00:00
Alexander Alekhin a76c72acdd Merge pull request #16738 from dkurt:onnx_broadcast 2020-03-06 19:04:43 +00:00
Alexander Alekhin e9655cf646 Merge pull request #16697 from alalek:imgcodecs_jpeg_drop_unnecessary_code 2020-03-06 19:03:43 +00:00
Alexander Alekhin 34530da66e core: fix coverity issues 2020-03-06 18:12:45 +00:00
Alexander Alekhin 6271192a32 Merge pull request #16694 from alalek:dnn_disable_nn_builder_api 2020-03-06 13:18:41 +00:00
Alexander Alekhin 3a2f40ac6f core: don't allow reallocation in add/div/sub/bitwise aug operators 2020-03-06 13:00:40 +00:00
Alexander Alekhin 094a5b0cba Merge pull request #16719 from alalek:dnn_disable_nn_builder_api_3.4 2020-03-06 12:26:48 +00:00
Alexander Alekhin a55cc07548 ts(gtest): dump exception message from EXPECT_NO_THROW() 2020-03-06 12:08:43 +00:00
Alexander Alekhin c9296e599f Merge pull request #16690 from asmorkalov:bug_template
Added checklist and recommendations to issue template
2020-03-06 14:30:48 +03:00
Alexander Alekhin b33ff22988 Merge pull request #16740 from m-gupta:header 2020-03-06 09:02:25 +00:00
Manoj Gupta 880d2afb67 Fix building with ToT libc++
ToT libc++ (LLVM) no longer includes <sstream>
as part of <complex> which breaks building opencv.
Include <sstream> header explcitly to fix this.
2020-03-05 17:10:43 -08:00
Dmitry Kurtaev 9e332dc5fb Broadcasting from ONNX 2020-03-06 00:58:59 +03:00
Alexander Alekhin a694e5074f Merge pull request #16723 from jansol:master 2020-03-05 12:25:20 +00:00
Alexander Alekhin 90a4d67e8d Merge pull request #16513 from pwuertz:cuda_py_interop 2020-03-05 11:56:07 +00:00
Alexander Alekhin 23bc89d6fc Merge pull request #16577 from Volskig:mp/ocv-gapi-work 2020-03-05 10:58:51 +00:00
Alexander Alekhin 73ddc091a2 Merge pull request #16693 from Volskig:mp/ocv-gapi-add-include 2020-03-05 10:53:23 +00:00
Maxim Pashchenkov bce9837604 Added assert for create Mat with negative dims, added tets for this case 2020-03-05 11:52:10 +03:00
Maxim Pashchenkov f3a50224f2 Rm imgproc from render.cpp 2020-03-05 11:41:36 +03:00
Alexander Alekhin d4a17da7b2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-04 20:49:09 +00:00
Alexander Alekhin 4f288a1e28 Merge pull request #16704 from alalek:core_log_once_log_if
* core(logger): add CV_LOG_ONCE_xxx() CV_LOG_IF_xxx() macros

* core(logger): keep tests disabled
2020-03-04 20:42:41 +00:00
Alexander Alekhin fd09413566 Merge pull request #16731 from alalek:issue_16708
* imgproc(integral): avoid OOB access

* imgproc(test): fix integral perf check

- FP32 computation is not accurate

* imgproc(integral): tune loop limits
2020-03-04 19:28:04 +00:00
Jan Solanti ad16c243ca core(ocl): Don't query image formats when none exist
clGetSupportedImageFormats returns CL_INVALID_VALUE if called with
num_entries 0 and a non-NULL image_formats pointer so let's not do that.
2020-03-04 14:15:33 +02:00
Alexander Alekhin da6ad1c640 Merge pull request #15765 from zachlowry:patch-1
Use argument value for 'mat' in call to format for vector_mat and vector_mat_template
2020-03-04 11:42:31 +03:00
Liubov Batanina 9ed1332355 Merge pull request #16722 from l-bat:reshape_opset_11
* Supported Div op for constants

* Added Mul test
2020-03-04 11:27:10 +03:00
Vadim Levin 90ec651bd7 test: Add test to verify correct mat substitution into the template in header parser 2020-03-04 08:14:19 +03:00
Zach Lowry 0aa5391c4b Use argument value for 'mat' in call to format for vector_mat and vector_mat_template
The hard-coded string value "Mat" was used in the two format strings for vector_mat and vector_mat_template, preventing UMat arguments to functions that have these types from working correctly. as noted in #12231.
2020-03-04 08:14:11 +03:00
Alexander Alekhin 57cf120118 Merge pull request #16709 from ashishkrshrivastava:cvonnx 2020-03-03 20:23:10 +00:00
Alexander Alekhin 0b85d0ec68 Merge pull request #16721 from mshabunin:fix-msmf-format 2020-03-03 15:41:53 +00:00
ashishiva3@gmail.com e18d5e94c7 Gather-Cast, Mul-Cast fusion 2020-03-03 21:08:28 +05:30
Alexander Alekhin bc036e1e86 Merge pull request #16720 from anton-potapov:kw_fixes 2020-03-03 11:45:24 +00:00
Maksim Shabunin 219ef95dd8 MSMF: fixed issue with camera format selection 2020-03-03 13:17:32 +03:00
Anton Potapov 8ed89bae84 KW: G-API tests - fixes for uninitialized variables 2020-03-03 11:37:40 +03:00
Alexander Alekhin 124bf8339f dnn(IE): use HAVE_DNN_IE_NN_BUILDER_2019 for NN Builder API code
- CMake option: OPENCV_DNN_IE_NN_BUILDER_2019
2020-03-03 08:07:54 +00:00
Alexander Alekhin 29d214474f dnn(IE): use HAVE_DNN_IE_NN_BUILDER_2019 for NN Builder API code
- CMake option: OPENCV_DNN_IE_NN_BUILDER_2019
2020-03-03 07:45:09 +00:00
Alexander Alekhin 4d0f13544d Merge pull request #16700 from alalek:fix_core_matexpr_size_gemm
core: fix MatExpr::size() for gemm()

* core(test): MatExpr::size() test for gemm()

* core: fix MatExpr::size() for gemm()
2020-03-02 17:13:02 +03:00
Alexander Alekhin a5ca5f6daf Merge pull request #16716 from l-bat:skip_resize_ie 2020-03-02 14:07:32 +00:00
Liubov Batanina b1b78aedd2 Skipped ResizeUnfused test on Builder API 2020-03-02 15:45:29 +03:00
Alexander Alekhin 9214103564 Merge pull request #16652 from MoonChasing:master 2020-03-01 10:15:55 +00:00
Alexander Alekhin 599a595c6f Merge pull request #16573 from ashishkrshrivastava:opencvonnx 2020-02-29 21:20:40 +03:00
ashishiva3@gmail.com 8559237d4e ONNX: upsample subgraph fusion added 2020-02-29 15:24:06 +05:30
Yashas Samaga B L 8808aaccff Merge pull request #16658 from YashasSamaga:cuda4dnn-refactor-activations
cuda4dnn(activations, eltwise, scale_shift): refactor to reduce code duplication

* refactor activations

* refactor eltwise kernels

* move all functors to functors.hpp

* remove bias1 and scale1 kernels
2020-02-29 11:46:14 +03:00
Alexander Smorkalov 831153d5fb Added checklist and recommendations to issue template. 2020-02-29 10:29:53 +03:00
Alexander Alekhin 333a767be4 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-28 18:34:37 +00:00
Peter Würtz 5012fc5d23 Merge pull request #16684 from pwuertz:ignore_clang_mat_inl
* Ignore clang warnings for deprecated enum+enum operations in mat.inl.hpp

* build: added customization macros, cmake flags for OpenCV build
2020-02-28 21:21:03 +03:00
firebladed f00607c8ac Merge pull request #16626 from firebladed:firebladed-v4l2_pix_fmt_y12
V4L2: Add V4L2_PIX_FMT_Y12 (12 bit grey) support
2020-02-28 21:17:30 +03:00
Chip Kerchner 8c24af66bd Merge pull request #16556 from ChipKerchner:vectorizeIntegralSumPixels
* Vectorize calculating integral for line for single and multiple channels

* Single vector processing for 4-channels - 25-30% faster

* Single vector processing for 4-channels - 25-30% faster

* Fixed AVX512 code for 4 channels

* Disable 3 channel 8UC1 to 32S for SSE2 and SSE3 (slower).  Use new version of 8UC1 to 64F for AVX512.
2020-02-28 19:34:06 +03:00
Alexander Alekhin 7ffab23a53 Merge pull request #16535 from jshiwam:exifbugfix 2020-02-28 16:31:59 +00:00
Alexander Alekhin 4a39b12a78 imgcodecs(jpeg): drop unnecessary code
- standard huffman tables are handled by modern libjpeg-turbo
2020-02-28 18:55:14 +03:00
Alexander Alekhin 1bc607e8d8 Merge pull request #16677 from Bleach665:Qt_imshow_clipbrd 2020-02-28 14:41:07 +00:00
MoonChasing 98db891851 using argv[0] represent binary executable files' name in help() function
in sample codes instead of cpp files' name.
2020-02-28 20:36:56 +08:00
jshiwam 1f48940a93 bug fix to Inconsistent comment for EXIF issue id #15706 stream added final
removed all the changes occured while trying to resolve conflicts
2020-02-28 15:01:17 +05:30
Yuriy Obukh edcc762f7a add "Copy to clipboard functional" to imshow wnd with Qt 2020-02-28 00:03:38 +02:00
Alexander Alekhin db5f1c3554 Merge pull request #16688 from alalek:issue_16679 2020-02-27 20:55:49 +00:00
Alexander Alekhin 9c4b1d0a51 Merge pull request #16685 from YashasSamaga:cuda4dnn-fix-tests-pr16595 2020-02-27 20:42:45 +00:00
YashasSamaga 98b5fb4b9f disable MaskRCNN test for CUDA_FP16 2020-02-28 15:44:37 +05:30
Alexander Alekhin d2cc30e2a5 Merge pull request #16687 from dkurt:dnn_ngraph_hetero 2020-02-27 19:52:02 +00:00
Alexander Alekhin e93c51762b gapi(test): fix check 2020-02-27 19:43:06 +00:00
Alexander Alekhin b16c1096d1 Merge pull request #16682 from alalek:dnn_test_keypoints_face_myriad 2020-02-27 19:04:28 +00:00
Alexander Alekhin 4d8d152461 Merge pull request #16683 from saskatchewancatch:issue-16680 2020-02-27 17:05:27 +00:00
Alexander Alekhin cc0066d38d dnn(test): adjust check tolerance in Keypoints_face 2020-02-27 19:44:51 +03:00
Dmitry Kurtaev 5bbe116f89 Track Hetero execution for nGraph networks using ngraph::Function 2020-02-27 17:45:28 +03:00
Rajkiran Natarajan b17e9c614b Fix annoying compiler warning. 2020-02-26 22:59:02 -08:00
Alexander Alekhin 45d073f889 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-26 20:09:03 +03:00
Alexander Alekhin 85c97f772c Merge pull request #16675 from alalek:fix_js_build_getNumberOfCPUs 2020-02-26 17:07:49 +00:00
Alexander Alekhin af9ded89d0 core: fix build getNumberOfCPUs for JavaScript 2020-02-26 18:54:23 +03:00
Alexander Alekhin c13a62ce10 Merge pull request #16638 from mshabunin:use-safe-buffers 2020-02-26 14:54:57 +00:00
Dmitry Kurtaev d8dea7896b Merge pull request #16628 from dkurt:dnn_ngraph_custom_layers
* Custom layers with nGraph

* nGraph: multiple outputs from nodes
2020-02-26 17:51:18 +03:00
Ganesh Kathiresan 09df7810d1 Merge pull request #16457 from ganesh-k13:bugfix/getCPUCount-fix
* Fixed getCPUCount

Minor new line changes

Android fix | efficient linux checks

Android fix 2

Fixed cpu logic for non linux platforms

Android fix 3

Android fix 4

* No v1 case handle | Refactor long lines

* Refined Cgroups logic | Combine Android and Linux

* Fixed directives

* Added support for --cpus | Fixed minor bug in Andriod | Change file read logic

* Added macro checks for apple errors

* Fixed macro to include android

* Addressed review comments

* Fixed android macro

* Refined return values

* Fixed apple warning

* Addressed review comments

* Fixed whitespace

* Android Fix try 1

* Android Fix try 2

* Android Fix try 3

* Removed unwanted endif

* Android Fix try 4

* Android Fix try 5

* Macro Restructure

* core: updates to CPUs detection (minor)
2020-02-26 17:48:50 +03:00
Alexander Alekhin 95aa6d7307 Merge pull request #16657 from alalek:issue_16655_master 2020-02-26 14:36:08 +00:00
Alexander Alekhin 2617c9aa64 Merge pull request #16673 from alalek:exclude_contrib_modules_4.x 2020-02-26 14:03:52 +00:00
Alexander Alekhin f48c84eaee Merge pull request #16656 from alalek:issue_16655 2020-02-26 12:47:46 +00:00
Alexander Alekhin 84bb67e49b exclude opencv_contrib modules 2020-02-26 15:12:45 +03:00
Alexander Alekhin 9e4b1d5a75 Merge pull request #16670 from alalek:update_valgrind_suppressions 2020-02-26 11:44:16 +00:00
Alexander Alekhin f2d3edec80 gapi(test): ban and get rid of countNonZero() checks 2020-02-26 14:19:19 +03:00
Peter Würtz 53c0189ed7 Allow access to CUDA memory and stream pointers for interoperability. 2020-02-26 11:11:03 +01:00
Maksim Shabunin bf96d8239d Use BufferArea in more places 2020-02-26 11:45:19 +03:00
Alexander Alekhin 64588dff46 valgrind: update suppression rules 2020-02-26 07:10:18 +00:00
Ivan Galanin f9bd025722 Merge pull request #16639 from iigalanin:patch-1
* Update to new ICV packages

MacOS ia32 ICV package is no longer built.

* cmake(ippicv): add Apple 32-bit check

* Updated commit hash
2020-02-25 22:04:11 +03:00
Alexander Alekhin a5d0c7b02c Merge pull request #16650 from ashishkrshrivastava:cvdarknet 2020-02-25 12:57:11 +00:00
Alexander Alekhin 53a853c3c9 Merge pull request #16661 from alalek:dnn_test_32bit_part2 2020-02-24 20:53:14 +00:00
Alexander Alekhin 43a907ddda Merge pull request #16648 from YashasSamaga:cuda4dnn-hotfix-i16467 2020-02-24 18:22:06 +00:00
Alexander Alekhin c2f5f5a202 dnn(test): configure filtering for 32-bit systems (part 2) 2020-02-24 18:18:33 +00:00
YashasSamaga 5e082ab852 resize tensor on reuse if required 2020-02-24 10:45:59 +05:30
Alexander Alekhin fce6e7248e Merge pull request #16629 from alalek:dnn_test_32bit 2020-02-23 17:09:31 +00:00
Alexander Alekhin d54d01ca46 core(MatExpr): fix .type() bug 2020-02-23 17:05:05 +00:00
ashishiva3@gmail.com 2b96a485e7 Darknet_io: Parsing for cost layer added 2020-02-23 21:06:48 +05:30
Alexander Alekhin 8eafddf211 Merge pull request #16647 from YashasSamaga:cuda4dnn-hotfix-i16568 2020-02-22 22:21:56 +00:00
Alexander Alekhin 1540ae340f dnn(test): configure filtering for 32-bit systems 2020-02-22 17:35:26 +00:00
Gourav Roy 8b5efc6f4c Merge pull request #16586 from themechanicalcoder:video-psnr
* add  python version of video-input-psnr-ssim

* remove ret

* documentation changes

* added link for python file

* command line argument
2020-02-22 14:42:26 +03:00
YashasSamaga c23ab37355 fix weights rank assertion in InnerProductOp 2020-02-22 16:59:09 +05:30
Alexander Alekhin 95f0c9b19b Merge pull request #16641 from alalek:fix_build_msvs2019 2020-02-21 19:50:09 +00:00
Alexander Alekhin 01048e5603 Merge pull request #16616 from alalek:dnn_fix_input_shape
* dnn: fix processing of input shapes

- importer: avoid using of .setInput() => .setInputShape()
- setInput: shape limitation check (partial)

* dnn(test): test .setInput() in readNet()
2020-02-21 22:39:54 +03:00
Alexander Alekhin 102ef39a27 Merge pull request #16225 from berak:dnn_pose_estimation
dnn: small fix in pose estimation model
2020-02-21 22:37:23 +03:00
Alexander Alekhin 966c2191cb Merge pull request #13928 from catree:add_matx_div_operations 2020-02-21 22:35:03 +03:00
Vadim Pisarevsky 8f3867756c Merge pull request #16594 from vpisarev:hull_ordering_fix
fixed the ordering of contour convex hull points

* partially fixed the issue #4539

* fixed warnings and test failures

* fixed integer overflow (issue #14521)

* added comment to force buildbot to re-run

* extended the test for the issue 4539. Check the expected behaviour on the original contour as well

* added comment; fixed typo, renamed another variable for a little better clarity

* added yet another part to the test for issue #4539, where we run convexHull and convexityDetects on the original contour, without any manipulations. the rest of the test stays the same
2020-02-21 18:18:24 +03:00
Alexander Alekhin b29512032a 3rdparty(openexr): fix compilation with MSVS2019 2020-02-21 17:48:28 +03:00
Alexander Alekhin a0f5eb282c Merge pull request #16635 from mshabunin:fix-avx512-cvt 2020-02-21 13:15:40 +00:00
Vadim Pisarevsky 07b475062f Merge pull request #16608 from vpisarev:fix_mac_ocl_tests
* fixed several problems when running tests on Mac:
* OCL_pyrUp
* OCL_flip
* some basic UMat tests
* histogram badarg test (out of range access)

* retained the storepix fix in ocl_flip only for 16U/16S datatype, where the OpenCL compiler on Mac generates incorrect code

* moved deletion of ACCESS_FAST flag to non-SVM branch (where SVM is shared virtual memory (in OpenCL 2.x), not support vector machine)

* force OpenCL to use read/write for GPU<=>CPU memory transfers on machines with discrete video only on Macs. On Windows/Linux the drivers are seemingly smart enough to implement map/unmap properly (and maybe more efficiently than explicit read/write)
2020-02-21 16:13:41 +03:00
Alexander Duda a41cbbdc99 findChessboardCornersSB: performance + support for full FOV boards with markers
Changes:

* UMat for blur + rotate resulting in a speedup of around 2X on an i7
* support for boards larger than specified allowing to cover full FOV
* support for markers moving the origin into the center of the board
* increase detection accuracy

The main change is for supporting boards that are larger than the FOV of
the camera and have their origin in the board center. This allows
building OEM calibration targets similar to the one from intel real
sense utilizing corner points as close as possible to the image border.
2020-02-21 14:01:47 +01:00
Maksim Shabunin 8b2c499be6 intrin: fixed int64->double conversion for AVX-512 2020-02-21 15:20:00 +03:00
Alexander Smorkalov c87b99e82b Added test for new MatX division. 2020-02-21 10:08:55 +03:00
Alexander Alekhin 96b26dc8f4 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-20 19:47:27 +03:00
berak 4fdf4d380c dnn: small fix in pose estimation model 2020-02-20 17:08:55 +01:00
Alexander Alekhin 150c29356a Merge pull request #16610 from AbsorbedInThought:patch-1 2020-02-20 15:31:57 +00:00
Muhammad Taha 8177adbd54 Minor update in grabcut.py 2020-02-20 16:19:24 +03:00
Alexander Alekhin 30331eef4b Merge pull request #16595 from dkurt:dnn_ie_mask_rcnn 2020-02-20 12:50:27 +00:00
Yashas Samaga B L 1f695c4532 Merge pull request #16161 from YashasSamaga:cuda4dnn-concat-fusion
cuda4dnn(concat): write outputs from previous layers directly into concat's output

* eliminate concat by directly writing to its output buffer

* fix concat fusion not happening sometimes

* use a whitelist instead of a blacklist
2020-02-20 15:43:05 +03:00
Aditya Kumar e007d93d93 Merge pull request #14107 from adityak2920:aditya
Adding python codes to samples/python

* Python version of samples:
- laplace.py
- drawing.py

* Update drawing.py

* Update drawing.py

* Update drawing.py

* Update laplace.py

* Update laplace.py

* Update drawing.py

* Update drawing.py

* Update laplace.py

* samples

* drawing

* drawing

* drawing.py
2020-02-20 15:41:55 +03:00
Alexander Alekhin 77dd40c96c Merge pull request #16619 from alalek:cmake_custom_cxx_standard_master
* cmake: allow customization of CMAKE_CXX_STANDARD value

* cmake: extra skip flag OPENCV_SKIP_CMAKE_CXX_STANDARD

* cmake: dump CMAKE_CXX_STANDARD value

- compiler option is missing in dumped flags
2020-02-20 14:18:43 +03:00
Dmitry Kurtaev f3eef792eb Enable Mask R-CNN with Inference Engine. Full coverage with nGraph 2020-02-20 10:13:40 +03:00
Alexander Alekhin 4d14307f5d Merge pull request #16503 from cyyever:fix_16500 2020-02-20 06:47:55 +00:00
cyy 450b96510e fixes #16500 2020-02-20 11:10:12 +08:00
Alexander Alekhin 4b0d3316f6 Merge pull request #16617 from alalek:dnn_fix_caffe_importer 2020-02-19 10:57:27 +00:00
Alexander Alekhin 7ac7aca33b dnn(caffe): fix net.input_dim handling in Caffe importer 2020-02-19 07:37:27 +00:00
Alexander Alekhin 6713063a8d Merge pull request #16612 from rabbull:master 2020-02-18 19:31:38 +00:00
Karl Liu 331a96c670 transplant 8p's normalization to 7p
use const instead of constexpr
2020-02-18 23:39:52 +08:00
Alexander Alekhin 1602a38fa9 Merge pull request #16572 from alalek:dnn_test_dldt_ir_v10
* dnn(test): test DLDT IRv10 model, drop old models

* dnn(test): don't expect bitexact results in DLDT IR tests
2020-02-18 17:57:46 +03:00
Dmitry Matveev dae1fc8889 Merge pull request #16555 from dmatveev:dm/ocv_blog_sample
* G-API/Samples: Added a simple "privacy masking camera" sample

The main idea is to host this code for an opencv.org blog post only

* G-API/Samples: Modified privacy masking camera code to look better for the post

* G-API/Samples: fix Windows (MSVC) support in Privacy Masking Camera

* G-API/Samples: Addressed the majority of review comments in PMC

* G-API/Samples: Use TickMeter to measure time + more info in cmd options

* G-API/Samples: fix yet another Windows warning in PMC

* G-API/Samples: Fix wording in PMC cmd arg parameters

* Fix wording, again

* G-API/Samples: Fix PMC cmd-line arguments, again
2020-02-18 15:11:44 +03:00
Anatoliy Talamanov a6ef9b4584 Merge pull request #16213 from TolyaTalamanov:at/lambdas-for-kernels
G-API: Using functors as kernel implementation

* Implement ability to create kernel impls from functors

* Clean up

* Replace make_ocv_functor to ocv_kernel

* Clean up

* Replace GCPUFunctor -> GOCVFunctor
* Move GOCVFunctor to cv::gapi::cpu namespace

* Implement override for rvalue and lvalue cases

* Fix comments to review

* Remove GAPI_EXPORT for template functions

* Fix indentation
2020-02-17 23:29:55 +03:00
Liubov Batanina e970eccbf1 Merge pull request #16472 from l-bat:cp_vton
Add CP-VTON sample

* Support resize from PyTorch

* Add CP-VTON sample

* Fix downsampling

* Fix test

* Add model links

* Add default args

* Speed up resize

* Fix TOM link

* Add default args

* Fix comments

* Set aspect ratio for input

* Update links

* Check files exist
2020-02-17 22:29:37 +03:00
Alexander Alekhin 5ad9e5f9bc Merge pull request #16600 from alalek:revert_16497 2020-02-17 13:17:35 +00:00
Alexander Alekhin 3a546aa380 imgproc: revert resize changes from PR 16497 2020-02-17 15:23:59 +03:00
Vadim Pisarevsky d67a6c1be4 Merge pull request #16588 from vpisarev:fix_macos_move_window
fixed cv::moveWindow() on mac

* fixed cv::moveWindow() on mac (issue #16343). Thanks to cwreynolds and saskatchewancatch for the help!

* fixed warnings about _x0 and _y0

* fixed warnings about _x0 and _y0
2020-02-17 14:54:36 +03:00
keeper121 d84360e7f3 Merge pull request #16497 from keeper121:master
* Fix NN resize with dimentions > 4

* add test check for nn resize with channels > 4

* Change types from float to double

* Del unnecessary test file. Move nn test to test_imgwarp. Add 5 channels test only.
2020-02-16 19:33:25 +03:00
atinfinity f81fdd58da Merge pull request #16445 from atinfinity:fixed-typo
* fixed typo

* add compatibility code to handle migration
2020-02-16 19:16:33 +03:00
Gagandeep Singh a6f3a21256 Merge pull request #16424 from czgdp1807:issue-16370
* fixed Split layer in ONNXImporter

* added test for fix of split layer

* fixed tests for Split layer

* applied reviews

* updated tests

* fixed paths in tests
2020-02-15 14:12:20 +03:00
Alexander Alekhin f3237fdc6e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-14 19:54:59 +03:00
Vadim Pisarevsky cc259e49f6 Merge pull request #16561 from vpisarev:better_hough_circles
* improved version of HoughCircles (HOUGH_GRADIENT_ALT method)

* trying to fix build problems on Windows

* fixed typo

* * fixed warnings on Windows
* make use of param2. make it minCos2 (minimal value of squared cosine between the gradient at the pixel edge and the vector connecting it with circle center). with minCos2=0.85 we can detect some more eyes :)

* * added description of HOUGH_GRADIENT_ALT
* cleaned up the implementation; added comments, replaced built-in numeic constants with symbolic constants
* rewrote circle_popcount() to use built-in popcount() if possible
* modified some of HoughCircles tests to use method parameter instead of the built-in loop

* fixed warnings on Windows
2020-02-14 19:16:41 +03:00
Alexander Alekhin a8c257cecb Merge pull request #16580 from dkurt:fix_14566 2020-02-14 16:11:37 +00:00
Dmitry Kurtaev 9a4cafa319 Resolve #14566 2020-02-14 00:21:38 +03:00
Alexander Alekhin c41f50f5f7 Merge pull request #16559 from alalek:cmake_msvc_mp_customize 2020-02-13 19:28:57 +00:00
Alexander Alekhin e48ae883e9 Merge pull request #16567 from alalek:dnn_updates_from_openvino_2020.1 2020-02-12 18:17:44 +00:00
Alexander Alekhin 0a91261c7f dnn: turn off visibility workaround for OpenVINO 2020.1 2020-02-12 17:22:44 +03:00
Alexander Alekhin d81a0da3e0 dnn: use OpenVINO 2020.1 defines 2020-02-12 17:21:08 +03:00
Alexander Alekhin ef93aea0da cmake: update handling of MSVC /MP flag 2020-02-11 21:05:44 +00:00
Alexander Alekhin 2a6637afdf Merge pull request #16516 from alalek:dnn_dump_network 2020-02-11 16:22:32 +00:00
Vadim Pisarevsky 3efa78311a Merge pull request #16488 from vpisarev:filestorage_longlines
trying to fix handling file storages with extremely long lines

* trying to fix handling of file storages with extremely long lines: https://github.com/opencv/opencv/issues/11061

* * fixed errorneous pointer access in JSON parser.
* it's now crash-test time! temporarily set the initial parser buffer size to just 40 bytes. let's run all the test and check if the buffer is always correctly resized and handled

* fixed pointer use in JSON parser; added the proper test to catch this case

* fixed the test to make it more challenging. generate test json with
*
**
***
etc. shape
2020-02-11 18:46:15 +03:00
Alexander Alekhin d4422e473a Merge pull request #16552 from dkurt:3.4_docs 2020-02-11 10:03:12 +00:00
Alexander Alekhin aaf9297592 Merge pull request #16549 from rayonnant14:objdetect_QRCode_issue_memory_allocation 2020-02-11 10:02:52 +00:00
Dmitry Kurtaev 1159453139 3.4 docs for 3.4 branch 2020-02-11 09:31:16 +03:00
rayonnant14 fb13b87285 fix wrong memory allocation 2020-02-10 20:21:58 +03:00
Alexander Alekhin aa2777ed61 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-10 19:40:29 +03:00
Alexander Alekhin 8a588f2c0b Merge pull request #16542 from asmorkalov:asmorkal/base64_json 2020-02-10 16:28:55 +00:00
Alexander Alekhin 1dd24eeec0 Merge pull request #16539 from baka-gori:bugfix_cudacodec 2020-02-10 16:28:31 +00:00
Alexander Alekhin 5eec3be850 Merge pull request #16531 from paroj:featlinepy 2020-02-10 16:28:07 +00:00
Alexander Alekhin 236e3868df Merge pull request #16527 from mshabunin:fix-msmf-fmt-34 2020-02-10 16:27:00 +00:00
Alexander Alekhin c3264aa83c Merge pull request #16520 from GArik:3.4 2020-02-10 16:25:30 +00:00
Alexander Alekhin 9d0f16e8fe Merge pull request #16505 from alalek:issue_16326 2020-02-10 15:51:49 +00:00
Alexander Alekhin 867c922bcc Merge pull request #16546 from alalek:backport_16544 2020-02-10 15:49:11 +00:00
Ilya Lavrenov 41f444a230 CMAKE: more robust custom IE libraries support
backporting of commit 98d96f2cc8
2020-02-10 17:55:51 +03:00
Alexander Alekhin a631196155 Merge pull request #16544 from ilya-lavrenov:il/custom-ie-libraries 2020-02-10 14:09:43 +00:00
Pavel Rojtberg e13a73d084 core: export getCPUFeaturesLine to bindings 2020-02-10 14:06:43 +01:00
Ilya Lavrenov 98d96f2cc8 CMAKE: more robust custom IE libraries support 2020-02-10 15:17:54 +03:00
Alexander Smorkalov bd6ab6d38e Implemented BASE64 support in cv::FileStorage parser. 2020-02-10 11:38:19 +03:00
baka-gori 80aaed73e6 add cuda 10 support 2020-02-09 22:18:29 +09:00
Alexander Alekhin db9f4436e0 Merge pull request #16473 from ashishkrshrivastava:opencvtf 2020-02-09 11:52:24 +03:00
ashishiva3@gmail.com cd53144ed3 commit: Corrected end tensor_content parsing for StridedSlice layer. 2020-02-09 06:43:23 +05:30
Alexander Alekhin f791cf825f Merge pull request #16486 from alalek:cmake_use_target_compile_features 2020-02-08 20:01:12 +00:00
Alexander Alekhin eb14f9a464 Merge pull request #16463 from alalek:core_strong_ptr_alignment 2020-02-08 19:45:43 +00:00
Alexander Alekhin 0a691f7840 Merge pull request #16529 from alalek:dnn_skip_failed_ngraph_tests 2020-02-08 18:53:10 +00:00
Alexander Alekhin 8ecfb59930 dnn(test): skip failed ngraph tests 2020-02-07 22:43:40 +00:00
Alexander Alekhin 69944cd46b Merge pull request #16421 from mshabunin:add-local-pool 2020-02-07 21:44:50 +00:00
Maksim Shabunin 6c8f50d1f3 videoio/MSMF: refactored format handling and selection, property reading and writing 2020-02-08 00:16:41 +03:00
Alexander Alekhin 8d078f63a9 Merge pull request #16530 from collinbrake:imread_unchanged_exif_doc 2020-02-07 20:37:44 +00:00
Alexander Alekhin bcc9946650 Merge pull request #16438 from ashishkrshrivastava:opencvc 2020-02-07 23:17:59 +03:00
Collin Brake d4a28f3bf6 improved documentation for imread() 2020-02-07 08:54:34 -05:00
Maksim Shabunin 55cdeaa6dd BufferArea: initial version, usage in StereoBM
New class BufferArea is used to hide complexity of buffers allocations and allow instrumentation with valgrind and sanitizers.
2020-02-07 14:57:36 +03:00
Alexander Alekhin 7d998336d3 Merge pull request #16510 from andrey-golubev:unify_g_typed_kernel 2020-02-07 11:22:23 +00:00
Alexander Alekhin 6ad390a1cd Merge pull request #16523 from collinbrake:imread_unchanged_exif_doc 2020-02-07 10:42:39 +00:00
Alexander Alekhin 3c2e5583d2 Merge pull request #16522 from alalek:dnn_build_warnings_from_ngraph 2020-02-07 10:33:00 +00:00
ashishiva3@gmail.com d64529f6de Added parsing for Connected and Dropout. Modified maxpool padding 2020-02-07 07:26:36 +05:30
Collin Brake 3cc07a4411 improved documentation for IMREAD_UNCHANGED flag 2020-02-06 17:49:14 -05:00
Alexander Alekhin ac0a14631d dnn: eliminate MSVC warnings from ngraph.hpp 2020-02-06 19:53:49 +00:00
Alexander Alekhin 745153098a Merge pull request #16509 from omasaht:imwrite-throwerr-permissiondenied 2020-02-06 19:32:09 +00:00
Igor Murzov 981e63d8c2 Install all CMake files required to build samples
CMakeLists.txt includes samples_utils.cmake, so the later should be
installed as well to make samples build successfully
2020-02-06 18:07:36 +03:00
Alexander Alekhin d0d676929d Merge pull request #16519 from TolyaTalamanov:at/fix-render-text-slowdown 2020-02-06 13:38:22 +00:00
Talamanov, Anatoliy 4dffcbd9f0 Fix render opencv backend text slowdown 2020-02-06 15:12:38 +03:00
Alexander Alekhin 6d75be03f9 Merge pull request #16518 from asmorkalov:as/gstreamer_docs 2020-02-06 11:38:27 +00:00
Alexander Smorkalov fb781834f5 Improved GStreamer documentation. 2020-02-06 12:51:09 +03:00
Alexander Alekhin 6eba1a4d44 dnn: auto network dump through parameter 2020-02-05 21:46:32 +00:00
Alexander Alekhin fa4871b013 dnn: don't require setInput in .dump() 2020-02-05 21:28:07 +00:00
Omar Hassan 8dd0fd8a13 If applied, this commit will describe permission denied message in imwrite_ function when user does not have write permission 2020-02-05 22:23:10 +05:00
Andrey Golubev 5baa2c0706 Update documentation and clean up redundant code 2020-02-05 15:01:42 +02:00
Alexander Alekhin 225566da7b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-04 19:49:24 +03:00
Alexander Alekhin 0cb3bf95f1 Merge pull request #16490 from dkurt:dnn_refactor_resize 2020-02-04 16:45:35 +00:00
Alexander Alekhin d917f889b1 Merge pull request #16504 from alalek:issue_16501 2020-02-04 16:39:17 +00:00
Vadim Pisarevsky e50acb923e Merge pull request #16495 from vpisarev:drawing_aa_border_fix
* fixed antialiased line rendering to process image border correctly

* fixed warning on Windows

* imgproc(test): circle drawing regression
2020-02-04 19:37:33 +03:00
Polina Smolnikova 4e4dfffe06 Merge pull request #16491 from rayonnant14:objdetect_decodeMulti_issue
* fixed issue with Mat reshape in decodeMulti()

* added test for decodeMulti

* used assign
2020-02-04 19:31:11 +03:00
Alexander Alekhin 85a59ef292 cmake: hide IPPICV symbols using --exclude-libs 2020-02-04 18:11:07 +03:00
Alexander Alekhin f67c8e37d6 imgproc(resize): drop optimization for channels>4 2020-02-04 17:14:52 +03:00
ankit6979 17fe63446f Merge pull request #16499 from ankit6979:3.4
* Update py_thresholding.markdown

* 📝 Update py_thresholding.markdown
2020-02-04 15:22:18 +03:00
Alexander Alekhin 0673866ceb Merge pull request #16502 from tomoaki0705:fixTypo 2020-02-04 12:18:50 +00:00
Alexander Alekhin 0dd1ce1a4f Merge pull request #16442 from asmorkalov:as/pr_template_checklist 2020-02-04 12:17:00 +00:00
Alexander Alekhin c56e91dcc0 Merge pull request #16487 from asmorkalov:as/gapi_freetype 2020-02-04 11:40:15 +00:00
Vadim Pisarevsky 5c6d319ebc Merge pull request #16493 from vpisarev:bordertype_sgbm_doc_fixes
* added note about BORDER_TYPE in separable filters; fixed SGBMStereo description

* added # to BORDER_ constants to generate hyperlinks
2020-02-04 14:30:16 +03:00
Alexander Alekhin 20fb9281f4 Merge pull request #16496 from andrey-golubev:unify_g_typed_kernel 2020-02-04 11:11:38 +00:00
Tomoaki Teshima edaf4e0104 apply to correct range (entire 3.0 and 4.0 series) 2020-02-04 18:49:19 +09:00
Dmitry Kurtaev 005f38fb45 Fix dnn::ResizeLayer to manage varying input shapes 2020-02-04 09:06:17 +03:00
Alexander Smorkalov a173ea36f7 Added PR readiness checklist. 2020-02-04 08:37:14 +03:00
Andrey Golubev e569e9dcbd Unify G_TYPED_KERNEL and G_TYPED_KERNEL_M 2020-02-04 02:16:51 +02:00
Alexander Alekhin 01c1b341a8 cmake: enable C++11 implicitly 2020-02-03 17:45:37 +03:00
Alexander Alekhin 4d291c06f6 Merge pull request #16483 from saskatchewancatch:issue-16458 2020-02-03 13:49:21 +00:00
Alexander Smorkalov a9a33d9a5f Fixed build with FREETYPE and without tests. 2020-02-03 16:41:31 +03:00
hannesa2 57c9991413 Merge pull request #16481 from hannesa2:DeleteOldAndroidManifest.xml
* delete old AndroidManifrst.xml

* fix tutorial generation
2020-02-03 16:34:03 +03:00
Alexander Alekhin 8519db8efb Merge pull request #15464 from tallestorange:3.4 2020-02-03 12:54:03 +00:00
Vadim Pisarevsky 174022547f fixed incorrect dump of the pixel format 2020-02-03 13:22:56 +03:00
Rajkiran Natarajan 579dcf12bd GCC 10 warnings not caught by CMake ignore regex 2020-02-03 06:39:14 +00:00
StefanBruens f05d5888c9 Merge pull request #16479 from StefanBruens:fix_gles_glx_h_include
Fix compilation errors on GLES platforms

* Do not include glx.h when using GLES

GL/glx.h is included on all LINUX plattforms, which is wrong
for a number of reasons:

- GL_PERSPECTIVE_CORRECTION_HINT is defined in GL/gl.h, so we
  want gl.h not glx.h, the latter just includes the former
- GL/gl.h is a Desktop GL header, and should not be included
  on GLES plattforms
- GL/gl.h is already included via QtOpenGL ->
  QtGui/qopengl.h on desktop plattforms

This fixes a problem when Qt is compiled with GLES, which
is often done on ARM platforms where desktop GL is not or
only poorly supported (e.g. slow due to emulation).

Fixes part of #9171.

* Only set GL_PERSPECTIVE_CORRECTION_HINT when GL version defines it

GL_PERSPECTIVE_CORRECTION_HINT does not exist in GLES 2.0/3.x,
and has been deprecated in OpenGL 3.0 core profiles.

Fixes part of #9171.
2020-02-02 16:29:04 +03:00
Alexander Alekhin bf2f7b0f8b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-02-01 17:26:00 +00:00
Alexander Alekhin 84c29dce77 Merge pull request #16474 from gapry:issue_16336 2020-02-01 17:22:12 +00:00
Gourav Roy 126b0d855f Merge pull request #16366 from themechanicalcoder:features2D-tutorial-python
* Add python version of panorama_stitching_rotating_camera and perspective_correction

* Updated code

* added in the docs

* added python code in the docs

* docs change

* Add java tutorial as well

* Add toggle in documentation

* Added the link for Java code

* format code

* Refactored code
2020-02-01 20:20:00 +03:00
gapry ac9f8c1f41 Fixed Compilation warnings | Issue #16336 2020-02-01 03:32:42 +08:00
midjji 86e5e8d765 Merge pull request #15993 from midjji:master
This is a correction of the previously missleading documentation and a warning related to a common calibration failure described in issue 15992

* corrected incorrect description of failed calibration state.

see issue 15992

* calib3d: apply suggestions from code review by catree
2020-01-31 17:50:21 +03:00
Alexander Alekhin 27edba495a Merge pull request #16246 from VadimLevin:dev/vlevin/videoio_classes_cleanup 2020-01-31 13:08:43 +00:00
Alexey Smirnov 0d456f9111 Merge pull request #16118 from smirnov-alexey:as/gopaque
G-API: GOpaque implementation

* Stub initial copypasted solution

* Fix mov test and add a couple of others

* Fix warnings

* More code coverage and tests

* fix macos warning

* address review comments

* Address review comments and fix indentation

* Fix build on armv7
2020-01-30 21:08:11 +03:00
Alexander Alekhin 591f427003 Merge pull request #16459 from nh2:patch-1 2020-01-30 14:25:18 +00:00
Alexander Alekhin 2ced568d34 Merge pull request #16220 from YashasSamaga:cuda4dnn-roi-pooling-test_fix-optim 2020-01-29 20:57:15 +00:00
Arnaud Brejeon ecbba852cf Merge pull request #16415 from arnaudbrejeon:bug_fix_16410
* Fix bug 16410 and add test

* imgproc(connectedcomponents): avoid manual uninitialized allocations

* imgproc(connectedcomponents): force 'odd' chunk range size

* imgproc(connectedcomponents): reuse stripeFirstLabel{4/8}Connectivity

* imgproc(connectedcomponents): extend fix from PR14964
2020-01-29 23:55:43 +03:00
Alexander Alekhin 48c8c95381 Merge pull request #16452 from alalek:objdetect_align_with_master 2020-01-29 16:12:31 +00:00
Alexander Alekhin cd2d6ac935 Merge pull request #16461 from seiko2plus:issue16455 2020-01-29 15:57:00 +00:00
Alexander Alekhin a4bd7506a5 core: CV_STRONG_ALIGNMENT macro
Should be used to guard unsafe type casts of pointers
2020-01-29 18:44:17 +03:00
Niklas Hambüchen 70cbc3d883 cvdef.h: Don't use C's limits.h under C++
Just like with the other headers in the rest of the file.

See e.g. https://stackoverflow.com/questions/36831465/what-difference-does-it-make-when-i-include-limits-or-limits-h-in-my-c-cod
for the reasons, the most important one being that limits.h does not respect
namespaces, which can make problems for downstream consumers of cvdef.h.
2020-01-29 16:41:31 +01:00
Sayed Adel ec033330df core:vsx workaround for the unexpected results of vec_vbpermq in gcc4.9 2020-01-29 15:05:12 +02:00
Alexander Alekhin e037800e46 Merge pull request #15714 from neurodroid:patch-1 2020-01-29 10:54:22 +00:00
Alexander Alekhin 7e6bdbad9b Merge pull request #16453 from seiko2plus:issue16448 2020-01-29 10:34:17 +00:00
cudawarped 5542dcb2bc Merge pull request #16248 from cudawarped:fix_python_cudawarping_cudaarithm
* Move python CUDA  tests to the contrib repo.
2020-01-29 12:54:02 +03:00
Sayed Adel bd531bd828 core:vsx fix inline asm constraints
generalize constraints to 'wa' for VSX registers
2020-01-28 15:48:00 +02:00
Alexander Alekhin 8facf61bed objdetect(QR): don't introduce deprecated API, compatibility code 2020-01-28 15:20:37 +03:00
Alexander Alekhin 560f85f8e5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-28 14:26:57 +03:00
Alexander Alekhin f856c964e2 Merge pull request #16338 from alalek:abi_checker_exclude_modules 2020-01-28 12:58:45 +03:00
Alexander Alekhin 223790e6fc Merge pull request #16423 from alalek:issue_16321 2020-01-28 09:57:49 +00:00
Alexander Alekhin 5429b1f5ff Merge pull request #16223 from l-bat:lip_jppnet 2020-01-27 19:17:43 +00:00
Liubov Batanina 24166ac402 Fix indentation 2020-01-27 17:59:58 +03:00
Alexander Alekhin 02f8a9470a Merge pull request #16441 from alalek:abi_checker_exclude_modules_3.4 2020-01-27 13:26:23 +00:00
Liubov Batanina 4a19ac5aca Move instruction 2020-01-27 16:18:32 +03:00
Alexander Alekhin 4af55e64e9 cmake: support OPENCV_ABI_SKIP_MODULES_LIST
backporting of commit f163778da7
2020-01-27 14:40:48 +03:00
Liubov Batanina 5790810c3a Change link 2020-01-27 12:34:57 +03:00
Polina Smolnikova acc089ca64 Merge pull request #15338 from rayonnant14:my_detect_and_decode_3.4
QR-Code detector : multiple detection

* change in qr-codes detection

* change in qr-codes detection

* change in test

* change in test

* add multiple detection

* multiple detection

* multiple detect

* add parallel implementation

* add functional for performance tests

* change in test

* add perftest

* returned implementation for 1 qr-code, added support for vector<Mat> and vector<vector<Point2f>> in MultipleDetectAndDecode

* deleted all lambda expressions

* changing in triangle sort

* fixed warnings

* fixed errors

* add java and python tests

* change in java tests

* change in java and python tests

* change in perf test

* change in qrcode.cpp

* add spaces

* change in qrcode.cpp

* change in qrcode.cpp

* change in qrcode.cpp

* change in java tests

* change in java tests

* solved problems

* solved problems

* change in java and python tests

* change in python tests

* change in python tests

* change in python tests

* change in methods name

* deleted sample qrcode_multi, change in qrcode.cpp

* change in perf tests

* change in objdetect.hpp

* deleted code duplication in sample qrcode.cpp

* returned spaces

* added spaces

* deleted draw function

* change in qrcode.cpp

* change in qrcode.cpp

* deleted all draw functions

* objdetect(QR): extractVerticalLines

* objdetect(QR): whitespaces

* objdetect(QR): simplify operations, avoid duplicated code

* change in interface, additional checks in java and python tests, added new key in sample for saving original image from camera

* fix warnings and errors in python test

* fix

* write in file with space key

* solved error with empty mat check in python test

* correct path to test image

* deleted spaces

* solved error with check empty mat in python tests

* added check of empty vector of points

* samples: rework qrcode.cpp

* objdetect(QR): fix API, input parameters must be first

* objdetect(QR): test/fix points layout
2020-01-26 22:18:42 +03:00
Alexander Alekhin 282a15c9f9 Merge pull request #16434 from alalek:fix_build_i386 2020-01-26 07:21:59 +00:00
Alexander Alekhin 5d01821d9f Merge pull request #16422 from alalek:issue_16419 2020-01-26 07:21:05 +00:00
Alexander Alekhin f8f74fc4ae Merge pull request #16413 from l-bat:ngraph_deconv 2020-01-26 07:19:58 +00:00
Pierre Letessier 0853085ec6 Merge pull request #16190 from pletessier:videocapture_skip_frames
Videocapture skip frames

* enable skipping frames

* update videoio_skip test
2020-01-26 10:19:09 +03:00
Alexander Alekhin e83438c23d core(build): fix i386 compilation 2020-01-26 00:00:25 +00:00
Alexander Alekhin 3d5ca3ef75 Merge pull request #16418 from l-bat:ngraph_logsoftmax 2020-01-24 21:46:28 +00:00
Alexander Alekhin 043b9fbb31 Merge pull request #16170 from themechanicalcoder:tutorial_1 2020-01-24 21:26:18 +00:00
Alexander Alekhin 76c21b73aa Merge pull request #16374 from alalek:imgproc_dispatch_sumpixels 2020-01-24 21:21:48 +00:00
Chip Kerchner 4d2da2debe Merge pull request #16375 from ChipKerchner:vectorizeMultTranspose
* Reduce LLC loads, stores and multiplies on MulTransposed - 8% faster on VSX

* Add is_same method so c++11 is not required

* Remove trailing whitespaces.

* Change is_same to DataType depth check
2020-01-24 18:00:49 +03:00
Alexander Alekhin 84895d2566 Merge pull request #16414 from alalek:samples_fix_async 2020-01-24 14:57:24 +00:00
Alexander Alekhin 4b2363de5c gapi(test): update test tolerance for DIV operation on ARM 2020-01-24 17:07:24 +03:00
Alexander Alekhin ffaf15d0d9 cmake: reuse OpenCV NEON detection in carotene
- use carotene if NEON available only
2020-01-24 16:42:56 +03:00
Liubov Batanina 4b35112022 Update sample 2020-01-24 16:30:10 +03:00
Alexander Alekhin bd66f76fea Merge pull request #16356 from alalek:dnn_ie_prevent_plugins_unloading 2020-01-24 12:07:05 +00:00
Alexander Alekhin 5265db82c7 Merge pull request #16409 from smirnov-alexey:as/gapi_fix_standalone_streaming 2020-01-24 08:47:57 +00:00
Liubov Batanina d9474648f0 Fix diff 2020-01-24 11:00:06 +03:00
Alexander Alekhin d0e02cccba samples(dnn): avoid 'async' keyword (Python 3.7+) 2020-01-23 18:43:36 +03:00
Liubov Batanina 0687cffe21 Support logSoftMax 2020-01-23 15:32:16 +03:00
Ganesh Kathiresan 504cd8a9f5 Merge pull request #16405 from ganesh-k13:bugfix/solvepnp-crash
Added type check for solvePnPGeneric | Issue: #16049

* Added type check

* Added checks before type fix

* Tests for 16049

* calib3d: update solvePnP regression check (16049)
2020-01-23 15:23:03 +03:00
Liubov Batanina a3ae69893c Extend nGraph Deconvolution layer support 2020-01-23 15:10:42 +03:00
Liubov Batanina 55b03dcaba Refactoring 2020-01-23 10:25:41 +03:00
Alexander Smorkalov 1358c0ae66 Made automated triggering for ARAVIS cameras optional. 2020-01-23 09:00:28 +03:00
Gourav Roy a6359e49d2 Added tutorial for text skewness correction in C++ and Python. 2020-01-23 08:24:39 +03:00
Alexander Alekhin f4147c99c8 Merge pull request #16396 from miguelps:android_modules 2020-01-22 19:59:10 +00:00
Alexander Alekhin 6670e6b0bb dnn: prevent unloading of InferenceEngine plugins 2020-01-22 19:34:32 +03:00
Miguel Pari Soto 814a5cec41 feat(android): add support for android modules selection 2020-01-22 19:14:34 +03:00
Smirnov Alexey e5ed22bd5b Fix linkage in standalone mode 2020-01-22 17:51:16 +03:00
Alexander Alekhin 3d14dd4e39 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-22 16:58:30 +03:00
Alexander Alekhin 3019927a61 Merge pull request #16408 from alalek:dnn_test_tolerance_myriad 2020-01-22 13:56:15 +00:00
Alexander Alekhin 881cee4d8f Merge pull request #16146 from pmur:reg_16137x2 2020-01-22 13:53:51 +00:00
Liubov Batanina 7e5b5390ba Fix comments 2020-01-22 14:57:54 +03:00
Alexander Alekhin b21a861c5b dnn(test): adjust test tolerance for MYRIAD 2020-01-22 14:42:52 +03:00
Liubov Batanina 35c24480ae Fix axis 2020-01-22 13:36:29 +03:00
Alexander Alekhin 16d8e9e0c8 Merge pull request #16358 from ashishkrshrivastava:opencv-2 2020-01-22 09:57:41 +00:00
Vadim Levin 3fe9dfaa2e VideoIO classes refactoring
- Added `explicit` to `VideoCapture` constructors with 2
    arguments, 1 of them has default value
  - Applied library code style
  - Introduced 2 debug macros to improve readability of the code
2020-01-22 12:05:10 +03:00
Liubov Batanina 832ca0734d Refactoring 2020-01-22 10:52:40 +03:00
Alexander Alekhin 15e1acaf67 Merge pull request #16400 from alalek:issue_7001 2020-01-21 19:16:39 +00:00
Alexander Alekhin 8b3042da63 Merge pull request #16393 from alalek:build_videoio_fix_15020 2020-01-21 19:16:00 +00:00
Alexander Alekhin 8af87d5792 cmake: apply '-Wl,--as-needed' linker option 2020-01-21 19:09:38 +03:00
Alexander Alekhin 6bc953e911 Merge pull request #16391 from l-bat:ngraph_lrn 2020-01-21 10:08:54 +00:00
Liubov Batanina fada959b4b Fix comment 2020-01-21 10:28:50 +03:00
Liubov Batanina c6936f5a77 Support lrn with SPATIAL_NRM 2020-01-21 10:12:05 +03:00
Liubov Batanina d825caf18e Update check params 2020-01-21 10:09:24 +03:00
Alexander Alekhin 998e355b97 Merge pull request #16389 from alalek:core_fix_msa_build 2020-01-20 16:31:38 +00:00
Alexander Alekhin 7dad0f23d6 build: workaround for FORTIFY_SOURCE=2 builds on Alpine 2020-01-20 18:05:14 +03:00
Liubov Batanina 97455f1593 Remove useless condition 2020-01-20 17:31:58 +03:00
Liubov Batanina 08ba63da02 Add global pool flags 2020-01-20 15:37:11 +03:00
Alexander Alekhin d42e04d0df core(SIMD): fix MSA build - add v_reduce_min/max for u8/s8 2020-01-20 15:10:03 +03:00
Ganesh Kathiresan 80ade96c8c Merge pull request #16309 from ganesh-k13:bugfix/imdecode-resize
* Added flag handlers for imread and imdecode | Issue 16203

Undo imread change

Added Imread resize tests

Added imdecode flags check

Added imdecode tests for resize

Removed trailing whitespace

Removed IMREAD_IGNORE_ORIENTATION check

Added else condition

Removed IMREAD_IGNORE_ORIENTATION check in decode

Added HAVE_JPEG guards

Added static_cast for Win32

Added resize for non jpegs

Added tests for non jpeg resize case

Fixed resize value in assert

Changed tests to Value-Parameterized Tests

Changed tests to Value-Parameterized Tests | handled >> in cpp

Changed tests to Value-Parameterized Tests | removed trailing whitespace

* imgcodecs: update test
2020-01-20 14:00:45 +03:00
Alexander Alekhin 00830d9dd8 Merge pull request #16385 from alalek:ts_update_optional_message 2020-01-20 10:54:40 +00:00
Alexander Alekhin 4e577b8d3c Merge pull request #16378 from alalek:dnn_getMemoryShapes_error_dump_blobs 2020-01-20 10:49:17 +00:00
Alexander Alekhin 61b6d40539 Merge pull request #16377 from alalek:fix_16373 2020-01-20 10:48:21 +00:00
Liubov Batanina bb91e6999b Fix demo 2020-01-20 10:22:01 +03:00
ashishiva3@gmail.com f29bc22005 Convolutional padding parsing modified 2020-01-19 22:33:12 +05:30
Alexander Alekhin ac30620344 ts: move message about misused 'optional' under the configuration parameter 2020-01-19 16:09:40 +00:00
Alexander Alekhin 8128f6284a Merge pull request #15929 from sturkmen72:patch-3 2020-01-19 12:45:29 +00:00
Alexander Alekhin 2c0ebf36a9 Merge pull request #16372 from alalek:backport_16350 2020-01-18 17:57:46 +00:00
Alexander Alekhin b3a07166ba Merge pull request #16350 from hannesa2:fixLintIssuesAndroid 2020-01-18 17:57:03 +00:00
Chip Kerchner 301626ba26 Merge pull request #15488 from ChipKerchner:vectorizeMinMax2
Vectorize minMaxIdx functions

* Updated documentation and intrinsic tests for v_reduce

* Add other files back in from the forced push

* Prevent an constant overflow with v_reduce for int8 type

* Another alternative to fix constant overflow warning.

* Fix another compiler warning.

* Update comments and change comparison form to be consistent with other vectorized loops.

* Change return type of v_reduce_min & max for v_uint8 and v_uint16 to be same as lane type.

* Cast v_reduce functions to int to avoid overflow. Reduce number of parameters in MINMAXIDX_REDUCE macro.

* Restore cast type for v_reduce_min & max to LaneType
2020-01-17 19:37:35 +03:00
Julien 886220b9be Merge pull request #16273 from JulienMaille:wrapper_available_target
* add a wrapper for getAvailableTargets

* add java wrapper on Target enum
2020-01-17 19:24:37 +03:00
Alexander Alekhin 55d54b56bf dnn(onnx): handle unaligned access in ONNX importer 2020-01-17 19:03:34 +03:00
Alexander Alekhin 282fcb90dc Merge pull request #16376 from JulienMaille:cuda-dnn-for-older-gpus 2020-01-17 15:42:50 +00:00
Alexander Alekhin 09b3383a7e imgproc: dispatch sumpixels (integral) 2020-01-17 16:54:29 +03:00
Alexander Alekhin b4316af834 imgproc: rename sumpixels.avx512_skx.{cpp,hpp} 2020-01-17 16:50:08 +03:00
Julien Maille a696348ec5 FIX: disable dnn cuda input_shortcut on _half for CC<5.3 2020-01-17 14:21:25 +01:00
Hannes Achleitner 3b54ebec3f fix lint errors and warnings ins Android samples
backporting of commit 4057e81b76
2020-01-17 14:14:36 +03:00
Alexander Alekhin 16b13c6e3b Merge pull request #16367 from dkurt:dnn_ie_ngraph_mvn 2020-01-17 09:12:36 +00:00
Alexander Alekhin f429cee5d1 Merge pull request #16369 from kraj:gcc10 2020-01-17 08:58:20 +00:00
Alexander Alekhin 90e4907b0b Merge pull request #16294 from h6197627:master 2020-01-17 08:53:09 +00:00
h6197627 fb3a334bbe cmake: fix Linux system OpenEXR detection 2020-01-16 23:12:41 +02:00
Khem Raj 2bd9488475 carotene: Replace ipcp-unit-growth with ipa-cp-unit-growth on gcc >= 10
gcc 10+ has renamed this option, therefore check for gcc version before
deciding which name to use for opt parameter

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-01-16 11:02:25 -08:00
Yashas Samaga B L d85e67d3ec Merge pull request #16063 from YashasSamaga:cuda4dnn-shortcut-unequal
support eltwise sum with different number of input channels in CUDA backend

* add shortcut primitive

* add offsets in shortcut kernel

* skip tests involving more than two inputs

* remove redundant modulus operation

* support multiple inputs

* remove whole file indentation

* skip acc in0 trunc test if weighted

* use shortcut iff channels are unequal
2020-01-16 21:54:00 +03:00
Alexander Alekhin c30af724ef Merge pull request #16349 from hannesa2:RemoveEclipseRelicts 2020-01-16 16:53:06 +00:00
Alexander Alekhin 3e2d8ca0a1 Merge pull request #16325 from alalek:core_simd_neon_fix_alignment_lut 2020-01-16 15:18:56 +00:00
Alexander Alekhin 1f8802b94d Merge pull request #16351 from hannesa2:finishAndroidVersionGradleStyle 2020-01-16 15:17:17 +00:00
Dmitry Kurtaev 8b9e8a805d MVN support through nGraph 2020-01-16 18:15:31 +03:00
Alexander Alekhin 2b9cfe1e1c Merge pull request #16257 from ianare:more-pythonic 2020-01-16 13:57:08 +00:00
Alexander Alekhin 358139b6b9 imgproc(dispatch): keep history of sumpixels.cpp 2020-01-16 15:09:10 +03:00
Alexander Alekhin c6a622542d imgproc: copy sumpixels.dispatch.cpp 2020-01-16 15:07:48 +03:00
Alexander Alekhin 4ecbcf0885 imgproc: copy sumpixels.simd.hpp 2020-01-16 15:06:34 +03:00
Alexander Alekhin 2638c5e9b7 dnn: dump layer's blobs on getMemoryShapes() error 2020-01-16 14:59:47 +03:00
Alexander Alekhin ed377ac1e8 Merge pull request #16363 from JulienMaille:cuda-dnn-for-older-gpus 2020-01-16 11:08:05 +00:00
Julien ced3df73da Fix: rsqrt(float) was improperly put in the ifdef for half 2020-01-16 09:21:50 +01:00
Hannes Achleitner 4057e81b76 fix lint errors and warnings ins Android samples 2020-01-15 22:41:04 +01:00
Alexander Alekhin 24ca53183d Merge pull request #16361 from alalek:android_fix_javadoc 2020-01-15 19:42:35 +00:00
YashasSamaga fd369a5004 fix and optimize ROIPooling 2020-01-15 22:53:48 +05:30
Alexander Alekhin f6137292f1 Merge pull request #16357 from dkurt:dnn_ie_reset_myriad 2020-01-15 17:03:09 +00:00
Alexander Alekhin a90dacdf75 android: fix javadoc 2020-01-15 19:44:27 +03:00
Dmitry Kurtaev d92a883de1 Different way to reset Myriad device 2020-01-15 18:52:37 +03:00
Alexander Alekhin f6a8f7859c Merge pull request #16354 from dkurt:dnn_ie_custom_cpu_layers 2020-01-15 15:33:18 +00:00
Julien 4e2ef8c8f5 Merge pull request #16218 from JulienMaille:cuda-dnn-for-older-gpus
Enable cuda4dnn on hardware without support for __half

* Enable cuda4dnn on hardware without support for half (ie. compute capability < 5.3)

Update CMakeLists.txt

Lowered minimum CC to 3.0

* UPD: added ifdef on new copy kernel

* added fp16 support detection at runtime

* Clarified #if condition on atomicAdd definition

* More explicit CMake error message
2020-01-15 18:28:37 +03:00
Alexander Alekhin 7cd3615f9f Merge pull request #16353 from dkurt:uninitialized_value 2020-01-15 14:49:45 +00:00
Dmitry Kurtaev 7c741f54fa Wrap custom OpenCV layers to try-catch 2020-01-15 17:44:38 +03:00
Dmitry Kurtaev 0d896af8ec Fix uninitialized value 2020-01-15 12:58:12 +03:00
Hannes Achleitner afc8dd5661 remove Eclipse relicts in Android sample 2020-01-15 07:19:58 +01:00
Hannes Achleitner 52f930cca7 finish Android version info to Gradle style 2020-01-15 06:34:42 +01:00
Alexander Alekhin 4cb9faf6c9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-14 17:04:22 +03:00
Alexander Alekhin a67228cd73 Merge pull request #16291 from dkurt:dnn_onnx_graph_simplifier 2020-01-14 12:45:59 +00:00
Alexander Alekhin f4daf14bfa Merge pull request #16199 from sajarindider:computeGradientX 2020-01-14 12:42:28 +00:00
Alexander Alekhin abe2ca886d Merge pull request #16344 from l-bat:ngraph_normalize 2020-01-14 11:55:37 +00:00
sajarindider 4b93820880 Fixed small inefficiency in seamless clone init 2020-01-14 12:57:52 +03:00
Liubov Batanina be86338a79 Enable acrossSpatial normalizeL2 on Myriad 2020-01-14 12:51:19 +03:00
Dmitry Kurtaev c1c84d2fd1 ONNX graphs simplifier 2020-01-14 12:45:49 +03:00
Alexander Alekhin 3f27f8cf41 Merge pull request #16232 from dkurt:dnn_ie_ngraph_fix_myriad_tests 2020-01-13 16:59:45 +00:00
Vadim Levin 31289d2f32 Merge pull request #15915 from VadimLevin:dev/norm_fix
Fix implicit conversion from array to scalar in python bindings

* Fix wrong conversion behavior for primitive types

  - Introduce ArgTypeInfo namedtuple instead of plain tuple.
    If strict conversion parameter for type is set to true, it is
    handled like object argument in PyArg_ParseTupleAndKeywords and
    converted to concrete type with the appropriate pyopencv_to function
    call.
  - Remove deadcode and unused variables.
  - Fix implicit conversion from numpy array with 1 element to scalar
  - Fix narrowing conversion to size_t type.

* Fix wrong conversion behavior for primitive types

  - Introduce ArgTypeInfo namedtuple instead of plain tuple.
    If strict conversion parameter for type is set to true, it is
    handled like object argument in PyArg_ParseTupleAndKeywords and
    converted to concrete type with the appropriate pyopencv_to function
    call.
  - Remove deadcode and unused variables.
  - Fix implicit conversion from numpy array with 1 element to scalar
  - Fix narrowing conversion to size_t type.·
  - Enable tests with wrong conversion behavior
  - Restrict passing None as value
  - Restrict bool to integer/floating types conversion

* Add PyIntType support for Python 2

* Remove possible narrowing conversion of size_t

* Bindings conversion update

  - Remove unused macro
  - Add better conversion for types to numpy types descriptors
  - Add argument name to fail messages
  - NoneType treated as a valid argument. Better handling will be added
    as a standalone patch

* Add descriptor specialization for size_t

* Add check for signed to unsigned integer conversion safety

  - If signed integer is positive it can be safely converted
    to unsigned
  - Add check for plain python 2 objects
  - Add check for numpy scalars
  - Add simple type_traits implementation for better code style

* Resolve type "overflow" false negative in safe casting check

 - Move type_traits to separate header

* Add copyright message to type_traits.hpp

* Limit conversion scope for integral numpy types

  - Made canBeSafelyCasted specialized only for size_t, so
    type_traits header became unused and was removed.
  - Added clarification about descriptor pointer
2020-01-13 18:11:34 +03:00
Alexander Alekhin f163778da7 cmake: support OPENCV_ABI_SKIP_MODULES_LIST 2020-01-13 17:17:47 +03:00
Dmitry Kurtaev 8f1e36f7c1 Disable some tests for Myriad target of nGraph
Add lightweight IE hardware targets checks

nGraph: Concat with paddings

Enable more nGraph tests

Restore FP32->FP16 for GPU plugin of IE

try to fix buildbot

Use lightweight IE targets check only starts from R4
2020-01-13 15:35:47 +03:00
Alexander Alekhin 4cc458eb10 Merge pull request #16335 from berak:fix_ml_python_digits_samples_3.4 2020-01-13 12:16:40 +00:00
Anatoliy Talamanov 55f2370f36 Merge pull request #16221 from TolyaTalamanov:at/fix-g_typed_kernel_m
G-API: Fix G_TYPED_KERNEL_M macro

* Fix G_TYPED_KERNEL_M macro

* Fixes

* Fix windows build
* Fix doxygen

* Added several macros

* Add overloads for G_TYPED_KERNEL
2020-01-13 14:54:10 +03:00
berak a718f2e6ea ml/python: fix digits samples(3.4) 2020-01-13 12:26:28 +01:00
Alexander Alekhin fb61f88b9c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-01-12 09:35:39 +00:00
Gourav Roy 38e6d668b1 Merge pull request #16276 from themechanicalcoder:video-tutorial
* Added java code for meanshift and optical_flow

* added java code for module video

* added appropriate spaces in codes

* converted absolute path to command line arguments

* added spaces at appropriate places
2020-01-12 11:34:59 +03:00
ihsan314 2c21ea2dd7 Merge pull request #14666 from ihsan314:file_io_xml_yml
Python code examples for file IO in xml and yml format

* Initial "Pythonization" of file_input_output.cpp

* Moved file_input_output.py to correct location

* Nearly done Pythonizing file_input_output.cpp

* Python equivalent of file_input_output.py created

* Started Pythonizing camera_calibration.cpp

* Completed Python tutorial/sample code for file_input_output

* Resolved whitespace issues

* Removed tabs in file_input_output.cpp

* Patched import order and wrapped code in main function

* Changed string to docstring format in help file

* Updated link to Python example code
2020-01-12 11:32:12 +03:00
Alexander Alekhin a9f3acb125 core(simd): fix NEON alignmnet issue 2020-01-11 18:39:50 +00:00
Alexander Alekhin 993b9af756 Merge pull request #16270 from dkurt:dnn_sort_tf_text_graphs 2020-01-11 17:39:13 +00:00
Alexander Alekhin e180cc050b Merge pull request #16236 from alalek:fix_core_simd_emulator
* core: fix intrin_cpp, allow to build modules with SIMD emulator

* core(arithm): fix v_zero initialization

* core(simd): 'strict' types for binary/bitwise operations

* features2d: avoid aligned load issue in GCC 5.4 with emulated SIMD

* core(simd): alignment checks in SIMD emulator
2020-01-10 21:31:02 +03:00
Liubov Batanina ea31a14cc5 Update sample 2020-01-10 16:33:17 +03:00
olramde c75d93337e Merge pull request #16240 from olramde:olramde
* Changed plus operator to os.path.join()

* Remove '/' from PATH
2020-01-10 16:18:31 +03:00
Alexander Alekhin 1e32781b54 Merge pull request #16302 from sthibaul:dlopen-glibc 2020-01-10 11:38:17 +00:00
Liubov Batanina 9ed372b297 Update get memory shapes 2020-01-10 14:09:08 +03:00
Liubov Batanina 4625337179 Add docs reduce mean 2020-01-10 12:49:06 +03:00
Liubov Batanina e9e3af0aaa Add global pool by axis test 2020-01-10 11:32:48 +03:00
Liubov Batanina a33d50084d Add global_pooling_dim flags 2020-01-10 09:01:57 +03:00
Liubov Batanina 7eba3a7c96 Add pack description 2020-01-09 13:59:35 +03:00
Alexander Alekhin 1a74de1f9c Merge pull request #16300 from Palmitoxico:cmake-cmp0077 2020-01-08 21:52:30 +00:00
Augusto Fraga Giachero 2d778434f1 Enable cmake CMP0077 policy
When building OpenCV as a sub-project using cmake's add_subdirectory()
the OpenCV's build options would be overwritten to its default
state. With cmake 3.13+ the CMP0077 policy, option() honors previous
definitions via set().
2020-01-08 14:10:45 -03:00
Samuel Thibault e57ceea3d3 Fix build on non-Linux glibc-based systems
dl functions are provided by all glibc-based systems (GNU/Linux, but
also GNU/Hurd, GNU/kFreeBSD)
2020-01-08 01:32:44 +01:00
Alexander Alekhin 8b43861217 Merge pull request #16289 from Nuzhny007:3.4 2020-01-07 22:13:39 +00:00
Nuzhny007 7d484d21f7 Fixed compilation on windows with openvx 2020-01-06 06:32:56 +03:00
Alexander Alekhin 74bc8d351c Merge pull request #16265 from JanuszL:fix_bgr 2020-01-05 12:01:03 +00:00
Alexander Alekhin 1f2b2c5242 Merge pull request #16230 from YashasSamaga:cuda4dnn-fp-conversion 2020-01-05 11:59:33 +00:00
Janusz Lisiecki 178c4810e6 Fix swapped channels in BGR* conversion utility function
- some of `icvCvt_BGR*` functions have R with B channels
  swapped what leads to the wrong conversion
- renames misleading `rgb` variable name to `bgr`
- swap back the conversion coefficients, `cB` should be the first

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
2020-01-05 00:06:36 +01:00
Ianaré Sévi e4a64760db make stitching script more pythonic 2020-01-04 00:41:03 +01:00
Paul E. Murphy c1cdb2416a imgproc(resize): improve 8u3 HResize vector exit calc
Actually, we can do this in constant time. xofs always
contains same or increasing offset values. We can instead
find the most extreme value used and never attempt to load it.

Similarly, we can note for all dx >= 0 and dx < (dwidth - cn)
where xofs[dx] + cn < xofs[dwidth-cn] implies dx < (dwidth - cn).

Thus, we can use this to control our loop termination optimally.

This fixes #16137 with little or no performance impact. I have
also added a debug check as a sanity check.
2020-01-03 14:46:59 -06:00
Alexander Alekhin 40ac72a8f1 Merge pull request #16238 from alalek:imgproc_resize_fix_types 2020-01-03 16:30:28 +00:00
hannesa2 43a91f82fe Merge pull request #16222 from hannesa2:AndroidMoveVersionInfo
Android move version info to Gradle style

* move version info to Gradle style

* Use VERSION_NAME in loader

* apply review suggestion
2020-01-03 19:15:35 +03:00
Andrew Bruce ccfca869e5 Merge pull request #16275 from andybrucenet:fix_vector_insert
* Ticket 16274: Fix compile error on std::vector.insert

* See https://github.com/opencv/opencv/issues/16274
2020-01-03 19:09:40 +03:00
Alexander Alekhin f6ec467f19 copyright: 2020 2020-01-02 11:59:41 +00:00
Alexander Alekhin 039f5ca42e copyright: 2020 2020-01-02 11:58:20 +00:00
Alexander Alekhin 1996ae4a42 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-31 10:11:39 +00:00
Alexander Alekhin bb93066558 Merge pull request #16249 from alalek:check_size 2019-12-31 10:09:00 +00:00
Dmitry Kurtaev f954f0830c Sort text TensorFlow graphs 2019-12-31 11:43:32 +03:00
Alexander Alekhin dec25e8531 Merge pull request #16264 from YashasSamaga:cuda4dnn-msvc-v140-workaround 2019-12-31 08:20:24 +00:00
Alexander Alekhin 7b28d5b409 Merge pull request #16263 from dkurt:dnn_tf_addv2 2019-12-30 22:56:11 +00:00
Alexander Alekhin 1df148aae9 Merge pull request #16258 from jed-frey:patch/python38-clock 2019-12-30 17:34:23 +00:00
YashasSamaga 48eecafc89 simplify code to help MSVC 19.10 and lower 2019-12-30 23:02:17 +05:30
Dmitry Kurtaev 76cfa65d55 AddV2 from TensorFlow 2019-12-30 20:06:58 +03:00
Jed ef290366b0 Removed deprecated 'clock' import. 2019-12-30 13:00:29 +00:00
Alexander Alekhin b4759d7272 Merge pull request #16251 from pwuertz:rtrees_set_rng 2019-12-29 22:30:39 +00:00
Peter Würtz 8aebef2459 Use global RNG for training RTrees. 2019-12-29 21:59:14 +01:00
Alexander Alekhin 7b12cbd7dc Merge pull request #16254 from YashasSamaga:cuda4dnn-cudnn-optm-conv_bias_relu 2019-12-29 20:53:17 +00:00
YashasSamaga 01f97f150c perfor fp conversions on GPU 2019-12-30 00:05:39 +05:30
YashasSamaga 17a35587e1 use optimized cuDNN path for conv + bias + relu 2019-12-29 13:08:38 +05:30
Alexander Alekhin d76f24567b Merge pull request #16250 from alalek:remove_moved_code 2019-12-28 21:59:19 +00:00
Liubov Batanina 752653c70b Update global pooling 2019-12-28 18:03:40 +03:00
Alexander Alekhin 03a602b6ef remove moved code 2019-12-28 13:57:11 +00:00
Alexander Alekhin 523f081923 core(check): add Size_<int> 2019-12-28 13:50:39 +00:00
Alexander Alekhin 9572895da0 Merge pull request #16237 from alalek:eliminate_build_warnings 2019-12-27 19:38:25 +00:00
Alexander Alekhin 515ec6b98a Merge pull request #16247 from alalek:backport_16241 2019-12-27 16:20:52 +00:00
Alexander Alekhin 9ec3d76b21 Merge pull request #16241 from bwignall:typo 2019-12-27 16:18:57 +00:00
Alexander Alekhin c4c94f891e Merge pull request #16229 from hannesa2:RemoveAndroidEclipse 2019-12-27 13:41:38 +00:00
Alexander Alekhin d16cf68a3b Merge pull request #16242 from catree:add_Rodrigues_input_shape_check 2019-12-27 13:12:03 +00:00
Alexander Alekhin 4ebd91e637 Merge pull request #16226 from YashasSamaga:cuda4dnn-permute-optm 2019-12-27 13:01:43 +00:00
Brian Wignall f9c514b391 Fix spelling typos
backport commit 659ffaddb4
2019-12-27 12:46:53 +00:00
Alexander Alekhin ccb7253818 Merge pull request #16243 from collinbrake:grammar_fixes_9 2019-12-27 11:13:08 +00:00
catree badd0d1ff4 Add explicit size check for Rodrigues() function to prevent issue like https://stackoverflow.com/questions/58969553 2019-12-27 06:07:54 +01:00
Collin Brake 8b55f476be grammar and readability improvements 2019-12-26 20:31:54 -05:00
Brian Wignall 659ffaddb4 Fix spelling typos 2019-12-26 06:45:03 -05:00
Alexander Alekhin 07729e396d imgproc(resize): avoid unnecessary type conversions 2019-12-26 00:02:52 +00:00
Alexander Alekhin d064079a4e build: eliminate build warnings 2019-12-25 23:28:24 +00:00
Liubov Batanina cf477f7e9f Fix global axis 2019-12-24 16:42:00 +03:00
Liubov Batanina 543e0302d3 Support global pooling by axis 2019-12-24 16:16:58 +03:00
Liubov Batanina ffa72fc979 Refactoring 2019-12-24 09:45:27 +03:00
Hannes Achleitner 2da7360b63 Remove Android Eclipse relicts 2019-12-24 07:38:12 +01:00
YashasSamaga 16bc505d26 improve reduction logic and add fast transpose kernel 2019-12-24 00:23:45 +05:30
Liubov Batanina 6e33769e56 Add human parsing demo 2019-12-23 15:47:20 +03:00
Alexander Alekhin 89d3f95a8e Merge tag '4.2.0' 2019-12-20 17:06:45 +03:00
Alexander Alekhin bda89a6469 release: OpenCV 4.2.0 2019-12-20 16:44:16 +03:00
shimat ee4feb4b09 Merge pull request #16208 from shimat:fix_compare_16f
* add cv::compare test when Mat type == CV_16F

* add assertion in cv::compare when src.depth() == CV_16F

* cv::compare assertion minor fix

* core: add more checks
2019-12-20 16:38:51 +03:00
Yashas Samaga B L 1fac1421e5 Merge pull request #16010 from YashasSamaga:cuda4dnn-fp16-tests
* enable tests for DNN_TARGET_CUDA_FP16

* disable deconvolution tests

* disable shortcut tests

* fix typos and some minor changes

* dnn(test): skip CUDA FP16 test too (run_pool_max)
2019-12-20 16:36:32 +03:00
Alexander Alekhin 4de1efd3c8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-20 14:02:56 +03:00
Alexander Alekhin 5e2bcc9149 Merge tag '3.4.9' 2019-12-20 12:44:15 +03:00
Alexander Alekhin 545f8a8c93 Merge pull request #16205 from alalek:fix_dnn_test_data 2019-12-19 20:55:46 +00:00
Alexander Alekhin 97b6068c46 dnn(test): don't require downloaded data 2019-12-19 19:31:59 +00:00
Alexander Alekhin 64e6cf9fe5 release: OpenCV 3.4.9 2019-12-19 18:16:47 +03:00
Sajarin ed788229ed Merge pull request #16165 from sajarindider:macOS_install
* doc: added macOS installation guide

* doc: added clarification and corrections

* docs: introduction entry, lowercase file names and ids
2019-12-19 18:15:59 +03:00
Alexander Alekhin 71ef76ecad Merge pull request #16201 from mshabunin:fix-dup-test 2019-12-19 14:43:53 +00:00
Alexander Alekhin 4c86fc13cb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-19 15:09:05 +03:00
Maksim Shabunin b379969c63 Test: avoid duplicated test cases 2019-12-19 14:38:59 +03:00
Alexander Alekhin 9564aa1fdb Merge pull request #16195 from alalek:tbb_version_2020 2019-12-19 10:55:31 +00:00
Alexander Alekhin 24b05cb308 Merge pull request #16196 from alalek:issue_13574 2019-12-19 10:35:54 +00:00
Alexander Alekhin dff8e29f98 Merge pull request #16139 from alalek:core_flip_avoid_unaligned 2019-12-19 10:29:07 +00:00
Alexander Alekhin 4733a19bab Merge pull request #16194 from alalek:fix_16192
* imgproc(test): resize(LANCZOS4) reproducer 16192

* imgproc: fix resize LANCZOS4 coefficients generation
2019-12-19 13:20:42 +03:00
jeffeDurand 5bf7345743 Merge pull request #16090 from jeffeDurand:cuda_mog2_issue_5296
* cuda_mog2_issue_5296
2019-12-19 13:02:48 +03:00
Alexander Alekhin 4342657762 Merge pull request #16034 from Quantizs:irLoadFromBuffer 2019-12-19 10:00:07 +00:00
Sebastien Wybo e801f0e954 Merge pull request #16011 from sebastien-wybo:fix_16007
* Fix #16007 - colinearity computed using all 3 coordinates

* calib3d(test): estimateAffine3D regression 16007
2019-12-19 12:59:18 +03:00
Alexander Alekhin 9cd1d087c3 android(camera2): apply .disconnectCamera() patch from issue 13574 2019-12-19 00:29:53 +00:00
Alexander Alekhin 8d22ac200f core: workaround flipHoriz() alignment issues 2019-12-19 00:05:23 +00:00
Alexander Alekhin 28a5f7d66b 3rdparty: TBB version 2019u8 => 2020.0 2019-12-18 23:14:38 +00:00
Alexander Alekhin a8345133ac Merge pull request #16191 from terfendail:lres2c_fix 2019-12-18 22:31:52 +00:00
Vitaly Tuzov f5a84f75c4 Fix for CV_8UC2 linear resize vectorization 2019-12-18 21:41:36 +00:00
Alexander Alekhin b8e0898c7c Merge pull request #16082 from YashasSamaga:cuda4dnn-roi-pooling 2019-12-18 14:41:58 +00:00
antalzsiroscandid aa80f754f4 dnn: reading IR models from buffer 2019-12-18 15:31:08 +01:00
mcellis33 5d15c65e48 Merge pull request #16136 from mcellis33:mec-nan
* Handle det == 0 in findCircle3pts.

Issue 16051 shows a case where findCircle3pts returns NaN for the
center coordinates and radius due to dividing by a determinant of 0. In
this case, the points are colinear, so the longest distance between any
2 points is the diameter of the minimum enclosing circle.

* imgproc(test): update test checks for minEnclosingCircle()

* imgproc: fix handling of special cases in minEnclosingCircle()
2019-12-18 17:25:59 +03:00
Alexander Alekhin f8b16fa293 Merge pull request #16188 from saskatchewancatch:issue-13551 2019-12-18 10:30:35 +00:00
Rajkiran Natarajan af04b422c9 Change program type in hdr format files to modern value: RADIANCE so
modern readers that expect RADIANCE will read it
2019-12-17 20:17:32 -08:00
Alexander Alekhin c97ff6c0f9 Merge pull request #16104 from alalek:issue_16095 2019-12-17 19:02:15 +00:00
Alexander Alekhin 61969dc158 Merge pull request #16171 from YashasSamaga:cuda4dnn-tensor-cores 2019-12-17 18:58:12 +00:00
Alexander Alekhin 8f910d2d49 Merge pull request #16083 from alalek:issue_14961 2019-12-17 12:03:55 +00:00
Alexander Alekhin fd4fac946a gapi(test): avoid using of unstable random floating-point input 2019-12-17 13:48:40 +03:00
Orest Chura 287874a444 Merge pull request #15942 from OrestChura:fb_tutorial
G-API: Tutorial: Face beautification algorithm implementation

* Introduce a tutorial on face beautification algorithm

- small typo issue in render_ocv.cpp

* Addressing comments rgarnov smirnov-alexey
2019-12-17 11:00:49 +03:00
Alexander Alekhin c6c8783c60 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-16 21:30:30 +00:00
Tatsuro Shibamura 971ae00942 Merge pull request #16027 from shibayan:arm64-windows10
* Support ARM64 Windows 10 platform

* Fixed detection issue for ARM64 Windows 10

* Try enabling ARM NEON intrin

* build: disable NEON with MSVC compiler

* samples(directx): gdi32 dependency
2019-12-17 00:23:30 +03:00
Alexander Alekhin a11f9e1963 Merge pull request #16177 from cudawarped:fix_python_cudaarithm 2019-12-16 20:14:31 +00:00
cudawarped d427cebd12 Fix mistake introcuded in previous PR and increase test coverage to avod this happening again 2019-12-16 18:38:58 +00:00
Alexander Alekhin e5b58b1020 Merge pull request #16172 from alalek:dnn_fix_keypoints_test 2019-12-16 16:17:02 +00:00
Alexander Alekhin 2c0d9fa81f dnn(test): fix Test_Model.Keypoints* tests 2019-12-16 18:07:23 +03:00
YashasSamaga cf93df41fc enable tensor cores for fp16 convolutions 2019-12-16 15:38:12 +05:30
Alexander Alekhin ba7b0f4c54 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
Sajarin 21ee54c3d1 Merge pull request #16100 from sajarindider:brief
* (doc): added info about STAR

* (doc): fixed typos and sentence structure

* fixed trailing whitespaces
2019-12-15 12:42:19 +03:00
Alexander Alekhin 90a17cf964 Merge pull request #16159 from alalek:imgcodecs_bmp_ubsan_enum_handling 2019-12-15 09:28:08 +00:00
Yashas Samaga B L 17c485eb03 Merge pull request #16092 from YashasSamaga:cuda4dnn-conv-act-fuse
cuda4dnn: fuse activations with convolutions

* fuse ReLU, ReLU6, TanH, Sigmoid with conv

* fix OpenCL errors

* improve ReLU, add power, swish and mish

* fix missing fusion entries

* fix handling of unsetAttached

* remove whole file indentation

* optimize power = 1.0, use IDENTITY instead of NONE

* handle edge case: change backend and then clear
2019-12-14 22:26:58 +03:00
Alexander Alekhin 60ba6ef916 Merge pull request #16163 from alalek:fix_16122 2019-12-14 18:51:22 +00:00
Alexander Alekhin 424e1150ae cmake: fix OpenCV_ARCH 2019-12-14 15:02:43 +00:00
Alexander Alekhin d1c35e7b61 imgcodecs(bmp): make happy UBSAN with enum value range check 2019-12-13 18:51:46 +03:00
Xuanda Yang 3d60a9b96c Merge pull request #16156 from TH3CHARLie:3.4
* Eltwise::DIV support in Halide backend

* fix typo

* remove div from generated test suite to pass CI, switching to manual test...

* ensure divisor not near to zero

* use randu

* dnn(test): update test data for Eltwise.Accuracy/DIV layer test
2019-12-13 18:29:39 +03:00
Diego 5b0b59ecfb Merge pull request #15189 from dvd42:keypoints_module
Keypoints module
2019-12-13 18:00:06 +03:00
Alexander Alekhin 60f81032bb Merge pull request #16157 from alalek:update_libwebp_1.0.3
* 3rdparty: update libwebp 1.0.2 => 1.0.3

https://github.com/webmproject/libwebp/releases/tag/v1.0.3

* 3rdparty(libwebp): re-apply patches
2019-12-13 17:54:42 +03:00
Alexander Alekhin a45928045a Merge pull request #16150 from alalek:cmake_avoid_deprecated_link_private
* cmake: avoid deprecated LINK_PRIVATE/LINK_PUBLIC

see CMP0023 (CMake 2.8.12+)

* cmake: fix 3rdparty list

- don't include OpenCV modules
2019-12-13 17:52:40 +03:00
Alexander Alekhin f62241b780 Merge pull request #16148 from alalek:doxygen_update_config 2019-12-13 14:51:37 +00:00
Alexander Alekhin 43302c79ca Merge pull request #16122 from alalek:cmake_update_cpu_compiler_detection 2019-12-13 14:51:19 +00:00
Alexander Alekhin 94f73ee680 Merge pull request #16153 from vsuyi:master 2019-12-13 13:43:58 +00:00
ysy ff4d3d27dd fix wrong method name 2019-12-13 19:54:53 +08:00
Alexander Alekhin 682653c6f8 doc: update doxygen configuration 2019-12-13 01:41:45 +00:00
Alexander Alekhin c2b6c67431 Merge pull request #16141 from OrestChura:oc/fix-standalone-build 2019-12-12 18:34:12 +00:00
RAJKIRAN NATARAJAN e6ce752da1 Merge pull request #15966 from saskatchewancatch:issue-15760
Add checks for empty operands in Matrix expressions that don't check properly

* Starting to add checks for empty operands in Matrix expressions that
don't check properly.

* Adding checks and delcarations for checker functions

* Fix signatures and add checks for each class of Matrix Expr operation

* Make it catch the right exception

* Don't expose helper functions to public API
2019-12-12 19:23:57 +03:00
atalaman 4a4ff6749b Merge pull request #16080 from TolyaTalamanov:at/fix-mosaic-primitive
G-API: Mosaic handle corner cases

* Handle corner cases

* Fix mosaic algo

* Fix bug with empty rects
2019-12-12 19:10:14 +03:00
Dmitry Matveev f270e8d040 Merge pull request #16066 from dmatveev:dm/gapi_slides
* G-API: Added G-API Overview slides & its source code

- Sample code snippets are moved to separate files;
- Introduced a separate benchmark to measure Fluid/OpenCV
  performance;
- Added notes on API changes (it is still a 4.0, not a 4.2 talk!)
- Added a "Metropolis" beamer download-n-build script.

* G-API: Addressed review issues on G-API overview slides
2019-12-12 18:48:38 +03:00
OrestChura 3cd8976493 Fix standalone-gapi 2019-12-12 18:22:16 +03:00
Alexander Alekhin 92b9888837 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-12 13:02:19 +03:00
Paul Murphy 1c4a64f0a1 Merge pull request #16138 from pmur:reg_16137
* imgproc: Prevent 1B overrun of 8C3 SIMD optimization

The fourth value read via v_load_q is essentially ignored,
but can cause trouble if it happens to cross page boundaries.

The final few iterations may attempt to read the most extreme
elements of S, which will read 1B beyond the array in most
aligment cases. Dynamically compute the stop. This could be
hoised from the loop, but will require a more extensive change.

Likewise, cleanup the iteration increment statements to make
it more obvious they do channel count (3) elements per pass.

This should resolve #16137

* imgproc(resize): extra check
2019-12-12 13:00:44 +03:00
Alexander Alekhin afa072578c Merge pull request #16120 from alalek:python3.8 2019-12-11 17:18:51 +00:00
Alexander Alekhin 5ee7abbe3c Merge pull request #16088 from alalek:dnn_eltwise_layer_different_src_channels
dnn(eltwise): fix handling of different number of channels

* dnn(test): reproducer for Eltwise layer issue from PR16063

* dnn(eltwise): rework support for inputs with different channels

* dnn(eltwise): get rid of finalize(), variableChannels

* dnn(eltwise): update input sorting by number of channels

- do not swap inputs if number of channels are same after truncation

* dnn(test): skip "shortcut" with batch size 2 on MYRIAD targets
2019-12-11 20:16:58 +03:00
Alexander Alekhin 121bc50ca9 Merge pull request #16130 from alalek:fix_build_gapi_gcc_4.x 2019-12-11 14:17:03 +00:00
Alexander Alekhin f2cce5fd8c Merge pull request #16125 from alalek:core_safe_xadd 2019-12-11 14:15:46 +00:00
Alexander Alekhin 7d61426279 Merge pull request #16124 from alalek:issue_13354 2019-12-11 14:15:23 +00:00
Alexander Alekhin 8b97c93f3d Merge pull request #16123 from alalek:opencv_include_port_file 2019-12-11 14:15:04 +00:00
atalaman 0d19fa0720 Merge pull request #16062 from TolyaTalamanov:at/add-default-initlization-for-primitives
G-API: Add default initialization for primitives

* Add ctors for primitives

* Add description for constructors
2019-12-11 17:10:42 +03:00
Alexander Alekhin 2a11103a73 Merge pull request #16098 from alalek:dnn_clarify_error_getMemoryShapes 2019-12-11 14:02:15 +00:00
Alexander Alekhin b8ef2036b0 Merge pull request #16091 from dkurt:png_to_dot 2019-12-11 14:01:39 +00:00
Alexander Alekhin 8b9982a0a5 Merge pull request #16086 from alalek:gapi_test_bitwise_not_exclude_32f 2019-12-11 14:00:59 +00:00
Alexander Alekhin 15612ebd39 python: enable Python 3.8 2019-12-11 16:52:38 +03:00
Alexander Alekhin d1bb2055da Merge pull request #16121 from shimat:fix_voronoi_typo 2019-12-11 12:30:47 +00:00
Alexander Alekhin 6b6c2f6087 gapi: fix build with GCC 4.8 2019-12-11 13:31:50 +03:00
Alexander Alekhin 416848066c core: provide safe implementations of CV_XADD() only 2019-12-11 00:48:45 +00:00
Alexander Alekhin 76b5e19eb3 core: add "namespace cv" in CV_StaticAssert fallback implementation 2019-12-11 00:35:13 +00:00
Alexander Alekhin a675c4937a core: OPENCV_INCLUDE_PORT_FILE for custom platform configuration 2019-12-11 00:31:45 +00:00
Alexander Alekhin 6ea29a7696 cmake: prefer using CMAKE_SYSTEM_PROCESSOR / CMAKE_SIZEOF_VOID_P
Drop:
- discouraged CMAKE_CL_64
- MSVC64
- MINGW64
2019-12-11 00:21:10 +00:00
shimat b89581960c s/Voroni/Voronoi/g 2019-12-11 09:13:58 +09:00
Alexander Alekhin 4ec4ec844f python: fix issue with bindings loading on Python 3.8 2019-12-10 19:00:10 +00:00
Alexander Alekhin e47f3e5bcc Merge pull request #16109 from pixelb:gcc-9-pch 2019-12-10 16:29:07 +00:00
Alexander Alekhin 9a27901edc Merge pull request #16117 from mshabunin:fix-hist-args-34 2019-12-10 15:14:22 +00:00
Pádraig Brady 7b298b0995 Fix pch generation when linker flags used with GCC
-c is required to avoid linking (and the associated missing "main" message)
when linker flags like "-Wl,-z,relro" are passed to GCC
2019-12-10 14:55:56 +00:00
Maksim Shabunin 435c97c7a2 imgproc: add parameter checks in calcHist and calcBackProj 2019-12-10 16:10:19 +03:00
Alexander Alekhin 939099b9ce Merge pull request #16107 from dkurt:dnn_ie_ngraph_v1_conv 2019-12-10 12:10:50 +00:00
Alexander Alekhin 2a19db0f0a Merge pull request #16106 from dkurt:dnn_ie_ngraph_weights_fusion 2019-12-10 12:08:04 +00:00
Dmitry Kurtaev fe77223dee Modify nGraph's ConvolutionBackpropData and GroupConvolution 2019-12-10 14:14:00 +03:00
Dmitry Matveev 9a18330f3a Merge pull request #16081 from dmatveev:dm/ocv42_gapi_bugfixes
G-API: Fix various issues for 4.2 release

* G-API: Fix issues reported by Coverity

- Fixed: passing values by value instead of passing by reference

* G-API: Fix redundant std::move()'s in return statements

Fixes #15903

* G-API: Added a smarter handling of Stop messages in the pipeline

- This should fix the "expected 100, got 99 frames" problem
- Fixes #15882

* G-API: Pass enum instead of GKernelPackage in Streaming test parameters

- Likely fixes #15836

* G-API: Address review issues in new bugfix comments
2019-12-10 13:31:42 +03:00
Dmitry Matveev c89780dfe0 Merge pull request #16039 from dmatveev:dm/gapi_tutorial_interactive_face_detection
* G-API-NG/Docs: Added a tutorial page on interactive face detection sample

- Introduced a "--ser" option to run the pipeline serially for
  benchmarking purposes
- Reorganized sample code to better fit the documentation;
- Fixed a couple of issues (mainly typos) in the public headers

* G-API-NG/Docs: Reflected meta-less compilation in new G-API tutorial

* G-API-NG/Docs: Addressed review comments on Face Analytics Pipeline example
2019-12-10 00:30:10 +03:00
Yashas Samaga B L 3fddd3bf93 Merge pull request #16069 from YashasSamaga:cuda4dnn-crop_and_resize
add CropAndResize layer for CUDA backend

* add CropAndResize layer

* process multiple channels per iteration
2019-12-09 22:26:58 +03:00
Alexander Alekhin 45f6931352 Merge pull request #16089 from dkurt:dnn_ie_fix_fpga 2019-12-09 19:26:00 +00:00
RAJKIRAN NATARAJAN b9435b9e38 Merge pull request #16094 from saskatchewancatch:issue-16053
* Add eps error checking for approxPolyDP to allow sensible values only
for epsilon value of Douglas-Peucker algorithm.

* Review changes for PR
2019-12-09 22:24:35 +03:00
Alexander Alekhin a2642d83d3 Merge pull request #16093 from alalek:core_itt_thread_name_16072 2019-12-09 18:29:53 +00:00
Alexander Alekhin a4cb914656 Merge pull request #16101 from dkurt:dnn_ie_ngraph_detection_output 2019-12-09 18:29:24 +00:00
Alexander Alekhin 2817cbe450 Merge pull request #16102 from asmorkalov:as/xperience_c 2019-12-09 18:28:29 +00:00
Dmitry Kurtaev c2ca3ee2fa Fix weights fusion for Convolution and Deconvolution layers in nGraph 2019-12-09 19:06:47 +03:00
Alexander Alekhin 13bc55a015 calib3d: clarify error messages in collectCalibrationData() 2019-12-09 18:36:13 +03:00
Alexander Alekhin b505cf84de Merge pull request #16096 from YashasSamaga:cuda4dnn-region-optimize 2019-12-09 14:34:48 +00:00
Yashas Samaga B L 476a02739e Merge pull request #16097 from YashasSamaga:cuda4dnn-optimize-resize-bilinear
cuda4dnn(resize): process multiple channels each iteration

* resize bilinear: process multiple chans. per iter.

* remove unused headers

* correct dispatch logic

* resize_nn: process multiple chans. per iter.
2019-12-09 17:31:27 +03:00
Alexander Alekhin 544ceedcac Merge pull request #16103 from alalek:videoio_ffmpeg_wrapper_version_check 2019-12-09 14:15:38 +00:00
Alexander Smorkalov 766465ce94 Added Xperience.AI to copyright file. 2019-12-09 15:58:24 +03:00
Paul Murphy a011035ed6 Merge pull request #15257 from pmur:resize
* resize: HResizeLinear reduce duplicate work

There appears to be a 2x unroll of the HResizeLinear against k,
however the k value is only incremented by 1 during the unroll. This
results in k - 1 duplicate passes when k > 1.

Likewise, the final pass may not respect the work done by the vector
loop. Start it with the offset returned by the vector op if
implemented. Note, no vector ops are implemented today.

The performance is most noticable on a linear downscale. A set of
performance tests are added to characterize this.  The performance
improvement is 10-50% depending on the scaling.

* imgproc: vectorize HResizeLinear

Performance is mostly gated by the gather operations
for x inputs.

Likewise, provide a 2x unroll against k, this reduces the
number of alpha gathers by 1/2 for larger k.

While not a 4x improvement, it still performs substantially
better under P9 for a 1.4x improvement. P8 baseline is
1.05-1.10x due to reduced VSX instruction set.

For float types, this results in a more modest
1.2x improvement.

* Update U8 processing for non-bitexact linear resize

* core: hal: vsx: improve v_load_expand_q

With a little help, we can do this quickly without gprs on
all VSX enabled targets.

* resize: Fix cn == 3 step per feedback

Per feedback, ensure we don't overrun. This was caught via the
failure observed in Test_TensorFlow.inception_accuracy.
2019-12-09 14:54:06 +03:00
Alexander Alekhin 734de34b7a Merge pull request #16085 from alalek:imgproc_threshold_to_zero_ipp_bug
* imgproc(IPP): wrong result from threshold(THRESH_TOZERO)

* imgproc(IPP): disable IPP code to pass THRESH_TOZERO test
2019-12-09 14:51:02 +03:00
Alexander Alekhin e0e683aedf videoio(plugins): relax version check for FFmpeg wrapper on Windows 2019-12-09 14:47:38 +03:00
Dmitry Kurtaev 883c4c60c3 Remove Dummy layer 2019-12-09 12:49:47 +03:00
Alexander Alekhin b1b505f783 dnn: clarify error message from getMemoryShapes() 2019-12-08 22:17:24 +00:00
Yashas dd3f517fe9 optimize region kernels 2019-12-08 21:03:30 +05:30
Alexander Alekhin 65d606630d Merge pull request #16084 from alalek:issue_15784 2019-12-07 22:33:11 +00:00
Alexander Alekhin 816f82682b core(trace/itt): avoid calling __itt_thread_set_name() by default
- don't override current application thread names
- set name for own threads only
2019-12-07 21:41:15 +00:00
Dmitry Kurtaev ad56838040 Replace .png to .dot 2019-12-07 15:03:28 +03:00
Alexander Alekhin 202ba124a5 Merge pull request #16087 from YashasSamaga:cuda4dnn-eltwise-div 2019-12-06 18:33:55 +00:00
Lubov Batanina 629d47fcd8 Merge pull request #15988 from l-bat:custom_layer
Test create custom layer in python

* check is contiguos

* Add custom layer test

* Fix test

* Remove assert

* Move assert to pyopencv dnn

* remove assert

* Add unregister

* Fix python2

* proto to bytearray

* Fix data type
2019-12-06 21:29:57 +03:00
Dmitry Kurtaev beb5b291b9 Fix HETERO:FPGA,CPU plugin for IE backend 2019-12-06 19:35:11 +03:00
YashasSamaga a91eca6ec2 add DIV support to EltwiseOp 2019-12-06 21:28:36 +05:30
Alexander Alekhin c0503718cd gapi(test): exclude 32F from bitwise_not case 2019-12-06 18:12:45 +03:00
Alexander Alekhin 51d54ad4f0 Merge pull request #16076 from l-bat:prior_ngraph 2019-12-06 14:08:21 +00:00
Alexander Alekhin 1ddcfc5c68 gapi: update CMakeLists.txt, fix TBB dependency handling 2019-12-06 16:36:42 +03:00
YashasSamaga 9b8ddba4d1 add ROIPoolingOp 2019-12-06 18:19:37 +05:30
Dmitry Matveev b2b6f52d14 Merge pull request #16050 from dmatveev:dm/ocv42_gapi_doc_fixup
* G-API: Addressed various documentation issues

- Fixed various typos and missing references;
- Added brief documentaion on G_TYPED_KERNEL and G_COMPOUND_KERNEL macros;
- Briefly described GComputationT<>;
- Briefly described G-API data objects (in a group section).

* G-API: Some clean-ups in doxygen, also a chapter on Render API

* G-API: Expose more graph compilation arguments in the documentation

* G-API: Address documentation review comments
2019-12-06 15:36:02 +03:00
Alexander Alekhin fb5db23463 Merge pull request #16079 from alalek:imgproc_color_clarify_error_message 2019-12-06 12:33:07 +00:00
Alexander Alekhin 0a35b97e75 Merge pull request #16070 from dkurt:backport_15611 2019-12-06 12:32:22 +00:00
Alexander Alekhin 15621532b8 Merge pull request #16077 from dmatveev:dm/gapi_narg_combine 2019-12-06 12:31:30 +00:00
Alexander Alekhin 774d28efb1 Merge pull request #16078 from alalek:update_version_4.2.0-pre 2019-12-06 11:26:11 +00:00
Alexander Alekhin eea517be92 Merge pull request #16071 from alalek:update_version_3.4.9-pre 2019-12-06 11:25:05 +00:00
Alexander Alekhin b369c456f2 imgproc(color): clarify error message 2019-12-06 13:25:51 +03:00
Alexander Alekhin c3023fb52b pre: OpenCV 4.2.0 (version++) 2019-12-06 12:58:57 +03:00
Liubov Batanina 660a709840 Support Swish and Mish activations 2019-12-06 11:27:59 +03:00
Dmitry Matveev ccf415c341 G-API: Added an arbitrary-argument version of cv::gapi::combine
- Now user doesn't need to do `combine(x, combine(y, combine(z, zz)))` but
  just `combine(x, y, z, zz)`
2019-12-06 10:47:50 +03:00
Liubov Batanina d99d18304a Slice v1 op 2019-12-06 09:56:21 +03:00
Alexander Alekhin 76a27e3399 pre: OpenCV 3.4.9 (version++) 2019-12-05 18:28:38 +00:00
Dmitry Kurtaev 134094a442 Backport fix for autodetection of input shapes 2019-12-05 19:25:51 +03:00
Alexander Alekhin 8108fb0575 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-05 18:27:45 +03:00
Alexander Alekhin c790779a37 Merge pull request #16024 from alalek:issue_15953 2019-12-05 14:23:48 +00:00
Alexander Alekhin 72f35e0626 Merge pull request #16052 from alalek:issue_16040
* calib3d: use normalized input in solvePnPGeneric()

* calib3d: java regression test for solvePnPGeneric

* calib3d: python regression test for solvePnPGeneric
2019-12-05 15:36:39 +03:00
Alexander Alekhin f21bde4d9f Merge pull request #16046 from alalek:issue_15990
* core: disable invalid constructors in C API by default

- C API objects will lose their default initializers through constructors

* samples: stop using of C API
2019-12-05 14:48:18 +03:00
Alexander Alekhin 986c5084a4 Merge pull request #16036 from dkurt:dnn_backport_15203 2019-12-05 09:56:00 +00:00
Alexander Alekhin 38180c2c97 Merge pull request #16014 from dkurt:dnn_ie_pooling_with_indices 2019-12-05 09:52:03 +00:00
Alexander Alekhin 95e36fd488 Merge pull request #16055 from alalek:issue_16041 2019-12-05 07:54:17 +00:00
Alexander Alekhin 36c9f7c3df Merge pull request #16061 from alalek:bindings_parser_support_simple_if 2019-12-04 19:13:22 +00:00
Dmitry Kurtaev d8e10f3a8d Enable MaxPooling with indices in Inference Engine 2019-12-04 19:14:55 +03:00
cudawarped b4a3c92867 Merge pull request #15957 from cudawarped:fix_cudacodec_python
Fix cudacodec python

* Add python bindings to cudacodec.

* Allow args with CV_OUT GpuMat& or CV_OUT cuda::GpuMat& to generate python bindings that allow the argument to be an optional output in the same way as OutputArray.

* Add wrapper flag to indicate that an OutputArray is a GpuMat.

* python: drop CV_GPU, extra checks in test

* Remove "cuda::GpuMat" check rom python parser
2019-12-04 18:57:58 +03:00
Alexander Alekhin 72315e7b00 Merge pull request #16045 from YashasSamaga:cuda4dnn-hotfix-log1p-expm1 2019-12-04 15:50:07 +00:00
Alexander Alekhin 1633c29f29 Merge pull request #16037 from alalek:dnn_test_fix_skip_vulkan 2019-12-04 15:49:47 +00:00
Alexander Alekhin 4dfa0a0383 bindings: basic support for #if preprocessor directives
- #if 0
- #ifdef __OPENCV_BUILD
2019-12-04 18:42:31 +03:00
Alexander Alekhin 818585fd12 core(tls): unblock TlsAbstraction destructor call
- required to unregister callbacks from system
2019-12-04 08:27:01 +00:00
Alexander Alekhin 529a241a26 Merge pull request #15972 from TolyaTalamanov:at/ftext-primitive 2019-12-03 20:09:21 +00:00
Pinaev Danil 5e3a7ac8a7 Merge pull request #16031 from aDanPin:dm/streaming_auto_meta
G-API-NG/Streaming: don't require explicit metadata in compileStreaming()

* First probably working version
Hardcode gose to setSource() :)

* Pre final version of move metadata declaration from compileStreaming() to setSource().

* G-API-NG/Streaming: recovered the existing Streaming functionality

- The auto-meta test is disabling since it crashes.
- Restored .gitignore

* G-API-NG/Streaming: Made the meta-less compileStreaming() work

- Works fine even with OpenCV backend;
- Fluid doesn't support such kind of compilation so far - to be fixed

* G-API-NG/Streaming: Fix Fluid to support meta-less compilation

- Introduced a notion of metadata-sensitive passes and slightly
  refactored GCompiler and GFluidBackend to support that
- Fixed a TwoVideoSourcesFail test on streaming

* Add three smoke streaming tests to gapi_streaming_tests.
All three teste run pipeline with two different input sets
1) SmokeTest_Two_Const_Mats test run pipeline with two const Mats
2) SmokeTest_One_Video_One_Const_Scalar test run pipleline with Mat(video source) and const Scalar
3) SmokeTest_One_Video_One_Const_Vector test run pipeline with Mat(video source) and const Vector
 # Please enter the commit message for your changes. Lines starting

* style fix

* Some review stuff

* Some review stuff
2019-12-03 19:14:13 +03:00
Alexander Alekhin eb44e0a556 Merge pull request #16028 from catree:improve_calib3d_doc 2019-12-03 12:34:10 +00:00
Talamanov, Anatoliy 63b154396a Implement cv::gapi::wip::draw::FText 2019-12-03 13:13:06 +03:00
YashasSamaga fbb3f64a1a fix expm1 and log1p for __half/__half2 2019-12-03 15:25:35 +05:30
Alexander Alekhin 0dc0bc80ae dnn(test): fix Vulkan skip test tag 2019-12-02 18:22:10 +03:00
Dmitry Kurtaev ca1ba7a53d Backport for dnn input shape estimation 2019-12-02 16:28:59 +03:00
Alexander Alekhin 4b0132ed7a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-02 16:26:52 +03:00
Lubov Batanina 7523c777c5 Merge pull request #15537 from l-bat:ngraph
* Support nGraph

* Fix resize
2019-12-02 16:16:06 +03:00
catree 43d58aa760 Improve calib3d documentation:
- add reference to Rodrigues Jacobian
  - add references to SE(3) and Lie Groups topics
  - update some conventions and pinhole figure
2019-12-02 03:04:56 +01:00
Alexander Alekhin 20ac7f40f6 Merge pull request #16025 from dkurt:thebhatman/Mish_swish_3.4 2019-12-01 21:07:26 +00:00
Manjunath Bhat 78c5e41c23 Merge pull request #15808 from thebhatman:Mish_swish
* Added Swish and Mish activations

* Fixed whitespace errors

* Kernel implementation done

* Added function for launching kernel

* Changed type of 1.0

* Attempt to add test for Swish and Mish

* Resolving type mismatch for log

* exp from device

* Use log1pexp instead of adding 1

* Added openCL kernels
2019-12-02 00:06:17 +03:00
thebhatman 8a18d132fc Port Swish and Mish layers 2019-12-01 11:55:39 +03:00
Alexander Alekhin 9a4404276a calib3d: revert stereoRectify() changes from PRs: 6836, 6972, 6955
(1/4) Revert "Correct image borders and principal point computation in cv::stereoRectify"

This reverts commit 93ff1fb2f2.

(2/4) Revert "fix calib3d changes in 6836 plus some others"

This reverts commit fa42a1cfc2.

(3/4) Revert "fix compiler warning"

This reverts commit b3d55489d3.

(4/4) Revert "add test for 6836"

This reverts commit d06b8c4ea9.
2019-11-30 23:37:49 +00:00
Alexander Alekhin f5b9705c70 Merge pull request #16006 from sajarindider:typo 2019-11-30 20:20:56 +00:00
sajarindider 101a147496 fixed Scheimpflug typo 2019-11-30 18:52:23 +00:00
Alexander Alekhin 01a28db949 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-29 18:57:33 +03:00
Vadim Levin 8d74101f07 Merge pull request #15955 from VadimLevin:dev/vlevin/generator_tests
Tests for argument conversion of Python bindings generator

* Tests for parsing elemental types from Python bindings

  - Add positive and negative tests for int, float, double, size_t,
    const char*, bool.
  - Tests with wrong conversion behavior are skipped.

* Move implicit conversion of bool to integer/floating types to wrong
conversion behavior.
2019-11-29 16:24:13 +03:00
Alexander Alekhin 41af8aa046 Merge pull request #16017 from berak:fix_svm_train_auto 2019-11-29 11:38:22 +00:00
berak 0dfab6bbd0 ml: fix check in SVM::trainAuto 2019-11-28 20:33:58 +01:00
Pinaev Danil 53b6fb465c Merge pull request #15695 from aDanPin:dp/incorrect_use_of_muve_fix
Fix incorrect use of std::move() in g-api perf tests

* First version

* Fix perfomace tests

Replace

    c.apply(...);

with

    cc = c.compile(...);
    cc(...);

* Remove output meta arguments from .compile()

* Style fix

* Remove useless commented string

* Stick to common pattern : i.e. use gin() and gout() explicitly.

* Use cc(gin(...), gout(...)) in all cases.
2019-11-28 16:25:20 +03:00
Alexander Alekhin 873250f5de Merge pull request #15998 from alalek:ts_count_skip_exception 2019-11-27 19:23:27 +00:00
Alexander Alekhin 6c37e10c83 Merge pull request #15994 from SSteve:affine_transform_docs 2019-11-27 19:23:09 +00:00
Alexander Alekhin 70146700aa Merge pull request #15839 from alalek:core_simd_v_setall_template 2019-11-27 19:19:35 +00:00
atalaman a7acb8805f Merge pull request #15869 from TolyaTalamanov:at/plaidml-backend
G-API: Implement PlaidML2 backend

* PlaidML backend init version

* Add test

* Support multiply inputs/outputs in PlaidML2 backend

* Fix comment to review

* Add HAVE_PLAIDML macros

* Move plaidml tests to separate file

* Fix comment to review

* Fix cmake warning

* Fix comments to review

* Fix typos

overload -> overflow

* Fix comments to review

* Clean up

* Remove spaces from cmake scripts
* Disable tests with bitwise operations

* Use plaidml::exec::Binder
2019-11-27 18:21:00 +03:00
Dmitry Matveev fb5e7964b3 Merge pull request #15753 from dmatveev:dm/ng-5000-security_barrier-interactive_face
G-API: Introduced Security Barrier & Interactive Face Detection samples

* G-API-NG/Samples: Added samples & relevant changes

- Security barrier camera sample
- Age/Gender/Emotions recognition sample
- GIEBackend now loads CPU extension libraries
- A couple of API-level workarounds added to deal with cv::Mat/Blob conversions

* G-API-NG/Samples: removed HAVE_INF_ENGINE remnants
2019-11-27 17:54:17 +03:00
Alexander Alekhin 5af747c6fd Merge pull request #16001 from alalek:backport_15995 2019-11-26 18:35:28 +00:00
Alexander Alekhin d9efb55d29 Merge pull request #15995 from bwignall:typo 2019-11-26 15:52:04 +00:00
Alexander Alekhin 17dfae77af Merge pull request #15991 from collinbrake:feature_grammar_fixes_8 2019-11-26 15:48:22 +00:00
Brian Wignall af997529a1 Fix some typos 2019-11-26 18:41:19 +03:00
Alexander Alekhin 5639f5a296 ts: count skipped tests via SkipTestException
- apply tag 'skip_other'
2019-11-26 18:34:04 +03:00
Brian Wignall 9276f1910b Fix some typos 2019-11-25 19:55:07 -05:00
Steve Nicholson 0c644d1ec8 Rename parameter R to H in AffineWarper member declarations 2019-11-25 16:31:03 -08:00
Alexander Alekhin a093a0e05c Merge pull request #15986 from dkurt:fix_15863 2019-11-25 20:04:47 +00:00
Alexander Alekhin cdc469786c Merge pull request #15978 from alalek:videoio_refactor_v4l 2019-11-25 20:04:25 +00:00
Maksim Shabunin 5ff1fababc Merge pull request #15959 from mshabunin:refactor-ml-tests
ml: refactored tests

* use parametrized tests where appropriate
* use stable theRNG in most tests
* use modern style with EXPECT_/ASSERT_ checks
2019-11-25 23:03:16 +03:00
Collin Brake 6276b86a78 grammar corrections 2019-11-25 13:49:09 -05:00
Dmitry Kurtaev 6e14cc2189 Resolve https://github.com/opencv/opencv/issues/15863 2019-11-24 21:59:25 +03:00
Alexander Alekhin 9e906d9e21 Merge pull request #15980 from SSteve:doxygen_links 2019-11-24 09:39:48 +00:00
Steve Nicholson dc4af58be0 Update links to Doxygen website 2019-11-23 22:23:17 -08:00
Alexander Alekhin 4a3ab8fbdb Merge pull request #15975 from SSteve:ios_install 2019-11-23 22:59:01 +00:00
Steve Nicholson b38547ee9a Update and add information to iOS build instructions. 2019-11-23 13:53:08 -08:00
Alexander Alekhin 501ff7f056 videoio(v4l2): use logging, update handling of EBUSY, device closing
- DEBUG logging compilation is enabled for all videoio backends
- eliminate output through perror(), stderr
2019-11-23 10:36:43 +00:00
Alexander Alekhin ad0ab4109a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-22 22:47:13 +00:00
Vadim Levin 373160ce00 Merge pull request #15973 from VadimLevin:dev/vlevin/video_capture_inf_loop
* Fix infinite loop when trying to change state of the busy camera

  - Add finite number of attempts in tryIoctl functions
    10 by default.

* Introduced new flag for ioctl call to handle EBUSY
2019-11-23 01:10:16 +03:00
Alexander Alekhin 50ac880335 Merge pull request #15971 from alalek:core_kmeans_handle_overflow 2019-11-22 21:36:02 +00:00
Natsu 54e6f5c237 Merge pull request #15970 from akemimadoka:master
* Fix android armv7 c++_static init crash

* core: move initialization of 'ios_base::Init' for Android
2019-11-22 18:42:25 +03:00
Alexander Alekhin 3266ac7667 core(kmeans): bailout if can't select cluster center 2019-11-22 14:40:02 +00:00
Alexander Alekhin ca28274895 Merge pull request #15968 from alalek:fix_msa_build 2019-11-21 17:36:10 +00:00
Alexander Alekhin ec55b6f6db core: fix MSA build 2019-11-21 18:59:41 +03:00
Alexander Alekhin 16ad53f354 Merge pull request #15962 from alalek:dnn_fix_ie_opencvlayer 2019-11-21 13:04:09 +00:00
Alexander Alekhin 86042af108 dnn: fix registration of custom OpenCVLayer
- do not require extensions library
2019-11-20 21:42:26 +00:00
Alexander Alekhin e459a5108c Merge pull request #15951 from alalek:python_reduce_code_size 2019-11-20 19:05:15 +00:00
Alexander Alekhin a2aa8db5a9 Merge pull request #15956 from lorenzolightsgdwarf:dnn_fix_tf_ssd 2019-11-20 15:43:32 +00:00
Everton Constantino 75315fb297 Merge pull request #15494 from everton1984:hal_vector_get_n
Improving VSX performance of integral function

* Adding support for vector get function on VSX datatypes so the
integral function gains a bit of performance.

* Removing get as a datatype member function and implementing a new HAL
instruction v_extract_n to get the n-th element of a vector register.

* Adding SSE/NEON/AVX intrinsics.

* Implement new HAL instruction v_broadcast_element on VSX/AVX/NEON/SSE.

* core(simd): add tests for v_extract_n/v_broadcast_element

- updated docs
- commented out code to repair compilation
- added WASM and MSA default implementations

* core(simd): fix compilation

- x86: avoid _mm256_extract_epi64/32/16/8 with MSVS 2015
- x86: _mm_extract_epi64 is 64-bit only

* cleanup
2019-11-20 13:41:07 +03:00
Lorenzo Lucignano c40fbad12e Samples DNN: tf_text_graph_sd.py loads box coder variance and box NMS params from config file 2019-11-20 10:45:57 +01:00
Alexander Alekhin a4d16acd00 Merge pull request #15950 from alalek:ffmpeg_update_master 2019-11-20 07:32:06 +00:00
Alexander Alekhin 5d96f984b1 python: reduce code size of cv2.cpp 2019-11-19 22:43:28 +00:00
Alexander Alekhin 744798aadd ffmpeg/4.x: update FFmpeg plugin 2019-11-19 22:04:44 +00:00
Alexander Alekhin 318cba4ce3 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-19 19:48:49 +00:00
Alexander Alekhin 9d14c0b37a Merge pull request #15939 from alalek:ffmpeg_update_3.4 2019-11-19 18:45:39 +00:00
Alexander Alekhin 2f636b4456 Merge pull request #15918 from alalek:python_debug_parameter 2019-11-19 18:39:56 +00:00
Alexander Alekhin e07a488012 Merge pull request #15925 from alalek:core_test_simd_cpp_emulation
core(test): extending tests with SIMD C++ emulation code (intrin_cpp.hpp)

* core(test): test SIMD CPP emulation code (intrin_cpp.hpp)

* core(simd): eliminate build warnings from intrin_cpp.hpp
2019-11-19 21:08:45 +03:00
Alexander Alekhin 77bf5593e5 Merge pull request #15946 from alalek:fix_js_test_features2d 2019-11-19 14:25:28 +00:00
Alexander Alekhin 26513285dd Merge pull request #15945 from alalek:dnn_ie_extension_handling 2019-11-19 14:25:12 +00:00
Alexander Alekhin de64db3064 Merge pull request #15919 from alalek:python_fix_arginfo 2019-11-19 13:24:58 +00:00
Alexander Alekhin cf93217365 Merge pull request #15935 from rgarnov:rg/fix_own_mat_empty 2019-11-19 11:08:19 +00:00
Alexander Alekhin ec8db970f9 js(test): update features2d test 2019-11-19 07:40:12 +00:00
Alexander Alekhin 09d54c9f52 dnn: update InferenceEngine extension handling 2019-11-19 06:55:14 +00:00
Alexander Alekhin d00eb451bf ffmpeg/3.4: update FFmpeg wrapper 2019-11-18 19:13:45 +00:00
Alexander Alekhin 3f431a16a3 videoio: fix ffmpeg wrapper build 2019-11-18 18:56:57 +00:00
Alexander Alekhin 593e240d7c Merge pull request #15938 from alalek:backport_15290 2019-11-18 18:26:00 +00:00
Alexander Alekhin fb9d59ab15 Merge pull request #15937 from clunietp:3.4-fix-13577 2019-11-18 18:23:48 +00:00
cudawarped aff8c9bd28 videoio: retrieve encoded frames through FFmpeg backend
- backport 15290
- add extra test case
2019-11-18 19:23:19 +03:00
cudawarped 0867e3188d Merge pull request #15290 from cudawarped:ffmpeg_raw_retrieve
Add retrieve encoded frame to VideoCapture

* Add capacity to retrieve the encoded frame from a VideoCapture object.

* Correct raw codec and pixle format output from ffmpeg capture.

* Remove warnings from build.

* Added VideoCaptureRaw subclass.

* Include abstract base class VideoCaptureBase and rename new subclass VideoContainer as suggested by mshabunin.

* Remove using.

* Change base class name for compatibility with jave bindings generator.

* Move grab and retrieve and add override specifier

* Add setRaw and readRaw to IVideoCapture interface
-setRaw to disable video decoding and enable bitstream filters from mp4 to h254 and h265.
-readRaw to return the raw undecoded/filtered bitstream.
Add createRawCapture to initiate a backend with setRaw enabled.
Remove inheritance and use an independant VideoContainer subclass with IVideoCapture member.

* Address unused parameter warings.
Remove VideoContainer from python bindings as it no longer returns a Mat.
Use opencv type uchar instead of unsigned char.
Add missing destructor to VideoContainer class.

* Address build warnings and include all params in documentation.

* Include deprecated bitstream filtering API.

* Update codec_id query to work with older ffmpeg api's.
Change api version defines to be consistent - most recent api version first.

* Fix typo.

* Update test to work with naming of new files in the extra repo

* Investigate test failure

* Check bytes read by ffmpeg

* Removed mp4 video container test

* Applied suggested changes.

* videoio: rework API for extraction of RAW video streams

- FFmpeg only

* address review comments
2019-11-18 17:07:06 +03:00
Ruslan Garnov 1261559305 Fixed own::Mat::empty() for non md case 2019-11-18 16:38:33 +03:00
clunietp 2185bce4b7 Fix 13577 2019-11-18 07:41:34 -05:00
Orest Chura af230ec133 Merge pull request #15888 from OrestChura:facebeautification_gapi_sample
Introducing the sample of Face Beautification algorithm implemented via Graph-API

* Introducing the sample of Face Beautification algorithm implemented via Graph-API
- 'gapi/samples/face_beautification.cpp' added
- FIXME added in 'gcpukernel.hpp'

* INF_ENGINE fix
- preprocessing clauses added not to run the sample without Inference Engine

* INF_ENGINE fix 2
- warnings removed

* Fixes
- checking IE version cut as there is no dependency
- some alignments fixed
- the comment about preprocessing commands fixed

* ie::backend() issue fix (according to dmatveev)
- as the sample needs the cv::gapi::ie::backend() to be defined regardless of having IE or not, there is its throw-error definition in `giebackend.cpp` now (by dmatveev)
- for the same reason, #includes in `giebackend.hpp` are fixed
- HAVE_INF_ENGINE check is removed from the sample
2019-11-18 15:13:05 +03:00
Alexander Alekhin fc41c18c6f Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-18 13:56:24 +03:00
Alexander Alekhin f4d55d512f imgproc: fix bit-exact GaussianBlur() / sepFilter2D() (#15855)
* imgproc: fix bit-exact GaussianBlur() / sepFilter2D()

- avoid kernels with bad approximation
- GaussiabBlur - apply error-diffusion approximation for kernel (8-bit fraction)

* java(test): update features2d ref data

* test: update test_facedetect
2019-11-18 01:39:27 +03:00
Suleyman TURKMEN eff514f8bb Update seamless_cloning.cpp 2019-11-17 21:25:03 +03:00
Sebastián Gurin 955b20230c Merge pull request #15503 from cancerberoSgx:js-test-puppeteer
Js test puppeteer

* run_puppeteer.js / tests

* js run test section

* rollback html

* whitespace

* js: update OpenCV.js tests infrastructure

* js: exclude puppeteer from default 'npm install'

* js: update notes

* js: more fixes in run_puppeteer

* fix build folder
2019-11-17 00:29:38 +03:00
Alexander Alekhin 686ea5c1a6 Merge pull request #15917 from ChipKerchner:demosaicingToHal2 2019-11-16 19:45:37 +00:00
Maxim Pashchenkov 1acadd363b Merge pull request #15100 from Volskig:cam_multiplexing_function_v
Implement Camera Multiplexing API

* IdideoCapture + two wrong function

function waitAny

Add errors catcher

Stub for Python added.

Sifting warnings

One test added

Two tests for camera and Perf tests added

* Perf sync and async tests for waitAny() added, waitAnyInterior() deleted, getDeviceHandle() deleted

* Variable OPENCV_TEST_CAMERA_LIST added

* Without fps set

* ASSERT_FAILED for environment variable

* Perf tests is DISABLED_

* --Trailing whitespace

* Return false from cap.cpp deleted

* Two functions deleted from interface, +range for, +environment variable in test_camera

* Space deleted

* printf deleted, perror added

* CV_WRAP deleted, cv2 cleared from stubs

* -- space

* default timeout added

* @param changed

* place of waitAny changed

* --whitespace

* ++function description

* function description changed

* revert unused changes

* videoio: rework API for VideoCapture::waitAny()
2019-11-15 19:42:12 +03:00
Alexander Alekhin 7ec91aefc1 python: force using of ArgInfo 2019-11-15 19:16:22 +03:00
Alexander Alekhin 973b367da6 python: emit bindings conversion failures on OPENCV_PYTHON_DEBUG=1 2019-11-15 18:55:24 +03:00
ChipKerchner 1d33335e33 Convert demosiacing with variable number of gradients to HAL - 5.5x faster 2019-11-15 07:42:03 -06:00
Alexander Alekhin 1f57eb93fd Merge pull request #15911 from l-bat:fix_reducel2 2019-11-15 11:04:05 +00:00
Alexander Alekhin ac2dc29525 Merge pull request #15852 from akhakim:gauss_blur_kernel_5x5 2019-11-14 14:55:24 +00:00
Alexander Alekhin 6773b938b3 Merge pull request #15896 from alalek:build_gcc_9 2019-11-14 14:22:02 +00:00
Alexander Alekhin d1c4e4b5a5 Merge pull request #15906 from anton-potapov:gapi_fluid_i420_support 2019-11-14 14:07:05 +00:00
Liubov Batanina ac4fd4f4ae Fix ReduceL2 2019-11-14 15:30:53 +03:00
Anna Khakimova beb14c70da GAPI Fluid: SIMD optimization for sep filters 5x5 kernel size (gaussBlur) 2019-11-14 13:42:20 +03:00
Alexander Alekhin 94f1c3d152 Merge pull request #15905 from alalek:issue_15904 2019-11-14 10:33:29 +00:00
Anton Potapov b5426a8679 G-API (Fluid) core support for I420
- Extended NV12 support in Fluid Core engine to cover I420
2019-11-14 11:16:17 +03:00
Alexander Alekhin ad8d7e84b9 Merge pull request #15900 from komakai:fix-osx-build 2019-11-13 17:02:08 +00:00
Sebastián Gurin b48959fa57 Merge pull request #15425 from cancerberoSgx:nodejs
JS - adds a tutorial about running opencv.js in Node.js
2019-11-13 18:14:53 +03:00
Alexander Alekhin 7a52a4c134 Merge pull request #15874 from akhakim:runsepfilter_5x5_kernel_size 2019-11-13 14:53:14 +00:00
Giles Payne 3cdbcc1645 Fix MacOS build 2019-11-13 21:10:08 +09:00
Alexander Alekhin 763b80d5fa imgproc(IPP): disable ippiDistanceTransform_3x3_8u32f_C1R 2019-11-13 14:14:19 +03:00
Alexander Alekhin d0c767428b Merge pull request #15891 from alalek:issue_15886 2019-11-12 22:57:15 +00:00
Alexander Alekhin a67248f386 Merge pull request #15883 from cbachhuber:refactor-opencl-information 2019-11-12 22:56:51 +00:00
Christoph Bachhuber c638f085aa Refactor for clarity and avoiding code duplication
Implement GArik's comments

Remove unnecessary c_str()

Fix brace position
2019-11-12 19:22:42 +01:00
Alexander Alekhin 7ecdcf6ca6 build: GCC9 compilation 2019-11-12 18:49:34 +03:00
Anna Khakimova 363976694e GAPI Fluid: The run_sepfilter() has logic error into handler for 5x5 and larger kernels 2019-11-12 14:47:42 +03:00
Alexander Alekhin b6a58818bb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-11 20:25:42 +00:00
Alexander Alekhin af92a517a7 cmake: set _WIN32_WINNT for Windows 7 API 2019-11-11 20:19:40 +00:00
Alexander Alekhin ba58bba4e8 Merge pull request #15875 from gyadam:fix-windows-install-doc 2019-11-10 09:35:59 +00:00
Alexander Alekhin e0b5637474 Merge pull request #15877 from mshabunin:fix-gst-relative-34 2019-11-10 09:25:29 +00:00
Alexander Alekhin d32d31577c Merge pull request #15835 from alalek:cmake_cpu_optimizations_fix_15802 2019-11-10 09:22:45 +00:00
Alexander Alekhin e9dcecf9b4 Merge pull request #15826 from alalek:cmake_fix_itt_define_condition 2019-11-10 09:22:22 +00:00
Maksim Shabunin fccf284088 Fixed relative paths handling in cap_gstreamer: 2019-11-09 11:34:30 +00:00
Lubov Batanina cfc781949d Merge pull request #15811 from l-bat:eltwise_div
Supported ONNX Squeeze, ReduceL2 and Eltwise::DIV

* Support eltwise div

* Fix test

* OpenCL support added

* refactoring

* fix code style

* Only squeeze with axes supported
2019-11-09 14:11:09 +03:00
Adam Gyarmati 3755099bd4 Fix Windows installation script error
Fix an error during Windows installation caused by trying to create the already existing Build directory. Also excluding intermediate steps for Install directory creation.
2019-11-08 19:05:46 -08:00
Alexander Alekhin af23375352 Merge pull request #15861 from dkurt:dnn_fix_get_input_layers 2019-11-08 22:01:07 +00:00
Alexander Alekhin 6053996253 Merge pull request #15319 from cancerberoSgx:fs 2019-11-08 13:20:09 +00:00
Sebastián Gurín dd9262c318 expose FS 2019-11-08 15:13:25 +03:00
collinbrake 35cebbd167 Merge pull request #15832 from collinbrake:feature_grammar_fixes_4
* Grammar fixes for python core operations docs

* fixed whitespace error

* reverted changes
2019-11-08 12:27:37 +03:00
Alexander Alekhin d66aa2e0ff Merge pull request #15848 from alalek:backport_test_15842 2019-11-07 16:48:41 +00:00
Alexander Alekhin 5dd3e6052e Merge pull request #15868 from alalek:issue_15857 2019-11-07 14:21:35 +00:00
Alexander Alekhin 3d47e043af Merge pull request #15866 from mshabunin:add-security-md 2019-11-07 14:04:33 +00:00
Alexander Alekhin 895fc72a0b Merge pull request #15867 from mshabunin:fix-gapi-install 2019-11-07 13:49:34 +00:00
Alexander Alekhin f42d5399aa core(persistence): add more checks for implementation limitations 2019-11-07 14:19:00 +03:00
Maksim Shabunin ad5874779c Install: added missing gapi headers 2019-11-07 14:03:46 +03:00
Maksim Shabunin d19bccad74 Added SECURITY.md 2019-11-07 13:10:42 +03:00
Dimitri Gerin 7c4158d8c2 Fix dnn::getLayerInputs 2019-11-07 08:13:33 +03:00
Alexander Alekhin c546a27de7 Merge pull request #15854 from czgdp1807:rem-typo 2019-11-06 13:47:37 +00:00
Alexander Smorkalov 377fcc062d Merge pull request #15159 from SSE4:fix_find_openexr 2019-11-06 13:37:37 +00:00
czgdp1807 07ef08e966 removed typo 2019-11-06 17:15:31 +05:30
SSE4 2e20f06f8e - fix FindOpenEXR to respect OPENEXR_ROOT
Signed-off-by: SSE4 <tomskside@gmail.com>
2019-11-06 17:26:52 +07:00
Alexander Alekhin 54d9597522 Merge pull request #15814 from i-murzov:3.4-ocl-cleanup 2019-11-06 09:54:29 +00:00
Alexander Alekhin f3e788b8ab Merge pull request #15813 from i-murzov:3.4-ocl-empty-platform 2019-11-06 08:12:40 +00:00
Igor Murzov cdbfdcc363 Fix OpenCL device detection when some OpenCL platform has no devices
It's not an error if some OpenCL platform has no devices. This makes
OpenCL device detection work correctly in the following scenario:

$ OPENCV_OPENCL_DEVICE=:GPU: ./opencv_test_dnn

OpenCV version: 4.1.2-dev
OpenCV VCS version: 4.1.2-80-g467748ee98-dirty
Build type: Debug
Compiler: /usr/bin/g++  (ver 7.4.0)
Parallel framework: pthreads
CPU features: SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?
Intel(R) IPP version: ippIP AVX2 (l9) 2019.0.0 Gold (-) Jul 24 2018
OpenCL Platforms:
    AMD Accelerated Parallel Processing
    Portable Computing Language
        CPU: pthread-AMD Ryzen 7 2700X Eight-Core Processor (OpenCL 1.2 pocl HSTR: pthread-x86_64-pc-linux-gnu-znver1)
    NVIDIA CUDA
        dGPU: GeForce GTX 1080 (OpenCL 1.2 CUDA)
Current OpenCL device:
    Type = dGPU
    Name = GeForce GTX 1080
    Version = OpenCL 1.2 CUDA
    Driver version = 430.26
2019-11-05 20:02:39 +03:00
Alexander Alekhin 417034518c Merge pull request #15851 from alalek:fixup_15842 2019-11-05 16:21:04 +00:00
Chip Kerchner 2112aa31e6 Merge pull request #15828 from ChipKerchner:momentsToHal
* Convert moments in tile algorithms to HAL (1.3x faster for VSX).

* Adding NEON code back in for non 64-bit platforms.

* Remove floats from post processing.
2019-11-05 18:52:35 +03:00
TH3CHARLie 2c2716de0f core(test): add test for YAML parse multiple documents
- added removal of temporary file
2019-11-05 18:39:07 +03:00
Alexander Alekhin dcf72e49e2 core(persistence): fix processing of multiple documents 2019-11-05 18:28:15 +03:00
Alexander Alekhin c4c4ac28dc revert changes in modules/core/src/persistence_yml.cpp (PR15842) 2019-11-05 18:24:16 +03:00
Igor Murzov 6d5b900324 Simplify OpenCL info dumping code:
* Reduce code nesting
* Drop redundant .c_str() calls
2019-11-05 14:49:49 +03:00
TH3CHARLie a165f55579 Merge pull request #15842 from TH3CHARLie:yaml-fix
* fix yaml parse

* add test for YAML parse multiple documents

* remove trailing whitespace in test
2019-11-04 16:27:48 +03:00
Alexander Alekhin 0d7f770996 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-11-04 09:58:29 +00:00
Oleg Alexandrov 53139e6ebe Merge pull request #15838 from oleg-alexandrov:patch-2
Correct stereoRectify documentation
2019-11-03 16:37:25 +03:00
Alexander Alekhin a893969ec9 core(simd): v_setall template 2019-11-03 12:49:25 +00:00
Alexander Alekhin d5bbb16066 Merge pull request #15834 from berak:python_fix_type_error 2019-11-02 18:50:46 +00:00
Alexander Alekhin 21c38bbdaf cmake(cpu optmizations): fix cleanup of OPENCV_DEPENDANT_TARGETS_* vars 2019-11-02 10:34:54 +00:00
berak b7c8e9e874 python: fix type error msg 2019-11-02 08:17:07 +01:00
Gael Colas e65b51ca3c Merge pull request #15821 from ColasGael:colasg-viz-color
Fix wrong definition of viz::Color::navy()
2019-11-01 22:37:34 +03:00
Oleg Alexandrov d56535afce Merge pull request #15820 from oleg-alexandrov:patch-1
Clarify stereoRectify() doc

The function stereoRectify() takes as input a coordinate transform between two cameras. It is ambiguous how it goes. I clarified that it goes from the second camera to the first.
2019-11-01 22:34:11 +03:00
yuriyluxriot 4e156a162f Merge pull request #15812 from yuriyluxriot:fls_replaces_tls
* Use FlsAlloc/FlsFree/FlsGetValue/FlsSetValue instead of TlsAlloc/TlsFree/TlsGetValue/TlsSetValue to implment TLS value cleanup when thread has been terminated on Windows Vista and above

* Fix 32-bit build

* Fixed calling convention of cleanup callback

* WINAPI changed to NTAPI

* Use proper guard macro
2019-11-01 22:33:12 +03:00
Chip Kerchner ed7e4273cd Merge pull request #15555 from ChipKerchner:flipVectorize
* Vectorize flipHoriz and flipVert functions.

* Change v_load_mirror_1 to use vec_revb for VSX

* Only use vec_revb in ISA3.0

* Removing vec_revb code since some of the older compilers don't fully support it.

* Use new v_reverse intrinsic and cleanup code.

* Ensure there are no alignment issues with copies
2019-11-01 22:30:48 +03:00
Alexander Alekhin 0ca5f68d72 Merge pull request #15831 from alalek:fix_pylint_master 2019-11-01 19:07:15 +03:00
Alexander Alekhin 48073e6d95 pylint: eliminate warnings 2019-11-01 18:59:35 +03:00
Alexander Alekhin 657c17bb8c cmake: fix ITT define condition 2019-11-01 15:07:49 +03:00
Alexander Alekhin cec7cc037b Merge pull request #15819 from alalek:ts_unblock_reporting_of_disabled_tests 2019-10-31 20:39:41 +00:00
Alexander Alekhin 5c12bafe80 Merge pull request #15805 from i-murzov:3.4 2019-10-31 20:39:16 +00:00
Ciprian Alexandru Pitis d2e02779c4 Merge pull request #15799 from Cpitis:feature/parallelization
Parallelize pyrDown & calcSharrDeriv

* ::pyrDown has been parallelized

* CalcSharrDeriv parallelized

* Fixed whitespace

* Set granularity based on amount of threads enabled

* Granularity changed to cv::getNumThreads, now each thread should receive 1/n sized stripes

* imgproc: move PyrDownInvoker<CastOp>::operator() implementation

* imgproc(pyramid): remove syloopboundary()

* video: SharrDerivInvoker replace 'Mat*' => 'Mat&' fields
2019-10-31 23:38:49 +03:00
CJ Smith c2f2ea6b85 Merge pull request #15789 from CJSmith-0141:15779-scale-bug-in-stereo-match-sample
* Changes disparity image to float representation

Signed-off-by: Connor James Smith <cjs.connor.smith@gmail.com>

* samples: update disparity multiplier handling in stereo_match.cpp
2019-10-31 22:29:04 +03:00
Oleg Alexandrov af433d0352 Merge pull request #15780 from oleg-alexandrov:master
* Doc bugfix

The documentation page StereoBinaryBM and StereoBinarySGBM says that it returns a disparity that is scaled multiplied by 16. This scaling must be undone before calling reprojectImageTo3D, otherwise the results are wrong. The function reprojectImageTo3D() could do this scaling internally, maybe, but at least the documentation must explain that this has to be done.

* calib3d: update reprojectImageTo3D documentation

* calib3d: add StereoBM/StereoSGBM into notes list
2019-10-31 22:28:01 +03:00
Alexander Alekhin ee044771a7 Merge pull request #15478 from terfendail:wintr_stereosgbm 2019-10-31 19:24:06 +00:00
Dizhenin Vlad edc5518f68 Merge pull request #15608 from SimpleVlad:3.4
* Add flags for build js

* Add poi.json

* Rebase whitelist into JSON file

* Rework generator of white_list

* Fix small typos

* Transfer opencv_js.josn in opencv_js.config.py

* Edit OPENCV_JS_WHITELIST

* Write comment

* Add description

* Fix typos in desc

* flag's append deleeted

* Fix whitespace

* variable deleted

* fix comment on lines 229 and 235
2019-10-31 22:09:33 +03:00
Alexander Alekhin 79f792ad05 ts: do not block reporting of launched "DISABLED_" tests
If tests are run through GTest option `--gtest_also_run_disabled_tests`
2019-10-31 15:13:50 +03:00
Alexander Alekhin 469addeca3 Merge pull request #15763 from akhakim:dynamic_set_kernel_window_size 2019-10-31 11:10:45 +00:00
Anna Khakimova c394847c35 GAPI Fluid: Dynamic window size 2019-10-30 17:09:54 +03:00
atalaman ea64bb58a5 Merge pull request #15751 from TolyaTalamanov:at/refactor-render-tests
* Refactor render tests

* Fix comment to review

* Move ocv render tests stuff to specific file

* Add OCV prefix for render tests

* Fix comments to review
2019-10-30 13:33:39 +03:00
Igor Murzov a9d23a6479 Fix wording in some tutorials 2019-10-30 13:27:17 +03:00
Alexander Alekhin ea5499fa51 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-10-29 20:46:51 +00:00
Alexander Alekhin bad4e5c3eb Merge pull request #15692 from alalek:core_tls_handle_thread_termination 2019-10-29 20:40:35 +00:00
Alexander Alekhin e86c888a92 Merge pull request #15791 from alalek:android_camera2_issue_14915 2019-10-29 19:10:00 +00:00
Chip Kerchner a71ff50130 Merge pull request #15623 from ChipKerchner:optimizeHOGpipeline
* Use circular lut hustory buffer in computeGradient of HOG

* Initialize prefetch data outside main loop.  Avoid code duplication.
2019-10-29 13:42:20 +03:00
Alexander Alekhin 278b4ca40c Merge pull request #15800 from alalek:issue_15796 2019-10-28 20:11:36 +00:00
Alexander Alekhin cd6d79d106 gapi: fix opencv_world build 2019-10-28 18:53:14 +00:00
Alexander Alekhin 80c4cedd25 android: use .getRowStride() in JavaCamera2View 2019-10-28 18:45:56 +00:00
Alexander Alekhin 02f4d6ca53 Merge pull request #15777 from dbudniko:dbudniko/add_own_empty 2019-10-28 13:31:16 +00:00
Alexander Alekhin 732657cc46 Merge pull request #15793 from Cherubin7th:3.4 2019-10-27 22:45:19 +00:00
André Lippok 86a8ff6129 Fixed typo in assertion 2019-10-27 17:43:31 +01:00
Alexander Alekhin d8ab83600b Merge pull request #15761 from alalek:core_trace_itt_parameter 2019-10-26 21:39:08 +00:00
Alexander Alekhin 6ec5ae0215 core(trace): add ITT control parameter
- OPENCV_TRACE_ITT_ENABLE
2019-10-26 15:03:51 +00:00
Dmitry Budnikov 8dfba51884 add empty implementation 2019-10-25 17:50:09 +03:00
Alexander Alekhin 7cf1054d36 Merge pull request #15764 from ChipKerchner:demosaicingToHal 2019-10-25 13:49:46 +00:00
Vitaly Tuzov 42b1d04999 StereoSGBM algorithm updated to use wide universal intrinsics 2019-10-25 16:34:16 +03:00
Alexander Alekhin 055ffc0425 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-10-24 18:21:19 +00:00
Alexander Alekhin eabe679f78 Merge pull request #15770 from terfendail:stereobm_fix 2019-10-24 17:58:22 +00:00
Vitaly Tuzov 1ce5a724c7 Fixed StereoBM uniqueness check 2019-10-24 17:54:49 +03:00
Alexander Alekhin d65fead337 Merge pull request #15752 from dkurt:fix_15750 2019-10-24 07:06:32 +00:00
Alexander Alekhin 17e2bf5717 core(tls): implement releasing of TLS on thread termination
- move TLS & instrumentation code out of core/utility.hpp
- (*) TLSData lost .gather() method (to dispose thread data on thread termination)
- use TLSDataAccumulator for reliable collecting of thread data
- prefer using of .detachData() + .cleanupDetachedData() instead of .gather() method

(*) API is broken: replace TLSData => TLSDataAccumulator if gather required
(objects disposal on threads termination is not available in accumulator mode)
2019-10-24 06:36:18 +00:00
Alexander Alekhin 87a692b89e Merge pull request #15736 from akhakim:fix_for_ADE-859_using_namespace_cv_G_TYPED_KERNEL_fail_c++ 2019-10-23 17:07:32 +00:00
Alexander Alekhin 5e8d8df847 Merge pull request #15754 from float13:patch-1 2019-10-23 17:02:22 +00:00
ChipKerchner c46f119e0e Convert demosaic functions to HAL 2019-10-23 10:47:07 -05:00
Alexander Alekhin 09619c1c45 Merge pull request #15762 from rgarnov:return_exported_mkdatanode 2019-10-23 12:05:28 +00:00
float13 1accf3b3f4 Tutorial - Make required input args positional.
I think it would help to change all 3 of the the input file arguments to be "positional" for consistency with the other tutorials. This also simplifies the command line input to run this tutorial by reducing typing, and helpfully prints the "usage" info if any of the 3 required inputs are missing.

I'm new to OpenCV and working through the tutorials. I kept getting runtime errors with this one until I realized that the arguments weren't positional, and I was missing the "--input1", "--input2, "--input3" flags preceding the filenames. All of the previous tutorials had required filenames as positional arguments and didn't require this.

The original code would require each input to be specified like this:
./compareHist_Demo --input1 filename1 --input2 filename2 --input3 filename3 

But with this change, the above command is simplified to:
./compareHist_Demo  filename1 filename2 filename3

This avoids a confusing runtime error to make things simpler for newcomers like me :)
2019-10-23 13:07:52 +03:00
Anna Khakimova 8bf5bed0a9 GAPI:Fix for using cv makes G_TYPED_KERNEL fail 2019-10-23 12:17:49 +03:00
Alexander Alekhin 5ffeebabad Merge pull request #15759 from alalek:issue_15758 2019-10-22 21:40:10 +00:00
Ruslan Garnov e89c1103ff Returned GModel::mkDataNode() overload for external backends 2019-10-22 18:57:31 +03:00
Chip Kerchner 5a6a49405d Merge pull request #15738 from ChipKerchner:bugInt64x2Comparison
Fixing bug with comparison of v_int64x2 or v_uint64x2

* Casting v_uint64x2 to v_float64x2 and comparing does NOT work in all cases.  Rewrite using epi64 instructions - faster too.

* Fix bad merge.

* Fix equal comparsion for non-SSE4.1. Add test cases for v_int64x2 comparisons.

* Try to fix merge conflict.

* Only test v_int64x2 comparisons if CV_SIMD_64F

* Fix compiler warning.
2019-10-22 16:37:20 +03:00
Alexander Alekhin fe4f27b99b gapi: fix build
- gcc 4.8.4 (ARMv7)
2019-10-22 16:31:40 +03:00
Alexander Alekhin 1864b64f64 Merge pull request #15739 from dkurt:darknet_shortcut_asymm 2019-10-22 12:52:13 +00:00
Alexander Alekhin 4bd2ad30c4 Merge pull request #15756 from dankamongmen:dankamongmen/stitching_surf_default 2019-10-22 12:51:30 +00:00
nick black 6e9eca29e2 stitching_detailed: use correct match_conf default
The usage function states that the default for match_conf is
0.65 if the default SURF feature finder is used, and 0.3 for
orbs. Indeed, if --feature orbs is used, match_conf is set
to 0.3f. This is a NOP, because the real default is also set
to 0.3f. Change it to 0.65f when SURF is in play.
2019-10-22 08:03:46 -04:00
anton-potapov 471b40040a Merge pull request #15735 from anton-potapov:gapi_async_documentaion
* G-API: Doxygen documentatation for Async API

* G-API: Doxygen documentatation for Async API

 - renamed local variable (reading parameter async) async ->
asyncNumReq in object_detection DNN sample
to avoid Doxygen erroneous linking the sample to cv::gapi::wip::async
documentation
2019-10-21 22:33:18 +03:00
Dmitry Kurtaev dfe0368835 Fix custom IE layers in case of no MKLDNN plugin 2019-10-21 19:09:44 +03:00
Yashas Samaga B L 613c12e590 Merge pull request #14827 from YashasSamaga:cuda4dnn-csl-low
CUDA backend for the DNN module

* stub cuda4dnn design

* minor fixes for tests and doxygen

* add csl public api directory to module headers

* add low-level CSL components

* add high-level CSL components

* integrate csl::Tensor into backbone code

* switch to CPU iff unsupported; otherwise, fail on error

* add fully connected layer

* add softmax layer

* add activation layers

* support arbitary rank TensorDescriptor

* pass input wrappers to `initCUDA()`

* add 1d/2d/3d-convolution

* add pooling layer

* reorganize and refactor code

* fixes for gcc, clang and doxygen; remove cxx14/17 code

* add blank_layer

* add LRN layer

* add rounding modes for pooling layer

* split tensor.hpp into tensor.hpp and tensor_ops.hpp

* add concat layer

* add scale layer

* add batch normalization layer

* split math.cu into activations.cu and math.hpp

* add eltwise layer

* add flatten layer

* add tensor transform api

* add asymmetric padding support for convolution layer

* add reshape layer

* fix rebase issues

* add permute layer

* add padding support for concat layer

* refactor and reorganize code

* add normalize layer

* optimize bias addition in scale layer

* add prior box layer

* fix and optimize normalize layer

* add asymmetric padding support for pooling layer

* add event API

* improve pooling performance for some padding scenarios

* avoid over-allocation of compute resources to kernels

* improve prior box performance

* enable layer fusion

* add const layer

* add resize layer

* add slice layer

* add padding layer

* add deconvolution layer

* fix channelwise  ReLU initialization

* add vector traits

* add vectorized versions of relu, clipped_relu, power

* add vectorized concat kernels

* improve concat_with_offsets performance

* vectorize scale and bias kernels

* add support for multi-billion element tensors

* vectorize prior box kernels

* fix address alignment check

* improve bias addition performance of conv/deconv/fc layers

* restructure code for supporting multiple targets

* add DNN_TARGET_CUDA_FP64

* add DNN_TARGET_FP16

* improve vectorization

* add region layer

* improve tensor API, add dynamic ranks

1. use ManagedPtr instead of a Tensor in backend wrapper
2. add new methods to tensor classes
  - size_range: computes the combined size of for a given axis range
  - tensor span/view can be constructed from a raw pointer and shape
3. the tensor classes can change their rank at runtime (previously rank was fixed at compile-time)
4. remove device code from tensor classes (as they are unused)
5. enforce strict conditions on tensor class APIs to improve debugging ability

* fix parametric relu activation

* add squeeze/unsqueeze tensor API

* add reorg layer

* optimize permute and enable 2d permute

* enable 1d and 2d slice

* add split layer

* add shuffle channel layer

* allow tensors of different ranks in reshape primitive

* patch SliceOp to allow Crop Layer

* allow extra shape inputs in reshape layer

* use `std::move_backward` instead of `std::move` for insert in resizable_static_array

* improve workspace management

* add spatial LRN

* add nms (cpu) to region layer

* add max pooling with argmax ( and a fix to limits.hpp)

* add max unpooling layer

* rename DNN_TARGET_CUDA_FP32 to DNN_TARGET_CUDA

* update supportBackend to be more rigorous

* remove stray include from preventing non-cuda build

* include op_cuda.hpp outside condition #if

* refactoring, fixes and many optimizations

* drop DNN_TARGET_CUDA_FP64

* fix gcc errors

* increase max. tensor rank limit to six

* add Interp layer

* drop custom layers; use BackendNode

* vectorize activation kernels

* fixes for gcc

* remove wrong assertion

* fix broken assertion in unpooling primitive

* fix build errors in non-CUDA build

* completely remove workspace from public API

* fix permute layer

* enable accuracy and perf. tests for DNN_TARGET_CUDA

* add asynchronous forward

* vectorize eltwise ops

* vectorize fill kernel

* fixes for gcc

* remove CSL headers from public API

* remove csl header source group from cmake

* update min. cudnn version in cmake

* add numerically stable FP32 log1pexp

* refactor code

* add FP16 specialization to cudnn based tensor addition

* vectorize scale1 and bias1 + minor refactoring

* fix doxygen build

* fix invalid alignment assertion

* clear backend wrappers before allocateLayers

* ignore memory lock failures

* do not allocate internal blobs

* integrate NVTX

* add numerically stable half precision log1pexp

* fix indentation, following coding style,  improve docs

* remove accidental modification of IE code

* Revert "add asynchronous forward"

This reverts commit 1154b9da9da07e9b52f8a81bdcea48cf31c56f70.

* [cmake] throw error for unsupported CC versions

* fix rebase issues

* add more docs, refactor code, fix bugs

* minor refactoring and fixes

* resolve warnings/errors from clang

* remove haveCUDA() checks from supportBackend()

* remove NVTX integration

* changes based on review comments

* avoid exception when no CUDA device is present

* add color code for CUDA in Net::dump
2019-10-21 14:28:00 +03:00
Alexander Alekhin 8ec6544624 Merge pull request #15747 from TH3CHARLie:imshow-fix 2019-10-20 13:08:40 +00:00
Alexander Alekhin a8d14e88fe Merge pull request #15743 from collinbrake:feature_grammar_fixes_2 2019-10-20 13:08:28 +00:00
Alexander Alekhin 6576e8b927 Merge pull request #14518 from SSteve:intersectConvexConvex-example 2019-10-20 13:06:27 +00:00
Steve Nicholson acb3b3bd4d Add documentation and example program for intersectConvexConvex 2019-10-19 22:08:07 -07:00
TH3CHARLie da0fec7308 fix incorrect imshow behavior 2019-10-19 20:34:18 +08:00
Dmitry Kurtaev af61a15839 Fix Darknet eltwise 2019-10-19 12:54:15 +03:00
collin 3ada597449 grammar corrections for python gui docs 2019-10-18 17:42:56 -04:00
Alexander Alekhin 938d8dce06 Merge pull request #15685 from pmur:cnz64f-simd 2019-10-18 20:19:40 +00:00
Alexander Alekhin 6e85e852d4 Merge pull request #15740 from xerus:fix_typo 2019-10-18 18:41:35 +00:00
Alexander Alekhin 70a5553499 Merge pull request #15741 from mipsopen-fwu:issue_15730 2019-10-18 18:40:25 +00:00
Fei Wu 90af2835a2 Fix issue 15730. 2019-10-19 00:36:18 +08:00
Pavel Grunt 83e2e124a3 OpenCVFindMKL: Fix a typo 2019-10-18 18:33:06 +02:00
Dmitry Matveev 2477103707 Merge pull request #15216 from dmatveev:dm/ng-0010-g-api-streaming-api
* G-API-NG/Streaming: Introduced a Streaming API

Now a GComputation can be compiled in a special "streaming" way
and then "played" on a video stream.

Currently only VideoCapture is supported as an input source.

* G-API-NG/Streaming: added threading & real streaming

* G-API-NG/Streaming: Added tests & docs on Copy kernel

- Added very simple pipeline tests, not all data types are covered yet
  (in fact, only GMat is tested now);
- Started testing non-OCV backends in the streaming mode;
- Added required fixes to Fluid backend, likely it works OK now;
- Added required fixes to OCL backend, and now it is likely broken
- Also added a UMat-based (OCL) version of Copy kernel

* G-API-NG/Streaming: Added own concurrent queue class

- Used only if TBB is not available

* G-API-NG/Streaming: Fixing various issues

- Added missing header to CMakeLists.txt
- Fixed various CI issues and warnings

* G-API-NG/Streaming: Fixed a compile-time GScalar queue deadlock

- GStreamingExecutor blindly created island's input queues for
  compile-time (value-initialized) GScalars which didn't have any
  producers, making island actor threads wait there forever

* G-API-NG/Streaming: Dropped own version of Copy kernel

One was added into master already

* G-API-NG/Streaming: Addressed GArray<T> review comments

- Added tests on mov()
- Removed unnecessary changes in garray.hpp

* G-API-NG/Streaming: Added Doxygen comments to new public APIs

Also fixed some other comments in the code

* G-API-NG/Streaming: Removed debug info, added some comments & renamed vars

* G-API-NG/Streaming: Fixed own-vs-cv abstraction leak

- Now every island is triggered with own:: (instead of cv::)
  data objects as inputs;
- Changes in Fluid backend required to support cv::Mat/Scalar were
  reverted;

* G-API-NG/Streaming: use holds_alternative<> instead of index/index_of test

- Also fixed regression test comments
- Also added metadata check comments for GStreamingCompiled

* G-API-NG/Streaming: Made start()/stop() more robust

- Fixed various possible deadlocks
- Unified the shutdown code
- Added more tests covering different corner cases on start/stop

* G-API-NG/Streaming: Finally fixed Windows crashes

In fact the problem hasn't been Windows-only.
Island thread popped data from queues without preserving the Cmd
objects and without taking the ownership over data acquired so when
islands started to process the data, this data may be already freed.

Linux version worked only by occasion.

* G-API-NG/Streaming: Fixed (I hope so) Windows warnings

* G-API-NG/Streaming: fixed typos in internal comments

- Also added some more explanation on Streaming/OpenCL status

* G-API-NG/Streaming: Added more unit tests on streaming

- Various start()/stop()/setSource() call flow combinations

* G-API-NG/Streaming: Added tests on own concurrent bounded queue

* G-API-NG/Streaming: Added more tests on various data types, + more

- Vector/Scalar passed as input;
- Vector/Scalar passed in-between islands;
- Some more assertions;
- Also fixed a deadlock problem when inputs are mixed (1 constant, 1 stream)

* G-API-NG/Streaming: Added tests on output data types handling

- Vector
- Scalar

* G-API-NG/Streaming: Fixed test issues with IE + Windows warnings

* G-API-NG/Streaming: Decoupled G-API from videoio

- Now the core G-API doesn't use a cv::VideoCapture directly,
  it comes in via an abstract interface;
- Polished a little bit the setSource()/start()/stop() semantics,
  now setSource() is mandatory before ANY call to start().

* G-API-NG/Streaming: Fix STANDALONE build (errors brought by render)
2019-10-18 19:29:58 +03:00
Dmitry Kurtaev adbd613660 Enable Eltwise layer with different numbers of inputs channels 2019-10-18 18:51:52 +03:00
Alexander Alekhin 849d8d31fe Merge pull request #15737 from alalek:issue_15705 2019-10-18 14:52:26 +00:00
Alexander Alekhin 24ebca5c59 core(simd): v_reverse() for MSA backend 2019-10-18 16:43:03 +03:00
Alexander Alekhin ead7d6d80f Merge pull request #15716 from alalek:javadoc_fix 2019-10-17 22:35:14 +00:00
Alexander Alekhin 34df28db2b Merge pull request #15180 from terfendail:wintr_stereobm 2019-10-17 20:18:30 +00:00
atalaman 2ff12c4981 Merge pull request #15699 from TolyaTalamanov:at/graph-ocv-render-backend-skeleton
G-API: Implement OpenCV render backend

* Implement render opencv backend

* Fix comment to review

* Add comment

* Add wrappers for kernels

* Fix comments to review

* Fix comment to review
2019-10-17 21:04:03 +03:00
Alexander Alekhin a2b3cd9a2c Merge pull request #15709 from alalek:js_simd_reverse 2019-10-17 13:14:50 +00:00
Alexander Alekhin d31da08d43 Merge pull request #15708 from alalek:js_simd_support_1.38.48 2019-10-17 13:14:34 +00:00
Alexander Alekhin 17e9fde75a Merge pull request #15718 from alalek:pylint_warnings 2019-10-17 10:46:03 +00:00
Alexander Smorkalov 692e1eccb6 Merge pull request #15720 from alalek:cmake_fix_uwp 2019-10-17 10:35:27 +00:00
Alexander Smorkalov 009f5f74ef Merge pull request #15722 from jasjuang:3.4 2019-10-17 10:19:47 +00:00
jasjuang 4c7db02925 document CC_STAT_MAX in ConnectedComponentsTypes 2019-10-16 17:22:25 -07:00
Alexander Alekhin c4e2e17b0c cmake: fix UWP scripts path 2019-10-16 21:42:31 +00:00
Alexander Alekhin 9255df44d0 Merge pull request #15715 from adamrankin:patch-1 2019-10-16 18:52:10 +00:00
Alexander Alekhin 0e40c8a031 fix pylint warnings
pylint 1.8.3
2019-10-16 18:49:33 +03:00
Alexander Alekhin 86e7d82418 javadoc: fix generation with OpenJDK 11 2019-10-16 18:14:07 +03:00
Adam Rankin 3b070517ad COMP: Enabling build with recent VTK version
VTK_MAJOR_VERSION not found unless header is included
2019-10-16 10:04:41 -04:00
Alexander Alekhin ad5d14ec0e Merge pull request #15701 from alalek:issue_15691 2019-10-16 11:13:07 +00:00
Alexander Alekhin bce653117f Merge pull request #15700 from alalek:issue_12943 2019-10-16 11:12:49 +00:00
Christoph Schmidt-Hieber 194304bbe4 Support software triggering aravis cameras
If an aravis camera is software triggered, a trigger needs to be explicitly sent using `arv_camera_software_trigger`, otherwise the camera will not grab any frames.
2019-10-16 10:59:43 +02:00
Alexander Alekhin ad172726c0 js(simd): v_reverse implementation 2019-10-15 18:46:08 +03:00
Alexander Alekhin cc9b199ecb Merge pull request #15704 from alalek:gapi_avoid_dynamic_initializers_in_optimized_code 2019-10-15 15:22:09 +00:00
Alexander Alekhin b1a8de0901 js(simd): support Emscripten 1.38.48-upstream 2019-10-15 15:39:22 +03:00
Alexander Alekhin 823884b064 core(alloc): force initialization of memalign flag
- before main() launch
2019-10-15 13:07:11 +03:00
Alexander Alekhin a84969bdcd gapi: avoid dynamic initialization in dispatched files 2019-10-14 23:07:57 +00:00
Alexander Alekhin 6a7d1c15d3 core(ipp): skip huge input in flip()
- IPP/SSE4.2 works well
2019-10-14 18:26:19 +03:00
Alexander Alekhin 823e767eed Merge pull request #15684 from OrestChura:id_helper_class_semicolon_issue 2019-10-14 09:46:41 +00:00
Alexander Alekhin e42560bed5 Merge pull request #15659 from malfet:use-atomic-in-getExpTab32f 2019-10-12 20:27:58 +00:00
Alexander Alekhin d6630ab35b Merge pull request #15655 from malfet:use-atomic-in-parallel-for 2019-10-12 20:26:15 +00:00
Alexander Smorkalov d154fa4b4c Merge pull request #15688 from JamesNewton:3.4 2019-10-12 18:05:55 +00:00
JamesNewton 47fc889df0 Update js_image_arithmetics.markdown 2019-10-11 10:07:22 -07:00
Chip Kerchner 027769bf5d Merge pull request #15662 from ChipKerchner:addVReverseIntrinsic
* New v_reverse HAL intrinsic for reversing the ordering of a vector

* Fix conflict.

* Try to resolve conflict again.

* Try one more time.

* Add _MM_SHUFFLE. Remove non-vectorize code in SSE2. Fix copy and paste issue with NEON.

* Change v_uint16x8 SSE2 version to use shuffles
2019-10-11 18:34:17 +03:00
Everton Constantino 9ca9249992 Merge pull request #15527 from everton1984:faster_acc
* Adding support for vectorized masking for uchar/ushort.

* Fixing bug where mask was zeroing the dst. Improved the way to calculate
the mask and tweaked for further performance improvements.

* Fixing mask comparison test.

* Restricting to one channel.

* Adding support for 3 channels, switch old approach to start using HAL's
v_select.
2019-10-11 18:32:59 +03:00
Paul E. Murphy ec91a3d59d core: vectorize countNonZero64f
Improves performance a bit. 2.2x on P9 and 2 - 3x on coffee lake
x86-64.
2019-10-11 09:02:46 -05:00
Alexander Alekhin 2f30c3fd4f Merge pull request #15681 from mshabunin:fix-gapi-ie-test 2019-10-11 13:12:45 +00:00
OrestChura 2f9351d995 Fix warning issue:
- unnecessary extra semicolon after member function definition removed
2019-10-10 18:48:27 +03:00
Maksim Shabunin 230e44b01d G-API: removed deprecated IE call from test 2019-10-10 12:58:59 +03:00
Alexander Alekhin 46206b4814 Merge tag '4.1.2' 2019-10-09 23:01:31 +00:00
Alexander Alekhin 4c71dbf0af release: OpenCV 4.1.2
OpenCV 4.1.2
2019-10-09 22:53:14 +00:00
Alexander Alekhin 0cf77c3916 Merge tag '4.1.2-openvino' 2019-10-09 22:52:29 +00:00
Alexander Alekhin 9efafc3e33 Merge pull request #15673 from TolyaTalamanov:at/fix-valgrind-issue 2019-10-09 22:48:24 +00:00
Alexander Alekhin 65573784c4 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-10-09 19:46:18 +00:00
Alexander Alekhin dd4f591d54 Merge tag '3.4.8' 2019-10-09 18:33:35 +03:00
Alexander Alekhin 6bdb9ca725 OpenCV release (3.4.8)
OpenCV 3.4.8
2019-10-09 14:42:29 +03:00
Maksim Shabunin 1ca74c3c03 Merge pull request #15544 from mshabunin:disable_posix_memalign
* Disable posix_memalign by default

* core: fix memalign parameter handling
2019-10-09 14:06:12 +03:00
Alexander Smorkalov c3a588037a Merge pull request #15666 from seanm:Wnewline 2019-10-09 11:04:44 +00:00
Talamanov, Anatoliy 40215f99d7 Define operator<< for cv::gapi::wip::draw::Prim 2019-10-09 13:41:36 +03:00
Marcin Tolysz 3fd36c1be1 Merge pull request #15658 from tolysz:patch-1
* Cuda + OpenGL on ARM

There might be multiple ways of getting OpenCV compile on Tegra (NVIDIA Jetson) platform, but mainly they modify CUDA(8,9,10...) source code, this one fixes it for all installations. 
( https://devtalk.nvidia.com/default/topic/1007290/jetson-tx2/building-opencv-with-opengl-support-/post/5141945/#5141945 et al.).
This way is exactly the same as the one proposed but the code change happens in OpenCV.

* Updated,
The link provided mentions: cuda8 + 9, I have cuda 10 + 10.1 (and can confirm it is still defined this way).
NVIDIA is probably using some other "secret" backend with Jetson.
2019-10-09 11:38:10 +03:00
Sean McBride 24effe8cd6 Fixed clang -Wnewline-eof warning by adding newline to end of file 2019-10-09 10:12:09 +03:00
Alexander Alekhin 2ff1fb60ad Merge pull request #15661 from alalek:fix_android_build_avx2 2019-10-08 23:36:26 +00:00
Alexander Alekhin 374d952e09 Merge pull request #15664 from alalek:build_eliminate_cuda_warnings 2019-10-08 15:27:54 +00:00
Alexander Alekhin 6efdfee3f0 build: eliminate CUDA warnings 2019-10-08 15:30:02 +03:00
Alexander Alekhin 42ac089e12 build: update AVX2 check
- _mm256_bslli_epi128() works in GCC 4.9.3+ only
- Android NDK r10 doesn't support this instruction
2019-10-08 13:12:02 +03:00
Pinaev Danil 9ab5e52f04 Merge pull request #15632 from aDanPin:dp/any_ref_tests
* Add a few more tests on `any`

Added tests:
- get_ref_to_val_from_any
- update_val_via_ref

* Style fix
2019-10-08 12:42:49 +03:00
Nikita Shulga ec37364762 Use std::atomic in getExpTab32f and getLogTab32f
Reads and writes to volatile bool are not guaranteed to be atomic.
2019-10-07 16:35:07 -07:00
Nikita Shulga 23288b7cb5 Use atomic operations to modify flagNestedParallelFor
This ensures uniform behavior on any C++11 compliant compiler
2019-10-07 16:26:30 -07:00
Alexander Alekhin 4748aca61f Merge pull request #15642 from alalek:issue_15597 2019-10-08 00:33:20 +03:00
Sayed Adel f2fe6f40c2 Merge pull request #15510 from seiko2plus:issue15506
* core: rework and optimize SIMD implementation of dotProd

  - add new universal intrinsics v_dotprod[int32], v_dotprod_expand[u&int8, u&int16, int32], v_cvt_f64(int64)
  - add a boolean param for all v_dotprod&_expand intrinsics that change the behavior of addition order between
    pairs in some platforms in order to reach the maximum optimization when the sum among all lanes is what only matters
  - fix clang build on ppc64le
  - support wide universal intrinsics for dotProd_32s
  - remove raw SIMD and activate universal intrinsics for dotProd_8
  - implement SIMD optimization for dotProd_s16&u16
  - extend performance test data types of dotprod
  - fix GCC VSX workaround of vec_mule and vec_mulo (in little-endian it must be swapped)
  - optimize v_mul_expand(int32) on VSX

* core: remove boolean param from v_dotprod&_expand and implement v_dotprod_fast&v_dotprod_expand_fast

  this changes made depend on "terfendail" review
2019-10-07 22:01:35 +03:00
Alexander Alekhin 7837ae0e19 Merge pull request #15654 from sturkmen72:patch-3 2019-10-07 16:15:04 +00:00
Alexander Alekhin a007220c52 imgproc: update histogram test 2019-10-07 15:06:43 +03:00
Alexander Alekhin ebb77bb311 Merge pull request #15653 from tolysz:patch-1 2019-10-07 12:04:13 +00:00
Marcin Tolysz 53400d86e2 Fix compiler warnings for latest cuda npp which defines this itself as:
```
#define NPP_VER_MAJOR 10
#define NPP_VER_MINOR 2
#define NPP_VER_PATCH 0
#define NPP_VER_BUILD 243

#define NPP_VERSION (NPP_VER_MAJOR * 1000 +     \
                     NPP_VER_MINOR *  100 +     \
                     NPP_VER_PATCH)
2019-10-07 11:45:26 +01:00
Suleyman TURKMEN c0489963bb Update copy.cpp 2019-10-07 11:59:52 +03:00
Alexander Alekhin 626bfbf309 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-10-05 15:45:31 +00:00
Alexander Alekhin 98fc098216 Merge pull request #15646 from alalek:fix_avx512_detection 2019-10-05 15:30:09 +00:00
Alexander Alekhin 953c60829e Merge pull request #15644 from wise86-android:upgradePySetup 2019-10-05 15:29:13 +00:00
Alexander Alekhin 6d811f9879 Merge pull request #15641 from alalek:dnn_pytest_update_3.4 2019-10-05 15:28:52 +00:00
Alexander Alekhin 22d0c57a1c Merge pull request #15602 from alalek:core_softfloat_ubsan_shift 2019-10-05 15:27:35 +00:00
Wise86 b1485d0337 upgrade the file to use the correct package name and include py3/gtk3 support 2019-10-05 14:53:09 +02:00
Alexander Alekhin c54753c185 Merge pull request #15638 from AsyaPronina:asyadev/gapi_filter2d_test 2019-10-05 11:22:11 +00:00
Alexander Alekhin bdc097495a fix avx512 detection
- renamed Cascade Lake AVX512_CEL => AVX512_CLX (align with Intel SDE tool)
- fixed CLX instruction sets (no IFMA/VBMI)
- added flag to bypass CPU baseline check: OPENCV_SKIP_CPU_BASELINE_CHECK
2019-10-05 11:03:57 +00:00
Alexander Alekhin 8115b004b9 Merge pull request #15639 from alalek:dnn_test_fix_data 2019-10-04 19:46:21 +00:00
Alexander Alekhin feff8bf972 Merge pull request #15626 from alalek:dnn_openvino_2019r3 2019-10-04 19:45:37 +00:00
AsyaPronina 4429352125 OpenCV G-API test for Filter2d has changed:
> Size parameter is changed from int to cv::Size type to allow rectangle kernels
    > Kernel creation code is adopted for different kernel sizes to not create only white images on the output
2019-10-04 21:25:33 +03:00
Alexander Alekhin f301f17b61 imgproc: accurate histogram value thresholding 2019-10-04 19:56:25 +03:00
Alexander Alekhin c13a5ce229 Merge pull request #15622 from dkurt:enet_ie_cpu 2019-10-04 16:31:05 +00:00
Alexander Alekhin c9b2cedebd Merge pull request #15631 from codeclown:pkg-config 2019-10-04 15:56:16 +00:00
Alexander Alekhin ab5252c18e dnn(pytest): backport changes from master, update test setUp() 2019-10-04 18:43:35 +03:00
Dmitry Kurtaev e35fd463e7 Enable ENet with Inference Engine backend on CPU 2019-10-04 18:10:11 +03:00
Alexander Alekhin fd11e3a81d dnn: update IE tests 2019-10-04 17:49:10 +03:00
Alexander Alekhin f0058bbed3 dnn(test): fix optional test data 2019-10-04 17:26:35 +03:00
Alexander Alekhin 22d86116ee Merge pull request #15634 from alalek:issue_15083_4903 2019-10-04 11:54:54 +00:00
Alexander Alekhin deea46000e Merge pull request #15637 from APrigarina:3.4_version2
QR-Code detection: accuracy improvement (fixed)
2019-10-04 14:09:35 +03:00
APrigarina c99db2b9db bug fix 2019-10-04 13:02:54 +03:00
Alexander Alekhin c69245da1f imgproc: fix fitLine() implementation
- update optimal solutions on each iteration
2019-10-03 21:23:52 +00:00
Martti Laine 3c50d24d8e Add note about pkg-config usage in tutorial 2019-10-03 15:55:03 +03:00
Alexander Alekhin 53c88f0f9e Merge pull request #15627 from andrey-golubev:fix_perform_subst 2019-10-02 22:30:01 +00:00
andrey-golubev d50babfc99 G-API: fix perform substitution UB/crash 2019-10-02 20:54:11 +03:00
Alexander Alekhin 2b66495a9d dnn: use OpenVINO 2019R3 defines 2019-10-02 18:47:01 +03:00
Alexander Alekhin 3fb6617d62 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-10-02 17:49:19 +03:00
Alexander Alekhin a105f56957 Merge pull request #15621 from alalek:cmake_ipp_licenses 2019-10-02 14:30:17 +00:00
Alexander Alekhin 23bd1866ca Merge pull request #15620 from alalek:issue_14727 2019-10-02 14:29:56 +00:00
Alexander Alekhin 59c182ed2b Merge pull request #15467 from elmsfu:dshow/add_save_graph_file 2019-10-02 14:27:56 +00:00
Alexander Alekhin c06115cb3f Merge pull request #15619 from alalek:dnn_eltwise_sum_ie_ocl 2019-10-01 18:02:45 +00:00
Elms 8b483a91bc dshow: Add ability to save direct show graph 2019-10-01 09:46:07 -07:00
Alexander Alekhin 8814645c8d dnn(test): skip IE/OCL test for "sum" 2019-10-01 18:29:47 +03:00
Alexander Alekhin c92f3072b4 cmake: add check for IPP IW license files 2019-10-01 18:24:03 +03:00
Alexander Alekhin ffea927ac2 Merge pull request #15618 from alalek:dnn_test_async_timeout 2019-10-01 14:48:47 +00:00
Alexander Alekhin 77346d7286 core: workaround transform() inplace calls 2019-10-01 16:52:14 +03:00
Alexander Alekhin 3133bb49aa Merge pull request #15492 from TolyaTalamanov:at/new-render-prims 2019-10-01 12:39:16 +00:00
Alexander Alekhin 440a937d24 dnn: increase async test timeout 2019-10-01 13:31:57 +03:00
Talamanov, Anatoliy 06067efa3f Add new render primitives 2019-10-01 12:11:41 +03:00
Alexander Alekhin 6aa689f87c Merge pull request #15611 from dkurt:fix_dnn_inp_size_autodetect 2019-09-30 18:38:14 +00:00
Alexander Alekhin ba0b3983c6 Merge pull request #15609 from sturkmen72:update_loadsave_cpp 2019-09-30 18:37:21 +00:00
Sebastián Gurin a3144cbadc Merge pull request #15480 from cancerberoSgx:estimateAffine2D
js - cv.estimateAffine2D, cv.warpPolar
2019-09-30 21:35:26 +03:00
ann 5c9a624a85 Merge pull request #15356 from APrigarina:3.4_version2
QR-Code detection: accuracy improvement

* first commit

* resize improvement

* resize improvement

* dummy commit

* warnings fix

* warnings fix

* warnings fix

* test added

* resize fix

* resize fix

* tests changed

* tests changed
2019-09-30 21:33:58 +03:00
Dmitry Kurtaev fba9fdfd27 Fix autodetection of input size for dnn networks 2019-09-30 16:05:15 +03:00
Suleyman TURKMEN d88d1c9935 Update loadsave.cpp 2019-09-28 23:24:17 +03:00
Alexander Alekhin 507ca291e1 Merge pull request #12670 from alalek:imgproc_getRotationMatrix2D_return_type 2019-09-28 18:03:34 +00:00
Alexander Alekhin ed9bca969c core: fix UBSAN in softfloat 2019-09-27 16:29:50 +03:00
Alexander Alekhin aa61e79615 Merge pull request #15600 from alalek:imgproc_pyramid_fix_indexing 2019-09-27 10:21:52 +00:00
Brandon 25dee8383c Merge pull request #15595 from frastlin:rodrigues
* Added Rodrigues to the JS embindgen.py and a unittest in test_calib3d.js on 3.4 base
2019-09-27 13:06:07 +03:00
Alexander Alekhin f81e401cd0 imgproc: fix indexing issue in pyramids
UBSAN violation expression: 'tab = tabR - x;'
2019-09-26 18:09:47 +03:00
Alexander Alekhin bc927f9788 Merge pull request #15591 from alalek:core_persistence_fix 2019-09-26 12:59:37 +00:00
Alexander Alekhin e2a5a6a05c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-25 18:32:44 +00:00
Alexander Alekhin 7ce9428e96 Merge pull request #15580 from smbz:dnn-lstm-reverse 2019-09-25 15:54:06 +00:00
Andrey Golubev 9f4f9000bc Merge pull request #15313 from andrey-golubev:map_subst_to_pattern
G-API: add transformation logic to GCompiler

* Introduce transformation logic to GCOmpiler

* Remove partialOk() method

* Fix minor issues

* Refactor code according to code review

1. Re-design matchPatternToSubstitute logic
2. Update transformations order
3. Replace check_transformations pass with a
   one time check in GCompiler ctor

* Revert unused nodes handling in pattern matching

* Address minor code review issues

* Address code review comments:

1) Fix some mistakes
2) Add new tests for endless loops
3) Update GCompiler's transformations logic

* Simplify GCompiler check for endless loops

1. Simplify transformations endless loops check:
 - Original idea wasn't a full solution
 - Need to develop a good method (heuristic?) to find loops
   in general case (TODO)
2. Remove irrelevant Endless Loops tests
3. Add new "bad arg" tests and unit tests

* Update comments
2019-09-25 18:19:45 +03:00
Alexander Alekhin 677b94c92e Merge pull request #15579 from alalek:ocl_use_host_mem_ptr_flag 2019-09-25 15:12:59 +00:00
Andrew Ryrie b88435fdc2 dnn: Allow LSTM layer to operate in reverse direction
This is useful for bidirectional LSTMs.
2019-09-25 14:12:43 +01:00
Alexander Alekhin 790927bb55 Merge pull request #15582 from terfendail:pyrdown_oob 2019-09-25 12:37:31 +00:00
Lubov Batanina e923712d81 Merge pull request #15572 from l-bat:deconv3d
Fix computation of internal shapes in Deconvolution layer

* Fix computation of internal shapes

* Refactoring
2019-09-25 15:35:04 +03:00
Alexander Alekhin eacadf0e73 core(ocl): add flag OPENCV_OPENCL_ENABLE_MEM_USE_HOST_PTR
to control CL_MEM_USE_HOST_PTR usage
2019-09-25 15:12:36 +03:00
Alexander Alekhin 6e246ee58c core(persistence): fix reserveNodeSpace() implementation
- avoid data copying after buffer block shrink
- resize current block in case of single FileNode
2019-09-25 15:02:20 +03:00
Vitaly Tuzov 0a1b957331 StereoBM algorithm updated to use wide universal intrinsics 2019-09-25 14:37:12 +03:00
Alexander Alekhin e3daf489c8 Merge pull request #15581 from takacsd:3.4 2019-09-25 10:45:49 +00:00
Vitaly Tuzov 1c17b3281a Fixed OOB reading in pyrDown 2019-09-25 13:24:17 +03:00
Alexander Alekhin d2cacac07a Merge pull request #15573 from alalek:build_cxx11_warnings 2019-09-24 22:08:55 +00:00
takacsd e0be771b64 Add option to disable features in iOS build. 2019-09-24 17:42:35 +02:00
Wenzhao Xiang c2096771cb Merge pull request #15371 from Wenzhao-Xiang:gsoc_2019
[GSoC 2019] Improve the performance of JavaScript version of OpenCV (OpenCV.js)

* [GSoC 2019]

Improve the performance of JavaScript version of OpenCV (OpenCV.js):
1. Create the base of OpenCV.js performance test:
     This perf test is based on benchmark.js(https://benchmarkjs.com). And first add `cvtColor`, `Resize`, `Threshold` into it.
2. Optimize the OpenCV.js performance by WASM threads:
     This optimization is based on Web Worker API and SharedArrayBuffer, so it can be only used in browser.
3. Optimize the OpenCV.js performance by WASM SIMD:
     Add WASM SIMD backend for OpenCV Universal Intrinsics. It's experimental as WASM SIMD is still in development.

* [GSoC2019] 

1. use short license header
2. fix documentation node issue
3. remove the unused `hasSIMD128()` api

* [GSoC2019]

1. fix emscripten define
2. use fallback function for f16

* [GSoC2019]

Fix rebase issue
2019-09-24 16:30:42 +03:00
Alexander Alekhin 2fef9bc1d8 Merge pull request #15570 from smirnov-alexey:gapi_threshold_test 2019-09-24 13:21:10 +00:00
Alexander Alekhin 3cf9185159 Merge pull request #15538 from terfendail:wui_checkany 2019-09-23 15:52:24 +00:00
Maksim Shabunin c8abf2ad14 backport: fixed warnings produced by clang-9.0.0
ea3dc78986
https://github.com/opencv/opencv_contrib/commit/83fc27cb99db4435d07974090fbdc77d831931cd
2019-09-23 18:36:18 +03:00
smirnov-alexey bab8addcbb Move maxval to threshold tests parameter
Fix documentation
2019-09-23 14:21:33 +03:00
Alexander Alekhin c4d2e3c0b3 Merge pull request #15566 from alalek:issue_15558 2019-09-23 09:22:06 +00:00
Alexander Alekhin b40fd6de32 Merge pull request #15565 from alalek:issue_15561 2019-09-23 09:21:49 +00:00
Alexander Alekhin 3516d0835e Merge pull request #15564 from alalek:issue_15560 2019-09-23 09:21:27 +00:00
Alexander Alekhin fcc69d5a60 core(test): fix check conditions 2019-09-22 11:28:41 +00:00
Alexander Alekhin fef7fc343e ml: add checks of empty train data 2019-09-22 11:12:19 +00:00
Alexander Alekhin ad2854c8b3 imgcodecs: add check image.empty() in imwrite()/imencode() 2019-09-22 10:45:00 +00:00
Alexander Alekhin a74fe2ec01 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-20 21:11:49 +00:00
Alexander Alekhin eabbe38001 Merge pull request #15554 from alalek:pr15422_patch_files
* 3rdparty: libpng v1.6.37 MSA patch (pr15422)

original files: https://github.com/glennrp/libpng/tree/v1.6.37/mips

* 3rdparty: libwebp MSA asm patch (pr15422)
2019-09-21 00:07:24 +03:00
mipsopen-fwu b1ea91d8bd Merge pull request #15422 from mipsopen-fwu:msa-dev
* Added MSA implementations for mips platforms. Intrinsics for MSA and build scripts for MIPS platforms are added.

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* Removed some unused code in mips.toolchain.cmake.

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* Added comments for mips toolchain configuration and disabled compiling warnings for libpng.

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* Fixed the build error of unsupported opcode 'pause' when mips isa_rev is less than 2.

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* 1. Removed FP16 related item in MSA option defines in OpenCVCompilerOptimizations.cmake.
2. Use CV_CPU_COMPILE_MSA instead of __mips_msa for MSA feature check in cv_cpu_dispatch.h.
3. Removed hasSIMD128() in intrin_msa.hpp.
4. Define CPU_MSA as 150.
Signed-off-by: Fei Wu <fwu@wavecomp.com>

* 1. Removed unnecessary CV_SIMD128_64F guarding in intrin_msa.hpp.
2. Removed unnecessary CV_MSA related code block in dotProd_8u().

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* 1. Defined CPU_MSA_FLAGS_ON as "-mmsa".
2. Removed CV_SIMD128_64F guardings in intrin_msa.hpp.

Signed-off-by: Fei Wu <fwu@wavecomp.com>

* Removed unused msa_mlal_u16() and msa_mlal_s16 from msa_macros.h.

Signed-off-by: Fei Wu <fwu@wavecomp.com>
2019-09-20 19:52:48 +03:00
Alexander Alekhin a052567db8 Merge pull request #15530 from sturkmen72:update_samples_v4 2019-09-20 16:41:41 +00:00
Suleyman TURKMEN 2d2330382d Update samples 2019-09-20 18:03:26 +03:00
Vitaly Tuzov 66842f5a18 Extended v_check_any/v_check_all universal intrinsics to support 64-bit integer 2019-09-19 18:31:31 +03:00
Alexander Alekhin 33e9fe9312 Merge pull request #15540 from alalek:issue_15278_2 2019-09-18 20:12:36 +00:00
Alexander Alekhin 65c209fad3 Merge pull request #15519 from mshabunin:fix-custom-install 2019-09-18 15:31:25 +00:00
dab0bby a9163a53d3 Merge pull request #15477 from dab0bby:remove-old-build-java-option
* remove old BUILD_opencv_java option

* replace old build_java option with new BUILD_JAVA option
2019-09-18 18:30:01 +03:00
Alexander Alekhin c657c6cbac cmake: use 'long long' for atomic check 2019-09-18 15:18:09 +00:00
Alexander Alekhin ee23a7575d Merge pull request #15515 from dkurt:dnn_detection_model_fix 2019-09-18 12:19:14 +00:00
Alexander Alekhin 8167d47efc Merge pull request #15516 from dkurt:dnn_detection_model_fix_3.4 2019-09-18 11:22:27 +00:00
Alexander Alekhin 1ecea1f4a6 Merge pull request #15529 from collinbrake:feature_grammar_fixes 2019-09-18 11:19:59 +00:00
Vitaly Tuzov 9fa6c2ac04 Fixed out of bound reading in DIS optical flow evaluation implementation 2019-09-17 18:01:46 +03:00
Maksim Shabunin 3ece62cb9c Merge pull request #15531 from terfendail:disflow_fix 2019-09-17 15:01:06 +00:00
Alexander Alekhin 46fd112f9b Merge pull request #15399 from terfendail:perf_stereobm 2019-09-17 14:26:43 +00:00
Vitaly Tuzov cd7fa04985 Fixed out of bound reading in DIS optical flow evaluation implementation 2019-09-17 15:53:18 +03:00
collin bcf7d3160c Grammer fixes on python image display tutorial 2019-09-16 17:57:22 -04:00
Daniel Kapusi d2872afce0 Merge pull request #15341 from DiebBlue:is5769
* issue 5769 fixed: cv::stereoRectify fails if given inliers mask of type vector<uchar>

* issue5769 fix using reshape and add regression test

* regression test with outlier detection, testing vector and mat data

* Size comparision of wrong vector within CV_Assert in regression test corrected

* cleanup test code
2019-09-17 00:04:05 +03:00
Alexander Alekhin 70c88a2087 Merge pull request #15517 from mshabunin:fix-osx-avfoundation-auth 2019-09-16 15:28:34 +00:00
Alexander Alekhin 7770ba1f10 Merge pull request #15491 from terfendail:undistort_fix 2019-09-16 15:24:29 +00:00
Vitaly Tuzov 7b3a752012 Fixed universal intrinsic undistort() implementation 2019-09-16 17:16:38 +03:00
Dmitry Kurtaev b8d4664e6e Fix OpenVINO 2019R1 compilation 2019-09-16 15:12:19 +03:00
Dmitry Kurtaev bd5d16ce36 Fix DetectionModel in case of out of [0, 1] range detection prediction 2019-09-16 15:07:10 +03:00
Maksim Shabunin e98852a389 AVFoundation: fix authorization request not being shown 2019-09-16 15:06:29 +03:00
Alexander Alekhin 08e4ffdf79 ffmpeg/4.x: update FFmpeg plugin
ffmpeg: 4.1.3 -> 4.2.1
libvpx: 1.8.0 -> 1.8.1
2019-09-16 15:02:11 +03:00
Maksim Shabunin 5a75808516 Windows: partially restore install config generation 2019-09-16 12:11:48 +03:00
Alexander Alekhin b4c5b50a3e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-13 17:15:45 +00:00
Alexander Alekhin 03c4c67dad Merge pull request #15518 from mshabunin:fix-osx-qt 2019-09-13 17:06:00 +00:00
Alexander Alekhin f5f9187720 Merge pull request #15476 from cancerberoSgx:js-docker 2019-09-13 17:04:52 +00:00
Alexander Alekhin 89b82e796e Merge pull request #15449 from mshabunin:cmake-download-params 2019-09-13 17:03:28 +00:00
Alexander Alekhin 48fa39f675 Merge pull request #15487 from dkurt:fix_ie_2019r1 2019-09-13 16:57:34 +00:00
Alexander Alekhin 69c19dc3d3 Merge pull request #15511 from pmur:vmuleo-fix-gcc7 2019-09-13 16:48:18 +00:00
Maksim Shabunin 5c0502b470 Fixed OSX build with Qt 2019-09-13 15:23:59 +03:00
Maksim Shabunin f10fce9ab4 AVFoundation: backported runtime authorization check from master 2019-09-13 13:20:29 +03:00
Maksim Shabunin aaad238c6e AVFoundation: fix authorization request not being shown 2019-09-13 13:11:35 +03:00
Dmitry Kurtaev 3ddb005480 Fix DetectionModel in case of out of [0, 1] range detection prediction 2019-09-13 12:58:56 +03:00
Dmitry Kurtaev 741aee6901 Fix dnn object detection sample 2019-09-13 11:50:50 +03:00
Dmitry Kurtaev 0428f60d66 Fix OpenVINO 2019R1 compilation 2019-09-13 09:22:34 +03:00
Paul E. Murphy b465c82696 core: workaround old gcc vec_mul{e,o} (Issue #15506)
ISA 2.07 (aka POWER8) effectively extended the expanding multiply
operation to word types. The altivec intrinsics prior to gcc 8 did
not get the update.

Workaround this deficiency similar to other fixes.

This was exposed by commit 33fb253a66
which leverages the int -> dword expanding multiply.

This fixes Issue #15506
2019-09-12 09:54:02 -05:00
Alexander Alekhin 1e410ed826 Merge pull request #15468 from alalek:ffmpeg_update_master 2019-09-10 09:57:57 +00:00
Alexander Alekhin 8609198b05 Merge pull request #15466 from alalek:ffmpeg_update_3.4 2019-09-10 09:57:38 +00:00
Alexander Alekhin 95a55250a7 ffmpeg/4.x: update FFmpeg plugin
ffmpeg: 4.1.3 -> 4.2.1
libvpx: 1.8.0 -> 1.8.1
2019-09-10 03:13:21 +00:00
Maksim Shabunin 349f0cf5e9 Merge pull request #15443 from anton-potapov:fluid_internal_parallellism_fix_review_comments 2019-09-09 19:27:59 +00:00
Maksim Shabunin 57b16a4b6e Merge pull request #15485 from anton-potapov:gapi_standalone_fix_cmake_warning 2019-09-09 14:58:18 +00:00
Anton Potapov 758156a9b6 Fluid Internal Parallelism:
- add comments on signature of custom parallel_for
  - use cv::parallel_for_ by default
2019-09-09 17:37:52 +03:00
Vitaly Tuzov bf8b5ffeb1 Added performance test for StereoBM algorithm 2019-09-09 16:37:06 +03:00
Anton Potapov 8747082091 G-API: fixing CMake warning for standalone build 2019-09-09 16:23:04 +03:00
Sebastián Gurín a17231a6b4 js docker build docs emcc latest warning 2019-09-06 15:18:34 -03:00
Alexander Alekhin b3a0507546 Merge pull request #15475 from alalek:build_eliminate_warning_array_bounds 2019-09-06 15:57:52 +00:00
Alexander Alekhin 4de115c08c Merge pull request #15474 from alalek:gapi_test_valgrind_disable_memory_consuption_check 2019-09-06 15:33:01 +00:00
Alexander Alekhin f139a0bda8 Merge pull request #15461 from alalek:imgproc_connectedcomponents_allocation 2019-09-06 15:32:04 +00:00
Alexander Alekhin bdf23ce855 ts: eliminate -Warray-bounds warning 2019-09-06 18:06:02 +03:00
Alexander Alekhin 60488ffbbd gapi(test): disable memory consumption check in valgrind runs 2019-09-06 17:02:30 +03:00
Yuhel Tanaka a13862e924 Fix issue #6450 2019-09-06 11:56:04 +09:00
Alexander Alekhin 6a49887695 ffmpeg/3.4: update FFmpeg wrapper 2019-09-05 21:36:06 +00:00
Alexander Alekhin e7b6753a10 imgproc: avoid manual memory allocation in connectedcomponents.cpp 2019-09-05 16:20:08 +03:00
Maksim Shabunin 8b42995e8b Add option to skip nested cmake structure on Windows 2019-09-05 15:42:21 +03:00
Alexander Alekhin 84c3bbd934 OpenCV version '-openvino' 2019-09-05 15:42:21 +03:00
Alexander Alekhin a0d227714e dnn: use OpenVINO 2019R3 defines 2019-09-05 15:42:21 +03:00
Alexander Alekhin bea2c75452 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-05 14:29:22 +03:00
Jaime fafada28eb Merge pull request #14872 from AhiyaHiya:feature/topmost_window
* Added mechanism to set/toggle NORMAL window to TOPMOST window.

* highgui: remove unnecessary/legacy code
2019-09-05 13:55:17 +03:00
Alexander Alekhin 4ffb5b62ea Merge pull request #15170 from sturkmen72:update_samples 2019-09-05 10:44:06 +00:00
Suleyman TURKMEN f73395122c Update Samples 2019-09-05 01:10:51 +03:00
Alexander Alekhin 0a13633411 Merge pull request #15444 from alalek:ocl_fix_fft_kernel 2019-09-04 16:25:34 +00:00
Everton Constantino 76e403cf25 Merge pull request #15440 from everton1984:new_integral_tests
* Adding all possible data type interactions to the perf tests since some
use SIMD acceleration and others do not.

* Disabling full tests by default.

* Giving proper names, removing magic numbers and sanity checks of new
performance tests for the integral function.

* Giving proper names, making array static.
2019-09-04 19:14:00 +03:00
Alexander Alekhin 00f36a261b Merge pull request #15451 from mattmyne:calibratecameraRO_fix_emptyJo 2019-09-04 16:12:30 +00:00
huihut fe42933ac5 Merge pull request #15433 from huihut:master
* fix 'chmod' is not recognized as an internal or external command in Windows

https://github.com/opencv/opencv/issues/14939

* cmake: update PCH command handling
2019-09-04 18:36:56 +03:00
Matt Bennett b17d16623a Prevent empty _Jo matrix multiplication when using calibrateCameraRO with iFixedPoint > 0 2019-09-04 15:33:03 +01:00
Maksim Shabunin 9d4f01626c cmake: add directory creation to download helper scripts 2019-09-04 17:09:13 +03:00
Maksim Shabunin d974d4c6ce cmake: download tries, customizable download parameters 2019-09-04 17:09:13 +03:00
Dmitry Kurtaev ba703157cf Merge pull request #15063 from dkurt:dnn_ie_ocv_layers
* Wrap unsupported by IE layers as custom layers

* Replace pointers to layers blobs to their shapes

* Enable Faster R-CNN with IE backend on CPU
2019-09-03 18:58:57 +03:00
Alexander Alekhin 8bd2720c28 core(ocl): fix fft kernel compilation
- error: variables in the local address space can only be declared in the outermost scope of a kernel function
2019-09-03 15:46:53 +03:00
Alexander Alekhin 7e46766c8d Merge pull request #15437 from devnexen:fbsd_opencl_build_fix 2019-09-03 12:21:02 +00:00
Alexander Alekhin 61cc855564 Merge pull request #15442 from alalek:fix_15293 2019-09-03 12:05:57 +00:00
Alexander Alekhin e736f590f7 Merge pull request #15436 from alalek:update_version_4.1.2-pre 2019-09-03 12:05:16 +00:00
Alexander Alekhin 9ef5373776 Merge pull request #15435 from alalek:update_version_3.4.8-pre 2019-09-03 12:04:23 +00:00
Alexander Alekhin 6d669dcd7d gapi(test): fix 32S->8U type in OwnMatConversion.WithND 2019-09-03 14:00:28 +03:00
Alexander Alekhin abd7d63b74 Merge pull request #15424 from mshabunin:add-cmake-docs 2019-09-03 10:50:45 +00:00
OrestChura 55c1720719 Merge pull request #15419 from OrestChura:gapi_headers_internal_flag_issue
* - headers in "infer/" and "infer/ie/" folders are included into gapi_ext_hdrs;
+ because of that a few #includes are required in the headers
- HAVE_INF_ENGINE flag check in headers "infer/ie.hpp" and "infer/ie/util.hpp" is deleted

* - the "ie/util.hpp" header is a private header now as it's used for tests; it's been moved to the scr directory to the place next to the implementation file "ie/giebackend.cpp"
- the path to this header in files "ie/giebackend.cpp" and "test/infer/gapi_infer_ie_test.cpp" is updated
- As it's private header now and explicitly depends on IE, the "HAVE_INF_ENGINE" flag check is returned
2019-09-03 13:22:12 +03:00
David Carlier 6769ee3748 OpenCL: FreeBSD build fix 2019-09-02 18:30:53 +01:00
Alexander Alekhin 07f0225ca6 Merge pull request #15438 from anton-potapov:fluid_internal_parallellism_fix_kw 2019-09-02 15:47:21 +00:00
Anton Potapov f7b5900671 Fluid Internal Parallelism
- make static analysis happy
2019-09-02 16:16:01 +03:00
Alexey Smirnov 8a7e74673e Merge pull request #15312 from smirnov-alexey:gapi_fluid_garray
* Support GArray as input in fluid kernels

* Create tests on GArray input in fluid

* Some fixes to fully support GArray

* Refactor code and change the kernel according to review

* Add histogram calculation as a G-API kernel

Add assert that input GArgs in fluid contain at least one GMat
2019-09-02 15:51:58 +03:00
Alexander Alekhin 3c62f3a8e3 pre: OpenCV 4.1.2 (version++) 2019-09-02 15:26:14 +03:00
Alexander Alekhin 48d41ab088 dnn: bump API version 2019-09-02 14:25:18 +03:00
Alexander Alekhin 0fda243a05 pre: OpenCV 3.4.8 (version++) 2019-09-02 14:20:49 +03:00
Alexander Alekhin 70dfae31a2 experimental version++ 2019-09-02 14:17:36 +03:00
Alexander Alekhin e98e58c65a Merge pull request #15432 from atinfinity:removed-tegra-optimization 2019-09-01 21:57:57 +00:00
atinfinity 3b9f981358 removed tegra optimization 2019-09-01 21:22:06 +09:00
Alexander Alekhin 048ddbf9ee Merge pull request #15339 from pmur:dotprod-32s-vsx 2019-08-31 11:16:04 +00:00
Alexander Alekhin 2a6527e751 Merge pull request #15402 from ChipKerchner:normUnroll 2019-08-31 11:10:05 +00:00
Chip Kerchner 26228e6b4d Merge pull request #15358 from ChipKerchner:imgwarpToHal
* Convert ImgWarp from SSE SIMD to HAL - 2.8x faster on Power (VSX) and 15% speedup on x86

* Change compile flag from CV_SIMD128 to CV_SIMD128_64F for use of v_float64x2 type

* Changing WarpPerspectiveLine from class functions and dispatching to static functions.

* Re-add dynamic runtime and dispatch execution.

* RRestore SSE4_1 optimizations inside opt_SSE4_1 namespace
2019-08-31 13:47:58 +03:00
Maksim Shabunin f3aab47f94 Assorted documentation fixes
* removed private flann documentation
* common tutorial images moved to doc/images
* grouping issues
2019-08-31 01:50:11 +03:00
Alexander Alekhin 1661e83939 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-30 16:22:42 +03:00
Alexander Alekhin f224d740a3 Merge pull request #15414 from kuzi117:instr 2019-08-30 12:03:19 +00:00
Alexander Alekhin 700f7a275f Merge pull request #15418 from mshabunin:try-install-layout-34 2019-08-29 18:42:58 +00:00
Alexander Alekhin e319340253 Merge pull request #15417 from alalek:ts_fix_callback_signature 2019-08-29 18:40:19 +00:00
Alexander Alekhin 6508bbcef5 Merge pull request #15412 from kuzi117:ambig 2019-08-29 18:39:00 +00:00
Braedy Kuzma 9bf8b496d6 Use commonly supported instruction mnemonic. 2019-08-29 10:00:40 -06:00
Braedy Kuzma d4120dd2fe Disambiguate vecpopcnt for (u)dword2. 2019-08-29 09:54:56 -06:00
Maksim Shabunin 8c849a48cc Ported install layout refactoring from master branch 2019-08-29 17:01:49 +03:00
Alexander Alekhin 654d0c29ad ts: fix callback function signature
detected by UBSAN
2019-08-29 15:09:32 +03:00
Alexander Alekhin 8d0b3dad5c Merge pull request #15357 from ChipKerchner:fastCorner 2019-08-29 08:26:31 +00:00
Lubov Batanina 90eb529bc4 Merge pull request #15395 from l-bat:fully_connected
* Fix IE FullyConnected layer

* Fix MyriadX
2019-08-29 10:52:02 +03:00
Alexander Alekhin 6506c19ac3 Merge pull request #15407 from terfendail:test_check_any 2019-08-28 16:39:01 +00:00
Alexander Alekhin 834c992553 Merge pull request #14786 from mshabunin:try-install-layout 2019-08-28 15:58:21 +00:00
Chip Kerchner 30a60d396b Merge pull request #15274 from ChipKerchner:lkpyramidToHal
* Convert lkpyramid from SSE SIMD to HAL - 90% faster on Power (VSX).

* Replace stores with reduce_sum.  Rework to handle endianess correctly.

* Fix compiler warnings by casting values explicitly to shorts

* Switch to CV_SIMD128 compiler definition.  Unroll loop to 8 elements since we've already loaded the data.
2019-08-28 18:56:48 +03:00
Vitaly Tuzov d134ec54c5 Extend tests for v_check_any and v_check_all intrinsics 2019-08-28 14:53:31 +03:00
Alexander Alekhin ca7640e10f Merge pull request #15401 from ChipKerchner:vectorReduceInt8Bug 2019-08-27 19:59:39 +00:00
ChipKerchner 288e6f9c07 –Improve vectorization in the 'norm' functions 2019-08-27 12:15:19 -05:00
ChipKerchner 70b883cfeb Fix macro bug with v_reduce_min and v_reduce_max for chars in VSX 2019-08-27 11:38:53 -05:00
Alexander Alekhin ea525d5685 Merge pull request #15400 from terfendail:fix_check_any 2019-08-27 14:07:23 +00:00
Alexander Alekhin 1ae001d10a Merge pull request #15378 from andrey-golubev:acc_tests_doc 2019-08-27 12:20:05 +00:00
Vitaly Tuzov 1b40528e1a Fix for AVX2 implementation of v_check_any(), v_check_all() intrinsics 2019-08-27 14:31:23 +03:00
Maksim Shabunin 4e67eb6c42 Extracted install layout configuration to separate file 2019-08-26 18:15:32 +03:00
atinfinity 824465ea27 Merge pull request #15388 from atinfinity:impl-turbo-colormap
Implementation of colormap "Turbo" (#15388)

* implemented turbo colormap

* add colormap image

* changed float value to avoid cast

* sorted flag check alphabetically
2019-08-26 17:55:10 +03:00
Alexander Alekhin 4a33014edc Merge pull request #15391 from dkurt:fix_15141 2019-08-26 12:17:21 +00:00
Dmitry Kurtaev 57676cf64d Fix https://github.com/opencv/opencv/issues/15141 2019-08-24 23:14:26 +03:00
Alexander Alekhin a7b954f655 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-23 19:24:37 +03:00
Alexander Alekhin 114674c3d9 Merge pull request #15383 from alalek:fix_15379 2019-08-23 16:19:36 +00:00
Alexander Alekhin c05595e482 Merge pull request #15382 from alalek:fix_15287 2019-08-23 16:09:13 +00:00
Alexander Alekhin d4d7ab0620 Merge pull request #15380 from alalek:fix_build_icc 2019-08-23 16:07:21 +00:00
Alexander Alekhin c74206e4de Merge pull request #15376 from ilya-lavrenov:detect_openvino 2019-08-23 16:05:15 +00:00
Giles Payne 96d5cbd036 Merge pull request #15350 from komakai:apple-debug-build
* Add debug build option to MacOs and iOS build scripts

* osx: allow selection of MACOSX_DEPLOYMENT_TARGET

* Add --debug_info flag to iOS and macOS builds for building with debug info
2019-08-23 18:22:29 +03:00
Ilya Lavrenov d0c4a92b4c Adopted detection of Inference Engine 2019-08-23 17:37:57 +03:00
Alexander Alekhin d7409604b5 core: handle empty Mat in Mat_ assignment operators 2019-08-23 16:54:24 +03:00
Alexander Alekhin 29dbeb253c build: fix build with ICC 2019-08-23 16:36:32 +03:00
Alexander Alekhin 5a497077f1 objdetect: add input check in HOG detector 2019-08-23 16:14:53 +03:00
Alexander Alekhin 576644a197 Merge pull request #15236 from dbudniko:dbudniko/g_api_copy_kernels 2019-08-23 10:47:47 +00:00
Andrey Golubev 410583e5f9 Document usage of accuracy tests model 2019-08-23 13:15:35 +03:00
Alexander Alekhin 6bf6d1dc6b Merge pull request #15373 from pmur:libpng-vsx-fix 2019-08-22 20:54:34 +00:00
Alexander Alekhin 56e832ee43 Merge pull request #15372 from alalek:core_stat_fix_intrin 2019-08-22 20:52:54 +00:00
Alexander Alekhin 601096f360 Merge pull request #15370 from alalek:core_fastmath_hpp_update 2019-08-22 17:05:38 +00:00
Alexander Alekhin aa09febf79 Merge pull request #15353 from alalek:cmake_check_atomic 2019-08-22 15:43:34 +00:00
Paul E. Murphy 8aca1934ff libpng: update check for VSX enablement
The deprecated flag ENABLE_VSX should not be used to enable this
feature. Instead, use the baseline cpu feature set to determine.
2019-08-22 10:08:01 -05:00
Kazuma Furuhashi ccecd3405a Merge pull request #15007 from 284km:fixatypo
s/last_occurence/last_occurrence/
2019-08-22 17:32:25 +03:00
Alexander Alekhin 8a0b93bc4d core: update fastmath.hpp 2019-08-22 16:43:07 +03:00
Alexander Alekhin 8b1fe8f6e0 core: fix stat SIMD code 2019-08-22 16:37:26 +03:00
Alexander Alekhin 7243eda2ff Merge pull request #15316 from sturkmen72:update_seamless_cloning_cpp 2019-08-22 11:37:38 +00:00
Prakhar Varshney 3f7cc45686 Merge pull request #15345 from prakhar9998:patch-1
* fix broken code link

resolves  #15344

* Update stitcher.markdown

* update 3.4 link
2019-08-22 12:25:27 +03:00
Alexander Alekhin 84b8a2fb05 Merge pull request #15303 from dkurt:fix_15296 2019-08-21 16:59:20 +00:00
Alexander Alekhin c93e2ff81d Merge pull request #15365 from Zyrin:3.4 2019-08-21 15:55:25 +00:00
Alexander Alekhin 0cdfd72529 Merge pull request #15368 from dab0bby:patch-2 2019-08-21 15:10:25 +00:00
dab0bby 70ce2bbb9e fix typo and reference 2019-08-21 14:52:31 +02:00
Alexander Alekhin 4700722444 Merge pull request #15359 from mgehre:fix_dangling_pointer 2019-08-21 11:38:36 +00:00
Alexander Alekhin 464972855e cmake: add libatomic check 2019-08-21 13:02:36 +03:00
Rosen Penev 58ca013b90 Merge pull request #15279 from neheb:patch-1
* jas_stream: Add definition for L_tmpnam if missing

uClibc-ng for some reason does not provide a definition when some
deprecated APIs are disabled. Value taken from the musl libc.

* 3rdparty: move uClibc-ng workaround into config file
2019-08-21 12:59:09 +03:00
Zyrin 869ea22f34 Use std::move in Mat_<T> move constructors 2019-08-21 11:12:00 +02:00
Zyrin 8ef8088686 Fix stack overflow on gcc with c++17 (#15343) 2019-08-21 10:57:03 +02:00
Alexander Alekhin c5e9bbe4f3 Merge pull request #15335 from lixit:master 2019-08-20 22:10:11 +00:00
Matthias Gehre 0e92ac2af7 modules/core/src/ocl.cpp: Fix dangling pointer
Detected by clang trunk:
```
opencv/modules/core/src/ocl.cpp:4337:37: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
        CV_OCL_CHECK_RESULT(retval, cv::format("clCreateBuffer(capacity=%lld) => %p", (long long int)entry.capacity_, (void*)entry.clBuffer_).c_str());
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opencv/modules/core/src/ocl.cpp:193:42: note: expanded from macro 'CV_OCL_CHECK_RESULT'
            if (0) { const char* msg_ = (msg); CV_UNUSED(msg_); /* ensure const char* type (cv::String without c_str()) */ } \
```
because `cv::format` yields a temporary std::string, and thus `msg_` points to a destroyed buffer.
2019-08-20 23:30:34 +02:00
Philippe FOUBERT b77a0039ee Merge pull request #15351 from philippefoubert:pr_ximea
* Fix the detection of XIMEA on Windows (when it has been installed by another user with administrative privileges, for example).

* Change the flow: we first try HKEY_CURRENT_USER key and, if empty, then try HKEY_LOCAL_MACHINE
2019-08-21 00:01:34 +03:00
Paul E. Murphy 33fb253a66 core: vectorize dotProd_32s
Use 4x FMA chains to sum on SIMD 128 FP64 targets. On
x86 this showed about 1.4x improvement.

For PPC, do a full multiply (32x32->64b), convert to DP
then accumulate. This may be slightly less precise for
some inputs. But is 1.5x faster than the above which
is about 1.5x than the FMA above for ~2.5x speedup.
2019-08-20 15:28:36 -05:00
ChipKerchner 51ceabb2eb Change fast corner flags in HAL version from char array to single int 2019-08-20 13:25:35 -05:00
Alexander Alekhin b2274a63cd Merge pull request #15348 from alalek:fix_videoio_doc_version 2019-08-20 13:12:58 +00:00
Alexander Alekhin 6a439ae53d videoio(doc): fix 'since' version 2019-08-20 13:15:56 +03:00
xitong b1a5c76215 Fix a typo 2019-08-20 12:01:40 +08:00
Alexander Alekhin 9612397aa2 Merge pull request #15329 from craterkamath:fixTypoCamshift 2019-08-19 19:01:43 +00:00
craterkamath 04f720d56a Fixed Typo Closes #15148 2019-08-19 22:52:00 +05:30
Alexander Alekhin 19a4b51371 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-16 18:48:08 +03:00
Alexander Alekhin b8f35aa109 Merge pull request #15322 from alalek:backport_15318 2019-08-16 15:40:22 +00:00
Suleyman TURKMEN a1e96a7deb Update seamless_cloning.cpp 2019-08-16 17:35:22 +03:00
luz.paz fcc7d8dd4e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`

backporting of commit: ec43292e1e
2019-08-16 17:34:29 +03:00
Alexander Alekhin a41b79d43e Merge pull request #15318 from luzpaz:modules_typo_fixes 2019-08-16 14:23:58 +00:00
luz.paz ec43292e1e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`
2019-08-15 18:02:09 -04:00
Alexander Alekhin 7df3141bbc Merge pull request #15309 from alalek:backport_15305 2019-08-15 12:02:24 +00:00
Alexander Alekhin ea667d82b3 Merge pull request #15305 from luzpaz:typo-fixes 2019-08-15 10:11:06 +00:00
luz.paz 57ccf14952 FIx misc. source and comment typos
Found via `codespell -q 3 -S ./3rdparty,./modules -L amin,ang,atleast,dof,endwhile,hist,uint`

backporting of commit: 32aba5e64b
2019-08-15 13:09:52 +03:00
Alexander Alekhin 0a02dd5f58 Merge pull request #15298 from smirnov-alexey:gapi_simplify_transform_tests 2019-08-15 10:09:14 +00:00
Alexander Alekhin 13ecd5bb25 Merge pull request #15122 from pmur:fast-math-improvements 2019-08-14 19:28:05 +00:00
Alexander Alekhin a703b9ed84 Merge pull request #15101 from alalek:cmake_initialization 2019-08-14 19:17:07 +00:00
luz.paz 32aba5e64b FIx misc. source and comment typos
Found via `codespell -q 3 -S ./3rdparty,./modules -L amin,ang,atleast,dof,endwhile,hist,uint`
2019-08-14 13:33:49 -04:00
Dmitry Kurtaev e4a80aee09 Fix #15296 2019-08-14 19:44:05 +03:00
Alexander Alekhin 26551f178c Merge pull request #15301 from alalek:backport 2019-08-14 16:40:24 +00:00
Alexander Alekhin dbf8e22fad Merge pull request #15242 from vchiluka5:lazy_load_nvcuda_dll 2019-08-14 16:35:41 +00:00
ilbalance 0b5d0b83be Merge pull request #15275 from ilbalance:js_inpaint
* in embindgen.py added inpaint function

* added test for inpaint function and fixed function in build_js

* fixed test for inpaint function

* rotate deleted, build_js.py fixed
2019-08-14 17:16:45 +03:00
Alexander Alekhin 32772a5436 3.4: backported changes from 'master' branch 2019-08-14 16:36:08 +03:00
smirnov-alexey 35e5f00cac Simplify tests on GAPI_TRANSFORM 2019-08-14 13:37:40 +03:00
Alexander Alekhin 290da93845 Merge pull request #15285 from AsyaPronina:dev/asyadev/matching_requirements_test 2019-08-14 09:59:56 +00:00
Andrey Golubev f6bb900259 Merge pull request #15238 from andrey-golubev:fluid_fix_journal
G-API: Fix Journal usage in Fluid backend (#15238)

* Fix Journal usage in Fluid backend

* Delete dumpDotRequired(): invalid check

* Update mem consumption test

* Test that new test works

* Debug memory consumption function

* Increase iterations in test

* Re-write memory consumption measurement part

* Restore correct fix for Fluid journals
2019-08-14 10:03:52 +03:00
Diego f7f2438478 Merge pull request #15082 from dvd42:segmentation-module
Segmentation module (#15082)
2019-08-13 23:38:48 +03:00
Alexander Alekhin 2ad0487cec Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-13 18:32:29 +00:00
Alexander Alekhin 72ccb5fe6e Merge pull request #15283 from smirnov-alexey:gapi_transform_tests 2019-08-13 14:45:18 +00:00
Alexander Alekhin 7c96857c02 Merge pull request #15292 from alalek:build_warnings_xcode_10_3 2019-08-13 14:18:48 +00:00
Alexander Alekhin 15b8a8d935 build: eliminate warnings with Xcode 10.3 2019-08-13 15:06:13 +03:00
Andrey Golubev bf0765fc7f Merge pull request #15282 from andrey-golubev:rename_argkind_opaque
* G-API: rename ArgKind OPAQUE to GOPAQUE

Rename ArgKind value to GOPAQUE to fix conflict in the
user code when wingdi.h is included: it defines OPAQUE
macro that (for some reason) is chosen instead of ArgKind
value

* Add compatibility with existing API

* Renamed GOPAQUE to OPAQUE_VAL
2019-08-13 13:57:27 +03:00
AsyaPronina 59de4d9ad8 Added Preproc use case test for graph pattern matching 2019-08-12 20:14:56 +03:00
Alexander Alekhin e0cb01e2cf Merge pull request #15249 from dkurt:dnn_ie_tests_2019r2 2019-08-12 16:32:38 +00:00
smirnov-alexey 4c168e95de Extend test suite on GAPI_TRANSFORM macro 2019-08-12 16:44:05 +03:00
Alexander Alekhin 183fc43a67 Merge pull request #15217 from elatkin:15163_gapi_std_math 2019-08-12 09:41:11 +00:00
Alexander Alekhin c95407f1bc Merge pull request #14883 from AsyaPronina:dev/asyadev/pattern_matching 2019-08-09 20:52:52 +03:00
Lubov Batanina f1ea9d86b9 Merge pull request #15203 from l-bat:determine_inp_shape
* Determine input shapes

* Add test

* Remove getInputShapes

* Fix model

* Fix constructors

* Add Caffe test

* Fix predict
2019-08-09 19:51:42 +03:00
AsyaPronina e06efd5329 G-API: Added graph pattern matching routine and basic tests 2019-08-09 18:57:56 +03:00
Alexander Alekhin 358d69956a Merge pull request #15198 from AsyaPronina:bump_to_new_ade_release 2019-08-09 15:24:01 +00:00
Hugo Lindström 935067ee05 Merge pull request #15265 from hugolm84:wince-armv7-supports-neon
* WINCE 8.0 requires ARMv7 Thumb2 and thus have NEON instructions

* Only add NEON if on _ARM_
2019-08-09 18:01:37 +03:00
Alexander Alekhin 212f0fb509 Merge pull request #15262 from alalek:fix_15252 2019-08-08 19:34:33 +00:00
Chip Kerchner d513fb4c8e Merge pull request #15199 from ChipKerchner:hogToHal
Convert HOG from SSE SIMD to HAL - 35-45% faster on Power (VSX) (#15199)

* Convert SSE SIMD to HAL. 35-45% improvement for Power (VSX)

* Remove CV_NEON code. Use v_floor instead of 3 lines of code.

* Invert comparison logic to simplify code.

* Change initialization from v_load to constructor type.
2019-08-08 18:57:03 +03:00
Alexander Alekhin 596b8a5d06 Merge pull request #15263 from alalek:videoio_skip_msmf_tests3 2019-08-08 15:47:08 +00:00
Alexander Alekhin 6f267be6f1 Merge pull request #15260 from tomoaki0705:suppressNoisyWarning 2019-08-08 15:45:29 +00:00
Jake Howard 76b40a37e7 Merge pull request #15111 from RealOrangeOne:patch-1
* Remove unavoidable print of CV error

The return value covers whether the device exists.

This might be better hidden behind a debug flag, but I couldn't work out how to do that nicely.

* Use `CV_LOG_WARNING` macro to log rather than removing it entirely
2019-08-08 16:56:49 +03:00
Alexander Alekhin 487d331d74 Merge pull request #15256 from dkurt:dnn_model_warps 2019-08-08 13:54:35 +00:00
Alexander Alekhin a77275e650 videoio(test): skip unstable MSMF tests (3) 2019-08-08 16:25:19 +03:00
Alexander Alekhin 5e527d22e3 gapi: fix build with MSVS2017/2019 2019-08-08 16:13:25 +03:00
Tomoaki Teshima 40c71a2463 suppress noisy warning
* add -Wno-psabi when using GCC 6
  * add -Wundef for CUDA 10
  * add -Wdeprecated-declarations when using GCC 7
  * add -Wstrict-aliasing and -Wtautological-compare for GCC 7
  * replace cudaThreadSynchronize with cudaDeviceSynchronize
2019-08-08 21:49:32 +09:00
Alexander Alekhin 5ef548a985 cmake: update initialization 2019-08-08 15:23:16 +03:00
Paul E. Murphy f38a61c66d fast_math: implement optimized PPC routines
Implement cvRound using inline asm. No compiler support
exists today to properly optimize this. This results in
about a 4x speedup over the default rounding. Likewise,
simplify the growing number of rounding function overloads.

For P9 enabled targets, utilize the classification
testing instruction to test for Inf/Nan values. Operation
speedup is about 1.2x for FP32, and 1.5x for FP64 operands.

For P8 targets, fallback to the GCC nan inline. It provides
a 1.1/1.4x improvement for FP32/FP64 arguments.
2019-08-07 15:01:18 -05:00
Paul E. Murphy 3f92bcc11a fast_math: selectively use GCC rounding builtins when available
Add a new macro definition OPENCV_USE_FASTMATH_GCC_BUILTINS to enable
usage of GCC inline math functions, if available and requested by the
user.

Likewise, enable it for POWER. This is nearly always a substantial
improvement over using integer manipulation as most operations can
be done in several instructions with no branching. The result is a
1.5-1.8x speedup in the ceil/floor operations.

1. As tested with AT 12.0-1 (GCC 8.3.1) compiler on P9 LE.
2019-08-07 15:01:18 -05:00
Paul E. Murphy b2135be594 fast_math: add extra perf/unit tests
Add a basic sanity test to verify the rounding functions
work as expected.

Likewise, extend the rounding performance test to cover the
additional float -> int fast math functions.
2019-08-07 14:59:46 -05:00
AsyaPronina 816929c704 Bump to new ADE release v0.1.1f 2019-08-07 21:35:28 +03:00
Dmitry Kurtaev a9839af903 Add preprocessing warps for separate parameters 2019-08-07 14:51:41 +03:00
Dmitry Kurtaev 6193e403e7 Enable some tests for 2019R2 2019-08-07 09:07:53 +03:00
Alexander Alekhin 32da0705cf Merge pull request #15102 from dgel:force_input_format_ffmpeg 2019-08-06 20:52:57 +00:00
Alexander Alekhin ba1a48c2ce Merge pull request #14901 from fishjam:issue_8834 2019-08-06 20:52:21 +00:00
Alexander Alekhin 821f17d666 Merge pull request #15235 from pmur:vsx-v_signmask-vbpermq 2019-08-06 20:09:22 +00:00
Lubov Batanina 0e1ef8f8e1 Merge pull request #15184 from l-bat:IE_R2
Support new IE API (#15184)

* Add support OpenVINO R2 for layers

* Add Core API

* Fix tests

* Fix expectNoFallbacksFromIE for ONNX nets

* Remove deprecated API

* Remove td

* Remove TargetDevice

* Fix Async

* Add test

* Fix detectMyriadX

* Fix test

* Fix warning
2019-08-06 22:20:26 +03:00
Douwe Gelling 96a27f4266 allow forcing the input format for ffmpeg backend with env var 2019-08-06 19:30:39 +03:00
fishjam 26ac5a3bdc try to fix VideoCapture different time stamp 2019-08-06 19:04:22 +03:00
ilbalance cf93a05d2d Merge pull request #15230 from ilbalance:js_rotate
* in OpenCV.js added 'rotate' function and test sample

* value test added
2019-08-06 12:55:15 +03:00
Alexander Alekhin 174b4ce29d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-08-05 18:11:43 +00:00
Alexander Alekhin 90ccd2f37c Merge pull request #15239 from alalek:videoio_skip_msmf_tests2 2019-08-05 18:08:48 +00:00
Alexander Alekhin a4b4432015 videoio(test): skip unstable MSMF tests (2) 2019-08-05 19:13:17 +03:00
Vishal Chiluka bca49b99ca Removing static linking of cuda library 2019-08-05 21:42:10 +05:30
Dmitry Budnikov 6427744063 perf tests are added 2019-08-05 19:04:14 +03:00
Alexander Alekhin 365323afec Merge pull request #15234 from alalek:backport 2019-08-05 15:09:22 +00:00
Alexander Alekhin 99f709ca96 Merge pull request #15233 from alalek:videoio_skip_msmf_tests 2019-08-05 15:08:41 +00:00
Alexander Alekhin 3fc02353be Merge pull request #15228 from flyseaworld:exif/read_num_dir 2019-08-05 15:07:40 +00:00
Dmitry Matveev 0757a51e2b Merge pull request #15090 from dmatveev:dm/ng-0001-g-api-inference-api
* G-API-NG/API: Introduced inference API and IE-based backend

- Very quick-n-dirty implementation
- OpenCV's own DNN module is not used
- No tests so far

* G-API-NG/IE: Refined IE backend, added more tests

* G-API-NG/IE: Fixed various CI warnings & build issues + tests

- Added tests on multi-dimensional own::Mat
- Added tests on GMatDesc with dimensions
- Documentation on infer.hpp
- Fixed more warnings + added a ROI list test
- Fix descr_of clash for vector<Mat> & standalone mode
- Fix build issue with gcc-4.8x
- Addressed review comments

* G-API-NG/IE: Addressed review comments

- Pass `false` to findDataFile()
- Add deprecation warning suppression macros for IE
2019-08-05 17:56:34 +03:00
Dmitry Budnikov 290078e0d0 copy kernels 2019-08-05 17:46:28 +03:00
Sebastián Gurin ca79f75b32 OpenCV.js docker container build instructions
backport of commit: 59b0314a0e
2019-08-05 17:21:34 +03:00
Victor Romero 987bb2ca61 Fix build for UWP
backport of commit: f18cbd036a
2019-08-05 17:19:36 +03:00
TheGoddessInari 960bb540ec Make sure to use defined(__GNUC__) instead of bare __GNUC__ in flann2 header.
This fixes a compiler error on MSVC with Unreal Engine (at least).

backport of commit: 4e998c9ade
2019-08-05 17:19:12 +03:00
John Smith b9d6fc9dad Fix cv::selectROI rectangle rendering issue
backport of commit: 95c65aff75
2019-08-05 17:18:30 +03:00
Paul E. Murphy 1031b7f4bc hal: vsx: further optimize v_signmask
Use the quadword bit permutation instruction to creatively move
the sign bits to create the mask. Note that values above 127 will
result in 0.
2019-08-05 09:00:22 -05:00
Alexander Alekhin 406313bbc5 videoio(test): skip unstable MSMF tests 2019-08-05 16:57:26 +03:00
yaohai [姚海] cadb4dee14 fix exif bug 2019-08-05 16:41:07 +03:00
Alexander Alekhin d2c64b566b Merge pull request #15227 from tomoaki0705:fixFallThroughCarotene 2019-08-05 12:44:00 +00:00
Alexander Alekhin c5069266dc Merge pull request #15222 from hmaarrfk:verify_carbon 2019-08-05 12:43:13 +00:00
Sebastián Gurin 59b0314a0e Merge pull request #15221 from cancerberoSgx:master
OpenCv.js docker container build instructions (#15221)

* emscripten docker container

* docker

* typo

* typo

* whitespace issue
2019-08-05 15:41:59 +03:00
Tomoaki Teshima d6ba235655 fix fall through warning 2019-08-05 17:42:48 +09:00
Mark Harfouche 63775320ae Verify Carbon correctly on OSX 2019-08-04 18:26:28 -04:00
Alexander Alekhin 95eb199f41 Merge pull request #15220 from thangktran:fixbug/confusing_error_message_from_persistence 2019-08-04 21:10:06 +00:00
Thang Tran d659eb9327 core: fixed error message to avoid confusion 2019-08-04 17:17:03 +02:00
Evgeny Latkin f17a6b478b GAPI: use plain-C interface to math functions, sin/cos, etc.
- addresses #15163: C++11 definition issue by @neheb
2019-08-04 08:07:46 +03:00
Victor Romero f18cbd036a Merge pull request #15207 from vicroms:fix-uwp-build
Fix build for UWP (#15207)

* Guard non-WinRT calls to fix UWP build

* Remove unnecessary guard for WinRT
2019-08-03 22:53:38 +03:00
Alexander Alekhin b584c23061 Merge pull request #15158 from dkurt:fix_tf_ssd_configs 2019-08-02 16:08:55 +00:00
Alexander Alekhin ba934ff1ce Merge pull request #15202 from hugolm84:support_build_shared_for_wince 2019-08-02 15:34:02 +00:00
Alexander Alekhin b811420d28 Merge pull request #15188 from mshabunin:fix-v4l-old 2019-08-02 12:25:23 +00:00
Maksim Shabunin b231e91d87 Fix for building with old V4L 2019-08-02 11:19:49 +03:00
Alexander Alekhin f9cefc84a3 Merge pull request #15098 from RealJohnSmith:master 2019-08-01 16:35:07 +00:00
Alexander Alekhin 977d2c4330 Merge pull request #15197 from mshabunin:restore-ipp-cut 2019-08-01 16:33:37 +00:00
Alexander Alekhin 3f4004ae45 Merge pull request #15195 from mshabunin:disable-pch 2019-08-01 16:33:10 +00:00
Andrey Golubev fc85f3644d Merge pull request #15190 from andrey-golubev:fluid_invalid_roi
G-API: verify y offset and height of Fluid output ROIs (#15190)

* G-API: validate GFluidOutputRoi y and height

* Rearrange tested ROIs
2019-08-01 19:30:05 +03:00
Hugo Lindström 03fe1cb7fc Support building shared libraries on WINCE. 2019-08-01 15:28:04 +02:00
Maksim Shabunin 4dadf17bd9 Merge pull request #15168 from dkurt:dnn_onnx_15120 2019-07-31 15:03:23 +00:00
Maksim Shabunin 6d5ac67681 Restored IPP call reduction 2019-07-31 15:41:22 +03:00
Maksim Shabunin 1275248f39 PCH: disable by default on all platforms except MSVC 2019-07-31 15:20:01 +03:00
dcouwenh d3cf0d2c06 Bayer VNG Demosaicing Fix #2 (Merge pull request #15086)
* Update demosaicing.cpp

Fixed calculation of Bs for non-green pixels.

* Fixed cvtColor perf test for bayer VNG
2019-07-30 23:49:46 +03:00
Andrey Golubev 304e3ac12f G-API: fix Fluid reshape with unused nodes (Merge pull request #15115)
* G-API: fix fluid reshape with unused nodes

* Update test names

* Add FIXME for future improvement
2019-07-30 23:48:46 +03:00
Lubov Batanina 778f42ad34 Add high level API (Merge pull request #14780)
* Add high level API

* Fix Model

* Add DetectionModel

* Add ClassificationModel

* Fix classify

* Add python test

* Fix pytest

* Fix comments to review

* Fix detect

* Fix docs

* Modify DetectionOutput postprocessing

* Fix test

* Extract ref boxes

* Fix draw rect

* fix test

* Add rect wrap

* Fix wrap

* Fix detect

* Fix Rect wrap

* Fix OCL_FP16

* Fix MyriadX

* Fix nms

* Fix NMS

* Fix coords
2019-07-30 23:07:37 +03:00
Maksim Shabunin f482050f9a Merge pull request #15172 from TheGoddessInari:fix_windows 2019-07-30 14:28:07 +00:00
Maksim Shabunin 5ef7325874 Merge pull request #15176 from dkurt:fix_14993 2019-07-30 14:26:33 +00:00
Lubov Batanina 5a6b23e8f3 Support for several min and max sizes in PriorBox layer (Merge pull request #15076)
* Support for several min and max sizes in PriorBox layer

* Fix minSize

* Check size

* Modify initInfEngine

* Fix tests

* Fix IE support

* Add priorbox test

* Remove inputs
2019-07-30 17:23:47 +03:00
Maksim Shabunin e90438fe3c Merge pull request #14938 from LaurentBerger:face_clip 2019-07-30 14:18:51 +00:00
Maksim Shabunin f7d5b39ec9 Merge pull request #15169 from dkurt:dnn_onnx_drop_vgg16 2019-07-30 14:15:34 +00:00
Maksim Shabunin eec9fa9d5e Merge pull request #15181 from berak:java_print_blob 2019-07-30 14:13:02 +00:00
berak 4d3989817c java: fix Mat.toString() for higher dimensions 2019-07-29 19:39:09 +02:00
Dmitry Kurtaev 59864a3bbc Fix #14993 2019-07-28 22:32:37 +03:00
Dmitry Kurtaev f9f160404a Add support for slice from ONNX with multiple outputs 2019-07-28 21:20:25 +03:00
TheGoddessInari 4e998c9ade Make sure to use defined(__GNUC__) instead of bare __GNUC__ in flann2 header.
This fixes a compiler error on MSVC with Unreal Engine (at least).
2019-07-28 10:21:15 -07:00
Dmitry Kurtaev ebaefbb745 Remove VGG16 from ONNX test because there is VGG16_bn 2019-07-27 23:04:25 +03:00
Dmitry Kurtaev 47c5ee5d9c Fixes for OpenCV face detection network 2019-07-27 17:25:09 +02:00
Dmitry Kurtaev 77d4e3e8d2 Fix 2019R2 tests 2019-07-27 13:30:15 +03:00
Dmitry Kurtaev a0c3bb70a9 Modify SSD from TensorFlow graph generation script to enable MyriadX 2019-07-26 13:57:08 +03:00
Alexander Alekhin 3debb98805 Merge tag '4.1.1' 2019-07-26 03:34:59 +00:00
Alexander Alekhin ddbd10c001 release: OpenCV 4.1.1
OpenCV 4.1.1
2019-07-26 03:24:45 +00:00
Alexander Alekhin 7c0a43d425 Merge tag '4.1.1-openvino' 2019-07-26 03:23:42 +00:00
Alexander Alekhin 0cf479dd5c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-25 19:21:47 +00:00
Alexander Alekhin 2693ed9b22 Merge tag '3.4.7' 2019-07-25 19:19:49 +00:00
Alexander Alekhin 4a7ca5a291 OpenCV version++ (3.4.7)
OpenCV 3.4.7
2019-07-25 19:01:19 +00:00
Alexander Alekhin 7295983964 Merge pull request #15139 from alalek:openvino_2019R2 2019-07-25 18:59:56 +00:00
Alexander Alekhin 39a6889767 Merge pull request #15118 from dkurt:fix_15106 2019-07-25 18:56:32 +00:00
Chip Kerchner 0db4fb1835 Merge pull request #15136 from ChipKerchner:dotProd_unroll
* Unroll multiply and add instructions in dotProd_32f - 35% faster.

* Eliminate unnecessary v_reduce_sum instructions.
2019-07-25 21:21:32 +03:00
Alexander Alekhin ac425f67e4 Merge pull request #15150 from alalek:fix_15124_15125 2019-07-25 18:19:04 +00:00
Dmitry Kurtaev a2125594ea Fix false positives of face detection network for large faces 2019-07-25 20:09:59 +03:00
Alexander Alekhin 1f736a95a7 Merge pull request #15131 from paroj:web 2019-07-25 16:25:57 +00:00
Alexander Alekhin 79859ebca3 Merge pull request #15145 from alalek:fix_15127 2019-07-25 16:14:25 +00:00
Alexander Alekhin 416c693b3f dnn(test): OpenVINO 2019R2 2019-07-25 19:01:16 +03:00
Alexander Alekhin 321c74ccd6 objdetect: validate feature rectangle on reading 2019-07-25 18:58:53 +03:00
Alexander Alekhin 5691d998ea core(persistence): added null ptr checks 2019-07-25 15:14:22 +03:00
Alexander Alekhin 6158bd2afa Merge pull request #15103 from alalek:simd_intrinsics_in_user_code 2019-07-25 11:36:36 +00:00
Alexander Alekhin d2911a8d41 dnn: use OpenVINO 2019R2 defines 2019-07-24 21:37:03 +00:00
Andrey Golubev b10ec8ef8b Merge pull request #14985 from andrey-golubev:gapi_fix_ocl_umat
* G-API: fix GOCLExecutable issue with UMat lifetime

Add tests on initialized/uninitialized outputs for all
backends

* Use proper clean-up procedure for magazine

* Rename InitOut test and reduce tested sizes

* Enable output allocation test
2019-07-24 23:36:18 +03:00
Alexey Smirnov 8313209704 Merge pull request #14952 from smirnov-alexey:gapi_transform_macro_rework
G-API: GAPI_TRANSFORM internal functionality rework (#14952)

* Change internal pattern and substitute signatures and refactor tests

* Enhance GArrayU with type-checker function

Add a couple of new tests on GAPI_TRANSFORM
2019-07-24 23:29:52 +03:00
Alexander Alekhin 89f23a35c5 Merge pull request #15091 from anton-potapov:fluid_internal_parallellism_custom_pfor 2019-07-24 20:28:48 +00:00
Hugo Lindström 2ee00e7f7d Merge pull request #15059 from hugolm84:improved-support-for-wince
* Improve support for Windows Embedded Compact

* Remove redundant set(WINCE true) and format CMake
2019-07-24 23:12:09 +03:00
Pavel Rojtberg 293729f48a js: whitelist some more functions (calib3d , aruco) 2019-07-23 11:57:59 +02:00
Alexander Alekhin 79310a0051 Merge pull request #15105 from komakai:camera_permissions 2019-07-22 17:47:54 +00:00
Alexander Alekhin b69bf8a897 Merge pull request #15097 from komakai:no_samples_build-option 2019-07-22 17:38:37 +00:00
Alexander Alekhin 426482e05b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-21 18:06:04 +00:00
Alexander Alekhin ad092bf1ce Merge pull request #15107 from dkurt:js_features2d_drawings 2019-07-21 17:57:19 +00:00
Alexander Alekhin 557990fdcf Merge pull request #15104 from alalek:videoio_fix_debug_message 2019-07-21 17:56:41 +00:00
Dmitry Kurtaev a66a1a24d7 Fix drawKeypoints and drawMatches for JS 2019-07-20 23:47:26 +03:00
Alexander Alekhin 099f4f9e7c Merge pull request #15093 from tomoaki0705:fixCudaLegacyRansac 2019-07-20 08:07:14 +00:00
Giles Payne 2734291b35 Add CameraActivity utility class to automate Camera permission request handling 2019-07-20 13:40:10 +09:00
Alexander Alekhin 8bac8b513c core: support SIMD intrinsics in user code 2019-07-19 20:33:32 +00:00
Lubov Batanina 781f4d439e Merge pull request #15032 from l-bat:reduce_mean
* Added support for the ONNX "ReduceMean" Layer. (as this is the same as the GlobalAveragePool)

* Add ReduceMean test

* Fix ONNX importer

* Fix ReduceMean

* Add assert

* Split test

* Fix split test
2019-07-19 19:18:34 +03:00
Alexander Alekhin a8a71eb200 Merge pull request #15092 from alalek:videoio_gstreamer_more_get_checks 2019-07-19 15:50:54 +00:00
John Smith 95c65aff75 Fix cv::selectROI rectangle rendering issue 2019-07-19 14:07:09 +02:00
Alexander Alekhin 61f589ddd0 videoio(gstreamer): more .get() checks 2019-07-19 13:16:58 +03:00
Alexander Alekhin 3361c59576 Merge pull request #15084 from lpea:calib3d_doc_fix 2019-07-19 10:11:35 +00:00
Anton Potapov 8936d55675 Fluid Internal Parallelism
- added ability to use custom implementation of "parallel for" function
2019-07-19 11:56:57 +03:00
Tomoaki Teshima c6de84d868 cudalegacy: fix test failure of SolvePnPRansac
* use SOLVE_EPNP for the initial guess
2019-07-19 17:50:00 +09:00
Alexander Alekhin 228af2d617 videoio: fix debug message 2019-07-18 21:45:07 +00:00
Alexander Alekhin 199ddff13b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-18 20:25:25 +00:00
Alexander Alekhin 985e5014bc Merge pull request #15058 from alalek:core_fix_base64_packed_struct_master 2019-07-18 19:09:08 +00:00
Alexander Alekhin 002904e445 Merge pull request #15050 from alalek:core_fix_base64_packed_struct 2019-07-18 19:07:06 +00:00
Vitaly Tuzov e0f8bb83a6 Merge pull request #14994 from terfendail:wintr_undistort
WUI based implementation to initUndistortRectifyMap (#14994)

* Add initUndistortRectifyMap performance test

* Move cv namespace boundaries

* Add wide universal intrinsics based implementation to initUndistortRectifyMap

* Dispatch undistort
2019-07-18 19:32:51 +03:00
Lubov Batanina 12fdaf895e Merge pull request #15057 from l-bat:fix_vizualizer
* Fix dumpToFile

* Add test

* Fix test
2019-07-18 18:41:08 +03:00
Alexander Alekhin 8b341884d2 Merge pull request #15080 from alalek:gapi_fix_build 2019-07-18 15:15:25 +00:00
Giles Payne a897fc91ec Add no_samples_build option to Android SDK build 2019-07-18 21:31:02 +09:00
Alexander Alekhin e7bb0ecee0 gapi: fix build with unique_ptr
avoid generation of copy ctors with unique_ptr members
2019-07-18 14:08:42 +03:00
Alexander Alekhin c12e26ff28 Merge pull request #15071 from l-bat:tf_split 2019-07-18 08:12:42 +00:00
Guillaume Jacob 4a28ef8034 calib3d: fix format in findChessboardCornersSB doxygen 2019-07-18 10:04:47 +02:00
Liubov Batanina 0d2bc7b5fd Fix TF Split layer 2019-07-17 15:50:50 +03:00
Alexander Alekhin f6ec0cd827 Merge pull request #15061 from AsyaPronina:dev/fix_merge_issue 2019-07-16 21:00:50 +03:00
AsyaPronina add1df4bcb Fixed issue happened during merge 2019-07-16 20:47:34 +03:00
Alexander Alekhin 65d148d9a8 Merge pull request #15024 from alalek:android_stl_cxx_shared 2019-07-16 17:10:04 +00:00
Andrey Golubev c9bd43c0f6 Merge pull request #14945 from andrey-golubev:delete_bool
G-API: clean up accuracy tests (#14945)

* Delete createOutputMatrices flag

Update the way compile args function is created

Fix instantiation suffix print function

* Update comment (NB)

* Make printable comparison functions

* Use defines instead of objects for compile args

* Remove custom printers, use operator<< overload

* Remove SAME_TYPE and use -1 instead

* Delete createOutputMatrices flag in new tests

* Fix GetParam() printed values

* Update Resize tests: use CompareF object

* Address code review feedback

* Add default cases for operator<< overloads

* change throw to GAPI_Assert
2019-07-16 19:04:18 +03:00
Andrey Golubev c11423df1e Merge pull request #15012 from andrey-golubev:test_output
G-API: Add output allocation tests for backends (#15012)

* Add output tests for backends

* Fix large size test: output is in fact reallocated

* Use cv::Mat copies for reallocation tracking

* Separate LargeSizeWithCorrectSubmatrix test

* Rename backed output allocation tests

* Address code review feedback

Update test names

Add illustrative "expect (non-)empty" checks

Rename mat "copy" to mat reference

Add more pointer checks

* Add illustrative checks
2019-07-16 19:01:45 +03:00
Alexander Alekhin e4e0bb533d Merge pull request #15052 from alalek:dnn_fix_required_data 2019-07-16 16:00:33 +00:00
Andrey Golubev e629785a97 Merge pull request #15021 from andrey-golubev:gapi_fix_standalone_exports
* Fix G-API export specifier in standalone build

* Make dummy GAPI_EXPORTS in case of non-OpenCV builds

* Add old version under #if 0
2019-07-16 18:53:51 +03:00
Alexander Alekhin 3a2a74b655 Merge pull request #14968 from anton-potapov:fluid_internal_parallellism 2019-07-16 14:22:06 +00:00
Alexander Alekhin f5e01f7b49 Merge pull request #15037 from hugolm84:noop-noexcept-for-vs13 2019-07-16 13:28:15 +00:00
Chip Kerchner c9fcc12e3b Merge pull request #15048 from ChipKerchner:reduceStoreGatheringThreshold
* Reduce store gathering pressures - speeds thresholds by up to 20%

* Rename temporary histogram array and initialize so that MACOSX builder is happy
2019-07-16 16:10:49 +03:00
Anton Potapov 97e88bd769 Fluid Internal Parallelism
- Added new graph compile time argument to specify multiple independent
ROIs (Tiles)
 - Added new "executable" with serial loop other user specified
ROIs(Tiles)
 - refactored graph traversal code into separate function to be called
once
 - added saturate cast to Fluid AddCsimple test kernel
2019-07-16 16:09:14 +03:00
Alexander Alekhin d4501f08b8 core(persistence): disable base64 tests due missing encoders 2019-07-16 15:37:58 +03:00
Alexander Alekhin 2df7736562 Merge branch 'core_fix_base64_packed_struct' 2019-07-16 15:35:43 +03:00
Alexander Alekhin 4ea8526e9f core(persistence): fix writeRaw() / readRaw() struct support
- writeRaw(): support structs
- readRaw(): 'len' is buffer limit in bytes (documentation is fixed)
2019-07-16 14:03:39 +03:00
Alexander Alekhin ee1de8f30d Merge pull request #15053 from SciMad:fix-error-message 2019-07-16 09:55:06 +00:00
Alexander Alekhin 5ccb2a4cbd dnn(test): fix required data 2019-07-16 07:53:50 +00:00
Madhav bee510dbce Fix error message on invalid seam finder parameter 2019-07-16 13:27:04 +05:45
Alexander Alekhin c3b838b738 core(persistence): struct storage layout without alignment gaps 2019-07-15 21:37:20 +00:00
Alexander Alekhin 571b69bdb6 Merge pull request #15049 from alalek:disable_14850 2019-07-15 16:27:45 +00:00
Alexander Alekhin 095f44f4b2 cmake: disable WITH_NVCUVID by default due build failures 2019-07-15 17:09:07 +03:00
Alexander Alekhin 95415ac3a5 android: change ANDROID_STL='c++_shared'
- fixes crashes in face-detector application
- libc++_shared.so is bundled automatically via CMake helper project
2019-07-12 18:58:02 +00:00
Alexander Alekhin f6c573880e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-12 18:45:06 +00:00
Alexander Alekhin 054c796213 Merge pull request #15026 from terfendail:gaussian_fix 2019-07-12 18:31:09 +00:00
Hugo Lindström 245c256b1c Support compiliation for <=VS13 2019-07-12 19:02:36 +02:00
Alexander Alekhin 6aa07cdc7e Merge pull request #15025 from alalek:issue_14281 2019-07-12 15:28:44 +00:00
Vitaly Tuzov 894ad33bf4 Fix pixel value evaluation overflow in bit-exact GaussianBlur implementation 2019-07-12 18:11:51 +03:00
Lubov Batanina 34f6b05467 Merge pull request #14996 from l-bat:ocv_deconv3d
* Support Deconvolution3D on IE backend

* Add test tag

* Fix tests
2019-07-12 15:51:44 +03:00
Alexander Alekhin 32c6e58bdb imgproc: fix unaligned memory access
may cause crashes on ARM platform
2019-07-11 20:49:47 +00:00
Lubov Batanina 8bcd7e122a Merge pull request #14842 from l-bat:ocv_conv3d
* Support Conv3D on OCV backend

* Add header

* Add perf tests

* Support pool3d

* Enable Resnet34_kinetics on OCV backend

* Add test

* Fix conv

* Optimize Conv2D
2019-07-11 20:13:52 +03:00
Alexander Alekhin f663e8f903 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-09 19:57:57 +00:00
Alexander Alekhin 3c086fb2fe Merge pull request #15001 from antmicro:v4l2-y10-support 2019-07-09 14:34:11 +00:00
Alexander Alekhin 32b6ebb670 Merge pull request #14989 from alalek:issue_14978 2019-07-09 14:14:06 +00:00
Alexander Alekhin de4d304d90 Merge pull request #15000 from mshabunin:fix-videoio-writer 2019-07-09 12:59:10 +00:00
Tomasz Gorochowik 4997a6bf06 V4L2: Add V4L2_PIX_FMT_Y10 (10 bit grey) support 2019-07-09 14:36:00 +02:00
Maksim Shabunin 2a9521661e Fixed video writer filename check for plugins 2019-07-09 14:16:49 +03:00
Maksim Shabunin 693877212d Fixed video writer filename check for plugins 2019-07-09 14:08:29 +03:00
Alexander Alekhin 1e9e2aa95c Merge pull request #14811 from jxu:ubuntu-doc-fix 2019-07-08 16:47:19 +00:00
jxu b9399a5df8 Fix python setup in ubuntu dependencies 2019-07-07 15:15:31 -04:00
Alexander Alekhin 8408587341 Merge pull request #14888 from vchiluka5:NVIDIA_Optical_Flow 2019-07-07 17:20:53 +03:00
Alexander Alekhin 0fc584961c cmake: workaround to fix link issues with stubs/libcuda.so.1 2019-07-06 16:29:59 +00:00
Alexander Alekhin eedbd1ad59 imgcodecs: force reshaping of imdecode() input into a single row
OpenCV upstream stuff may reinterpret vector as column.
2019-07-06 10:11:29 +00:00
Alexander Alekhin 7589225fc0 Merge pull request #14981 from alalek:android_camera_use_calc_frame_size_method 2019-07-06 08:20:20 +00:00
Alexander Alekhin 39a975cb29 Merge pull request #14983 from tomoaki0705:fixOclCvtColorMRGBA 2019-07-05 09:31:08 +00:00
Tomoaki Teshima 594a95839c fix test failure of OCL_ImgProc/CvtColor8u.mRGBA2RGBA 2019-07-05 11:22:22 +09:00
Alexander Alekhin 3998b41d68 android: JavaCamera2View use calculateCameraFrameSize() method
from CameraBridgeViewBase (common base with JavaCameraView)
2019-07-04 21:43:09 +00:00
Diego 57fae4a6a1 Merge pull request #14858 from dvd42:instancenorm_onnx
Instancenorm onnx (#14858)

* Onnx unsupported operation handling

* instance norm implementation

* Revert "Onnx unsupported operation handling"

* instance norm layer test

* onnx instancenorm layer
2019-07-04 21:15:04 +03:00
Alexander Alekhin d7744aca02 dnn: use OpenVINO 2019R2 defines 2019-07-04 19:22:48 +03:00
Alexander Alekhin db211446f3 OpenCV version '-openvino' 2019-07-04 19:22:48 +03:00
Alexander Alekhin 43eba3d750 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-04 18:44:13 +03:00
Ruslan Garnov ad49138fae Merge pull request #14917 from rgarnov:gapi_planar_kernels
G-API planar kernels (#14917)

* Added resizeP with tests

* NV12 planar filters

* fix warnings in ResizeP test

* fix out mat ocv warning

* sz_on - > sz rename

* cpu tests new signature

* try to fix resizeP test

* trailing spaces remove

* doxygen doc fixed

* doxygen minor fix

* more doxygen fixes

* Doxygen corrected and extended after review.
2019-07-04 18:19:09 +03:00
Alexander Alekhin 3200fe0e53 Merge pull request #14970 from terfendail:undistort_avx2_fix 2019-07-04 14:01:27 +00:00
Vitaly Tuzov 82e5b961d3 Fixed initUndistortRectifyMap AVX2 implementation 2019-07-04 15:49:33 +03:00
Alexander Alekhin e00b0f6f47 Merge pull request #14860 from vonchenplus:ocv_maxpoolgrad 2019-07-04 09:57:14 +03:00
Diego 6dfe2ddc21 Merge pull request #14959 from dvd42:onnx_clip
* onnx clip operation
2019-07-04 08:56:00 +03:00
Alexander Alekhin fee87c5fdb Merge pull request #14975 from alalek:clang_suppress_warnings 2019-07-03 22:33:26 +00:00
Alexander Alekhin 07fe1cd6b8 videoio: eliminate build warnings (clang) 2019-07-03 21:57:05 +00:00
Alexander Alekhin ac14cee71c Merge pull request #14974 from alalek:ts_optional_files_runtime_check 2019-07-03 19:14:43 +00:00
Alexander Alekhin f795878d1a Merge pull request #14973 from alalek:itt_aarch64_support 2019-07-03 19:13:57 +00:00
Alexander Alekhin bc95c609ff ts: runtime check for misused 'optional' test data files 2019-07-03 20:07:44 +03:00
Alexander Alekhin ca022fdb4c 3rdparty(itt): support AARCH64 2019-07-03 18:35:43 +03:00
gal0is 206b546e5a tensroflow support maxpoolgrad 2019-07-03 09:53:17 +08:00
Alexander Alekhin 097d81363b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-07-02 21:17:45 +00:00
Alexander Alekhin 2370079220 Merge pull request #14954 from rafagjordana:fix_blob_detection_insertion_sort 2019-07-02 21:14:02 +00:00
Alexander Alekhin 02936dcf86 Merge pull request #14926 from alalek:tbb_version_2019u8 2019-07-02 21:12:00 +00:00
Alexander Alekhin ff877af2af Merge pull request #14929 from alalek:cmake_rpath_link_support 2019-07-02 20:31:33 +00:00
Rafa Gomez-Jordana 9a24886282 Fix blob detector insertion sort 2019-07-02 19:54:27 +00:00
Alexander Alekhin 350532ea2c Merge pull request #14964 from arnaudbrejeon:bug_fix_14955 2019-07-02 19:50:47 +00:00
Alexander Alekhin 3b8701e97e Merge pull request #14963 from alalek:pr14925_fix 2019-07-02 19:43:09 +00:00
arnaudbrejeon a37201abee Fix crash, add assert and test 2019-07-02 09:56:31 -07:00
Alexander Alekhin e3e8a58799 Merge pull request #14958 from tomoaki0705:fixArmFp16Behavior 2019-07-02 16:40:21 +00:00
Alexander Alekhin 275579a835 Merge pull request #14925 from StefanBruens:handle_absolute_include_path 2019-07-02 16:05:53 +00:00
Andrey Golubev 2bf8793632 Merge pull request #14946 from andrey-golubev:obj_not_ref
G-API: Use object instead of reference in extended lifetime case (#14946)

* Use object instead of reference

* Make the object const
2019-07-02 19:03:45 +03:00
Tomoaki Teshima db6a6ccaba re-enable CPU_BASELINE=FP16 on Armv7 platform 2019-07-02 21:57:15 +09:00
Alexander Alekhin 69560588fe Merge pull request #14953 from alalek:core_static_analysis_eval_expr 2019-07-02 09:44:29 +00:00
armenpoghosov edf2cbd5f7 Merge pull request #14828 from armenpoghosov:parmen_RANSACPointSetRegistrator_getSubset_disaster_cleanup
Parmen ransac point set registrator get subset disaster cleanup (#14828)
2019-07-01 21:57:28 +03:00
Alexander Alekhin b00e19a8da Merge pull request #14837 from Cartucho:fix_laplace_operator_on_python 2019-07-01 17:00:25 +00:00
Alexander Alekhin 6dea8309c5 Merge pull request #14880 from dkurt:dnn_ie_tests 2019-07-01 16:58:57 +00:00
Vitaly Tuzov 9befb7a1d7 Merge pull request #14916 from terfendail:wsignmask_deprecated
* Avoid using v_signmask universal intrinsic and mark it as deprecated

* Renamed v_find_negative to v_scan_forward
2019-07-01 19:53:51 +03:00
Alexander Alekhin bff90d4684 Merge pull request #14951 from alalek:issue_14937 2019-07-01 16:48:05 +00:00
Alexander Alekhin 44836c7f78 core: evaluate CV_Error() parameters during static scans 2019-07-01 18:17:03 +03:00
Alexander Alekhin 65552bf403 dnn: fix build with Vulkan 2019-07-01 17:54:40 +03:00
LaurentBerger 97681d0607 Add clip to deploy.prototxt 2019-06-30 18:39:05 +02:00
StefanBruens 3e4a195b61 Merge pull request #14936 from StefanBruens:crosscorr_cleanup
Crosscorr cleanup (#14936)

* Simplify code for convolution destination type/size

For the 2d filter code, destination size equals source size, and the
crossCorr function even (re-)creates the output matrix with the given size.

The number of channels also have to match. The destination type() is the
one used to create the output matrix, so we can use its type() here.

This is a preparatory patch.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

* Remove redundant destination size and type parameters from crossCorr

All calling sites of crossCorr already use (...,
mat, mat.size(), mat.type(), ...), so the parameters are redundant.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2019-06-30 19:04:25 +03:00
Alexander Alekhin 915427621f Merge pull request #14934 from StefanBruens:silence_assignment_operator_warning 2019-06-30 07:47:07 +00:00
Stefan Brüns e9a2e665b2 Explicitly default operator= for Vec<T, n>
Due to the explicitly declared copy constructor Vec<T, n>::Vec(Vec <T,n>&)
GCC 9 warns if there is no assignment operator, as having one typically
requires the other (rule-of-three, constructor/desctructor/assginment).

As the values are just a plain array the default assignment operator does
the right thing. Tell the compiler explicitly to default it.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2019-06-29 22:11:00 +02:00
Alexander Alekhin 6fdce865b8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-29 17:27:48 +00:00
Alexander Alekhin 25d62cc929 Merge pull request #14931 from dkurt:fix_dnn_js_sample_v4 2019-06-29 17:26:31 +00:00
Alexander Alekhin 93ef27aeba Merge pull request #14920 from StefanBruens:fix_arm_on_aarch64_detection 2019-06-29 17:17:16 +00:00
Dmitry Kurtaev a04ab2298b Fix JS sample of dnn 2019-06-29 19:21:14 +03:00
Alexander Alekhin 43e457c883 3rdparty: TBB version 2018u1 => 2019u8
- make it configurable via OPENCV_TBB_RELEASE + OPENCV_TBB_RELEASE_MD5
- remove legacy support
2019-06-29 11:16:49 +00:00
Alexander Alekhin bc79f477dd cmake: support rpath-link linker option
- builds with CMAKE_SKIP_RPATH=ON should properly find project .so files from <build>/lib directory
- $ORIGIN doesn't work properly in cross-compilation mode
2019-06-29 11:03:45 +00:00
Alexander Alekhin e3aa96ccf2 cmake: normalize include directories in OpenCVConfig.cmake 2019-06-28 20:57:58 +00:00
Alexander Alekhin 453466eb1a Merge pull request #14885 from anton-potapov:common_flow_explanatory_test_cases 2019-06-28 16:52:03 +00:00
Alexander Alekhin 49805f976a Merge pull request #14923 from andrey-golubev:imgproc_tests_update_clean 2019-06-28 16:01:32 +00:00
Andrey Golubev 1666195984 Merge pull request #14922 from andrey-golubev:operators_tests_update_clean
G-API: Align operators tests to new test model (#14922)

* Align operators tests to new test model

* Change init function in NotOperatorTest
2019-06-28 17:59:52 +03:00
Anton Potapov 3d345ca4c4 Async API for GAPI
- explanatory  test cases for common usage models
2019-06-28 17:40:00 +03:00
atalaman 8dd596b7ba Merge pull request #14892 from TolyaTalamanov:at/parameterized-render-tests
G-API: Parameterized render tests (#14892)

* Init commit

* Add mat size as test parameter

* Add test for text render

* Add test for rect render

* Add tests for line and circle

* Remove old render tests

* Init output mats

* Remove methods input arguments

* Add comment about data loss in BGR2NV12 conversion

* Add edge test cases

* Replace default color for out mats black -> white
2019-06-28 17:11:03 +03:00
Stefan Brüns 0a45b8c478 Handle absolute OPENCV_INCLUDE_INSTALL_PATH correctly
In case OPENCV_INCLUDE_INSTALL_PATH is absolute (i.e. starts with a "/"),
the path ends up with a double "/".

While this is mostly equivalent to a single slash, it may have a nasty
side effect when:
- OpenCV_INSTALL_PATH is empty
- OPENCV_INCLUDE_INSTALL_PATH is "/usr/include"
- the calling build script uses "-isystem" to specify the path to the
  headers of dependencies (to avoid warnings)

Specifying "-isystem /usr/include" breaks the path ordering, and GCC can
no longer find its "stdlib.h", thus CMake filters such statements.
Unfortunately it fails to do so when using "//usr/include".
2019-06-28 15:44:45 +02:00
Dmitry Kurtaev 75f4c1abf2 Enable some tests for Inference Engine backend 2019-06-28 15:52:31 +03:00
Stefan Brüns e10c01047c Fix detection of 32bit ARM builds on Aarch64
It is perfectly possible to compile ARM binaries on Aarch64. Generalize
the code to no only swap X86 with X86_64, but also ARM and AARCH64.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
2019-06-28 14:17:30 +02:00
Andrey Golubev 719912e46e Align imgproc tests to new model 2019-06-28 14:31:50 +03:00
Andrey Golubev 75c567b6ab Merge pull request #14757 from andrey-golubev:core_tests_update
G-API: Introduce new approach to write accuracy tests (#14757)

* G-API: Introduce new common accuracy test fixture

* Enable Range<> to Seq<> implicit conversion

* Fix shadowing parameters

* Update license headers

* Rename ALIGNED_TYPE to SAME_TYPE

* Move MkRange to tests

* Fix TODO(agolubev) in test instantiations

* Squash simple fixture declarations in one line

* Remove unused line

* Fix Windows issues with macro expansion

* Choose between 1 or 2 matrix initialization

* Redesign common class behavior

Use "views" for GetParam() provided by GTest
base class instead of doing segregation
(with copy!) of common and specific parameters:
request common or specific parameter directly
by index from GetParam()-returned parameters

* Refine user-level API and usage of new test model

* Fix -fpermissive errors

* Remove unnecessary init calls

* Replace GCompileArgs member variable with func ptr

* Rename initMatsRandN to make its behavior explicit

Rename initMatsRandN to initMatrixRandN to eliminate confusion:
initMatsRandN only initialized first matrix (similarly to
initMatrixRandU)

* Fix common of initNothing

* Update copyright dates in missed files

* Add check for specific parameters

* Fix coment stlye
2019-06-28 13:07:41 +03:00
Vishal Chiluka 0e9a865bbf Moved NVIDIA_Optical_Flow sample app to opencv_contrib
Description:
Moved NVIDIA_Optical_flow sample app and comparison app to
opencv_contrib branch. Added CUDA_CUDA_LIBRARY in CMakeLists.txt for
resolving linker errors.
2019-06-28 09:19:26 +05:30
Alexander Alekhin 8937e8756e Merge pull request #14918 from alalek:dnn_ie_compilation 2019-06-27 21:34:41 +00:00
Alexander Alekhin a743de0e24 dnn: adjust compilation options 2019-06-27 17:37:31 +03:00
Alexander Alekhin c531e275cc Merge pull request #14914 from Nuzhny007:3.4 2019-06-27 14:22:15 +00:00
Alexander Alekhin e59c6caee5 Merge pull request #14905 from savuor:fix/inst_region_unique 2019-06-27 10:16:59 +00:00
Alexander Alekhin 54fc60eb37 Merge pull request #14881 from dkurt:dnn_ie_num_threads 2019-06-27 10:14:24 +00:00
Nuzhny007 031e57b359 Fixed names conflict with dldt 2019-06-27 13:13:48 +03:00
Dmitry Kurtaev 96a2f80bf2 Limit number of threads in CPU plugin of IE by OpenCV's getNumThreads 2019-06-27 12:09:00 +03:00
Rostislav Vasilikhin f2f600f807 fixed multi instrumentations 2019-06-27 01:17:26 +03:00
Alexander Alekhin b95e93c20a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-26 20:19:04 +00:00
Alexander Alekhin 24790e4061 Merge pull request #14899 from alalek:dnn_fix_bnll_layer
* dnn: fix BNLLLayer implementation

details: https://github.com/BVLC/caffe/blame/1.0/src/caffe/layers/bnll_layer.cpp#L17

* dnn: enable OCV/OpenCL BNLL layer
2019-06-26 23:04:26 +03:00
Alexander Alekhin c251915198 Merge pull request #14895 from alalek:dnn_ie_extensions_path 2019-06-26 20:03:57 +00:00
Alexander Alekhin 4112866821 Merge pull request #14886 from alalek:fix_grabcut_kmeans_call_14879 2019-06-26 20:03:04 +00:00
Apoorv Goel 5b521bb778 Merge pull request #14898 from UnderscoreAsterisk:flann-warnings-and-4376
Keep a local copy of `features` from `flann::GenericIndex ` constructor (#14898)

* Fix warnings on Windows

* Fix #4376
2019-06-26 19:35:11 +03:00
Alexander Alekhin 3cfd8cc1fe Merge pull request #14900 from opencv:dnn_fix_js_sample_v3 2019-06-26 15:54:46 +00:00
Dmitry Kurtaev 411ca87a86 Remove extra ")" 2019-06-26 17:27:56 +03:00
Alexander Alekhin 2172544bb7 Merge pull request #14890 from alalek:dnn_consistent_protobuf_readers 2019-06-26 14:13:03 +00:00
Alexander Alekhin df7049d465 Merge pull request #14889 from alalek:issue_14863 2019-06-26 14:10:14 +00:00
Alexander Alekhin 01a41d86bc Merge pull request #14775 from cudawarped:master 2019-06-26 13:35:21 +00:00
Alexander Alekhin 0a461e7922 Merge pull request #13252 from take1014:filter2d_13179 2019-06-26 13:34:10 +00:00
James Bowley daa308f81c Update obsolete flag in Intel video decoder.
Old flag resulted in software implementation being selected when the Intel decoder is not the primary adapter.
2019-06-26 12:32:20 +03:00
Alexander Alekhin 333e51b217 dnn: configure plugin path for InferenceEngine 2019-06-26 06:41:01 +00:00
Alexander Alekhin 8fd87033ef Merge pull request #14869 from alalek:samples_msvs2019_support 2019-06-25 22:07:02 +00:00
Alexander Alekhin 44d146af9a Merge pull request #14814 from alalek:dnn_skip_test_tags 2019-06-25 22:00:25 +00:00
Alexander Alekhin f3e9eb3371 dnn: both protobuf readers have similar behavior
- ReadProtoFromTextFile
- ReadProtoFromTextBuffer
2019-06-25 18:03:04 +03:00
Alexander Alekhin 63e4b35c19 Merge pull request #14849 from thangktran:thangktran/feature/fillPoly_and_fillConvexPoly_js_binding 2019-06-25 15:01:12 +00:00
Alexander Alekhin e8a703a71d core(intrin): v_load_low() workaround for aarch64+clang 2019-06-25 17:29:04 +03:00
Alexander Alekhin 9b9e04a061 Merge pull request #14875 from Legoless:master 2019-06-25 10:53:49 +00:00
Alexander Alekhin 4a6888ccf6 imgproc: fix kmeans() call from grabCut() 2019-06-25 13:42:04 +03:00
Dal Rupnik e755c66418 [#14873] Fix code signing issue in Try Compile script 2019-06-25 10:02:54 +02:00
Alexander Alekhin b58b2c5ae8 Merge pull request #14878 from JoeHowse:4.1.0-patches 2019-06-24 18:29:30 +00:00
Alexander Alekhin e8ff5cac1d Merge pull request #14876 from dkurt:fix_js_face_recognition_v2 2019-06-24 18:29:05 +00:00
atalaman de60600126 Merge pull request #14820 from TolyaTalamanov:at/circle_and_line
G-API: Implement line and circle draw operations (#14820)

* Implement line and circle draw operations

* Fix comments to review
2019-06-24 17:37:32 +03:00
Dmitry Kurtaev d17d3b66aa Fix face recognition JS sample 2019-06-24 16:41:37 +03:00
Alexander Alekhin f4ca2c8e72 Merge pull request #14874 from alalek:videoio_fix_gstreamer_plugin_build 2019-06-24 12:37:53 +00:00
Maksim Shabunin 46205a7235 videoio: fix GStreamer plugin build 2019-06-24 13:56:43 +03:00
Feng Chen 5620306c70 Merge pull request #14845 from vonchenplus:ocv_mirrorpad
* tensorflow support mirror pad

* revert macro define

* revert macro define

* reduce code duplication

* revert macro define
2019-06-24 12:27:42 +03:00
tribta e8283f94ed Fix Python code, for the tutorial_laplace_operator, to get the same result between the Cpp, Java and Python 2019-06-23 18:03:01 +01:00
Alexander Alekhin 894f208de3 dnn(test): replace SkipTestException with tags 2019-06-23 13:12:23 +00:00
Alexander Alekhin f8c96cb18a Merge pull request #14847 from alalek:dnn_fix_test_data_searching 2019-06-23 12:42:27 +00:00
Alexander Alekhin e72f451173 Merge pull request #14305 from cameron-martin:calib3d-js 2019-06-22 16:43:40 +00:00
Alexander Alekhin 5c63be3c6e samples: support MSVS 2019 compiler
requires CMake 3.14+
2019-06-22 16:24:21 +00:00
Alexander Alekhin 974491f93d Merge pull request #14861 from alalek:update_version_4.1.1-pre 2019-06-22 13:57:10 +00:00
Alexander Alekhin e21f89a16d Merge pull request #14864 from dkurt:fix_js_face_recognition 2019-06-22 07:15:02 +00:00
Lubov Batanina 16294437d5 Merge pull request #14833 from l-bat:ocv_eltwise3d
* Support Eltwise3d

* Refactoring

* Fix test
2019-06-22 10:13:28 +03:00
Dmitry Kurtaev d75a089690 Fix face recognition sample for JS 2019-06-21 21:53:52 -07:00
Alexander Alekhin 442bc80cd7 pre: OpenCV 4.1.1 (version++) 2019-06-21 19:18:50 +03:00
Alexander Alekhin f84b08ff08 dnn: bump API version 2019-06-21 19:18:23 +03:00
Alexander Alekhin f33f88de31 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-21 17:27:14 +03:00
Alexander Alekhin 4b205680df Merge pull request #14855 from alalek:update_version_3.4.7-pre 2019-06-21 17:26:40 +03:00
Alexander Alekhin 779f59da6b pre: OpenCV 3.4.7 (version++) 2019-06-21 16:57:17 +03:00
Alexander Alekhin f5ddaef46b experimental version++ 2019-06-21 16:57:17 +03:00
Alexander Alekhin aa6c66aa54 Merge pull request #14848 from alalek:build_warnings_avx512 2019-06-21 13:53:52 +00:00
Alexander Alekhin e69ff71302 Merge pull request #14846 from alalek:videoio_gstreamer_issues_master 2019-06-21 13:51:22 +00:00
Alexander Alekhin 6b32bd5f15 Merge pull request #14834 from alalek:videoio_gstreamer_issues 2019-06-21 13:38:34 +00:00
Alexander Alekhin 2b2633c11f videoio(gstreamer): port changes from 14834 2019-06-21 14:42:58 +03:00
Alexander Alekhin 31a22c27fe Merge pull request #14836 from alalek:static_analysis_issues_3.4 2019-06-21 10:26:09 +00:00
Cameron Martin 0ae053fdf8 js: Add findHomography js bindings.
Removed constants from legacy C api and switched out header with shorter version.

Removed blank line that was failing CI.
2019-06-21 13:13:53 +03:00
Alexander Alekhin d8c5bd92ae Merge pull request #14737 from Wenzhao-Xiang:master 2019-06-20 19:01:32 +00:00
Thang Tran 2a67375239 js: added fillPoly() and fillConvexPoly() 2019-06-20 19:56:23 +02:00
Alexander Alekhin 5ac55fc132 core: eliminate AVX512 build warnings
from MSVS2017 and GCC8 -O1 mode
2019-06-20 20:00:09 +03:00
Joe Howse 729848caeb core: revise syntax to support Visual C++ 2013 2019-06-20 13:57:17 -03:00
Alexander Alekhin 13a782c039 test: fix usage of findDataFile()
misused 'optional' mode
2019-06-20 18:20:14 +03:00
Alexander Alekhin 8ab6efb8c0 videoio: refactor GStreamer backend
- exception safe smart pointers, fixed many memory leaks
- fixed errors handling
- fixed strings handling
- fixed file existence check
- fixed toFraction() implementation
- add 'drop=true' for v4l2 input
- avoid overriding custom pipelines sink's 'max-buffers' value
- updated valgrind supression rules
- added support for GStreamer native leaks tracking (via gst_deinit() call)
- repaired capturing through GStreamer0.10 (fixed CV_8UC1)
2019-06-20 17:48:18 +03:00
Alexander Alekhin ab24325df3 videoio(test): avoid raw ptr in ffmpeg tests
causes leaks if FFmpeg is disabled through OPENCV_VIDEOIO_PRIORITY_FFMPEG=0
2019-06-20 17:48:18 +03:00
Alexander Alekhin 681e0323f2 core: backport toLowerCase()/toUpperCase() 2019-06-20 17:48:18 +03:00
Alexander Alekhin baf372ad3d videoio(test): add extra videoio tests 2019-06-20 17:48:18 +03:00
Alexander Alekhin 9cb239247d Merge pull request #14689 from anton-potapov:gapi_async_cacnel 2019-06-20 13:48:05 +00:00
Alexander Alekhin 1b7b2c3a62 Merge pull request #14844 from rgarnov:gapi_contains_tuple 2019-06-20 12:52:07 +00:00
Ruslan Garnov 7c0a9ff4c1 Added overload of contains<> for tuple 2019-06-20 14:40:14 +03:00
Alexander Alekhin 95d9cfb5c3 static analysis issues 2019-06-20 13:55:20 +03:00
Anton Potapov 8d75bfae47 Cancelation support fo Async GAPI
-
2019-06-19 13:41:39 +03:00
Alexander Alekhin 1d2ef6b2a1 Merge pull request #14774 from alalek:videoio_ffmpeg_plugin_win32 2019-06-17 14:47:48 +00:00
Alexander Alekhin 264679a725 Merge pull request #14816 from gal0is:gal0is-branch 2019-06-17 13:54:53 +00:00
Alexey Smirnov 7f9a9f2a09 Merge pull request #14648 from smirnov-alexey:as/gapi_transform
* Introduce GAPI_TRANSFORM initial interface

Comes along with simple tests and kernel package changes

* Fix documentation and adjust combine() function

* Fix stuff after rebasing on master

* Remove redundant functionality

* Refactoring according to review feedback provided

* Fixes according to review feedback

* Reconsider transformations return and fix a warning

* Fixes from code review

* Add a new simple test

* Cleanup, added tests on GScalar, GMatP, GArray
2019-06-17 16:26:28 +03:00
Alexander Alekhin 26dfa5e77c ffmpeg: win32 wrapper update 2019-06-16 16:20:40 +00:00
Alexander Alekhin 7b099e0fe2 videoio: plugins support on Win32 2019-06-16 15:25:25 +00:00
gal0is bb7dc5f992 Solve the import issue in Python2. 2019-06-16 06:10:00 +08:00
Alexander Alekhin 66d7956e67 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-15 16:25:11 +00:00
Alexander Alekhin 1f519eea89 Merge pull request #14815 from alalek:valgrind_suppress_openexr_threadpool 2019-06-15 16:18:57 +00:00
Alexander Alekhin b8c080de12 valgrind: suppress OpenEXR ThreadPool 2019-06-15 14:38:37 +00:00
Alexander Alekhin b6e41ebf27 Merge pull request #14808 from alalek:issue_14807 2019-06-14 22:44:43 +00:00
Kang Yifei ba0ed79635 Merge pull request #14800 from FanaticsKang:add_undistortPoint_test
Test request by #14583 (#14800)

* add test to show the undistort bug

* move test to calib3d
2019-06-14 22:57:21 +03:00
Alexander Alekhin 8ca4252303 Merge pull request #14583 from FanaticsKang:fix_undistortPoint_bug 2019-06-14 18:30:26 +00:00
Alexander Alekhin b909df5531 Merge pull request #14747 from dkurt:fix_14683 2019-06-14 16:41:55 +00:00
Ruslan Garnov 3df83dce7e Merge pull request #14741 from rgarnov:gapi_fix_includes
Changed quotes to brackets when including public includes (#14741)
2019-06-14 19:27:19 +03:00
Alexander Alekhin 3697ebef47 cmake: typo in hook name 2019-06-14 19:07:54 +03:00
Kang 549c53121a fix the bug, when k[4] is negative, icdist may be negative at the edge of image. 2019-06-14 19:00:36 +03:00
Dmitry Kurtaev dfdc91f8c9 dnn: fix MVN layer (issue 14683) 2019-06-14 18:38:05 +03:00
atalaman d3c0f4ef98 Merge pull request #14700 from TolyaTalamanov:at/cv_gapi_render
G-API: Render (#14700)

* cv::Render

Implement OCVRedner for BGR as input

* Support two plane cv::Render::run

* Snapshot

* Add RenderCreator

* text2Points

* Snapshot

* Refactoring tests

* Remove text2points

* Fix render input data type in tests

* Refactoring

* Fix headers
* Change struct fields name

* Fix headers

* Fix warnings

* Replace cv::Scalar -> cv::gapi::own::Scalar

* Add test

* PutText and rectangle case

* Fix comments to review

* Fix comments to review

* Fix comments to review

* Create render_priv.hpp
* Implement BGR2NV12
* Fix NV12 test

* Fix comments to review

* Add header for GAPI_Assert
2019-06-14 18:29:49 +03:00
Dmitry Kurtaev eba696a41e Merge pull request #14792 from dkurt:dnn_ie_min_version_r5
* Remove Inference Engine 2018R3 and 2018R4

* Fix 2018R5
2019-06-14 18:17:02 +03:00
Alexander Alekhin 54a14c877c Merge pull request #14794 from terfendail:wui512_interleavenames 2019-06-14 14:20:34 +00:00
Alexander Alekhin cf9bddcb89 Merge pull request #14805 from alalek:fix_valgrind_issues 2019-06-14 14:15:01 +00:00
Alexander Alekhin fc0498b5bd Merge pull request #14790 from alalek:update_ffmpeg_3.4 2019-06-14 13:40:59 +00:00
Alexander Alekhin 3af1b6ecdc valgrind: fix issues 2019-06-14 14:31:38 +03:00
Alexander Alekhin 4623e6220f Merge pull request #14804 from mshabunin:fix-mediasdk-detect 2019-06-14 11:20:37 +00:00
Vitaly Tuzov a29e59a770 Rename parameters in AVX512 implementation of v_load_deinterleave and v_store_interleave 2019-06-14 14:16:30 +03:00
Maksim Shabunin ae31115017 Improved MediaSDK detection mechanism 2019-06-14 12:37:49 +03:00
Alexander Alekhin f9eab2de5e Merge pull request #14673 from janstarzy:hidden-vis-with-java7 2019-06-13 17:59:39 +00:00
Jan Starzynski e9ed7eb68d make -fvisibility=hidden work with java 1.7 2019-06-13 17:39:10 +02:00
Alexander Alekhin 6389303c1c Merge pull request #14793 from mshabunin:fix-plugin-install 2019-06-13 14:05:55 +00:00
Maksim Shabunin 5015829ce8 Fixed plugin installation location on Windows 2019-06-13 16:06:06 +03:00
wenzhao 3f5c85e933 opencv.js: fix the loading issue of opencv.js(WASM) in face recognition 2019-06-13 11:26:27 +08:00
Alexander Alekhin 6aab6a251c ffmpeg: update 3.4.6
libvpx: 1.8.0
2019-06-12 16:54:47 +00:00
Alexander Alekhin 81fad9e247 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-11 20:43:40 +00:00
Alexander Alekhin 1c661e7548 Merge pull request #14784 from alalek:backport_14779 2019-06-11 20:36:16 +00:00
Alexander Alekhin a457fbdb58 Merge pull request #14783 from alalek:backport_14777 2019-06-11 20:12:01 +00:00
Alexander Alekhin e7dbc4ff28 Merge pull request #14782 from alalek:core_fix_log_level_default 2019-06-11 20:11:32 +00:00
Vitaly Tuzov d2aadabc5e Merge pull request #14743 from terfendail:wui512_fixvswarn
Fix for MSVS2019 build warnings (#14743)

* AVX512 arch support for MSVS

* Fix for MSVS2019 build warnings: updated integral() AVX512 implementation

* Fix for MSVS2019 build warnings: reworked v_rotate_right AVX512 implementation

* fix indentation
2019-06-11 23:07:39 +03:00
Alexander Alekhin f8791f072d core: avoid function type cast, make happy UBSAN
backporting of commit: d3d13c41c4
2019-06-11 19:36:47 +00:00
Alexander Alekhin db7f689728 imgcodecs(tiff): add more checks
backporting of commit: f6230ae019
2019-06-11 19:22:24 +00:00
Alexander Alekhin b4d3ff378e Merge pull request #14720 from rgarnov:gapi_remove_lut3d 2019-06-11 16:24:54 +00:00
Alexander Alekhin 6c8ffe81d0 core: repair default log level 2019-06-11 19:19:10 +03:00
Alexander Alekhin 1706a7609a Merge pull request #14781 from mshabunin:minimal-python-3-master 2019-06-11 14:19:37 +00:00
Alexander Alekhin b3e6c97d98 Merge pull request #14736 from mshabunin:minimal-python-3 2019-06-11 13:01:05 +00:00
Maksim Shabunin d60ac98ef2 Limited API support for Python3 2019-06-11 15:20:43 +03:00
Maksim Shabunin 10d61a2b44 Limited API support for Python3 2019-06-11 15:15:49 +03:00
Alexander Alekhin 3f67623c26 Merge pull request #14779 from alalek:oss_fuzz_14115 2019-06-11 11:35:28 +00:00
Alexander Alekhin 59f4a2e0f3 Merge pull request #14777 from alalek:oss_fuzz_15154 2019-06-11 11:34:46 +00:00
Alexander Alekhin d3d13c41c4 core: avoid function type cast, make happy UBSAN
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14115
2019-06-11 07:06:29 +00:00
Alexander Alekhin f6230ae019 imgcodecs(tiff): add more checks
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15154
2019-06-10 21:00:20 +00:00
Alexander Alekhin 11b020b9f9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-10 19:05:28 +00:00
Alexander Alekhin 878af7ada8 Merge pull request #14725 from alalek:update_openexr_2.3.0
3rdparty: update OpenEXR 2.3.0 (#14725)

* openexr 2.2.1

* openexr 2.3.0

* openexr: build fixes

* openexr: build dwa tables on-demand
2019-06-10 20:04:23 +03:00
Alexander Alekhin 987061d800 Merge pull request #14771 from mshabunin:fix-world-build 2019-06-10 12:02:39 +00:00
Maksim Shabunin f99f58d99f Allow setting IS_PART_OF_WORLD in command line, fix videoio plugin linking 2019-06-10 14:13:54 +03:00
atalaman 1aefa6779f Merge pull request #14513 from TolyaTalamanov:at/color-convert-kernels
G-API: Implement color-convert kernels (#14513)

* Implement color-convert kernels

* Fix rgb2yuv422 reference version

* Fix comments to review

* Restore NV12toBGR in imgproc.hpp

* Add accuracy tests

* Fix doxygen

* Fix ref version yuv422

* Fix warnings

* Fix typos

* Fix simd version yuv422

* Fix warnings

* Fix compile error

* Fix warning

* Remove comment
2019-06-10 14:09:30 +03:00
Alexander Alekhin d2f9cfcf81 Merge pull request #14760 from ChipKerchner:3.4 2019-06-09 17:43:02 +00:00
Alexander Alekhin 52644f067e Merge pull request #14764 from alalek:core_intrin_drop_hasSIMD_checks 2019-06-09 17:11:45 +00:00
Alexander Alekhin 417ac94456 Merge pull request #14767 from alalek:imgcodecs_test_exr 2019-06-08 22:44:37 +00:00
Alexander Alekhin 02bfd20760 imgcodecs(test): add OpenEXR I/O test 2019-06-08 21:30:26 +00:00
Alexander Alekhin 6d916c5bb4 Merge pull request #14440 from alalek:async_array 2019-06-08 20:57:15 +00:00
Alexander Alekhin 1e9ad5476d core(intrin): drop hasSIMD128 checks
- use compile-time checks instead (`#if CV_SIMD128`)
- runtime checks are useless
2019-06-08 19:20:20 +00:00
Lubov Batanina 5e80191d27 Merge pull request #14697 from l-bat:Slice_ONNX
* Support Slice layer in ONNX importer

* Add IE support

* Fix ONNX importer

* Fix Slice
2019-06-08 16:52:40 +03:00
Chip Kerchner Chip.Kerchner@ibm.com 058367f34c Rewrite code in BGR2Gray functions so that auto vectorizer does a better job. 2019-06-07 11:48:05 -05:00
Alexander Alekhin ddcf388270 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-07 19:02:55 +03:00
Alexander Alekhin 254f88f805 Merge pull request #14759 from alalek:java_gen_unicode 2019-06-07 16:02:12 +00:00
Alexander Alekhin 60fb1fde75 java: wrap StringIO() to support unicode strings 2019-06-07 17:05:58 +03:00
Alexander Alekhin 00367289bd Merge pull request #14754 from allnes:java_qr_code 2019-06-07 12:49:25 +00:00
Alexander Nesterov a9769b9202 Remove check and added binding tests 2019-06-07 14:53:40 +00:00
Alexander Alekhin 6d62be55b3 Merge pull request #14756 from mshabunin:fix-avx512-detection 2019-06-07 12:35:39 +00:00
Alexander Alekhin 002925466b Merge pull request #14717 from alalek:core_visibility_handling 2019-06-07 11:49:30 +00:00
Alexander Alekhin 8fae361768 Merge pull request #14750 from alalek:sample_fix_encoding 2019-06-07 11:12:28 +00:00
Maksim Shabunin 65919ed839 AVX 512 detection: workaround for older GCC 2019-06-07 13:58:09 +03:00
Alexander Alekhin cdee3d33b4 Merge pull request #14752 from SchultzC:3.4 2019-06-07 10:44:39 +00:00
Alexander Alekhin f5ca9d3fe1 python: visibility 2019-06-07 07:23:15 +00:00
Alexander Alekhin 4a8fd71a2e core: fix visibility handling 2019-06-07 07:23:15 +00:00
SchultzC 1e6e18ff05 Changed to integer division 2019-06-06 14:50:45 -07:00
Alexander Alekhin 5c05b7bc01 Merge pull request #14749 from alalek:fix_android_javadoc 2019-06-06 21:07:23 +00:00
Alexander Alekhin a51d46cbf9 samples: skip findFile() in encoding mode 2019-06-06 20:42:55 +00:00
Alexander Alekhin c6deba6003 android: fix javadoc 2019-06-06 20:22:42 +00:00
Alexander Alekhin 08019732e2 Merge pull request #14729 from arnaudbrejeon:bug_fix_14722 2019-06-06 19:44:06 +00:00
Alexander Alekhin aab9ef4290 Merge pull request #14667 from asashour:javadoc 2019-06-06 10:57:39 +00:00
utibenkei 03382d29cc Merge pull request #14693 from utibenkei:fix_java_simpleblobdetector
* java: fix java SimpleBlobDetector

* add SIMPLEBLOBFeatureDetectorTest

* add package org.opencv.test.features2d;

* fix SIMPLEBLOBFeatureDetectorTest
2019-06-06 13:05:41 +03:00
SchultzC 3833d86f0f Merge pull request #14733 from SchultzC:3.4
* cast positional arguments to int

* Changed to integer division based

* removed white space

* removed white space
2019-06-06 13:02:45 +03:00
Alexander Alekhin 94ec0e9b74 Merge pull request #14724 from asashour:typos 2019-06-06 10:01:03 +00:00
arnaudbrejeon e8e020ffb7 Add test 2019-06-05 09:15:18 -07:00
arnaudbrejeon e9b8571afc Fix bug 2019-06-05 09:15:04 -07:00
Alexander Alekhin f3de2b4be7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-06-05 19:11:52 +03:00
Alexander Alekhin 51631b90af Merge pull request #14726 from alalek:backport_14716 2019-06-05 15:54:46 +00:00
Alexander Alekhin a2445c44cb imgcodecs: sanitize PAM decoding
backporting of commit: 76fca0e755
2019-06-05 18:12:43 +03:00
Ahmed Ashour 5c56b8ce92 java: generated code to have javadoc 2019-06-05 12:44:03 +02:00
Ahmed Ashour 1aca1d582e Fix some typos 2019-06-05 12:24:13 +02:00
Lubov Batanina 3efd2df87f Merge pull request #14682 from l-bat:axpy_layer
* Add Axpy layer

* Fix test

* fix caffe importer
2019-06-05 00:18:06 +03:00
Ted Steiner f1fb002682 Merge pull request #14678 from tedsteiner:qnx
Fix build issue on QNX platform (#14678)

* QNX compatibility

* core: unify gettimeofday() usage
2019-06-04 19:45:21 +03:00
Alexander Alekhin d5a0d6783a Merge pull request #14710 from bommo1:bommo1-14265 2019-06-04 16:44:42 +00:00
Alexander Alekhin 5fde16ba90 Merge pull request #14712 from SchultzC:master 2019-06-04 16:43:45 +00:00
rasmus25 394bc91e07 Merge pull request #14718 from rasmus25:3.4
* Revert the bad parts of b085158d59 to fix https://github.com/opencv/opencv/issues/11131
but preserve the good parts to keep https://github.com/opencv/opencv/issues/10791 fixed

* calib3d: add regression test for stereoCalibrate to fix https://github.com/opencv/opencv/issues/11131
2019-06-04 18:43:42 +03:00
SchultzC edb3337ead Remove divide by 1000
because t = (time.time() - t) will return seconds,  dividing by 1000 to obtain seconds will be incorrect.
2019-06-04 08:17:37 -07:00
Ruslan Garnov 25e4bce1a6 Removed LUT3D API entry 2019-06-04 17:13:21 +03:00
Alexander Alekhin fa96507fe7 Merge pull request #14719 from alalek:update_protobuf_3.5.2 2019-06-04 13:10:17 +00:00
Alexey Smirnov e329c84d5e Merge pull request #14684 from smirnov-alexey:as/convert2_test_extension
G-API: Add parameters alpha and beta in tests on ConvertTo kernel (#14684)

* Add parameters alpha and beta in tests on ConvertTo kernel

* Change tolerance function

* Reduce number of test cases
2019-06-04 15:54:09 +03:00
Alexander Alekhin 1febb12942 3rdparty: apply protobuf v3.5.1..v3.5.2 patch
https://github.com/protocolbuffers/protobuf/compare/v3.5.1..v3.5.2
2019-06-04 12:57:34 +03:00
Alexander Alekhin 03a3be0844 Merge pull request #14716 from alalek:oss_fuzz_13282 2019-06-04 09:24:32 +00:00
Alexander Alekhin 9802b4e123 Merge pull request #14707 from alalek:update_libwebp_1.0.2 2019-06-04 09:21:35 +00:00
Alexander Alekhin e1ef7a2288 Merge pull request #14705 from alalek:update_libjpeg_9c 2019-06-04 09:21:17 +00:00
Alexander Alekhin f768f89803 Merge pull request #14704 from alalek:fix_missing_files_libjpeg_turbo_2.0.2 2019-06-04 09:19:58 +00:00
Alexander Alekhin 1f75c67c56 Merge pull request #14701 from alalek:update_libpng_1.6.37 2019-06-04 09:19:26 +00:00
Alexander Alekhin f1b6228d4f 3rdparty(webp): enable -std=c99 2019-06-03 22:23:34 +00:00
Alexander Alekhin d58f9ae824 3rdparty: update libwebp 1.0.0 => 1.0.2
https://github.com/webmproject/libwebp/releases/tag/v1.0.2
2019-06-03 22:23:34 +00:00
Alexander Alekhin 76fca0e755 imgcodecs: sanitize PAM decoding
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13282
2019-06-03 22:19:42 +00:00
bommo1 a38157a1f4 Fix https://github.com/opencv/opencv/issues/14265 2019-06-03 23:05:03 +02:00
Alexander Alekhin f355b3505f Merge pull request #14661 from dkurt:ie_deconv_adj 2019-06-03 16:58:17 +00:00
Vitaly Tuzov 3b015dfc7d Merge pull request #14210 from terfendail:wui_512
AVX512 wide universal intrinsics (#14210)

* Added implementation of 512-bit wide universal intrinsics(WIP)

* Added implementation of 512-bit wide universal intrinsics: implemented WUI vector types(WIP)

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented load/store

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented fp16 load/store

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented recombine and zip, implemented non-saturating and saturating arithmetics

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented bit operations

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented comparisons

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented lane shifts and reduction

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented absolute values

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented rounding and cast to float

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented LUT

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented type extension/narrowing and matrix operations

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented load_deinterleave for 2 and 3 channels images

* Added implementation of 512-bit wide universal intrinsics(WIP): reimplemented load_deinterleave for 2- and implemented for 4-channel images

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented store_interleave

* Added implementation of 512-bit wide universal intrinsics(WIP): implemented signmask and checks

* Added implementation of 512-bit wide universal intrinsics(WIP): build fixes

* Added implementation of 512-bit wide universal intrinsics(WIP): reimplemented popcount in case AVX512_BITALG is unavailable

* Added implementation of 512-bit wide universal intrinsics(WIP): reimplemented zip

* Added implementation of 512-bit wide universal intrinsics(WIP): reimplemented rotate for s8 and s16

* Added implementation of 512-bit wide universal intrinsics(WIP): reimplemented interleave/deinterleave for s8 and s16

* Added implementation of 512-bit wide universal intrinsics(WIP): updated v512_set macros

* Added implementation of 512-bit wide universal intrinsics(WIP): fix for GCC wrong _mm512_abs_pd definition

* Added implementation of 512-bit wide universal intrinsics(WIP): reworked v_zip to avoid AVX512_VBMI intrinsics

* Added implementation of 512-bit wide universal intrinsics(WIP): reworked v_invsqrt to avoid AVX512_ER intrinsics

* Added implementation of 512-bit wide universal intrinsics(WIP): reworked v_rotate, v_popcount and interleave/deinterleave for U8 to avoid AVX512_VBMI intrinsics

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed integral image SIMD part

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed warnings

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed load_deinterleave for u8 and u16

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed v_invsqrt accuracy for f64

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed interleave/deinterleave for u32 and u64

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed interleave_pairs, interleave_quads and pack_triplets

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed rotate_left

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed rotate_left/right, part 2

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed 512-wide universal intrinsics based resize

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed findContours by avoiding use of uint64 dependent 512-wide v_signmask()

* Added implementation of 512-bit wide universal intrinsics(WIP): fixed trailing whitespaces

* Added implementation of 512-bit wide universal intrinsics(WIP): reworked specific intrinsic sets dependent parts to check availability of intrinsics based on CPU feature group defines

* Added implementation of 512-bit wide universal intrinsics(WIP):Updated AVX512 implementation of v_popcount to avoid AVX512VPOPCNTDQ intrinsics if unavailable.

* Added implementation of 512-bit wide universal intrinsics(WIP): Fixed universal intrinsics data initialisation, v_mul_wrap, v_floor, v_ceil and v_signmask.

* Added implementation of 512-bit wide universal intrinsics(WIP): Removed hasSIMD512()

* Added implementation of 512-bit wide universal intrinsics(WIP): Fixes for gcc build

* Added implementation of 512-bit wide universal intrinsics(WIP): Reworked v_signmask, v_check_any() and v_check_all() implementation.
2019-06-03 18:05:35 +03:00
Alexander Alekhin 0ec72cbd10 3rdparty: update libjpeg 9c
https://www.ijg.org/
2019-06-03 16:21:02 +03:00
Alexander Alekhin 68e220e7bb 3rdparty: fix missing files from libjpeg-turbo 2.0.2 2019-06-03 15:42:51 +03:00
Alexander Alekhin 143b3d2b5b 3rdparty(libpng): re-apply OpenCV patches 2019-06-03 15:04:51 +03:00
Alexander Alekhin e96c94c4e4 3rdparty: update libpng 1.6.37
http://www.libpng.org/pub/png/libpng.html
https://github.com/glennrp/libpng/releases
2019-06-03 14:49:44 +03:00
Dmitry Kurtaev 9c0af1f675 Enable more deconvolution layer configurations with IE backend 2019-06-03 08:15:52 +03:00
Alexander Alekhin db900af8c7 Merge pull request #14696 from devnexen:fbsd_build_fix 2019-06-02 20:54:32 +00:00
David Carlier 9fd95b93f7 FreeBSD build fix 2019-06-02 20:25:42 +01:00
Yashas Samaga B L ae279966c2 Merge pull request #14660 from YashasSamaga:dnn-cuda-build
add cuDNN dependency and setup build for cuda4dnn (#14660)

* update cmake for cuda4dnn

- Adds FindCUDNN
- Adds new options:
   * WITH_CUDA
   * OPENCV_DNN_CUDA
- Adds CUDA4DNN preprocessor symbol for the DNN module

* FIX: append EXCLUDE_CUDA instead of overwrite

* remove cuDNN dependency for user apps

* fix unused variable warning
2019-06-02 14:47:15 +03:00
Alexander Alekhin 3289a0aff9 Merge pull request #14687 from terfendail:wint_reducefix 2019-05-31 14:52:50 +00:00
Vitaly Tuzov 723165f878 fix for AVX2 version of v_reduce_min intrinsic 2019-05-31 16:14:54 +03:00
Alexander Alekhin 805ab6331f Merge pull request #14662 from dkurt:dnn_tf_fix_identity_switch 2019-05-30 20:22:17 +00:00
Alexander Alekhin 738435b1dd Merge pull request #14679 from alalek:cmake_update_option_enable_fast_math 2019-05-30 18:24:30 +00:00
Alexander Alekhin d8b42792a6 cmake: update ENABLE_FAST_MATH option 2019-05-30 19:44:35 +03:00
Lubov Batanina f94253b82b Merge pull request #14627 from l-bat:demo_kinetics
* Support 3D ResNet-34-kinetics

* Update sample

* Remove preprocess

* Change test

* Fix sample
2019-05-30 17:36:00 +03:00
Alexander Alekhin 3ccb1d67c2 Merge pull request #14670 from alalek:gapi_fix_visibility_conflict 2019-05-30 11:21:50 +00:00
Alexander Alekhin 8ea2f59d33 Merge pull request #14671 from alalek:dnn_test_fast_read 2019-05-30 06:48:34 +00:00
Alexander Alekhin d6d4571628 Merge pull request #14675 from alalek:backport_14664 2019-05-29 21:09:24 +00:00
Alexander Alekhin 43de95eb19 3rdparty(libpng): fix leak in png_handle_eXIf
backporting of commit: 419a6d51b3
2019-05-29 20:15:55 +00:00
mehlukas 0ecc2b8c17 Merge pull request #14674 from mehlukas:3.4-moveObjdetect
Merge two Haar Cascade tutorials (#14674)

* move haar cascade introduction, add code explanation, mark content as moved

* switch to ref for include to provide correct breadcrumb navigation
2019-05-29 23:13:27 +03:00
Alexander Alekhin 52548bde05 dnn(test): replace file content reading 2019-05-29 23:08:33 +03:00
Alexander Alekhin d2d8535a31 Merge pull request #14664 from alalek:oss_fuzz_13314 2019-05-29 20:05:33 +00:00
Alexander Alekhin 29b3f66507 Merge pull request #14606 from asashour:java_inline_return 2019-05-29 20:03:54 +00:00
Alexander Alekhin 419a6d51b3 3rdparty(libpng): fix leak in png_handle_eXIf
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13314
ported commit: https://github.com/glennrp/libpng/commit/a142b7a543d16d271b8aba3ef7ca4aa9a368f55d
2019-05-29 18:51:52 +00:00
Dmitry Kurtaev 081d9bc73f Fix Identity Switch from Keras 2019-05-29 17:13:21 +03:00
Alexander Alekhin 9f68376c91 gapi: fix visibility conflict in OpenCV builds 2019-05-29 15:06:08 +03:00
Alexander Alekhin 216988b0b1 Merge pull request #14582 from alalek:android_update_debug 2019-05-29 11:22:53 +00:00
Alexander Alekhin 53c771551c Merge pull request #14473 from alalek:video_dis_update_opencl
video(DISOpticalFlow): update OpenCL implementation (#14473)

* video(DIS): add code for profiling

* video(DIS): fix test parameters

* video(DIS): simplify OpenCL kernels

- parameters -> defines
- avoid float3
- const / local scope
- improve readability, replace Kernel::set() -> args()

* video(DIS): use CV_32FC2 buffers
2019-05-29 14:22:21 +03:00
Alexander Alekhin 43467a2ac7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-28 18:29:48 +00:00
Alexander Alekhin 0d477d7364 Merge pull request #14651 from alalek:dnn_test_update_debug_tags 2019-05-28 16:26:49 +00:00
Alexander Alekhin e0d88cb7a4 Merge pull request #14614 from mehlukas:3.4-movevideo 2019-05-28 16:22:56 +00:00
Alexander Alekhin 571dfa7605 Merge pull request #14652 from LaurentBerger:I14644 2019-05-28 11:11:27 +00:00
Ahmed Ashour ca8a1d2cff java: generated code inline return 2019-05-28 08:34:02 +02:00
Alexander Alekhin 38a3c1ce6b dnn(test): update test tags for Debug build 2019-05-27 20:12:30 +00:00
LaurentBerger a3be8d7cd7 dead link 2019-05-27 21:57:10 +02:00
Alexander Alekhin 483e9f341c Merge pull request #14626 from dkurt:dnn_ie_slice_layer 2019-05-27 16:27:14 +00:00
Alexander Alekhin aaf56c2839 Merge pull request #14649 from savuor:fix/luv_hls_read_oob 2019-05-27 16:24:55 +00:00
Alexander Alekhin ed96864892 Merge pull request #14641 from thangktran:thangktran/bugfix/DISOpticalFlow-segfault-for-small-images 2019-05-27 16:23:08 +00:00
Alexey Nikolaev 05563f5bc4 Merge pull request #14592 from aleksey-nikolaev:master
VideoCapture Direct Show. Added getter for CV_CAP_PROP_CONVERT_RGB, CAP_PROP_CHANNEL properties. (#14592)

* Added getter for CV_CAP_PROP_CONVERT_RGB, CAP_PROP_CHANNEL properties.
Some refactoring.

* One space less.
2019-05-27 19:18:36 +03:00
Lubov Batanina 61d3222a22 Merge pull request #14537 from l-bat:fix_network_vizualizer
Fix dnn visualizer (#14537)

* Fixed print layer params

* Fix print
2019-05-27 19:17:07 +03:00
Alexander Alekhin a81c0e6db9 Merge pull request #14447 from catree:fix_issue_14423 2019-05-27 15:00:21 +00:00
Alexander Alekhin d73261844e Merge pull request #14622 from asashour:junit 2019-05-27 14:55:45 +00:00
Alexander Alekhin b07f951e6b Merge pull request #14591 from thangktran:thangktran/feature/floodFill-on-opencv.js 2019-05-27 14:54:46 +00:00
Alexander Alekhin 42484f3bcb Merge pull request #14647 from alalek:fix_coverity_issues 2019-05-27 14:32:02 +00:00
Alexander Alekhin d7c465d49e Merge pull request #14643 from mshabunin:fix-ie-status 2019-05-27 14:31:10 +00:00
Alexander Alekhin c5204a74c0 Merge pull request #14633 from alalek:java_test_filter 2019-05-27 14:13:25 +00:00
Alexander Alekhin 4a2544ff4b Merge pull request #14632 from alalek:java_test_debug 2019-05-27 14:13:10 +00:00
Alexander Alekhin c9b3e718db Merge pull request #14609 from janstarzy:tiff-orientation-fix 2019-05-27 13:39:51 +00:00
Dmitry Kurtaev 44d21e5a79 Enable Slice layer on Inference Engine backend 2019-05-27 16:28:01 +03:00
Rostislav Vasilikhin 8c698262ea rgb2hls_b: out of bounds read fixed 2019-05-27 16:19:52 +03:00
Alexander Alekhin 1094ed64e9 Merge pull request #14605 from terfendail:wsignmask_fixavx 2019-05-27 13:19:39 +00:00
Rostislav Vasilikhin 791ebd05fc out of bounds read fixed in rgb2luv_b 2019-05-27 16:19:01 +03:00
Alexander Alekhin 483f28723c calib3d: initialize local vars, fix indentation in for loops 2019-05-27 14:39:47 +03:00
Maksim Shabunin a550e50683 Fix IE status message on MacOS 2019-05-27 10:26:16 +03:00
Maksim Shabunin 472f3b7347 Fix TBB debug 2019-05-27 10:26:06 +03:00
Thang Tran d1615ba11a video:fixed DISOpticalFlow segfault from small img 2019-05-27 08:18:26 +02:00
utibenkei 898cf70210 Merge pull request #14597 from utibenkei:fix_java_missing_consts
* java: fix java missing_consts

* java: test Calib3d constants
2019-05-26 19:43:34 +03:00
Alexander Alekhin b958498074 java(test): test package filtering
Usage example:
- run.py -a -t java --package=calib3d
2019-05-26 15:12:05 +00:00
Alexander Alekhin 171dd9eff5 java(test): enable debug mode to show useful stacktraces 2019-05-26 14:54:44 +00:00
Alexander Alekhin 6c6dd16acf Merge pull request #14628 from devnexen:openbsd_build_fix 2019-05-25 13:53:53 +00:00
David Carlier a6144b8e1a OpenBSD build fix 2019-05-25 10:18:34 +01:00
Rostislav Vasilikhin e07ffe902e Merge pull request #14616 from savuor:hsv_wide
HSV and HLS color conversions rewritten to wide intrinsics (#14616)

* RGB2HSV_b vectorized

* RGB2HSV_f: widen

* RGB2HSV_f: shorten, more intuitive

* HSV2RGB_f and HSV2RGB_b widen

* hls2rgb_f widen

* instrumentation instead vx_cleanup

* RGB2HLS_f widen

* RGB2HLS_b rewritten to wide universal intrinsics

* define guard against no SIMD code

* hls2rgb_b rewritten

* extra define removed

* warning fixed

* hls2rgb_b: performance fixed
2019-05-24 23:01:08 +03:00
Alexander Alekhin 9b130efbb3 Merge pull request #14623 from alalek:fix_14617 2019-05-24 19:57:54 +00:00
Alexander Alekhin 22701f0c27 imgcodecs(CAP_IMAGES): fix handling of input pattern 2019-05-24 22:13:25 +03:00
Vitaly Tuzov f0fb91f2d4 Fixed v_signmask implementation for AVX2, updated universal intrinsics tests. 2019-05-24 19:34:54 +03:00
Ahmed Ashour f9564e053d java: test: use assertNotNull and assertFalse 2019-05-24 10:45:09 +02:00
Alexander Alekhin 166ecaeda8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-23 19:50:20 +03:00
Lukas Mehl 2acc7c96e7 remove bgsgm tutorial, set references to OpenCV-Tutorials 2019-05-23 17:11:44 +02:00
Alexander Alekhin 1810702bf0 Merge pull request #14610 from mshabunin:fix-gtk-gl 2019-05-23 15:05:18 +00:00
Alexander Alekhin 96e2126ade Merge pull request #14602 from asashour:java_lang_ 2019-05-23 15:04:38 +00:00
Jan Starzynski fb9c083a51 handle all orientations properly 2019-05-23 16:51:25 +02:00
Maksim Shabunin dc28a1aba2 highgui: fixed build GTK2+OpenGL 2019-05-23 16:30:22 +03:00
Alexander Alekhin 2080e06f7b Merge pull request #14601 from asashour:14211_CvType 2019-05-23 12:26:19 +00:00
Ahmed Ashour f3319f6140 java: remove redundant declaration of java.lang package 2019-05-23 14:06:34 +02:00
Ahmed Ashour 1050b5351e java: add CvType.CV_16F 2019-05-23 08:49:01 +02:00
Alexander Alekhin def8fa2248 Merge pull request #14557 from mshabunin:win-lapack 2019-05-22 18:59:31 +00:00
Alexander Alekhin 2fd1a4eef7 Merge pull request #14520 from kupferb:patch-1 2019-05-22 18:16:48 +00:00
Alexander Alekhin 8bf9dda604 Merge pull request #14514 from mshabunin:fix-videoio-docs 2019-05-22 18:15:43 +00:00
Ruslan Garnov 54ff72a1cc Merge pull request #14599 from rgarnov:gapi_aux_kernels
G-API aux kernels (#14599)

* Removed gcpuimgproc.hpp and gcpucore.hpp

* Changed GModel::orderedInputs and orderedOutputs to get ConstGraph&

* Added auxiliaryKernels() method of GBackend::Priv
2019-05-22 21:13:13 +03:00
atalaman cbb699efd2 Merge pull request #14151 from TolyaTalamanov:at/own-mat-output-doesnt-support
G-API: own::Mat as output computation doesn't work (#14151)

* Fix bug with output own::Mat

* Fix comments to review

* Fix preprocess condition

* Fix comments to review
2019-05-22 19:57:08 +03:00
atalaman d9dac9cd1b Merge pull request #14150 from TolyaTalamanov:at/computation-doesnt-work-with-out-vector
G-API: GComputation doesn't work with output vector<cv::Mat> (#14150)

* Fix bug with gcomputation output vector

* Add test fixture

* Fix comments to review

* Fix alignment
2019-05-22 19:13:15 +03:00
Maksim Shabunin fff7b7e459 LAPACK: add support for complex numbers for MSVC 2019-05-22 18:43:45 +03:00
Maksim Shabunin bcf7286ad9 Docs: updated videoio module overview 2019-05-22 15:35:34 +03:00
catree 7ed858e38e Fix issue with solvePnPRansac and Nx3 1-channel input when the number of points is 5. Try to uniform the input shape of projectPoints and undistortPoints. 2019-05-22 14:19:16 +02:00
atalaman 935c02c0a3 Merge pull request #13851 from TolyaTalamanov:at/new-kernel-package-design
G-API: Kernel package design (#13851)

* Remove cv::unite_policy from API

* Add check that all id in kernel package are unique

* Refactor checker id procedure

* Remove cv::gapi::GLookupOrder from API

* Implement cv::gapi::use_only

* Fix samples

* Fix docs

* Fix comments to review

* Remove unite_policy

* Fix GKernelPackage::backends()

* Fix comments to review

* Fix all_unique

* Fix comments to review

* Fix comments to review

* Remove out of date tests
2019-05-22 14:53:44 +03:00
Alexander Alekhin f629cdfe2c Merge pull request #14459 from dkurt:tf_strided_slice 2019-05-22 11:30:34 +00:00
Dmitry Kurtaev 26e426adb1 StridedSlice from TensorFlow 2019-05-22 12:45:52 +03:00
Alexander Alekhin 190467b6c1 Merge pull request #14586 from dianlujitao:master 2019-05-21 18:30:02 +00:00
Thang Tran eb243847eb js: added floodFill function to JS binding
previously floodFill() is white-list without any implementation.
floodFill() is now fully functional in JS.
2019-05-21 14:19:50 +02:00
Alexander Alekhin de977cc9c8 Merge pull request #14474 from alalek:ocl_kernel_args_variadic 2019-05-20 18:18:02 +00:00
Alexander Alekhin a433394870 Merge pull request #14362 from catree:feat_ippe 2019-05-20 18:16:52 +00:00
Rostislav Vasilikhin e90e0ef9aa Merge pull request #14106 from savuor:lab_wide
Lab, Luv and XYZ conversions rewritten to wide intrinsics (#14106)

* rgb2xyz<float> re-vectorized

* rgb2xyz_i vectorized for ushort and uchar

* xyz2rgb<float> vectorized

* xyz2rgb_i vectorized for both uchar and ushort

* intermediate conversions (int->float) rewritten

* packed rgb2luv rewritten

* (some) float conversions rewritten

* burnt volatile int _3 and similar

* RGB2Lab_b rewritten

* tests: logging made better

* RGB2Lab_f (LRGB path) rewritten

* Lab2RGBfloat rewritten

* Lab2RGBinteger and Lab2RGB_b rewritten to wide universal intrinsics

* Luv2RGBinteger wide vectorized

* RGB2Lab_b fixed: v_sub_wrap instead of saturated sub

* warnings fixed

* trying to fix compilation on older compilers

* using 16x8 registers for 8-element dot product

* cleanup added

* splineInterpolate: loop unrolled, perf fix for f32x4

* Lab2RGBfloat: grab 2x more data to process on f32x4

* nrepeats for Luv2RGBfloat, +20% perf

* minor

* nrepeats to RGB2Lab_f

* Lab2RGBinteger: no tab for linear BGR

* nrepeats for RGB2Luvfloat

* Luv2RGBinteger: no tab for linear RGB

* +10% more to perf of Luv2RGBfloat

* nrepeats for 256-simd for Lab2RGBfloat

* less warnings

* BOM removed

* CV_SIMD_WIDTH used for lanes number checking

* trilinearPackedInterpolate: 128-bit specialization added

* fix build; no vx_cleanup(), instrumentation instead
2019-05-20 21:10:20 +03:00
Sergiu Deitsch bc4b2d521c Merge pull request #13337 from sergiud:eigen-cross-compile
* added support for Eigen cross-compilation

* cmake: fix Eigen detection
2019-05-20 21:05:42 +03:00
dianlujitao f0f50b757d Fix LogSoftmax for ONNX
Fix wrong indentation as well while at it
2019-05-20 22:55:31 +08:00
catree 33cb9c5ca5 Add SOLVEPNP_IPPE for planar pose estimation. Add solvePnPGeneric function that returns all the pose solutions and the reprojection errors. 2019-05-20 11:56:54 +02:00
Alexander Alekhin e4b9a58c15 Merge pull request #14578 from mshabunin:add-mfx-plugin 2019-05-19 19:36:16 +00:00
Alexander Alekhin 3c1267dbe6 android: update 'debug' information support 2019-05-19 16:09:45 +00:00
Alexander Alekhin 132253c9f3 dnn: use AsyncArray 2019-05-18 19:32:23 +00:00
Alexander Alekhin 9340af1a8a core: Async API / AsyncArray 2019-05-18 19:32:23 +00:00
Alexander Alekhin 447116a93c Merge pull request #14524 from kohei-us:onnx-load-binary-blob 2019-05-18 16:19:34 +00:00
Alexander Alekhin d848594deb Merge pull request #14445 from l-bat:batchnorm3d 2019-05-17 17:03:53 +00:00
Alexander Alekhin b4ec8fe3ef Merge pull request #14539 from rgarnov:gapi_fix_nv12_odd_slices 2019-05-17 16:59:52 +00:00
Maksim Shabunin 6fc6207e93 Added videoio plugin for MediaSDK 2019-05-17 17:24:53 +03:00
Alexander Alekhin dbc7faca46 Merge pull request #14574 from catree:fix_norm_type_typo 2019-05-17 04:19:05 +00:00
catree b5e2ec4ea4 Fix typo in NormTypes documentation. 2019-05-16 19:22:41 +02:00
Kohei Yoshida 7b4aefedea Add support for loading ONNX model from in-memory buffer. 2019-05-16 11:26:20 -04:00
Alexander Alekhin 30a595789c Merge pull request #14463 from thangktran:thangktran/fix-imgproc-intersectConvexConvex 2019-05-16 14:50:20 +00:00
Alexander Alekhin 9003b60d65 Merge pull request #14567 from alalek:core_drop_ostream_string_overload 2019-05-16 11:32:13 +00:00
Alexander Alekhin d93588dfeb Merge pull request #14562 from alalek:calid3d_fix_examples_paragraph 2019-05-16 11:23:16 +00:00
Alexander Alekhin 6ca3c7f59f Merge pull request #14517 from FadyEssam:remove_redundant_imports 2019-05-16 11:03:44 +00:00
Alexander Alekhin e21262deba Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-16 04:40:39 +00:00
Alexander Alekhin 84fd8190f3 Merge pull request #14232 from terfendail:popcount_rework 2019-05-15 17:58:11 +00:00
Vitaly Tuzov 7a55f2af3b Updated AVX2 implementation of v_popcount for u8. 2019-05-15 19:39:25 +03:00
Alexander Alekhin 88996323b6 Merge pull request #14569 from alalek:fixup_14558 2019-05-15 16:21:31 +00:00
Alexander Alekhin 8b192b76c0 Merge pull request #14561 from alalek:fix_ctors_with_uninitialized_vars 2019-05-15 16:21:07 +00:00
Daniel Ingram 962d57b4d6 Merge pull request #14559 from daniel-s-ingram:master
* Fix typo: 'divisble' -> 'divisible'

* Fix typo: 'One of arguments' -> 'One of the arguments'
2019-05-15 18:41:43 +03:00
Alexander Alekhin 18151e79bb cmake(samples): use LINK_PRIVATE in target_link_libraries 2019-05-15 18:38:00 +03:00
Alexander Alekhin a70e1eecd9 Merge pull request #14552 from dkurt:fixed_detections_out_blob 2019-05-15 15:17:05 +00:00
Alexander Alekhin 3e876c5066 Merge pull request #14505 from alalek:android_fix_14477 2019-05-15 12:58:23 +00:00
mehlukas 6bff0e24f8 Merge pull request #14314 from mehlukas:3.4-opticalflow
Extend optical flow tutorial (#14314)

* extend python optical flow tutorial with cpp example code and add it to general tutorial directory

* remove unused parameters, fix comparison between signed and unsigned int

* fix hsv range problem

* switch to samples::findFile for sample file location

* switch to command line parameter for path

* remove old tutorial as in 14393

* minor fixes
2019-05-15 15:13:57 +03:00
Alexander Alekhin b8f9076de0 core: drop 'operator << (ostream, String)' overload
'cv::String' is 'std::string' in OpenCV 4.x
2019-05-15 14:00:02 +03:00
mehlukas 47c45e5bd3 Merge pull request #14393 from mehlukas:3.4-meanshift
Extend meanshift tutorial (#14393)

* copy original tutorial and python code

* add cpp code, fix python code

* add camshift cpp code, fix bug in meanshift code

* add description to ToC page

* fix shadowing previous local declaration

* fix grammar: with -> within

* docs: remove content of old py_meanshift tutorial, add link

* docs: replace meanshift tutorial subpage in Python tutorials

* switch to ref to fix wrong breadcrumb navigation

* switch to cmdline for path as in #14314

* Apply suggestions from code review

* order programming languages alphabetically
2019-05-15 13:34:20 +03:00
Alexander Alekhin 8936a0f3a5 android: fix JavaCamera2View UV plane handling 2019-05-15 07:57:50 +00:00
Alexander Alekhin d784b40e24 calib3d(docs): examples paragraph is related to findHomography() 2019-05-14 19:20:40 +00:00
Alexander Alekhin 68012bfbf9 calib3d: fix uninitialized fields in ctors 2019-05-14 19:15:13 +00:00
Alexander Alekhin 9fabc3406f Merge pull request #14558 from alalek:cmake_samples_threading_3.4 2019-05-14 19:02:23 +00:00
Alexander Alekhin e7338024f6 Merge pull request #14516 from dkurt:dnn_async_samples 2019-05-14 19:01:43 +00:00
Dmitry Kurtaev 63bb97cc19 Asynchronous C++ sample 2019-05-14 19:09:07 +03:00
Vitaly Tuzov 1220dd4877 Updated v_popcount description, reference implementation and test. 2019-05-14 18:59:40 +03:00
Vitaly Tuzov 96ab78dc4f Reworked v_popcount implementation to provide number of bits in a single lane 2019-05-14 18:59:38 +03:00
Ruslan Garnov 50af4df1d7 Fixed roi inference to always produce even sizes for nv12 2019-05-14 18:37:33 +03:00
Alexander Alekhin 3201ea89d6 cmake: enable threading in samples
- moved code into separate file due issue with handling of CMake policies
2019-05-14 17:29:46 +03:00
Liubov Batanina dfa753c6b4 Support OCV backend 2019-05-14 16:44:57 +03:00
Dmitry Kurtaev 6389dfe49c Fixed DetectionOutput output blob shape 2019-05-14 15:09:32 +03:00
Liubov Batanina dadb1473c1 Add BatchNorm3d layer 2019-05-14 12:44:48 +03:00
Dmitry Kurtaev c3b0a68a2b Async mode for dnn's object detection sample 2019-05-14 09:58:47 +03:00
kupferb f024425dd0 Update haarfeatures.cpp
Detailed description for my proposal can be found here
https://github.com/opencv/opencv/issues/14128
2019-05-13 16:41:03 +03:00
Fady Essam 1b294c013a remove unnecessary imports in knn tutorials 2019-05-09 00:01:57 +02:00
Alexander Alekhin b2abd8ca41 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-07 16:04:54 +00:00
Alexander Alekhin b998c06d08 Merge pull request #14501 from LaurentBerger:MatchLayer_text_graph_ssd 2019-05-07 15:49:54 +00:00
Alexander Alekhin 5ba8aa781c Merge pull request #14460 from dkurt:dnn_tf_no_extra_clone 2019-05-07 14:48:50 +00:00
Alexander Alekhin 455323ed58 Merge pull request #14500 from mshabunin:backport-avfoundation 2019-05-07 14:44:33 +00:00
Alexander Alekhin eb161942de Merge pull request #14486 from alalek:cmake_dispatch_all 2019-05-07 14:25:02 +00:00
LaurentBerger fa8e301c69 extends regex matching for conv group of layers 2019-05-07 16:17:25 +02:00
Alexander Alekhin 2aed9aea47 Merge pull request #14492 from anton-potapov:gapi_async_review_updates 2019-05-07 14:15:45 +00:00
Alexander Alekhin 55c02ff628 Merge pull request #14491 from mshabunin:add-clang-hardening 2019-05-07 14:13:07 +00:00
Maksim Shabunin 9a81ff7315 Backported AVFoundation fixes from master branch 2019-05-07 13:57:44 +03:00
Anton Potapov c2e26c1527 Async API for GAPI
- minor cosmetic changes : comments, typos
2019-05-07 13:12:15 +03:00
Maksim Shabunin 5acfa524cb Added support for Clang build hardening (including Apple) 2019-05-07 13:00:43 +03:00
Alexander Alekhin 94c7d99d0d Merge pull request #14489 from dkurt:fix_14464 2019-05-06 19:16:26 +00:00
Dmitry Kurtaev 471b83ccd5 Modify paddings computation for SAME pad mode 2019-05-06 10:49:10 +03:00
Alexander Alekhin 7bb8d89ef3 Merge pull request #14484 from dkurt:dnn_ie_fix_async_u8 2019-05-05 11:51:54 +00:00
Alexander Alekhin 6b6222bfbb cmake: support CPU_DISPATCH=ALL, fix misused CPU_DISPATCH
- CPU_DISPATCH_FINAL should be used for filtering
2019-05-05 11:24:21 +00:00
Sayed Adel 5a77f4cee3 Merge pull request #14007 from seiko2plus:core_avx512_infa
* core: improve AVX512 infrastructure by adding more CPU features groups

* cmake: use groups for AVX512 optimization flags

* core: remove gap in CPU flags enumeration

* cmake: restore default CPU_DISPATCH
2019-05-05 14:19:49 +03:00
Dmitry Kurtaev adc1ef9308 Fix uint8 input data for Async mode of dnn 2019-05-05 12:49:38 +03:00
Alexander Alekhin 610f5481c1 core(ocl): ocl::Kernels::args() via variadic template 2019-05-04 00:06:31 +00:00
Alexander Alekhin 03ec1ca0a4 Merge pull request #14403 from alalek:issue_14372 2019-05-03 20:41:51 +00:00
Alexander Alekhin 04caf0549d video(DIS): OpenCL workaround for AMDGPU 2019-05-03 19:01:14 +00:00
Alexander Alekhin 0e1dd63f5e video(DIS): use OpenCL shared mem
- fix perf test iterations
2019-05-03 18:58:26 +00:00
Alexander Alekhin fc57129300 Merge pull request #14431 from catree:feat_solvePnPRefine 2019-05-02 20:44:58 +00:00
Alexander Alekhin b7ca3d77a6 Merge pull request #14465 from unrandomness:master 2019-05-01 22:00:02 +00:00
seungju ceff82877d fix a typo in md file
fix a typo in ml_intro.md, tress -> trees
2019-05-01 14:05:33 +02:00
Thang Tran 1aff378ae8 imgproc: fixed bug from intersectConvexConvex
Added checks for all of vertices from each contour instead of checking
only for the first vertex.
2019-05-01 11:06:30 +02:00
Alexander Alekhin e28e3c9491 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-01 08:27:45 +00:00
Alexander Alekhin 163d5e4d39 Merge pull request #14368 from dkurt:dnn_ie_tests 2019-04-30 19:35:00 +00:00
Alexander Alekhin bc9893799d Merge pull request #14457 from alalek:dnn_fix_msvc_build 2019-04-30 16:49:33 +00:00
Alexander Alekhin 076ee65c85 Merge pull request #14448 from rgarnov:gapi_gmatp 2019-04-30 16:48:34 +00:00
Alexander Alekhin 1c092a181d Merge pull request #14454 from dkurt:dnn_tf_subgraph_fusion 2019-04-30 16:24:32 +00:00
Dmitry Kurtaev a6ed8f268a Remove extra weights cloning from TensorFlow importer 2019-04-30 19:18:41 +03:00
Alexander Alekhin ddfaa41f07 Merge pull request #14452 from alalek:issue_14432 2019-04-30 16:15:46 +00:00
Ruslan Garnov 834d438d6e Added GMatP type 2019-04-30 17:25:29 +03:00
Lubov Batanina 77fa59c3da Merge pull request #14301 from l-bat:conv3d
Support Convolution3D layer on IE backend (#14301)

* Add Convolution3D layer

* Disable CXX11

* Fixed tests

* Add Pooling3D layer

* Merge Conv2d with Conv3d and Pool2d with Pool3d layers

* Split pads

* Add Deconvolution layer

* Refactoring

* Deduplication

* Refactoring

* Add utils for Convolution and Pooling layers
2019-04-30 17:08:17 +03:00
Alexander Alekhin 3bcbd2a078 Merge pull request #14451 from alalek:fix_perf_calibation 2019-04-30 14:01:13 +00:00
Alexander Alekhin 85ea37ac01 Merge pull request #14450 from alalek:ts_hide_zero_memory_message 2019-04-30 14:00:36 +00:00
catree dac31e84fb Add solvePnPRefineLM to refine a pose according to a Levenberg-Marquardt iterative minimization process. Add solvePnPRefineVVS to refine a pose using a virtual visual servoing scheme. 2019-04-30 14:31:11 +02:00
Alexander Alekhin 138a80611c build: avoid MSVC ICE 2019-04-30 14:16:01 +03:00
Alexander Alekhin 2da00161c5 Merge pull request #14446 from mshabunin:old-v4l 2019-04-30 10:41:33 +00:00
anton-potapov f5801ee7da Merge pull request #14346 from anton-potapov:gapi_async
* Async API for GAPI

 - naive implementation as a starting point

* Fix namespace comment in header
2019-04-30 13:11:56 +03:00
Dmitry Kurtaev 9408c3e640 Refactored TensorFlow subgraphs fusion 2019-04-30 09:21:05 +03:00
Alexander Alekhin 1c180f4c7f imgproc: fix RemoveOverlaps() with empty input vector 2019-04-29 21:15:23 +00:00
Alexander Alekhin cd4926778e ts: fix perf calibation
properly handle "check" mode with:
"--perf_min_samples=1 --perf_force_samples=1"
2019-04-29 19:10:38 +00:00
Alexander Alekhin 38c0278be3 ts: silence zero memory usage messages 2019-04-29 18:28:54 +00:00
Alexander Alekhin ffd4a27901 Merge pull request #14443 from dkurt:fix_14435 2019-04-29 18:21:22 +00:00
Maksim Shabunin 683acd9ae2 Support very old V4L 2019-04-29 18:14:58 +03:00
Alexander Alekhin faca45a7ea Merge pull request #14429 from rgarnov:gapi_fluid_fix_small_rois 2019-04-29 15:08:11 +00:00
ostarling 643d9df42d Merge pull request #14411 from ostarling:3.4_fix_for_14242
* Fix for Homogenous precision #14242:
 - moved scale computation to an inline function
 - use std::numeric_limits<float>::epsilon() instead of != 0.0

* Fix for Homogenous precision #14242:
 - fixed warnings for type conversion

* Fix for Homogenous precision #14242:
 - use float epsilon() for truncation of doubles
2019-04-29 17:12:04 +03:00
Alexander Alekhin 84847cf4c3 Merge pull request #14342 from Victorlouisdg:bugfix-JavaCamera2View-green 2019-04-29 10:54:34 +00:00
Dmitry Kurtaev 61b928d9bd Add an assertion for Async request status 2019-04-29 08:16:28 +03:00
Alexander Alekhin e8a626d43a Merge pull request #14407 from dkurt:dnn_ie_fix_batch_detection 2019-04-27 21:48:56 +00:00
Alexander Alekhin 025f679dbc Merge pull request #14434 from seiko2plus:vsx_fix_reduce_sad 2019-04-27 18:01:29 +00:00
Sayed Adel afb157df67 core:vsx fix sum of v_reduce_sad 2019-04-27 02:01:24 +02:00
Alexander Alekhin 82be2d6210 Merge pull request #14430 from alalek:cmake_fix_include_pkgconfig_3.4 2019-04-26 20:18:59 +00:00
Alexander Alekhin e8ac7a34dd Merge pull request #14426 from alalek:cmake_fix_include_pkgconfig 2019-04-26 20:18:38 +00:00
Alexander Alekhin b95fdc1992 Merge pull request #14394 from alalek:build_support_memory_sanitizers 2019-04-26 16:13:52 +00:00
Alexander Alekhin d17699363c Merge pull request #14385 from terfendail:intrin_sad 2019-04-26 15:34:02 +00:00
Alexander Alekhin 90c34c5c17 cmake: fix pkg-config handling
backporting commit c9f3f4d1d3
2019-04-26 18:25:47 +03:00
Alexander Alekhin c9f3f4d1d3 cmake: fix pkg-config handling
Avoid non-intentional call of "include(FindPkgConfig)"
It should be handled in the root CMakeLists.txt (safely for cross-compiling)
2019-04-26 18:19:03 +03:00
Alexander Alekhin 7b8ce63730 Merge pull request #14402 from rgarnov:gapi_planar_mats 2019-04-26 14:59:12 +00:00
Ruslan Garnov ffaf4d5da4 Fixed incorrect first window setting for fluid FilterAgent 2019-04-26 17:34:44 +03:00
Ruslan Garnov fb326a3589 Added a reproducer 2019-04-26 17:33:50 +03:00
Ruslan Garnov f81886d17c Added planar flag to GMatDesc, intergated into framework, added tests 2019-04-26 14:04:44 +03:00
Alexander Alekhin 0023d8a106 Merge pull request #14410 from adamrankin:master 2019-04-25 18:45:14 +00:00
Dmitry Kurtaev 4f6be11c0e Check if Inference Engine networks are fully supported by backend 2019-04-25 11:27:17 +03:00
Adam Rankin a164a131f9 BUG: Qt5 components not correctly detected if only Qt5_DIR is provided, when this is supported by Qt CMake system.
Fixed by updating Qt5 find_package call to use modern CMake syntax
2019-04-24 15:46:30 -04:00
Alexander Alekhin 0431ecb9e2 Merge pull request #14408 from l-bat:onnx_deconv 2019-04-24 14:30:09 +00:00
Vitaly Tuzov 18d10d6b86 Fixed v_reduce_sad intrinsics implementation and added tests 2019-04-24 14:53:59 +03:00
Alexander Alekhin cd879bedb4 Merge pull request #14406 from thangktran:thangktran/java-wrapper-for-find4QuadCornerSubpix 2019-04-24 11:44:05 +00:00
Liubov Batanina 45ced8e022 Fix ONNX deconvolution 2019-04-24 14:37:52 +03:00
Dmitry Kurtaev 520e351489 Fix batching in DetectionOutput layer 2019-04-24 12:08:49 +03:00
Thang Tran 2f7fc1a598 calib3d: add find4QuadCornerSubpix java wrapper
Fixes: https://github.com/opencv/opencv/issues/14169
2019-04-24 08:45:28 +02:00
Sheel-Patel ec39f0dc9e Merge pull request #14122 from Sheel-Patel:patch-1
Grammatical errors for help() in detect_mser.cpp (#14122)

* Grammatical errors for help() statement

Corrected spelling of "synthetic" and added grammatical clarification for keys to press to change view or use mouse.

* Adjustment of superfluous spaces
2019-04-24 01:45:27 +03:00
Alexander Alekhin e98222dfb3 Merge pull request #14260 from allanrodriguez:sample-digits-cpp 2019-04-23 22:38:07 +00:00
Alexander Alekhin 3b3347857f Merge pull request #14395 from alalek:ts_catch_missing_files 2019-04-23 14:46:05 +00:00
Alexander Alekhin 7d2190a5d4 ts: +ENV{OPENCV_TEST_REQUIRE_DATA}
similar to '--test_require_data' parameter
2019-04-22 21:42:06 +00:00
Alexander Alekhin c1981f28ad build: +OPENCV_ENABLE_MEMORY_SANITIZER flag 2019-04-22 21:35:25 +00:00
Alexander Alekhin d0032b0717 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-04-22 18:17:28 +00:00
Alexander Alekhin 8eb685de9d Merge pull request #14390 from dkurt:dnn_onnx_const_reshape 2019-04-22 15:55:19 +00:00
Alexander Alekhin 9bfaf4fe40 Merge pull request #14389 from alalek:cmake_fix_pch_build_with_vtk 2019-04-22 15:54:08 +00:00
Alexander Alekhin 8120595c3e Merge pull request #14387 from alalek:fix_winpack_build 2019-04-22 15:53:13 +00:00
Alexander Alekhin de4be8e610 Merge pull request #14384 from terfendail:fp16_depint 2019-04-22 15:52:53 +00:00
Alexander Alekhin 0bbd28e0d4 Merge pull request #14382 from alalek:backport_14373 2019-04-22 15:52:10 +00:00
Alexander Alekhin 8fac166b66 Merge pull request #14379 from sturkmen72:upd_GeneralizedHough 2019-04-22 15:51:47 +00:00
masa-iwm 5c404bb142 Merge pull request #14376 from masa-iwm:3.4
* fix getting platformIDs in initializeContextFromD3D11Device
2019-04-22 18:50:31 +03:00
Dmitry Kurtaev 9b635830bc Run Reshape layer for const input from ONNX models 2019-04-22 17:57:46 +03:00
Alexander Alekhin 319e891d7d cmake: guard macro definitions in PCH scripts
fixes build with VTK
2019-04-22 17:43:32 +03:00
Alexander Alekhin 44bd849697 build: reduce usage of constexpr
some compilers has lack of proper support for that
2019-04-22 15:41:27 +03:00
Vitaly Tuzov 4a54aa3fbd Cleared up deprecated intrinsics for FP16 2019-04-22 10:35:37 +03:00
Suleyman TURKMEN 3f9343e238 Update imgproc.hpp 2019-04-22 00:48:11 +03:00
Ryan Wong 8af96248bf Merge pull request #13909 from kinchungwong:logging_20190220
OE-11 Logging revamp (#13909)

* Initial commit for log tag support.

Part of #11003, incomplete. Should pass build.

Moved LogLevel enum to logger.defines.hpp

LogTag struct used to convey both name and log level threshold as
one argument to the new logging macro. See logtag.hpp file, and
CV_LOG_WITH_TAG macro.

Global log level is now associated with a global log tag, when a
logging statement doesn't specify any log tag. See getLogLevel and
getGlobalLogTag functions.

A macro CV_LOGTAG_FALLBACK is allowed to be re-defined by other modules
or compilation units, internally, so that logging statements inside
that unit that specify NULL as tag will fall back to the re-defined tag.

Line-of-code information (file name, line number, function name),
together with tag name, are passed into the new log message sink.
See writeLogMessageEx function.

Fixed old incorrect CV_LOG_VERBOSE usage in ocl4dnn_conv_spatial.cpp.

* Implemented tag-based log filtering

Added LogTagManager. This is an initial version, using standard C++
approach as much as possible, to allow easier code review. Will
optimize later.

A workaround for all static dynamic initialization issues is
implemented. Refer to code comments.

* Added LogTagConfigParser.

Note: new code does not fully handle old log config parsing behavior.

* Fix log tag config vs registering ordering issue.

* Started testing LogTagConfigParser, incomplete.

The intention of this commit is to illustrate the capabilities of
the current design of LogTagConfigParser.

The test contained in this commit is not complete. Also, design changes
may require throwing away this commit and rewriting test code from
scratch.

Does not test whitespace segmentation (multiple tags on the config);
will do in next commit.

* Added CV_LOGTAG_EXPAND_NAME macro

This macro allows to be re-defined locally in other compilation units
to apply a prefix to whatever argument is passed as the "tag" argument
into CV_LOG_WITH_TAG. The default definition in logger.hpp does not
modify the argument. It is recommended to include the address-of
operator (ampersand) when re-defined locally.

* Added a few tests for LogTagManager, some fail.

See test_logtagmanager.cpp
Failed tests are: non-global ("something"), setting level by name-part
(first part or any part) has no effect at all.

* LogTagManagerTests substring non-confusion tests

* Fix major bugs in LogTagManager

The code change is intended to approximate the spec documented in
https://gist.github.com/kinchungwong/ec25bc1eba99142e0be4509b0f67d0c6

Refer to test suite in test_logtagmanager.cpp

Filter test result in "opencv_test_core" ...
with gtest_filter "LogTagManager*"

To see the test code that finds the bugs, refer to original commits
(before rebase; might be gone)

.. f3451208 (2019-03-03T19:45:17Z)
.... LogTagManagerTests substring non-confusion tests

.. 1b848f5f (2019-03-03T01:55:18Z)
.... Added a few tests for LogTagManager, some fail.

* Added LogTagManagerNamePartNonConfusionTest.

See test_logtagmanager.cpp in modules/core/test.

* Added LogTagAuto for auto registration in ctor

* Rewritten LogTagManager to resolve issues.

* Resolves code review issues around 2019-04-10

LogTagConfigParser::parseLogLevel - as part of resolving code review
issues, this function is rewritten to simplify control flow and to
improve conformance with legacy usage (for string values "OFF",
"DISABLED", and "WARNINGS").
2019-04-22 00:01:10 +03:00
Alexander Alekhin f7856a0f35 imgcodecs(tiff): update tile size checks
backporting of commit: 25247b9f6e
2019-04-21 18:36:39 +00:00
Alexander Alekhin f439fc4306 Merge pull request #14373 from alalek:oss_fuzz_14185_14321 2019-04-20 20:53:07 +00:00
Alexander Alekhin 25247b9f6e imgcodecs(tiff): update tile size checks
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14185
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14321
2019-04-20 20:13:47 +00:00
Alexander Alekhin 5c0a98cfb6 Merge pull request #14369 from ManthanKeim:patch-1 2019-04-20 19:30:54 +00:00
Manthan Keim 269c28e69e Update py_svm_opencv.markdown
Fixes a broken link for histograms of Oriented Gradients.
2019-04-20 18:52:13 +00:00
Dmitry Kurtaev a5c92c2029 Merge pull request #13694 from dkurt:dnn_ie_async
Asynchronous API from Intel's Inference Engine (#13694)

* Add forwardAsync for asynchronous mode from Intel's Inference Engine

* Python test for forwardAsync

* Replace Future_Mat to AsyncMat

* Shadow AsyncMat

* Isolate InferRequest callback

* Manage exceptions in Async API of IE
2019-04-19 21:01:19 +03:00
Alexander Alekhin c024edb9a8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-04-19 15:43:58 +03:00
Alexander Alekhin 3abae3c511 Merge pull request #14366 from alalek:win32_fix_pdb 2019-04-19 12:42:16 +00:00
Alexander Alekhin 2e4d771005 cmake: fix PDB handling 2019-04-19 14:53:35 +03:00
Alexander Alekhin 4f764b812e Merge pull request #14315 from dkurt:tf_squeeze_and_slim_softmax_v2 2019-04-18 16:01:24 +00:00
Alexander Alekhin f7b6e30156 Merge pull request #14354 from alalek:workaround_apple_dyld_bug 2019-04-17 19:09:15 +00:00
Alexander Alekhin 9dccfe2a96 Merge pull request #13917 from sturkmen72:removed_c_api 2019-04-17 19:04:33 +00:00
Alexander Alekhin 2b84039a16 Merge pull request #14313 from alalek:cmake_pch_fix_defines_from_interface_targets 2019-04-17 19:02:28 +00:00
Alexander Alekhin 96610c7ee1 Merge pull request #14332 from LaurentBerger:loadknearest 2019-04-17 19:00:42 +00:00
Ruslan Garnov 1f517b8a02 Merge pull request #13943 from rgarnov:export_headers_for_backend_development
G-API external backend development (#13943)

* Moved HostCtor and ConstVal from gapi_priv.hpp to objref.hpp

* Added gmodel_priv.hpp, added export of symbols from gmodel.hpp

* Added export of binInArg and bindOutArg

* Renamed gapi_priv.*pp -> gorigin.*pp

* Added a fixme on collecting exports inside one class
2019-04-17 21:54:47 +03:00
Alexander Alekhin 52f16e0f55 tests: workaround for DYLD_LIBRARY_PATH on Apple MacOSX 2019-04-17 15:19:33 +03:00
Alexander Alekhin dedd966002 Merge pull request #14345 from dkurt:fix_dnn_ie_mac 2019-04-16 19:18:49 +00:00
Alexander Alekhin 6d3ae8d4ca Merge pull request #14341 from alalek:cmake_fix_pkgconfig_libs 2019-04-16 19:04:07 +00:00
Alexander Alekhin c667de9b68 dnn: force visibility(default) for IE headers 2019-04-16 18:18:31 +03:00
LaurentBerger 621e3eaed8 Add Ptr KNearest::load and python binding 2019-04-16 16:32:37 +02:00
Alexander Alekhin 3ef046b6c9 Merge pull request #14338 from alalek:fix_13849 2019-04-16 13:42:27 +00:00
Alexander Alekhin 74d5cdb6d8 Merge pull request #14343 from alalek:dnn_static_scans_namespace 2019-04-16 13:11:23 +00:00
Alexander Alekhin 7ad5d21900 Merge pull request #14339 from alalek:cmake_fix_std_cxx11 2019-04-16 13:10:24 +00:00
Alexander Alekhin ebe13a9613 Merge pull request #14337 from alalek:ts_flush_stdout 2019-04-16 13:08:40 +00:00
Alexander Alekhin 7c1d9fea8b Merge pull request #14308 from m000:master 2019-04-16 11:58:21 +00:00
Alexander Alekhin 59e4f85898 Merge pull request #14347 from dkurt:dnn_samples 2019-04-16 11:50:46 +00:00
Dmitry Kurtaev a304069687 Remove preprocessing parameters from README 2019-04-16 13:29:33 +03:00
Dmitry Kurtaev 62d079fa69 Fix Normalize layer for Mac 2019-04-16 12:39:04 +03:00
Alexander Alekhin 3902694075 static scans: preserve namespace name 2019-04-16 06:49:47 +00:00
vdgussem 00861b668a Changed the way Images are converted into rgba Mats so that JavaCamera2View also shows correct colors when the Image contains I420 or YV12 data 2019-04-16 01:38:59 +02:00
Alexander Alekhin 0d747daf47 cmake: use absolute library paths from 'pkgconfig'
- drop legacy check_module() macro
- drop 'ALIASOF_'
2019-04-15 22:11:49 +00:00
Alexander Alekhin 78384d8923 build: avoid highgui dependency 2019-04-15 18:59:51 +00:00
Alexander Alekhin a56c12278e cmake: fix C++11 flags (ENABLE_CXX11 is not required) 2019-04-15 20:00:55 +03:00
Alexander Alekhin c9a76ede94 Merge pull request #14328 from lainy:3.4 2019-04-15 11:03:37 +00:00
lain 246733382f Fix OpenCVConfig.cmake for Arch Linux. 2019-04-14 12:22:57 -07:00
Alexander Alekhin d1387b25eb Merge pull request #14318 from dkurt:fix_ie_github 2019-04-14 17:33:11 +00:00
Allan Rodriguez 86561fef90 Added C++ version of digits.py. 2019-04-13 22:29:30 -07:00
Alexander Alekhin 64fd1c95a5 ts: flush stdout/stderr before test launch 2019-04-13 21:08:06 +00:00
Alexander Alekhin 4635356435 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-04-13 20:00:54 +00:00
Manolis Stamatogiannakis ef16e4203e Fix compile error with external TBB and -DBUILD_SHARED_LIBS=OFF.
Adds IMPORTED for the TBB::tbb alias target as otherwise cmake produces
the following error:

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set.

This problem occurs with the defaults used by homebrew on macOS, which
compiles both static and shared versions of TBB and OpenCV.
2019-04-13 21:53:04 +02:00
Dmitry Kurtaev 92cbec6fb1 Fix dnn with IE from GitHub 2019-04-13 19:02:03 +03:00
Dmitry Kurtaev 0cfd95c097 Fix TensorFlow's Squeeze and a new fusion for SoftMax from slim backend 2019-04-13 17:04:31 +03:00
Nick Yang 169dc9c311 Merge pull request #14297 from shxuy:patch-1
fix just a typo of the word 'word' (#14297)
2019-04-12 19:32:08 +03:00
Lubov Batanina 60a841c797 Merge pull request #14255 from l-bat:networks_visualization
* Add networks visualization

* Disable CXX11

* Fixed multy inputs support

* Added output shapes

* Added color for DLIE/CPU

* Fixed graph colors
2019-04-12 19:31:07 +03:00
michal-kowalczyk a246d8d8e9 Merge pull request #13709 from michal-kowalczyk:flush-processed-samples-number
* Add flushing to printing number of processed positive/negative samples so that user is informed of updates quickly.

* use flush C api instead of C++ api
2019-04-12 18:51:35 +03:00
Alexander Alekhin 64629cb94e Merge pull request #12783 from alalek:test_tag 2019-04-12 15:35:41 +00:00
Alexander Alekhin 9515137cb2 cmake: fix PCH generation
process defines from INTERFACE targets
2019-04-12 17:39:02 +03:00
Alexander Alekhin 5f500692f1 Merge pull request #14284 from dkurt:fix_14236 2019-04-12 13:05:38 +00:00
Alexander Alekhin 227ec19929 Merge pull request #14277 from dkurt:ie_enable_tests_2019r1 2019-04-12 13:05:19 +00:00
Dmitry Kurtaev a2bbfa1db5 Enable some tests for Inference Engine 2019R1 2019-04-12 15:21:42 +03:00
Alexander Alekhin a9ddf12187 Merge pull request #14078 from alalek:test_python_from_modules 2019-04-12 11:39:12 +00:00
Alexander Alekhin d68e722b71 Merge pull request #11748 from paroj:cap_except 2019-04-12 11:36:17 +00:00
Maksim Shabunin 5cb0eded64 Merge pull request #14278 from mshabunin:fix-osx-camera-auth-rt
* AVFoundation: Use runtime check for camera authorization
2019-04-11 19:16:50 +03:00
Alexander Alekhin 39630e076a Merge pull request #14294 from alalek:issue_14286
cmake: fix WITH_OPENCL_D3D11_NV check
2019-04-11 17:50:15 +03:00
Alexander Alekhin 7621b91769 Merge pull request #14292 from alalek:issue_14291
* macosx: fix C++11 build

backporting commit c3cf35ab63

* macosx: eliminate build warning
2019-04-11 17:46:28 +03:00
kiwixz c8056b3e27 Merge pull request #14276 from kiwixz:pr/fix_compound
Do not use compound literals (fix MSVC C4576) (#14276)

* do not use compound literals (compat cpp98)

* only fix msvc path

* remove unnecessary cplusplus check
2019-04-11 17:44:28 +03:00
Alexander Alekhin a0a1fb5fec python: discover tests from module/misc/python/test paths 2019-04-10 18:35:35 +00:00
Pavel Rojtberg 15bb0b86ce VideoCapture: add exception error mode similar to fstream + test 2019-04-10 13:41:57 +02:00
Dmitry Kurtaev 7ce2397b62 Fix a bug in FusedBatchNorm (TensorFlow) layer importer 2019-04-09 13:35:34 +03:00
Alexander Alekhin e0841f3d6e dnn(test-tags): add time / memory tags 2019-04-08 19:18:25 +00:00
Alexander Alekhin b38de57f9a ts: test tags for flexible/reliable tests filtering
- added functionality to collect memory usage of OpenCL sybsystem
- memory usage of fastMalloc() (disabled by default):
  * It is not accurate sometimes - external memory profiler is required.
- specify common `CV_TEST_TAG_` macros
- added applyTestTag() function
- write memory usage / enabled tags into Google Tests output file (.xml)
2019-04-08 19:12:49 +00:00
Alexander Alekhin 64168fc20a '-dev' version 2019-04-08 14:34:32 +03:00
Alexander Alekhin 072b524e02 Merge tag '4.1.0' 2019-04-08 08:10:29 +00:00
take1014 e0b664f390 fix dftFilter2D 2019-03-13 00:27:56 +09:00
Suleyman TURKMEN 3d1dbd2ccd clean up C API 2019-03-03 21:43:27 +03:00
catree 576ab3df9a Add division operators for Matx. 2019-02-27 19:36:23 +01:00
Alexander Alekhin f6ee03471d imgproc: use Matx23d as result type of getRotationMatrix2D() call 2018-11-18 09:02:40 +00:00
2001 changed files with 173883 additions and 46894 deletions
+41 -17
View File
@@ -1,23 +1,8 @@
<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
Please:
* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->
##### System information (version)
<!-- Example
- OpenCV => 3.1
- OpenCV => 4.2
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
- Compiler => Visual Studio 2017
-->
- OpenCV => :grey_question:
@@ -36,3 +21,42 @@ This is a template helping you to create an issue which can be processed as quic
```
or attach as .txt or .zip file
-->
##### Issue submission checklist
- [ ] I report the issue, it's not a question
<!--
OpenCV team works with answers.opencv.org, Stack Overflow and other communities
to discuss problems. Tickets with question without real issue statement will be
closed.
-->
- [ ] I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution
<!--
Places to check:
* OpenCV documentation: https://docs.opencv.org
* FAQ page: https://github.com/opencv/opencv/wiki/FAQ
* OpenCV forum: https://answers.opencv.org
* OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
* Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
-->
- [ ] I updated to latest OpenCV version and the issue is still there
<!--
master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
OpenCV team supports only latest release for each branch.
The ticket is closed, if the problem is not reproduced with modern version.
-->
- [ ] There is reproducer code and related data files: videos, images, onnx, etc
<!--
The best reproducer -- test case for OpenCV that we can add to the library.
Recommendations for media files and binary files:
* Try to reproduce the issue with images and videos in opencv_extra repository
to reduce attachment size
* Use PNG for images, if you report some CV related bug, but not image reader
issue
* Attach the image as archite to the ticket, if you report some reader issue.
Image hosting services compress images and it breaks the repro code.
* Provide ONNX file for some public model or ONNX file with with random weights,
if you report ONNX parsing or handling issue. Architecture details diagram
from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
-->
+9 -7
View File
@@ -1,9 +1,11 @@
<!-- Please use this line to close one or multiple issues when this pullrequest gets merged
You can add another line right under the first one:
resolves #1234
resolves #1235
-->
### Pull Request Readiness Checklist
### This pullrequest changes
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
<!-- Please describe what your pullrequest is changing -->
- [ ] I agree to contribute to the project under OpenCV (BSD) License.
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
- [ ] The PR is proposed to proper branch
- [ ] There is reference to original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
+2
View File
@@ -22,3 +22,5 @@ bin/
*.log
*.tlog
build
node_modules
CMakeSettings.json
+5 -2
View File
@@ -20,8 +20,11 @@ if(CMAKE_COMPILER_IS_GNUCC)
# - matchTemplate about 5-10%
# - goodFeaturesToTrack 10-20%
# - cornerHarris 30% for some cases
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
else()
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
endif()
endif()
add_library(carotene_objs OBJECT
+5 -17
View File
@@ -60,22 +60,6 @@ function(compile_carotene)
endif()
add_subdirectory("${CAROTENE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/carotene")
if(ARM OR AARCH64)
if(CMAKE_BUILD_TYPE)
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
endif()
check_cxx_compiler_flag("-mfpu=neon" CXX_HAS_MFPU_NEON)
check_c_compiler_flag("-mfpu=neon" C_HAS_MFPU_NEON)
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON} AND NOT "${CMAKE_CXX_FLAGS} " MATCHES "-mfpu=neon[^ ]*")
get_target_property(old_flags "carotene_objs" COMPILE_FLAGS)
if(old_flags)
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "${old_flags} -mfpu=neon")
else()
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "-mfpu=neon")
endif()
endif()
endif()
endfunction()
compile_carotene()
@@ -90,7 +74,11 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
# matchTemplate about 5-10%
# goodFeaturesToTrack 10-20%
# cornerHarris 30% for some cases
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
else()
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
endif()
# set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
endif()
+2
View File
@@ -1127,6 +1127,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
{
std::memcpy(ctx->kernel_data + kernel_width * j, kernel_data + kernel_step * j, kernel_width * sizeof(int16_t));
}
break;
default:
delete[] ctx->kernel_data;
delete ctx;
@@ -1243,6 +1244,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
ctx->kernely_data[0]=((int16_t*)kernely_data)[0];
ctx->kernely_data[1]=((int16_t*)kernely_data)[1];
ctx->kernely_data[2]=((int16_t*)kernely_data)[2];
break;
default:
delete ctx;
return CV_HAL_ERROR_NOT_IMPLEMENTED;
+2 -2
View File
@@ -1,6 +1,6 @@
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_ffmpeg_64.dll"
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_videoio_ffmpeg_64.dll"
$expected_md5 = "@FFMPEG_FILE_HASH_BIN64@"
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSION@_64.dll"
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_videoio_ffmpeg@OPENCV_DLLVERSION@_64.dll"
Write-Output ("=" * 120)
try {
+8 -8
View File
@@ -1,16 +1,16 @@
# Binaries branch name: ffmpeg/master_20181106
# Binaries were created for OpenCV: 2c6f1ab57d4250ee46e32d1b51c056431965b470
ocv_update(FFMPEG_BINARIES_COMMIT "759a23e24ab787a0979f8a93103dcc3105ec10c1")
ocv_update(FFMPEG_FILE_HASH_BIN32 "849286ccc527c99e5a218b67f13c6e8c")
ocv_update(FFMPEG_FILE_HASH_BIN64 "96444a4645753aaafa296479665c9185")
ocv_update(FFMPEG_FILE_HASH_CMAKE "f710891525a04586d565d0e700e62a9c")
# Binaries branch name: ffmpeg/master_20200311
# Binaries were created for OpenCV: 850414a501d5e6dba111c92d73fdd05794c7061d
ocv_update(FFMPEG_BINARIES_COMMIT "3d2e97081683265950316c65a52c2e8858ffba1b")
ocv_update(FFMPEG_FILE_HASH_BIN32 "3b094c37d270a30f0b20a0bc8d3ecafb")
ocv_update(FFMPEG_FILE_HASH_BIN64 "388ee23a7ca44eef2344e265fafd5940")
ocv_update(FFMPEG_FILE_HASH_CMAKE "ad57c038ba34b868277ccbe6dd0f9602")
function(download_win_ffmpeg script_var)
set(${script_var} "" PARENT_SCOPE)
set(ids BIN32 BIN64 CMAKE)
set(name_BIN32 "opencv_ffmpeg.dll")
set(name_BIN64 "opencv_ffmpeg_64.dll")
set(name_BIN32 "opencv_videoio_ffmpeg.dll")
set(name_BIN64 "opencv_videoio_ffmpeg_64.dll")
set(name_CMAKE "ffmpeg_version.cmake")
set(FFMPEG_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
+4 -4
View File
@@ -13,10 +13,10 @@
* On Windows OpenCV uses pre-built ffmpeg binaries, built with proper flags (without GPL components) and
wrapped with simple, stable OpenCV-compatible API.
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
opencv_ffmpeg_64.dll (version for 64-bit Windows).
The binaries are opencv_videoio_ffmpeg.dll (version for 32-bit Windows) and
opencv_videoio_ffmpeg_64.dll (version for 64-bit Windows).
The pre-built opencv_ffmpeg*.dll is:
The pre-built opencv_videoio_ffmpeg*.dll is:
* LGPL library, not BSD libraries.
* Loaded at runtime by opencv_videoio module.
If it succeeds, ffmpeg can be used to decode/encode videos;
@@ -30,7 +30,7 @@
Or you can specify location of binary file via OPENH264_LIBRARY environment variable.
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
opencv_videoio_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
decode/encode videos using FFMPEG (though, it may still be able to do that using other API,
such as Video for Windows, Windows Media Foundation or our self-contained motion jpeg codec).
+11 -16
View File
@@ -2,37 +2,32 @@ function(download_ippicv root_var)
set(${root_var} "" PARENT_SCOPE)
# Commit SHA in the opencv_3rdparty repo
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
set(IPPICV_COMMIT "a56b6ac6f030c312b2dce17430eef13aed9af274")
# Define actual ICV versions
if(APPLE)
set(OPENCV_ICV_PLATFORM "macosx")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
else()
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
endif()
set(OPENCV_ICV_NAME "ippicv_2020_mac_intel64_20191018_general.tgz")
set(OPENCV_ICV_HASH "1c3d675c2a2395d094d523024896e01b")
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
set(OPENCV_ICV_NAME "ippicv_2020_lnx_intel64_20191018_general.tgz")
set(OPENCV_ICV_HASH "7421de0095c7a39162ae13a6098782f9")
else()
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
set(OPENCV_ICV_NAME "ippicv_2020_lnx_ia32_20191018_general.tgz")
set(OPENCV_ICV_HASH "ad189a940fb60eb71f291321322fe3e8")
endif()
elseif(WIN32 AND NOT ARM)
set(OPENCV_ICV_PLATFORM "windows")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
set(OPENCV_ICV_NAME "ippicv_2020_win_intel64_20191018_general.zip")
set(OPENCV_ICV_HASH "879741a7946b814455eee6c6ffde2984")
else()
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
set(OPENCV_ICV_NAME "ippicv_2020_win_ia32_20191018_general.zip")
set(OPENCV_ICV_HASH "cd39bdf0c2e1cac9a61101dad7a2413e")
endif()
else()
return()
+7 -1
View File
@@ -196,6 +196,10 @@
# define ITT_ARCH_PPC64 5
#endif /* ITT_ARCH_PPC64 */
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
# define ITT_ARCH_AARCH64 6
#endif /* ITT_ARCH_AARCH64 */
#ifndef ITT_ARCH
# if defined _M_IX86 || defined __i386__
# define ITT_ARCH ITT_ARCH_IA32
@@ -205,6 +209,8 @@
# define ITT_ARCH ITT_ARCH_IA64
# elif defined _M_ARM || defined __arm__
# define ITT_ARCH ITT_ARCH_ARM
# elif defined __aarch64__
# define ITT_ARCH ITT_ARCH_AARCH64
# elif defined __powerpc64__
# define ITT_ARCH ITT_ARCH_PPC64
# endif
@@ -359,7 +365,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
: "memory");
return result;
}
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
#ifndef ITT_SIMPLE_INIT
+6
View File
@@ -17,6 +17,12 @@
#if !defined(JAS_WIN_MSVC_BUILD)
/* A configure-based build is being used. */
#include <stdio.h>
// uClibc-ng workaround: https://github.com/opencv/opencv/pull/15279
#ifndef L_tmpnam
#define L_tmpnam 20
#endif
/* Extra debugging support */
+5 -4
View File
@@ -4,9 +4,9 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-6
set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_REVISION 2)
set(VERSION_REVISION 4)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
set(LIBJPEG_TURBO_VERSION_NUMBER 2000004)
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -78,10 +78,11 @@ configure_file(jconfigint.h.in jconfigint.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
set(JPEG_SOURCES
jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcicc.c
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c jdmainct.c jdmarker.c
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
+36 -26
View File
@@ -1,14 +1,14 @@
Background
==========
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
generally 2-6x as fast as libjpeg, all else being equal. On other types of
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
virtue of its highly-optimized Huffman coding routines. In many cases, the
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and
MIPS systems, as well as progressive JPEG compression on x86 and x86-64
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
all else being equal. On other types of systems, libjpeg-turbo can still
outperform libjpeg by a significant amount, by virtue of its highly-optimized
Huffman coding routines. In many cases, the performance of libjpeg-turbo
rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
@@ -135,25 +135,24 @@ without recompiling. libjpeg-turbo does not claim to support all of the
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
cases (see below.)
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
The following section describes which libjpeg v7+ features are supported and
which aren't.
By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
that programs that are built against libjpeg v7 or v8 can be run with
libjpeg-turbo. The following section describes which libjpeg v7+ features are
supported and which aren't.
### Support for libjpeg v7 and v8 Features
#### Fully supported
- **libjpeg: IDCT scaling extensions in decompressor**<br>
- **libjpeg API: IDCT scaling extensions in decompressor**<br>
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
and 1/2 are SIMD-accelerated.)
- **libjpeg: Arithmetic coding**
- **libjpeg API: Arithmetic coding**
- **libjpeg: In-memory source and destination managers**<br>
- **libjpeg API: In-memory source and destination managers**<br>
See notes below.
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
@@ -185,14 +184,14 @@ means of quality improvement. The reader is invited to peruse the research at
but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
- **libjpeg: DCT scaling in compressor**<br>
- **libjpeg API: DCT scaling in compressor**<br>
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
There is no technical reason why DCT scaling could not be supported when
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
8/9 would be available, which is of limited usefulness.
- **libjpeg: SmartScale**<br>
- **libjpeg API: SmartScale**<br>
`cinfo.block_size` is silently ignored.
SmartScale is an extension to the JPEG format that allows for DCT block
sizes other than 8x8. Providing support for this new format would be
@@ -205,7 +204,7 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
interest in providing this feature would be as a means of supporting
additional DCT scaling factors.
- **libjpeg: Fancy downsampling in compressor**<br>
- **libjpeg API: Fancy downsampling in compressor**<br>
`cinfo.do_fancy_downsampling` is silently ignored.
This requires the DCT scaling feature, which is not supported.
@@ -247,15 +246,14 @@ don't, and it allows those functions to be provided in the "official"
libjpeg-turbo binaries.
Those who are concerned about maintaining strict conformance with the libjpeg
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
libjpeg v8 API/ABI.
On Un*x systems, including the in-memory source/destination managers changes
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
Note that, on most Un*x systems, the dynamic linker will not look for a
function in a library until that function is actually used. Thus, if a program
@@ -331,7 +329,7 @@ in a way that makes the rest of the libjpeg infrastructure happy, so it is
necessary to use the slow Huffman decoder when decompressing a JPEG image that
has restart markers. This can cause the decompression performance to drop by
as much as 20%, but the performance will still be much greater than that of
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
generating JPEG images, so images generated by those programs will experience
this issue.
@@ -344,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
function in those cases. This causes performance to drop by as much as 40%.
It is therefore strongly advised that you use the slow integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher.
Memory Debugger Pitfalls
========================
Valgrind and Memory Sanitizer (MSan) can generate false positives
(specifically, incorrect reports of uninitialized memory accesses) when used
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
to `cmake` when configuring the build or by setting the environment variable
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
MSan, or other memory debuggers.
+8 -4
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
* Copyright (C) 2009-2011, 2014-2016, 2018-2019, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -43,8 +43,8 @@
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#if !defined __thumb__ || defined __thumb2__
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif
@@ -356,6 +356,8 @@ dump_buffer(working_state *state)
put_buffer = (put_buffer << size) | code; \
}
#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
#define CHECKBUF15() { \
if (put_bits > 15) { \
EMIT_BYTE() \
@@ -363,6 +365,8 @@ dump_buffer(working_state *state)
} \
}
#endif
#define CHECKBUF31() { \
if (put_bits > 31) { \
EMIT_BYTE() \
@@ -428,7 +432,7 @@ dump_buffer(working_state *state)
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
* larger than 200 bytes.
*/
#define BUFSIZE (DCTSIZE2 * 4)
#define BUFSIZE (DCTSIZE2 * 8)
#define LOAD_BUFFER() { \
if (state->free_in_buffer < BUFSIZE) { \
+105
View File
@@ -0,0 +1,105 @@
/*
* jcicc.c
*
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
* Copyright (C) 2017, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides code to write International Color Consortium (ICC) device
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
* for including such data in JPEG "APP2" markers. The code given here does
* not know anything about the internal structure of the ICC profile data; it
* just knows how to embed the profile data in a JPEG file while writing it.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jerror.h"
/*
* Since an ICC profile can be larger than the maximum size of a JPEG marker
* (64K), we need provisions to split it into multiple markers. The format
* defined by the ICC specifies one or more APP2 markers containing the
* following data:
* Identifying string ASCII "ICC_PROFILE\0" (12 bytes)
* Marker sequence number 1 for first APP2, 2 for next, etc (1 byte)
* Number of markers Total number of APP2's used (1 byte)
* Profile data (remainder of APP2 data)
* Decoders should use the marker sequence numbers to reassemble the profile,
* rather than assuming that the APP2 markers appear in the correct sequence.
*/
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
#define MAX_BYTES_IN_MARKER 65533 /* maximum data len of a JPEG marker */
#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN)
/*
* This routine writes the given ICC profile data into a JPEG file. It *must*
* be called AFTER calling jpeg_start_compress() and BEFORE the first call to
* jpeg_write_scanlines(). (This ordering ensures that the APP2 marker(s) will
* appear after the SOI and JFIF or Adobe markers, but before all else.)
*/
GLOBAL(void)
jpeg_write_icc_profile(j_compress_ptr cinfo, const JOCTET *icc_data_ptr,
unsigned int icc_data_len)
{
unsigned int num_markers; /* total number of markers we'll write */
int cur_marker = 1; /* per spec, counting starts at 1 */
unsigned int length; /* number of bytes to write in this marker */
if (icc_data_ptr == NULL || icc_data_len == 0)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
if (cinfo->global_state < CSTATE_SCANNING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Calculate the number of markers we'll need, rounding up of course */
num_markers = icc_data_len / MAX_DATA_BYTES_IN_MARKER;
if (num_markers * MAX_DATA_BYTES_IN_MARKER != icc_data_len)
num_markers++;
while (icc_data_len > 0) {
/* length of profile to put in this marker */
length = icc_data_len;
if (length > MAX_DATA_BYTES_IN_MARKER)
length = MAX_DATA_BYTES_IN_MARKER;
icc_data_len -= length;
/* Write the JPEG marker header (APP2 code and marker length) */
jpeg_write_m_header(cinfo, ICC_MARKER,
(unsigned int)(length + ICC_OVERHEAD_LEN));
/* Write the marker identifying string "ICC_PROFILE" (null-terminated). We
* code it in this less-than-transparent way so that the code works even if
* the local character set is not ASCII.
*/
jpeg_write_m_byte(cinfo, 0x49);
jpeg_write_m_byte(cinfo, 0x43);
jpeg_write_m_byte(cinfo, 0x43);
jpeg_write_m_byte(cinfo, 0x5F);
jpeg_write_m_byte(cinfo, 0x50);
jpeg_write_m_byte(cinfo, 0x52);
jpeg_write_m_byte(cinfo, 0x4F);
jpeg_write_m_byte(cinfo, 0x46);
jpeg_write_m_byte(cinfo, 0x49);
jpeg_write_m_byte(cinfo, 0x4C);
jpeg_write_m_byte(cinfo, 0x45);
jpeg_write_m_byte(cinfo, 0x0);
/* Add the sequencing info */
jpeg_write_m_byte(cinfo, cur_marker);
jpeg_write_m_byte(cinfo, (int)num_markers);
/* Add the profile data */
while (length--) {
jpeg_write_m_byte(cinfo, *icc_data_ptr);
icc_data_ptr++;
}
cur_marker++;
}
}
+1 -1
View File
@@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
*/
master->pass_type = output_pass;
master->pass_number++;
/*FALLTHROUGH*/
#endif
/*FALLTHROUGH*/
case output_pass:
/* Do a data-output pass. */
/* We need not repeat per-scan setup if prior optimization pass did it. */
+2 -2
View File
@@ -52,8 +52,8 @@
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#if !defined __thumb__ || defined __thumb2__
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif
+7 -3
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -589,7 +589,11 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
/* Convert DC difference to actual value, update last_dc_val */
int ci = cinfo->MCU_membership[blkn];
s += state.last_dc_val[ci];
/* This is really just
* s += state.last_dc_val[ci];
* It is written this way in order to shut up UBSan.
*/
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block) {
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
@@ -684,7 +688,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
int ci = cinfo->MCU_membership[blkn];
s += state.last_dc_val[ci];
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block)
(*block)[0] = (JCOEF)s;
+171
View File
@@ -0,0 +1,171 @@
/*
* jdicc.c
*
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
* Copyright (C) 2017, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides code to read International Color Consortium (ICC) device
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
* for including such data in JPEG "APP2" markers. The code given here does
* not know anything about the internal structure of the ICC profile data; it
* just knows how to get the profile data from a JPEG file while reading it.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jerror.h"
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc() */
extern void *malloc(size_t size);
#endif
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
/*
* Handy subroutine to test whether a saved marker is an ICC profile marker.
*/
LOCAL(boolean)
marker_is_icc(jpeg_saved_marker_ptr marker)
{
return
marker->marker == ICC_MARKER &&
marker->data_length >= ICC_OVERHEAD_LEN &&
/* verify the identifying string */
GETJOCTET(marker->data[0]) == 0x49 &&
GETJOCTET(marker->data[1]) == 0x43 &&
GETJOCTET(marker->data[2]) == 0x43 &&
GETJOCTET(marker->data[3]) == 0x5F &&
GETJOCTET(marker->data[4]) == 0x50 &&
GETJOCTET(marker->data[5]) == 0x52 &&
GETJOCTET(marker->data[6]) == 0x4F &&
GETJOCTET(marker->data[7]) == 0x46 &&
GETJOCTET(marker->data[8]) == 0x49 &&
GETJOCTET(marker->data[9]) == 0x4C &&
GETJOCTET(marker->data[10]) == 0x45 &&
GETJOCTET(marker->data[11]) == 0x0;
}
/*
* See if there was an ICC profile in the JPEG file being read; if so,
* reassemble and return the profile data.
*
* TRUE is returned if an ICC profile was found, FALSE if not. If TRUE is
* returned, *icc_data_ptr is set to point to the returned data, and
* *icc_data_len is set to its length.
*
* IMPORTANT: the data at *icc_data_ptr is allocated with malloc() and must be
* freed by the caller with free() when the caller no longer needs it.
* (Alternatively, we could write this routine to use the IJG library's memory
* allocator, so that the data would be freed implicitly when
* jpeg_finish_decompress() is called. But it seems likely that many
* applications will prefer to have the data stick around after decompression
* finishes.)
*/
GLOBAL(boolean)
jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr,
unsigned int *icc_data_len)
{
jpeg_saved_marker_ptr marker;
int num_markers = 0;
int seq_no;
JOCTET *icc_data;
unsigned int total_length;
#define MAX_SEQ_NO 255 /* sufficient since marker numbers are bytes */
char marker_present[MAX_SEQ_NO + 1]; /* 1 if marker found */
unsigned int data_length[MAX_SEQ_NO + 1]; /* size of profile data in marker */
unsigned int data_offset[MAX_SEQ_NO + 1]; /* offset for data in marker */
if (icc_data_ptr == NULL || icc_data_len == NULL)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
if (cinfo->global_state < DSTATE_READY)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
*icc_data_ptr = NULL; /* avoid confusion if FALSE return */
*icc_data_len = 0;
/* This first pass over the saved markers discovers whether there are
* any ICC markers and verifies the consistency of the marker numbering.
*/
for (seq_no = 1; seq_no <= MAX_SEQ_NO; seq_no++)
marker_present[seq_no] = 0;
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
if (marker_is_icc(marker)) {
if (num_markers == 0)
num_markers = GETJOCTET(marker->data[13]);
else if (num_markers != GETJOCTET(marker->data[13])) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* inconsistent num_markers fields */
return FALSE;
}
seq_no = GETJOCTET(marker->data[12]);
if (seq_no <= 0 || seq_no > num_markers) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* bogus sequence number */
return FALSE;
}
if (marker_present[seq_no]) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* duplicate sequence numbers */
return FALSE;
}
marker_present[seq_no] = 1;
data_length[seq_no] = marker->data_length - ICC_OVERHEAD_LEN;
}
}
if (num_markers == 0)
return FALSE;
/* Check for missing markers, count total space needed,
* compute offset of each marker's part of the data.
*/
total_length = 0;
for (seq_no = 1; seq_no <= num_markers; seq_no++) {
if (marker_present[seq_no] == 0) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* missing sequence number */
return FALSE;
}
data_offset[seq_no] = total_length;
total_length += data_length[seq_no];
}
if (total_length == 0) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* found only empty markers? */
return FALSE;
}
/* Allocate space for assembled data */
icc_data = (JOCTET *)malloc(total_length * sizeof(JOCTET));
if (icc_data == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11); /* oops, out of memory */
/* and fill it in */
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
if (marker_is_icc(marker)) {
JOCTET FAR *src_ptr;
JOCTET *dst_ptr;
unsigned int length;
seq_no = GETJOCTET(marker->data[12]);
dst_ptr = icc_data + data_offset[seq_no];
src_ptr = marker->data + ICC_OVERHEAD_LEN;
length = data_length[seq_no];
while (length--) {
*dst_ptr++ = *src_ptr++;
}
}
}
*icc_data_ptr = icc_data;
*icc_data_len = total_length;
return TRUE;
}
-2
View File
@@ -429,8 +429,6 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
((INT16 *)(addr))[0] = (INT16)(pixels); \
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
+9 -5
View File
@@ -8,6 +8,7 @@
* Copyright (C) 2010, 2015-2016, D. R. Commander.
* Copyright (C) 2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2019, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY output_data = *output_data_ptr;
JSAMPROW inptr0, inptr1, outptr;
#if BITS_IN_JSAMPLE == 8
int thiscolsum;
int thiscolsum, bias;
#else
JLONG thiscolsum;
JLONG thiscolsum, bias;
#endif
JDIMENSION colctr;
int inrow, outrow, v;
@@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
for (v = 0; v < 2; v++) {
/* inptr0 points to nearest input row, inptr1 points to next nearest */
inptr0 = input_data[inrow];
if (v == 0) /* next nearest is row above */
if (v == 0) { /* next nearest is row above */
inptr1 = input_data[inrow - 1];
else /* next nearest is row below */
bias = 1;
} else { /* next nearest is row below */
inptr1 = input_data[inrow + 1];
bias = 2;
}
outptr = output_data[outrow++];
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
*outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
}
}
inrow++;
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* jfdctint.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* jidctint.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* jidctred.c
*
* This file was part of the Independent JPEG Group's software.
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1998, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.
-7
View File
@@ -15,13 +15,6 @@ else()
ocv_list_filterout(lib_srcs jmemnobs.c)
endif()
if(WINRT)
add_definitions(-DNO_GETENV)
get_directory_property( DirDefs COMPILE_DEFINITIONS )
message(STATUS "Adding NO_GETENV to compiler definitions for WINRT:")
message(STATUS " COMPILE_DEFINITIONS = ${DirDefs}")
endif()
# ----------------------------------------------------------------------------------
# Define the library target:
# ----------------------------------------------------------------------------------
+9 -6
View File
@@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software
==========================================
README for release 9b of 17-Jan-2016
README for release 9c of 14-Jan-2018
====================================
This distribution contains the ninth public release of the Independent JPEG
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@@ -246,8 +246,8 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
http://www.ijg.org/files/jpegsrc.v9c.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
@@ -293,8 +293,11 @@ communication about JPEG configuration in Sigma Photo Pro software.
Thank to Andrew Finkenstadt for hosting the ijg.org site.
Last but not least special thank to Thomas G. Lane for the original
design and development of this singular software package.
Thank to Thomas G. Lane for the original design and development of
this singular software package.
Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
FILE FORMAT WARS
+21
View File
@@ -1,6 +1,27 @@
CHANGE LOG for Independent JPEG Group's JPEG software
Version 9c 14-Jan-2018
-----------------------
jpegtran: add an option to the -wipe switch to fill the region
with the average of adjacent blocks, instead of gray out.
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
Make range extension bits adjustable (in jpegint.h).
Thank to Robin Watts for suggestion.
Provide macros for fflush() and ferror() in jinclude.h in order
to facilitate adaption by applications using an own FILE class.
Thank to Gerhard Huber for suggestion.
Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri,
Patrick McMunn, and Huw Davies for suggestion.
Add sanity checks in cjpeg image reader modules.
Thank to Bingchang, Liu for reports.
Version 9b 17-Jan-2016
-----------------------
+167 -2
View File
@@ -2,7 +2,7 @@
* jcinit.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding.
* Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -21,6 +21,168 @@
#include "jpeglib.h"
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
/* Sanity check on input image dimensions to prevent overflow in
* following calculations.
* We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
#ifdef DCT_SCALING_SUPPORTED
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
#else /* !DCT_SCALING_SUPPORTED */
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
#endif /* DCT_SCALING_SUPPORTED */
}
/*
* Master selection of compression modules.
* This is done once at the start of processing an image. We determine
@@ -37,7 +199,7 @@ jinit_compress_master (j_compress_ptr cinfo)
if (cinfo->data_precision != BITS_IN_JSAMPLE)
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
/* Sanity check on image dimensions */
/* Sanity check on input image dimensions */
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
cinfo->input_components <= 0)
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
@@ -48,6 +210,9 @@ jinit_compress_master (j_compress_ptr cinfo)
if ((long) jd_samplesperrow != samplesperrow)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
/* Compute JPEG image dimensions and related values. */
jpeg_calc_jpeg_dimensions(cinfo);
/* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, FALSE /* full compression */);
+5 -187
View File
@@ -2,7 +2,7 @@
* jcmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding.
* Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -43,191 +43,13 @@ typedef my_comp_master * my_master_ptr;
* Support routines that do various essential calculations.
*/
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
#ifdef DCT_SCALING_SUPPORTED
/* Sanity check on input image dimensions to prevent overflow in
* following calculation.
* We do check jpeg_width and jpeg_height in initial_setup below,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
#else /* !DCT_SCALING_SUPPORTED */
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
#endif /* DCT_SCALING_SUPPORTED */
}
LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
{
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
}
LOCAL(void)
initial_setup (j_compress_ptr cinfo, boolean transcode_only)
initial_setup (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
int ci, ssize;
jpeg_component_info *compptr;
if (transcode_only)
jpeg_calc_trans_dimensions(cinfo);
else
jpeg_calc_jpeg_dimensions(cinfo);
/* Sanity check on block_size */
if (cinfo->block_size < 1 || cinfo->block_size > 16)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
@@ -414,13 +236,9 @@ validate_script (j_compress_ptr cinfo)
* out-of-range reconstructed DC values during the first DC scan,
* which might cause problems for some decoders.
*/
#if BITS_IN_JSAMPLE == 8
#define MAX_AH_AL 10
#else
#define MAX_AH_AL 13
#endif
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) ||
Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10))
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (Ss == 0) {
if (Se != 0) /* DC and AC together not OK */
@@ -812,7 +630,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
master->pub.is_last_pass = FALSE;
/* Validate parameters, determine derived values */
initial_setup(cinfo, transcode_only);
initial_setup(cinfo);
if (cinfo->scan_info != NULL) {
#ifdef C_MULTISCAN_FILES_SUPPORTED
+21 -3
View File
@@ -2,7 +2,7 @@
* jctrans.c
*
* Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2013 by Guido Vollbeding.
* Modified 2000-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -85,12 +85,15 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
jpeg_set_defaults(dstinfo);
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
* Fix it to get the right header markers for the image colorspace.
* Note: Entropy table assignment in jpeg_set_colorspace depends
* on color_transform.
* Note: Entropy table assignment in jpeg_set_colorspace
* depends on color_transform.
* Adaption is also required for setting the appropriate
* entropy coding mode dependent on image data precision.
*/
dstinfo->color_transform = srcinfo->color_transform;
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
dstinfo->data_precision = srcinfo->data_precision;
dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE;
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
/* Copy the source's quantization tables. */
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
@@ -157,6 +160,18 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
}
LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
}
/*
* Master selection of compression modules for transcoding.
* This substitutes for jcinit.c's initialization of the full compressor.
@@ -166,6 +181,9 @@ LOCAL(void)
transencode_master_selection (j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays)
{
/* Do computations that are needed before master selection phase */
jpeg_calc_trans_dimensions(cinfo);
/* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, TRUE /* transcode only */);
+3 -3
View File
@@ -2,7 +2,7 @@
* jdatadst.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2012 by Guido Vollbeding.
* Modified 2009-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -170,9 +170,9 @@ term_destination (j_compress_ptr cinfo)
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
ERREXIT(cinfo, JERR_FILE_WRITE);
}
fflush(dest->outfile);
JFFLUSH(dest->outfile);
/* Make sure we wrote the output file OK */
if (ferror(dest->outfile))
if (JFERROR(dest->outfile))
ERREXIT(cinfo, JERR_FILE_WRITE);
}
+7 -1
View File
@@ -2,7 +2,7 @@
* jdcolor.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2015 by Guido Vollbeding.
* Modified 2011-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -14,6 +14,12 @@
#include "jpeglib.h"
#if RANGE_BITS < 2
/* Deliberate syntax err */
Sorry, this code requires 2 or more range extension bits.
#endif
/* Private subobject */
typedef struct {
+5 -6
View File
@@ -2,7 +2,7 @@
* jdct.h
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2015 by Guido Vollbeding.
* Modified 2002-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -79,13 +79,12 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
* be quite far out of range if the input data is corrupt, so a bulletproof
* range-limiting step is required. We use a mask-and-table-lookup method
* to do the combined operations quickly, assuming that MAXJSAMPLE+1
* is a power of 2. See the comments with prepare_range_limit_table
* (in jdmaster.c) for more info.
* to do the combined operations quickly, assuming that RANGE_CENTER
* (defined in jpegint.h) is a power of 2. See the comments with
* prepare_range_limit_table (in jdmaster.c) for more info.
*/
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
#define RANGE_MASK (RANGE_CENTER * 2 - 1)
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
+4 -5
View File
@@ -2,7 +2,7 @@
* jdhuff.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2006-2013 by Guido Vollbeding.
* Modified 2006-2016 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -799,10 +799,6 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
if (! entropy->insufficient_data) {
Se = cinfo->Se;
Al = cinfo->Al;
natural_order = cinfo->natural_order;
/* Load up working state.
* We can avoid loading/saving bitread state if in an EOB run.
*/
@@ -814,6 +810,9 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
EOBRUN--; /* ...process it now (we do nothing) */
else {
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
Se = cinfo->Se;
Al = cinfo->Al;
natural_order = cinfo->natural_order;
block = MCU_data[0];
tbl = entropy->ac_derived_tbl;
+20 -26
View File
@@ -2,7 +2,7 @@
* jdmainct.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2012 by Guido Vollbeding.
* Modified 2002-2016 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -26,8 +26,8 @@
* trivial. Its responsibility is to provide context rows for upsampling/
* rescaling, and doing this in an efficient fashion is a bit tricky.
*
* Postprocessor input data is counted in "row groups". A row group
* is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
* Postprocessor input data is counted in "row groups". A row group is
* defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
* sample rows of each component. (We require DCT_scaled_size values to be
* chosen such that these numbers are integers. In practice DCT_scaled_size
* values will likely be powers of two, so we actually have the stronger
@@ -37,8 +37,8 @@
* applying).
*
* The coefficient controller will deliver data to us one iMCU row at a time;
* each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
* exactly min_DCT_scaled_size row groups. (This amount of data corresponds
* each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or
* exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds
* to one row of MCUs when the image is fully interleaved.) Note that the
* number of sample rows varies across components, but the number of row
* groups does not. Some garbage sample rows may be included in the last iMCU
@@ -75,7 +75,7 @@
* We could do this most simply by copying data around in our buffer, but
* that'd be very slow. We can avoid copying any data by creating a rather
* strange pointer structure. Here's how it works. We allocate a workspace
* consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
* consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number
* of row groups per iMCU row). We create two sets of redundant pointers to
* the workspace. Labeling the physical row groups 0 to M+1, the synthesized
* pointer lists look like this:
@@ -100,11 +100,11 @@
* the first or last sample row as necessary (this is cheaper than copying
* sample rows around).
*
* This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
* This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that
* situation each iMCU row provides only one row group so the buffering logic
* must be different (eg, we must read two iMCU rows before we can emit the
* first row group). For now, we simply do not support providing context
* rows when min_DCT_scaled_size is 1. That combination seems unlikely to
* rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to
* be worth providing --- if someone wants a 1/8th-size preview, they probably
* want it quick and dirty, so a context-free upsampler is sufficient.
*/
@@ -118,17 +118,18 @@ typedef struct {
/* Pointer to allocated workspace (M or M+2 row groups). */
JSAMPARRAY buffer[MAX_COMPONENTS];
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
/* Remaining fields are only used in the context case. */
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
/* These are the master pointers to the funny-order pointer lists. */
JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
int whichptr; /* indicates which pointer set is now in use */
int context_state; /* process_data state machine status */
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
} my_main_controller;
@@ -195,7 +196,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above.
* The actual workspace is already allocated (in main->buffer),
* The actual workspace is already allocated (in mainp->buffer),
* and the space for the pointer lists is allocated too.
* This routine just fills in the curiously ordered lists.
* This will be repeated at the beginning of each pass.
@@ -317,12 +318,12 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
mainp->context_state = CTX_PREPARE_FOR_IMCU;
mainp->iMCU_row_ctr = 0;
mainp->buffer_full = FALSE; /* Mark buffer empty */
} else {
/* Simple case with no context needed */
mainp->pub.process_data = process_data_simple_main;
mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */
}
mainp->buffer_full = FALSE; /* Mark buffer empty */
mainp->rowgroup_ctr = 0;
break;
#ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST:
@@ -348,17 +349,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
JDIMENSION out_rows_avail)
{
my_main_ptr mainp = (my_main_ptr) cinfo->main;
JDIMENSION rowgroups_avail;
/* Read input data if we haven't filled the main buffer yet */
if (! mainp->buffer_full) {
if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) {
if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
return; /* suspension forced, can do nothing more */
mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */
}
/* There are always min_DCT_scaled_size row groups in an iMCU row. */
rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
/* Note: at the bottom of the image, we may pass extra garbage row groups
* to the postprocessor. The postprocessor has to check for bottom
* of image anyway (at row resolution), so no point in us doing it too.
@@ -366,14 +364,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
/* Feed the postprocessor */
(*cinfo->post->post_process_data) (cinfo, mainp->buffer,
&mainp->rowgroup_ctr, rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
if (mainp->rowgroup_ctr >= rowgroups_avail) {
mainp->buffer_full = FALSE;
mainp->rowgroup_ctr = 0;
}
&mainp->rowgroup_ctr, mainp->rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
}
@@ -498,7 +490,9 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
ngroups = cinfo->min_DCT_v_scaled_size + 2;
} else {
/* There are always min_DCT_v_scaled_size row groups in an iMCU row. */
ngroups = cinfo->min_DCT_v_scaled_size;
mainp->rowgroups_avail = (JDIMENSION) ngroups;
}
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+6 -7
View File
@@ -2,7 +2,7 @@
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2002-2015 by Guido Vollbeding.
* Modified 2002-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -237,18 +237,17 @@ prepare_range_limit_table (j_decompress_ptr cinfo)
JSAMPLE * table;
int i;
table = (JSAMPLE *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
/* First segment of range limit table: limit[x] = 0 for x < 0 */
MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */
MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
table += RANGE_CENTER; /* allow negative subscripts of table */
cinfo->sample_range_limit = table;
/* Main part of range limit table: limit[x] = x */
for (i = 0; i <= MAXJSAMPLE; i++)
table[i] = (JSAMPLE) i;
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
for (; i < 3 * (MAXJSAMPLE+1); i++)
for (; i <= MAXJSAMPLE + RANGE_CENTER; i++)
table[i] = MAXJSAMPLE;
}
+7 -1
View File
@@ -2,7 +2,7 @@
* jdmerge.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2013-2015 by Guido Vollbeding.
* Modified 2013-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -40,6 +40,12 @@
#ifdef UPSAMPLE_MERGING_SUPPORTED
#if RANGE_BITS < 2
/* Deliberate syntax err */
Sorry, this code requires 2 or more range extension bits.
#endif
/* Private subobject */
typedef struct {
+2 -2
View File
@@ -2,7 +2,7 @@
* jfdctflt.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2003-2015 by Guido Vollbeding.
* Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -48,7 +48,7 @@
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif
+2 -2
View File
@@ -2,7 +2,7 @@
* jfdctfst.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2003-2015 by Guido Vollbeding.
* Modified 2003-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -44,7 +44,7 @@
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif
+2 -2
View File
@@ -2,7 +2,7 @@
* jidctflt.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2010-2015 by Guido Vollbeding.
* Modified 2010-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -50,7 +50,7 @@
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif
+2 -2
View File
@@ -2,7 +2,7 @@
* jidctfst.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2015 by Guido Vollbeding.
* Modified 2015-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -46,7 +46,7 @@
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
#endif
+18 -17
View File
@@ -2,7 +2,7 @@
* jidctint.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2015 by Guido Vollbeding.
* Modification developed 2002-2016 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -166,6 +166,7 @@
/*
* Perform dequantization and inverse DCT on one block of coefficients.
*
* Optimized algorithm with 12 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/16).
*/
@@ -428,7 +429,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a 7x7 output block.
* producing a reduced-size 7x7 output block.
*
* Optimized algorithm with 12 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/14).
@@ -2623,7 +2624,7 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp0 <<= CONST_BITS;
/* Add fudge factor here for final descale. */
tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);
tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
@@ -2920,13 +2921,6 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6).
*/
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
@@ -2937,6 +2931,13 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3;
tmp1 = z2 - z3;
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
@@ -4883,13 +4884,6 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* The rotator is c(-6).
*/
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
@@ -4900,6 +4894,13 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3;
tmp1 = z2 - z3;
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
+6
View File
@@ -2,6 +2,7 @@
* jinclude.h
*
* Copyright (C) 1991-1994, Thomas G. Lane.
* Modified 2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -83,9 +84,14 @@
* The modules that use fread() and fwrite() always invoke them through
* these macros. On some systems you may need to twiddle the argument casts.
* CAUTION: argument order is different from underlying functions!
*
* Furthermore, macros are provided for fflush() and ferror() in order
* to facilitate adaption by applications using an own FILE class.
*/
#define JFREAD(file,buf,sizeofbuf) \
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
#define JFWRITE(file,buf,sizeofbuf) \
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
#define JFFLUSH(file) fflush(file)
#define JFERROR(file) ferror(file)
+14 -1
View File
@@ -2,7 +2,7 @@
* jpegint.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2013 by Guido Vollbeding.
* Modified 1997-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -260,6 +260,19 @@ struct jpeg_color_quantizer {
};
/* Definition of range extension bits for decompression processes.
* See the comments with prepare_range_limit_table (in jdmaster.c)
* for more info.
* The recommended default value for normal applications is 2.
* Applications with special requirements may use a different value.
* For example, Ghostscript wants to use 3 for proper handling of
* wacky images with oversize coefficient values.
*/
#define RANGE_BITS 2
#define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS)
/* Miscellaneous useful macros */
#undef MAX
+14 -14
View File
@@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2015 by Guido Vollbeding.
* Modified 2002-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -39,7 +39,7 @@ extern "C" {
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9
#define JPEG_LIB_VERSION_MINOR 2
#define JPEG_LIB_VERSION_MINOR 3
/* Various constants determining the sizes of things.
@@ -137,9 +137,9 @@ typedef struct {
/* The decompressor output side may not use these variables. */
int dc_tbl_no; /* DC entropy table selector (0..3) */
int ac_tbl_no; /* AC entropy table selector (0..3) */
/* Remaining fields should be treated as private by applications. */
/* These values are computed during compression or decompression startup: */
/* Component's size in DCT blocks.
* Any dummy blocks added to complete an MCU are not counted; therefore
@@ -411,10 +411,10 @@ struct jpeg_compress_struct {
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
/* The coefficient controller receives data in units of MCU rows as defined
* for fully interleaved scans (whether the JPEG file is interleaved or not).
* There are v_samp_factor * DCTSIZE sample rows of each component in an
* "iMCU" (interleaved MCU) row.
* There are v_samp_factor * DCT_v_scaled_size sample rows of each component
* in an "iMCU" (interleaved MCU) row.
*/
/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
@@ -422,10 +422,10 @@ struct jpeg_compress_struct {
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
@@ -636,7 +636,7 @@ struct jpeg_decompress_struct {
* in fully interleaved JPEG scans, but are used whether the scan is
* interleaved or not. We define an iMCU row as v_samp_factor DCT block
* rows of each component. Therefore, the IDCT output contains
* v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
* v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row.
*/
JSAMPLE * sample_range_limit; /* table for fast range-limiting */
@@ -711,7 +711,7 @@ struct jpeg_error_mgr {
#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
/* Reset error state variables at start of a new image */
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
/* The message ID code and any parameters are saved here.
* A message can have one string parameter or up to 8 int parameters.
*/
@@ -721,11 +721,11 @@ struct jpeg_error_mgr {
int i[8];
char s[JMSG_STR_PARM_MAX];
} msg_parm;
/* Standard state variables for error facility */
int trace_level; /* max msg_level that will be displayed */
/* For recoverable corrupt-data errors, we emit a warning message,
* but keep going unless emit_message chooses to abort. emit_message
* should count warnings in num_warnings. The surrounding application
+3 -3
View File
@@ -1,7 +1,7 @@
/*
* jversion.h
*
* Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -9,6 +9,6 @@
*/
#define JVERSION "9b 17-Jan-2016"
#define JVERSION "9c 14-Jan-2018"
#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
+26 -13
View File
@@ -6066,31 +6066,44 @@ Version 1.6.35 [July 15, 2018]
Version 1.6.36 [December 1, 2018]
Optimized png_do_expand_palette for ARM processors.
Improved performance by around 10-22% on a recent ARM Chromebook.
(Contributed by Richard Townsend, ARM Holdings)
(Contributed by Richard Townsend, ARM Holdings)
Fixed manipulation of machine-specific optimization options.
(Contributed by Vicki Pfau)
(Contributed by Vicki Pfau)
Used memcpy instead of manual pointer arithmetic on Intel SSE2.
(Contributed by Samuel Williams)
(Contributed by Samuel Williams)
Fixed build errors with MSVC on ARM64.
(Contributed by Zhijie Liang)
(Contributed by Zhijie Liang)
Fixed detection of libm in CMakeLists.
(Contributed by Cameron Cawley)
(Contributed by Cameron Cawley)
Fixed incorrect creation of pkg-config file in CMakeLists.
(Contributed by Kyle Bentley)
(Contributed by Kyle Bentley)
Fixed the CMake build on Windows MSYS by avoiding symlinks.
Fixed a build warning on OpenBSD.
(Contributed by Theo Buehler)
(Contributed by Theo Buehler)
Fixed various typos in comments.
(Contributed by "luz.paz")
(Contributed by "luz.paz")
Raised the minimum required CMake version from 3.0.2 to 3.1.
Removed yet more of the vestigial support for pre-ANSI C compilers.
Removed ancient makefiles for ancient systems that have been broken
across all previous libpng-1.6.x versions.
across all previous libpng-1.6.x versions.
Removed the Y2K compliance statement and the export control
information.
information.
Applied various code style and documentation fixes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
Version 1.6.37 [April 14, 2019]
Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
Fixed a memory leak in pngtest.c.
Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
contrib/pngminus; refactor.
Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
(Contributed by Willem van Schaik)
Fixed a typo in the libpng license v2.
(Contributed by Miguel Ojeda)
Added makefiles for AddressSanitizer-enabled builds.
Cleaned up various makefiles.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe).
to subscribe.
+12 -1
View File
@@ -46,8 +46,19 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
add_definitions(-DPNG_INTEL_SSE)
endif()
# set definitions and sources for MIPS
if(";${CPU_BASELINE_FINAL};" MATCHES "MSA")
list(APPEND lib_srcs mips/mips_init.c mips/filter_msa_intrinsics.c)
add_definitions(-DPNG_MIPS_MSA_OPT=2)
ocv_warnings_disable(CMAKE_C_FLAGS -Wshadow)
else()
add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif()
if(PPC64LE OR PPC64)
if(ENABLE_VSX AND NOT PPC64)
# VSX3 features are backwards compatible
if(";${CPU_BASELINE_FINAL};" MATCHES "VSX.*"
AND NOT PPC64)
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
else()
+4 -4
View File
@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------
* Copyright (c) 1995-2018 The PNG Reference Library Authors.
* Copyright (c) 2018 Cosmin Truta.
* Copyright (c) 1995-2019 The PNG Reference Library Authors.
* Copyright (c) 2018-2019 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -13,7 +13,7 @@ PNG Reference Library License version 2
The software is supplied "as is", without warranty of any kind,
express or implied, including, without limitation, the warranties
of merchantability, fitness for a particular purpose, title, and
non-infringement. In no even shall the Copyright owners, or
non-infringement. In no event shall the Copyright owners, or
anyone distributing the software, be liable for any damages or
other liability, whether in contract, tort or otherwise, arising
from, out of, or in connection with the software, or the use or
@@ -39,7 +39,7 @@ subject to the following restrictions:
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
-----------------------------------------------------------------------
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
+2 -2
View File
@@ -1,5 +1,5 @@
README for libpng version 1.6.36 - December 1, 2018
===================================================
README for libpng version 1.6.37 - April 14, 2019
=================================================
See the note about version numbers near the top of png.h.
See INSTALL for instructions on how to install libpng.
+16 -16
View File
@@ -1,7 +1,7 @@
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
*
@@ -20,9 +20,9 @@
# include <arm_neon.h>
#endif
/* Build an RGBA palette from the RGB and separate alpha palettes. */
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
void
png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
png_riffle_palette_neon(png_structrp png_ptr)
{
png_const_colorp palette = png_ptr->palette;
png_bytep riffled_palette = png_ptr->riffled_palette;
@@ -30,6 +30,8 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
int num_trans = png_ptr->num_trans;
int i;
png_debug(1, "in png_riffle_palette_neon");
/* Initially black, opaque. */
uint8x16x4_t w = {{
vdupq_n_u8(0x00),
@@ -38,16 +40,10 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
vdupq_n_u8(0xff),
}};
if (row_info->bit_depth != 8)
{
png_error(png_ptr, "bit_depth must be 8 for png_riffle_palette_rgba");
return;
}
/* First, riffle the RGB colours into a RGBA palette, the A value is
* set to opaque for now.
/* First, riffle the RGB colours into an RGBA8 palette.
* The alpha component is set to opaque for now.
*/
for (i = 0; i < (1 << row_info->bit_depth); i += 16)
for (i = 0; i < 256; i += 16)
{
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
w.val[0] = v.val[0];
@@ -61,9 +57,9 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
riffled_palette[(i << 2) + 3] = trans_alpha[i];
}
/* Expands a palettized row into RGBA. */
/* Expands a palettized row into RGBA8. */
int
png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
@@ -72,6 +68,8 @@ png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
const png_int_32 pixels_per_chunk = 4;
int i;
png_debug(1, "in png_do_expand_palette_rgba8_neon");
if (row_width < pixels_per_chunk)
return 0;
@@ -103,9 +101,9 @@ png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
return i;
}
/* Expands a palettized row into RGB format. */
/* Expands a palettized row into RGB8. */
int
png_do_expand_palette_neon_rgb(png_structrp png_ptr, png_row_infop row_info,
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
@@ -113,6 +111,8 @@ png_do_expand_palette_neon_rgb(png_structrp png_ptr, png_row_infop row_info,
const png_uint_32 pixels_per_chunk = 8;
int i;
png_debug(1, "in png_do_expand_palette_rgb8_neon");
if (row_width <= pixels_per_chunk)
return 0;
+808
View File
@@ -0,0 +1,808 @@
/* filter_msa_intrinsics.c - MSA optimised filter functions
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, August 2016.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include <stdio.h>
#include <stdint.h>
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
/* This code requires -mfpu=msa on the command line: */
#if PNG_MIPS_MSA_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
#include <msa.h>
/* libpng row pointers are not necessarily aligned to any particular boundary,
* however this code will only work with appropriate alignment. mips/mips_init.c
* checks for this (and will not compile unless it is done). This code uses
* variants of png_aligncast to avoid compiler warnings.
*/
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer)
/* The following relies on a variable 'temp_pointer' being declared with type
* 'type'. This is written this way just to hide the GCC strict aliasing
* warning; note that the code is safe because there never is an alias between
* the input and output pointers.
*/
#define png_ldr(type,pointer)\
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
#if PNG_MIPS_MSA_OPT > 0
#ifdef CLANG_BUILD
#define MSA_SRLI_B(a, b) __msa_srli_b((v16i8) a, b)
#define LW(psrc) \
( { \
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
uint32_t val_m; \
\
asm volatile ( \
"lw %[val_m], %[psrc_lw_m] \n\t" \
\
: [val_m] "=r" (val_m) \
: [psrc_lw_m] "m" (*psrc_lw_m) \
); \
\
val_m; \
} )
#define SH(val, pdst) \
{ \
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
uint16_t val_m = (val); \
\
asm volatile ( \
"sh %[val_m], %[pdst_sh_m] \n\t" \
\
: [pdst_sh_m] "=m" (*pdst_sh_m) \
: [val_m] "r" (val_m) \
); \
}
#define SW(val, pdst) \
{ \
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
uint32_t val_m = (val); \
\
asm volatile ( \
"sw %[val_m], %[pdst_sw_m] \n\t" \
\
: [pdst_sw_m] "=m" (*pdst_sw_m) \
: [val_m] "r" (val_m) \
); \
}
#if (__mips == 64)
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint64_t val_m = (val); \
\
asm volatile ( \
"sd %[val_m], %[pdst_sd_m] \n\t" \
\
: [pdst_sd_m] "=m" (*pdst_sd_m) \
: [val_m] "r" (val_m) \
); \
}
#else
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint32_t val0_m, val1_m; \
\
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
\
SW(val0_m, pdst_sd_m); \
SW(val1_m, pdst_sd_m + 4); \
}
#endif
#else
#define MSA_SRLI_B(a, b) (a >> b)
#if (__mips_isa_rev >= 6)
#define LW(psrc) \
( { \
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
uint32_t val_m; \
\
asm volatile ( \
"lw %[val_m], %[psrc_lw_m] \n\t" \
\
: [val_m] "=r" (val_m) \
: [psrc_lw_m] "m" (*psrc_lw_m) \
); \
\
val_m; \
} )
#define SH(val, pdst) \
{ \
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
uint16_t val_m = (val); \
\
asm volatile ( \
"sh %[val_m], %[pdst_sh_m] \n\t" \
\
: [pdst_sh_m] "=m" (*pdst_sh_m) \
: [val_m] "r" (val_m) \
); \
}
#define SW(val, pdst) \
{ \
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
uint32_t val_m = (val); \
\
asm volatile ( \
"sw %[val_m], %[pdst_sw_m] \n\t" \
\
: [pdst_sw_m] "=m" (*pdst_sw_m) \
: [val_m] "r" (val_m) \
); \
}
#if (__mips == 64)
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint64_t val_m = (val); \
\
asm volatile ( \
"sd %[val_m], %[pdst_sd_m] \n\t" \
\
: [pdst_sd_m] "=m" (*pdst_sd_m) \
: [val_m] "r" (val_m) \
); \
}
#else
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint32_t val0_m, val1_m; \
\
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
\
SW(val0_m, pdst_sd_m); \
SW(val1_m, pdst_sd_m + 4); \
}
#endif
#else // !(__mips_isa_rev >= 6)
#define LW(psrc) \
( { \
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
uint32_t val_m; \
\
asm volatile ( \
"ulw %[val_m], %[psrc_lw_m] \n\t" \
\
: [val_m] "=r" (val_m) \
: [psrc_lw_m] "m" (*psrc_lw_m) \
); \
\
val_m; \
} )
#define SH(val, pdst) \
{ \
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
uint16_t val_m = (val); \
\
asm volatile ( \
"ush %[val_m], %[pdst_sh_m] \n\t" \
\
: [pdst_sh_m] "=m" (*pdst_sh_m) \
: [val_m] "r" (val_m) \
); \
}
#define SW(val, pdst) \
{ \
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
uint32_t val_m = (val); \
\
asm volatile ( \
"usw %[val_m], %[pdst_sw_m] \n\t" \
\
: [pdst_sw_m] "=m" (*pdst_sw_m) \
: [val_m] "r" (val_m) \
); \
}
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint32_t val0_m, val1_m; \
\
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
\
SW(val0_m, pdst_sd_m); \
SW(val1_m, pdst_sd_m + 4); \
}
#define SW_ZERO(pdst) \
{ \
uint8_t *pdst_m = (uint8_t *) (pdst); \
\
asm volatile ( \
"usw $0, %[pdst_m] \n\t" \
\
: [pdst_m] "=m" (*pdst_m) \
: \
); \
}
#endif // (__mips_isa_rev >= 6)
#endif
#define LD_B(RTYPE, psrc) *((RTYPE *) (psrc))
#define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
#define LD_B2(RTYPE, psrc, stride, out0, out1) \
{ \
out0 = LD_B(RTYPE, (psrc)); \
out1 = LD_B(RTYPE, (psrc) + stride); \
}
#define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__)
#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) \
{ \
LD_B2(RTYPE, (psrc), stride, out0, out1); \
LD_B2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \
}
#define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__)
#define ST_B(RTYPE, in, pdst) *((RTYPE *) (pdst)) = (in)
#define ST_UB(...) ST_B(v16u8, __VA_ARGS__)
#define ST_B2(RTYPE, in0, in1, pdst, stride) \
{ \
ST_B(RTYPE, in0, (pdst)); \
ST_B(RTYPE, in1, (pdst) + stride); \
}
#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__)
#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) \
{ \
ST_B2(RTYPE, in0, in1, (pdst), stride); \
ST_B2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \
}
#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__)
#define ADD2(in0, in1, in2, in3, out0, out1) \
{ \
out0 = in0 + in1; \
out1 = in2 + in3; \
}
#define ADD3(in0, in1, in2, in3, in4, in5, \
out0, out1, out2) \
{ \
ADD2(in0, in1, in2, in3, out0, out1); \
out2 = in4 + in5; \
}
#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ADD2(in0, in1, in2, in3, out0, out1); \
ADD2(in4, in5, in6, in7, out2, out3); \
}
#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_ilvr_b((v16i8) in2, (v16i8) in3); \
}
#define ILVR_B2_SH(...) ILVR_B2(v8i16, __VA_ARGS__)
#define HSUB_UB2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_hsub_u_h((v16u8) in0, (v16u8) in0); \
out1 = (RTYPE) __msa_hsub_u_h((v16u8) in1, (v16u8) in1); \
}
#define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__)
#define SLDI_B2_0(RTYPE, in0, in1, out0, out1, slide_val) \
{ \
v16i8 zero_m = { 0 }; \
out0 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in0, slide_val); \
out1 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in1, slide_val); \
}
#define SLDI_B2_0_UB(...) SLDI_B2_0(v16u8, __VA_ARGS__)
#define SLDI_B3_0(RTYPE, in0, in1, in2, out0, out1, out2, slide_val) \
{ \
v16i8 zero_m = { 0 }; \
SLDI_B2_0(RTYPE, in0, in1, out0, out1, slide_val); \
out2 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in2, slide_val); \
}
#define SLDI_B3_0_UB(...) SLDI_B3_0(v16u8, __VA_ARGS__)
#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvev_w((v4i32) in1, (v4i32) in0); \
out1 = (RTYPE) __msa_ilvev_w((v4i32) in3, (v4i32) in2); \
}
#define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__)
#define ADD_ABS_H3(RTYPE, in0, in1, in2, out0, out1, out2) \
{ \
RTYPE zero = {0}; \
\
out0 = __msa_add_a_h((v8i16) zero, in0); \
out1 = __msa_add_a_h((v8i16) zero, in1); \
out2 = __msa_add_a_h((v8i16) zero, in2); \
}
#define ADD_ABS_H3_SH(...) ADD_ABS_H3(v8i16, __VA_ARGS__)
#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \
{ \
out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \
out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \
}
#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__)
#define CMP_AND_SELECT(inp0, inp1, inp2, inp3, inp4, inp5, out0) \
{ \
v8i16 _sel_h0, _sel_h1; \
v16u8 _sel_b0, _sel_b1; \
_sel_h0 = (v8i16) __msa_clt_u_h((v8u16) inp1, (v8u16) inp0); \
_sel_b0 = (v16u8) __msa_pckev_b((v16i8) _sel_h0, (v16i8) _sel_h0); \
inp0 = (v8i16) __msa_bmnz_v((v16u8) inp0, (v16u8) inp1, (v16u8) _sel_h0); \
inp4 = (v16u8) __msa_bmnz_v(inp3, inp4, _sel_b0); \
_sel_h1 = (v8i16) __msa_clt_u_h((v8u16) inp2, (v8u16) inp0); \
_sel_b1 = (v16u8) __msa_pckev_b((v16i8) _sel_h1, (v16i8) _sel_h1); \
inp4 = (v16u8) __msa_bmnz_v(inp4, inp5, _sel_b1); \
out0 += inp4; \
}
void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t i, cnt, cnt16, cnt32;
size_t istop = row_info->rowbytes;
png_bytep rp = row;
png_const_bytep pp = prev_row;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
for (i = 0; i < (istop >> 6); i++)
{
LD_UB4(rp, 16, src0, src1, src2, src3);
LD_UB4(pp, 16, src4, src5, src6, src7);
pp += 64;
ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
src0, src1, src2, src3);
ST_UB4(src0, src1, src2, src3, rp, 16);
rp += 64;
}
if (istop & 0x3F)
{
cnt32 = istop & 0x20;
cnt16 = istop & 0x10;
cnt = istop & 0xF;
if(cnt32)
{
if (cnt16 && cnt)
{
LD_UB4(rp, 16, src0, src1, src2, src3);
LD_UB4(pp, 16, src4, src5, src6, src7);
ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
src0, src1, src2, src3);
ST_UB4(src0, src1, src2, src3, rp, 16);
rp += 64;
}
else if (cnt16 || cnt)
{
LD_UB2(rp, 16, src0, src1);
LD_UB2(pp, 16, src4, src5);
pp += 32;
src2 = LD_UB(rp + 32);
src6 = LD_UB(pp);
ADD3(src0, src4, src1, src5, src2, src6, src0, src1, src2);
ST_UB2(src0, src1, rp, 16);
rp += 32;
ST_UB(src2, rp);
rp += 16;
}
else
{
LD_UB2(rp, 16, src0, src1);
LD_UB2(pp, 16, src4, src5);
ADD2(src0, src4, src1, src5, src0, src1);
ST_UB2(src0, src1, rp, 16);
rp += 32;
}
}
else if (cnt16 && cnt)
{
LD_UB2(rp, 16, src0, src1);
LD_UB2(pp, 16, src4, src5);
ADD2(src0, src4, src1, src5, src0, src1);
ST_UB2(src0, src1, rp, 16);
rp += 32;
}
else if (cnt16 || cnt)
{
src0 = LD_UB(rp);
src4 = LD_UB(pp);
pp += 16;
src0 += src4;
ST_UB(src0, rp);
rp += 16;
}
}
}
void png_read_filter_row_sub4_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t count;
size_t istop = row_info->rowbytes;
png_bytep src = row;
png_bytep nxt = row + 4;
int32_t inp0;
v16u8 src0, src1, src2, src3, src4;
v16u8 dst0, dst1;
v16u8 zero = { 0 };
istop -= 4;
inp0 = LW(src);
src += 4;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
for (count = 0; count < istop; count += 16)
{
src1 = LD_UB(src);
src += 16;
src2 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 4);
src3 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 8);
src4 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 12);
src1 += src0;
src2 += src1;
src3 += src2;
src4 += src3;
src0 = src4;
ILVEV_W2_UB(src1, src2, src3, src4, dst0, dst1);
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
ST_UB(dst0, nxt);
nxt += 16;
}
}
void png_read_filter_row_sub3_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t count;
size_t istop = row_info->rowbytes;
png_bytep src = row;
png_bytep nxt = row + 3;
int64_t out0;
int32_t inp0, out1;
v16u8 src0, src1, src2, src3, src4, dst0, dst1;
v16u8 zero = { 0 };
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
istop -= 3;
inp0 = LW(src);
src += 3;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
for (count = 0; count < istop; count += 12)
{
src1 = LD_UB(src);
src += 12;
src2 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 3);
src3 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 6);
src4 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 9);
src1 += src0;
src2 += src1;
src3 += src2;
src4 += src3;
src0 = src4;
VSHF_B2_UB(src1, src2, src3, src4, mask0, mask0, dst0, dst1);
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
out0 = __msa_copy_s_d((v2i64) dst0, 0);
out1 = __msa_copy_s_w((v4i32) dst0, 2);
SD(out0, nxt);
nxt += 8;
SW(out1, nxt);
nxt += 4;
}
}
void png_read_filter_row_avg4_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t i;
png_bytep src = row;
png_bytep nxt = row;
png_const_bytep pp = prev_row;
size_t istop = row_info->rowbytes - 4;
int32_t inp0, inp1, out0;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
v16u8 zero = { 0 };
inp0 = LW(pp);
pp += 4;
inp1 = LW(src);
src += 4;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
src0 = (v16u8) MSA_SRLI_B(src0, 1);
src1 += src0;
out0 = __msa_copy_s_w((v4i32) src1, 0);
SW(out0, nxt);
nxt += 4;
for (i = 0; i < istop; i += 16)
{
src2 = LD_UB(pp);
pp += 16;
src6 = LD_UB(src);
src += 16;
SLDI_B2_0_UB(src2, src6, src3, src7, 4);
SLDI_B2_0_UB(src2, src6, src4, src8, 8);
SLDI_B2_0_UB(src2, src6, src5, src9, 12);
src2 = __msa_ave_u_b(src2, src1);
src6 += src2;
src3 = __msa_ave_u_b(src3, src6);
src7 += src3;
src4 = __msa_ave_u_b(src4, src7);
src8 += src4;
src5 = __msa_ave_u_b(src5, src8);
src9 += src5;
src1 = src9;
ILVEV_W2_UB(src6, src7, src8, src9, dst0, dst1);
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
ST_UB(dst0, nxt);
nxt += 16;
}
}
void png_read_filter_row_avg3_msa(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t i;
png_bytep src = row;
png_bytep nxt = row;
png_const_bytep pp = prev_row;
size_t istop = row_info->rowbytes - 3;
int64_t out0;
int32_t inp0, inp1, out1;
int16_t out2;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
v16u8 zero = { 0 };
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
inp0 = LW(pp);
pp += 3;
inp1 = LW(src);
src += 3;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
src0 = (v16u8) MSA_SRLI_B(src0, 1);
src1 += src0;
out2 = __msa_copy_s_h((v8i16) src1, 0);
SH(out2, nxt);
nxt += 2;
nxt[0] = src1[2];
nxt++;
for (i = 0; i < istop; i += 12)
{
src2 = LD_UB(pp);
pp += 12;
src6 = LD_UB(src);
src += 12;
SLDI_B2_0_UB(src2, src6, src3, src7, 3);
SLDI_B2_0_UB(src2, src6, src4, src8, 6);
SLDI_B2_0_UB(src2, src6, src5, src9, 9);
src2 = __msa_ave_u_b(src2, src1);
src6 += src2;
src3 = __msa_ave_u_b(src3, src6);
src7 += src3;
src4 = __msa_ave_u_b(src4, src7);
src8 += src4;
src5 = __msa_ave_u_b(src5, src8);
src9 += src5;
src1 = src9;
VSHF_B2_UB(src6, src7, src8, src9, mask0, mask0, dst0, dst1);
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
out0 = __msa_copy_s_d((v2i64) dst0, 0);
out1 = __msa_copy_s_w((v4i32) dst0, 2);
SD(out0, nxt);
nxt += 8;
SW(out1, nxt);
nxt += 4;
}
}
void png_read_filter_row_paeth4_msa(png_row_infop row_info,
png_bytep row,
png_const_bytep prev_row)
{
int32_t count, rp_end;
png_bytep nxt;
png_const_bytep prev_nxt;
int32_t inp0, inp1, res0;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
v16u8 src10, src11, src12, src13, dst0, dst1;
v8i16 vec0, vec1, vec2;
v16u8 zero = { 0 };
nxt = row;
prev_nxt = prev_row;
inp0 = LW(nxt);
inp1 = LW(prev_nxt);
prev_nxt += 4;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
src1 += src0;
res0 = __msa_copy_s_w((v4i32) src1, 0);
SW(res0, nxt);
nxt += 4;
/* Remainder */
rp_end = row_info->rowbytes - 4;
for (count = 0; count < rp_end; count += 16)
{
src2 = LD_UB(prev_nxt);
prev_nxt += 16;
src6 = LD_UB(prev_row);
prev_row += 16;
src10 = LD_UB(nxt);
SLDI_B3_0_UB(src2, src6, src10, src3, src7, src11, 4);
SLDI_B3_0_UB(src2, src6, src10, src4, src8, src12, 8);
SLDI_B3_0_UB(src2, src6, src10, src5, src9, src13, 12);
ILVR_B2_SH(src2, src6, src1, src6, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src1, src2, src6, src10);
ILVR_B2_SH(src3, src7, src10, src7, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src10, src3, src7, src11);
ILVR_B2_SH(src4, src8, src11, src8, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src11, src4, src8, src12);
ILVR_B2_SH(src5, src9, src12, src9, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src12, src5, src9, src13);
src1 = src13;
ILVEV_W2_UB(src10, src11, src12, src1, dst0, dst1);
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
ST_UB(dst0, nxt);
nxt += 16;
}
}
void png_read_filter_row_paeth3_msa(png_row_infop row_info,
png_bytep row,
png_const_bytep prev_row)
{
int32_t count, rp_end;
png_bytep nxt;
png_const_bytep prev_nxt;
int64_t out0;
int32_t inp0, inp1, out1;
int16_t out2;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
v16u8 src10, src11, src12, src13;
v8i16 vec0, vec1, vec2;
v16u8 zero = { 0 };
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
nxt = row;
prev_nxt = prev_row;
inp0 = LW(nxt);
inp1 = LW(prev_nxt);
prev_nxt += 3;
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
src1 += src0;
out2 = __msa_copy_s_h((v8i16) src1, 0);
SH(out2, nxt);
nxt += 2;
nxt[0] = src1[2];
nxt++;
/* Remainder */
rp_end = row_info->rowbytes - 3;
for (count = 0; count < rp_end; count += 12)
{
src2 = LD_UB(prev_nxt);
prev_nxt += 12;
src6 = LD_UB(prev_row);
prev_row += 12;
src10 = LD_UB(nxt);
SLDI_B3_0_UB(src2, src6, src10, src3, src7, src11, 3);
SLDI_B3_0_UB(src2, src6, src10, src4, src8, src12, 6);
SLDI_B3_0_UB(src2, src6, src10, src5, src9, src13, 9);
ILVR_B2_SH(src2, src6, src1, src6, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src1, src2, src6, src10);
ILVR_B2_SH(src3, src7, src10, src7, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src10, src3, src7, src11);
ILVR_B2_SH(src4, src8, src11, src8, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src11, src4, src8, src12);
ILVR_B2_SH(src5, src9, src12, src9, vec0, vec1);
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
vec2 = vec0 + vec1;
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
CMP_AND_SELECT(vec0, vec1, vec2, src12, src5, src9, src13);
src1 = src13;
VSHF_B2_UB(src10, src11, src12, src13, mask0, mask0, dst0, dst1);
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
out0 = __msa_copy_s_d((v2i64) dst0, 0);
out1 = __msa_copy_s_w((v4i32) dst0, 2);
SD(out0, nxt);
nxt += 8;
SW(out1, nxt);
nxt += 4;
}
}
#endif /* PNG_MIPS_MSA_OPT > 0 */
#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 (intrinsics) */
#endif /* READ */
+127
View File
@@ -0,0 +1,127 @@
/* mips_init.c - MSA optimised filter functions
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, 2016.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
#define _POSIX_SOURCE 1
#include <stdio.h>
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_MIPS_MSA_OPT > 0
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the MIPS
* MSA instructions there is no processor-specific way of detecting the
* presence of the required support, therefore run-time detection is extremely
* OS specific.
*
* You may set the macro PNG_MIPS_MSA_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_msa function. There
* are a number of implementations in contrib/mips-msa, but the only one that
* has partial support is contrib/mips-msa/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
#ifndef PNG_MIPS_MSA_FILE
# ifdef __linux__
# define PNG_MIPS_MSA_FILE "contrib/mips-msa/linux.c"
# endif
#endif
#ifdef PNG_MIPS_MSA_FILE
#include <signal.h> /* for sig_atomic_t */
static int png_have_msa(png_structp png_ptr);
#include PNG_MIPS_MSA_FILE
#else /* PNG_MIPS_MSA_FILE */
# error "PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks"
#endif /* PNG_MIPS_MSA_FILE */
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
#endif
void
png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
{
/* The switch statement is compiled in for MIPS_MSA_API, the call to
* png_have_msa is compiled in for MIPS_MSA_CHECK. If both are defined
* the check is only performed if the API has not set the MSA option on
* or off explicitly. In this case the check controls what happens.
*/
#ifdef PNG_MIPS_MSA_API_SUPPORTED
switch ((pp->options >> PNG_MIPS_MSA) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_msa = -1; /* not checked */
if (no_msa < 0)
no_msa = !png_have_msa(pp);
if (no_msa)
return;
}
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
break;
default: /* OFF or INVALID */
return;
case PNG_OPTION_ON:
/* Option turned on */
break;
}
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_msa;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_msa;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_msa;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_msa;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
}
#else
(void)pp;
(void)bpp;
#endif /* PNG_MIPS_MSA_API_SUPPORTED */
}
#endif /* PNG_MIPS_MSA_OPT > 0 */
#endif /* READ */
@@ -0,0 +1,17 @@
diff --git a/3rdparty/libpng/pngrutil.c b/3rdparty/libpng/pngrutil.c
index d5fa08c397..4db3de990b 100644
--- a/3rdparty/libpng/pngrutil.c
+++ b/3rdparty/libpng/pngrutil.c
@@ -2087,10 +2087,8 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
}
}
- if (png_crc_finish(png_ptr, 0) != 0)
- return;
-
- png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
+ if (png_crc_finish(png_ptr, 0) == 0)
+ png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
png_free(png_ptr, info_ptr->eXIf_buf);
info_ptr->eXIf_buf = NULL;
+53
View File
@@ -0,0 +1,53 @@
diff --git a/3rdparty/libpng/mips/mips_init.c b/3rdparty/libpng/mips/mips_init.c
index 8dd283deef..6a061cccfa 100644
--- a/3rdparty/libpng/mips/mips_init.c
+++ b/3rdparty/libpng/mips/mips_init.c
@@ -73,7 +73,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
* this case will fall through to the 'default' below, which just
* returns.
*/
-#endif /* PNG_MIPS_MSA_API_SUPPORTED */
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_msa = -1; /* not checked */
@@ -84,12 +83,9 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
if (no_msa)
return;
}
-#ifdef PNG_MIPS_MSA_API_SUPPORTED
- break;
-#endif
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
+ break;
-#ifdef PNG_MIPS_MSA_API_SUPPORTED
default: /* OFF or INVALID */
return;
@@ -97,8 +93,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
/* Option turned on */
break;
}
-#endif
-
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
@@ -118,13 +112,16 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_msa;
}
-
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_msa;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
}
+#else
+ (void)pp;
+ (void)bpp;
+#endif /* PNG_MIPS_MSA_API_SUPPORTED */
}
#endif /* PNG_MIPS_MSA_OPT > 0 */
#endif /* READ */
+5 -6
View File
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_36 Your_png_h_is_not_version_1_6_36;
typedef png_libpng_version_1_6_37 Your_png_h_is_not_version_1_6_37;
#ifdef __GNUC__
/* The version tests may need to be added to, but the problem warning has
@@ -815,8 +815,8 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.36" PNG_STRING_NEWLINE \
"Copyright (c) 2018 Cosmin Truta" PNG_STRING_NEWLINE \
"libpng version 1.6.37" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2019 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
@@ -4588,8 +4588,7 @@ png_image_free(png_imagep image)
if (image != NULL && image->opaque != NULL &&
image->opaque->error_buf == NULL)
{
/* Ignore errors here: */
(void)png_safe_execute(image, png_image_free_function, image);
png_image_free_function(image);
image->opaque = NULL;
}
}
+17 -17
View File
@@ -1,9 +1,9 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.36 - December 1, 2018
* libpng version 1.6.37 - April 14, 2019
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -14,8 +14,9 @@
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson.
* libpng version 1.6.36, December 1, 2018: Cosmin Truta
* Glenn Randers-Pehrson
* libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -26,8 +27,8 @@
* PNG Reference Library License version 2
* ---------------------------------------
*
* * Copyright (c) 1995-2018 The PNG Reference Library Authors.
* * Copyright (c) 2018 Cosmin Truta.
* * Copyright (c) 1995-2019 The PNG Reference Library Authors.
* * Copyright (c) 2018-2019 Cosmin Truta.
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* * Copyright (c) 1996-1997 Andreas Dilger.
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -35,7 +36,7 @@
* The software is supplied "as is", without warranty of any kind,
* express or implied, including, without limitation, the warranties
* of merchantability, fitness for a particular purpose, title, and
* non-infringement. In no even shall the Copyright owners, or
* non-infringement. In no event shall the Copyright owners, or
* anyone distributing the software, be liable for any damages or
* other liability, whether in contract, tort or otherwise, arising
* from, out of, or in connection with the software, or the use or
@@ -61,7 +62,7 @@
* PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
* -----------------------------------------------------------------------
*
* libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
* libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
@@ -238,7 +239,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
* 1.6.36 16 10636 16.so.16.36[.0]
* 1.6.37 16 10637 16.so.16.37[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -277,8 +278,8 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.36"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.36 - December 1, 2018\n"
#define PNG_LIBPNG_VER_STRING "1.6.37"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@@ -286,12 +287,11 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 36
#define PNG_LIBPNG_VER_RELEASE 37
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
/* This should be zero for a public release, or non-zero for a
* development version. [Deprecated]
*/
#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
@@ -318,7 +318,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10636 /* 1.6.36 */
#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -428,7 +428,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_6_36;
typedef char* png_libpng_version_1_6_37;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
+3 -3
View File
@@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
/* pngconf.h - machine-configurable file for libpng
*
* libpng version 1.6.36
* libpng version 1.6.37
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+2 -2
View File
@@ -1,8 +1,8 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.36 */
/* libpng version 1.6.37 */
/* Copyright (c) 2018 Cosmin Truta */
/* Copyright (c) 2018-2019 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
+5 -5
View File
@@ -1,7 +1,7 @@
/* pngpriv.h - private declarations for use inside libpng
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -2119,11 +2119,11 @@ PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
#if PNG_ARM_NEON_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void,
png_riffle_palette_rgba,
(png_structrp, png_row_infop),
png_riffle_palette_neon,
(png_structrp),
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(int,
png_do_expand_palette_neon_rgba,
png_do_expand_palette_rgba8_neon,
(png_structrp,
png_row_infop,
png_const_bytep,
@@ -2131,7 +2131,7 @@ PNG_INTERNAL_FUNCTION(int,
const png_bytepp),
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(int,
png_do_expand_palette_neon_rgb,
png_do_expand_palette_rgb8_neon,
(png_structrp,
png_row_infop,
png_const_bytep,
+7 -1
View File
@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -994,6 +994,12 @@ png_read_destroy(png_structrp png_ptr)
png_ptr->chunk_list = NULL;
#endif
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
defined(PNG_ARM_NEON_IMPLEMENTATION)
png_free(png_ptr, png_ptr->riffled_palette);
png_ptr->riffled_palette = NULL;
#endif
/* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
* callbacks are still set at this point. They are required to complete the
* destruction of the png_struct itself.
+25 -23
View File
@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -1182,20 +1182,20 @@ png_init_palette_transformations(png_structrp png_ptr)
png_ptr->palette[png_ptr->background.index].blue;
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
{
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
{
/* Invert the alpha channel (in tRNS) unless the pixels are
* going to be expanded, in which case leave it for later
*/
int i, istop = png_ptr->num_trans;
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
{
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
{
/* Invert the alpha channel (in tRNS) unless the pixels are
* going to be expanded, in which case leave it for later
*/
int i, istop = png_ptr->num_trans;
for (i=0; i<istop; i++)
png_ptr->trans_alpha[i] = (png_byte)(255 -
png_ptr->trans_alpha[i]);
}
}
for (i = 0; i < istop; i++)
png_ptr->trans_alpha[i] =
(png_byte)(255 - png_ptr->trans_alpha[i]);
}
}
#endif /* READ_INVERT_ALPHA */
}
} /* background expand and (therefore) no alpha association. */
@@ -4320,9 +4320,11 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
* but sometimes row_info->bit_depth has been changed to 8.
* In these cases, the palette hasn't been riffled.
*/
i = png_do_expand_palette_neon_rgba(png_ptr, row_info, row,
i = png_do_expand_palette_rgba8_neon(png_ptr, row_info, row,
&sp, &dp);
}
#else
PNG_UNUSED(png_ptr)
#endif
for (; i < row_width; i++)
@@ -4349,8 +4351,10 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
dp = row + (size_t)(row_width * 3) - 1;
i = 0;
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
i = png_do_expand_palette_neon_rgb(png_ptr, row_info, row,
i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
&sp, &dp);
#else
PNG_UNUSED(png_ptr)
#endif
for (; i < row_width; i++)
@@ -4770,19 +4774,17 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
{
/* Allocate space for the decompressed full palette. */
if (png_ptr->riffled_palette == NULL)
{
png_ptr->riffled_palette = png_malloc(png_ptr, 256*4);
if (png_ptr->riffled_palette == NULL)
png_error(png_ptr, "NULL row buffer");
/* Build the RGBA palette. */
png_riffle_palette_rgba(png_ptr, row_info);
/* Initialize the accelerated palette expansion. */
png_ptr->riffled_palette =
(png_bytep)png_malloc(png_ptr, 256 * 4);
png_riffle_palette_neon(png_ptr);
}
}
#endif
png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
}
else
+2 -4
View File
@@ -2087,10 +2087,8 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
}
}
if (png_crc_finish(png_ptr, 0) != 0)
return;
png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
if (png_crc_finish(png_ptr, 0) == 0)
png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
png_free(png_ptr, info_ptr->eXIf_buf);
info_ptr->eXIf_buf = NULL;
+7 -5
View File
@@ -1,7 +1,7 @@
/* pngstruct.h - header file for PNG reference library
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -228,10 +228,6 @@ struct png_struct_def
* big_row_buf; while writing it is separately
* allocated.
*/
#ifdef PNG_READ_EXPAND_SUPPORTED
/* Buffer to accelerate palette transformations. */
png_bytep riffled_palette;
#endif
#ifdef PNG_WRITE_FILTER_SUPPORTED
png_bytep try_row; /* buffer to save trial row when filtering */
png_bytep tst_row; /* buffer to save best trial row when filtering */
@@ -396,6 +392,12 @@ struct png_struct_def
/* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
#endif
/* New member added in libpng-1.6.36 */
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
defined(PNG_ARM_NEON_IMPLEMENTATION)
png_bytep riffled_palette; /* buffer for accelerated palette expansion */
#endif
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
#if defined(PNG_MNG_FEATURES_SUPPORTED)
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
+1 -5
View File
@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -948,10 +948,6 @@ png_write_destroy(png_structrp png_ptr)
png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
png_free(png_ptr, png_ptr->row_buf);
png_ptr->row_buf = NULL;
#ifdef PNG_READ_EXPANDED_SUPPORTED
png_free(png_ptr, png_ptr->riffled_palette);
png_ptr->riffled_palette = NULL;
#endif
#ifdef PNG_WRITE_FILTER_SUPPORTED
png_free(png_ptr, png_ptr->prev_row);
png_free(png_ptr, png_ptr->try_row);
+91
View File
@@ -0,0 +1,91 @@
# COPYRIGHT
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# License); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Copyright (c) 2020, OPEN AI LAB
# Author: qtang@openailab.com or https://github.com/BUG1989
# qli@openailab.com
# sqfu@openailab.com
#
SET(TENGINE_COMMIT_VERSION "2f3cd86217f3530c8e4a82f3ed5af14c7a4e3943")
SET(OCV_TENGINE_DIR "${OpenCV_BINARY_DIR}/3rdparty/libtengine")
SET(OCV_TENGINE_SOURCE_PATH "${OCV_TENGINE_DIR}/Tengine-${TENGINE_COMMIT_VERSION}")
IF(EXISTS "${OCV_TENGINE_SOURCE_PATH}")
MESSAGE(STATUS "Tengine is exist already at: ${OCV_TENGINE_SOURCE_PATH}")
SET(Tengine_FOUND ON)
SET(BUILD_TENGINE ON)
ELSE()
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name2
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url2
SET(tengine_md5sum 9124324b6e2b350012e46ae1db4bad7d) #md5sum2
#MESSAGE(STATUS "**** TENGINE DOWNLOAD BEGIN ****")
ocv_download(FILENAME ${OCV_TENGINE_FILENAME}
HASH ${tengine_md5sum}
URL
"${OPENCV_TENGINE_URL}"
"$ENV{OPENCV_TENGINE_URL}"
"${OCV_TENGINE_URL}"
DESTINATION_DIR "${OCV_TENGINE_DIR}"
ID TENGINE
STATUS res
UNPACK RELATIVE_URL)
if (NOT res)
MESSAGE(STATUS "TENGINE DOWNLOAD FAILED. Turning Tengine_FOUND off.")
SET(Tengine_FOUND OFF)
else ()
MESSAGE(STATUS "TENGINE DOWNLOAD success . ")
SET(Tengine_FOUND ON)
SET(BUILD_TENGINE ON)
endif()
ENDIF()
if(BUILD_TENGINE)
SET(HAVE_TENGINE 1)
# android system
if(ANDROID)
if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
SET(CONFIG_ARCH_ARM32 ON)
elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
SET(CONFIG_ARCH_ARM64 ON)
endif()
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
else()
# linux system
if(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
SET(CONFIG_ARCH_ARM32 ON)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) ## AARCH64
SET(CONFIG_ARCH_ARM64 ON)
endif()
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
endif()
SET(BUILT_IN_OPENCV ON) ## set for tengine compile discern .
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/core/include" CACHE INTERNAL "")
if(EXISTS "${OCV_TENGINE_SOURCE_PATH}/CMakeLists.txt")
add_subdirectory("${OCV_TENGINE_SOURCE_PATH}" "${OCV_TENGINE_DIR}/build")
else()
message(WARNING "TENGINE: Missing 'CMakeLists.txt' in source code package: ${OCV_TENGINE_SOURCE_PATH}")
SET(HAVE_TENGINE 1)
endif()
endif()
+8 -6
View File
@@ -126,30 +126,30 @@ endif()
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned int")
set(TIFF_SIZE_FORMAT "%u")
set(TIFF_SSIZE_T "signed int")
set(TIFF_SSIZE_FORMAT "%d")
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long")
set(TIFF_SIZE_FORMAT "%lu")
set(TIFF_SSIZE_T "signed long")
set(TIFF_SSIZE_FORMAT "%ld")
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long")
if(MINGW)
set(TIFF_SIZE_FORMAT "%I64u")
set(TIFF_SSIZE_FORMAT "%I64d")
else()
set(TIFF_SIZE_FORMAT "%llu")
set(TIFF_SSIZE_FORMAT "%lld")
endif()
endif()
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed int")
set(TIFF_SSIZE_FORMAT "%d")
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed long")
set(TIFF_SSIZE_FORMAT "%ld")
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed long long")
if(MINGW)
set(TIFF_SSIZE_FORMAT "%I64d")
else()
set(TIFF_SSIZE_FORMAT "%lld")
endif()
endif()
@@ -216,6 +216,8 @@ endif()
set(fillorder FILLORDER_MSB2LSB)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
# AMD64 on Windows
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
set(fillorder FILLORDER_LSB2MSB)
endif()
+4
View File
@@ -16,7 +16,11 @@ int _TIFF_vsnprintf_f(char* str, size_t size, const char* format, va_list ap)
int count = -1;
if (size != 0)
#if _MSC_VER <= 1310
count = _vsnprintf(str, size, format, ap);
#else
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
#endif
if (count == -1)
count = _vscprintf(format, ap);
+10
View File
@@ -30,6 +30,7 @@
#include "tiffiop.h"
#include "tif_predict.h"
#include <math.h>
#include <float.h>
uint32
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
@@ -357,6 +358,15 @@ _TIFFUInt64ToDouble(uint64 ui64)
}
}
float _TIFFClampDoubleToFloat( double val )
{
if( val > FLT_MAX )
return FLT_MAX;
if( val < -FLT_MAX )
return -FLT_MAX;
return (float)val;
}
int _TIFFSeekOK(TIFF* tif, toff_t off)
{
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
+1 -1
View File
@@ -216,7 +216,7 @@
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
//disabled for OpenCV CMakeLists.txt: #define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
+33 -17
View File
@@ -29,7 +29,6 @@
* (and also some miscellaneous stuff)
*/
#include "tiffiop.h"
#include <float.h>
/*
* These are used in the backwards compatibility code...
@@ -88,13 +87,15 @@ setDoubleArrayOneValue(double** vpp, double value, size_t nmemb)
* Install extra samples information.
*/
static int
setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
setExtraSamples(TIFF* tif, va_list ap, uint32* v)
{
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
#define EXTRASAMPLE_COREL_UNASSALPHA 999
uint16* va;
uint32 i;
TIFFDirectory* td = &tif->tif_dir;
static const char module[] = "setExtraSamples";
*v = (uint16) va_arg(ap, uint16_vap);
if ((uint16) *v > td->td_samplesperpixel)
@@ -116,6 +117,18 @@ setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
return 0;
}
}
if ( td->td_transferfunction[0] != NULL && (td->td_samplesperpixel - *v > 1) &&
!(td->td_samplesperpixel - td->td_extrasamples > 1))
{
TIFFWarningExt(tif->tif_clientdata,module,
"ExtraSamples tag value is changing, "
"but TransferFunction was read with a different value. Cancelling it");
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
_TIFFfree(td->td_transferfunction[0]);
td->td_transferfunction[0] = NULL;
}
td->td_extrasamples = (uint16) *v;
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
return 1;
@@ -153,15 +166,6 @@ bad:
return (0);
}
static float TIFFClampDoubleToFloat( double val )
{
if( val > FLT_MAX )
return FLT_MAX;
if( val < -FLT_MAX )
return -FLT_MAX;
return (float)val;
}
static int
_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
@@ -285,6 +289,18 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
_TIFFfree(td->td_smaxsamplevalue);
td->td_smaxsamplevalue = NULL;
}
/* Test if 3 transfer functions instead of just one are now needed
See http://bugzilla.maptools.org/show_bug.cgi?id=2820 */
if( td->td_transferfunction[0] != NULL && (v - td->td_extrasamples > 1) &&
!(td->td_samplesperpixel - td->td_extrasamples > 1))
{
TIFFWarningExt(tif->tif_clientdata,module,
"SamplesPerPixel tag value is changing, "
"but TransferFunction was read with a different value. Cancelling it");
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
_TIFFfree(td->td_transferfunction[0]);
td->td_transferfunction[0] = NULL;
}
}
td->td_samplesperpixel = (uint16) v;
break;
@@ -320,13 +336,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
dblval = va_arg(ap, double);
if( dblval < 0 )
goto badvaluedouble;
td->td_xresolution = TIFFClampDoubleToFloat( dblval );
td->td_xresolution = _TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_YRESOLUTION:
dblval = va_arg(ap, double);
if( dblval < 0 )
goto badvaluedouble;
td->td_yresolution = TIFFClampDoubleToFloat( dblval );
td->td_yresolution = _TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_PLANARCONFIG:
v = (uint16) va_arg(ap, uint16_vap);
@@ -335,10 +351,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
td->td_planarconfig = (uint16) v;
break;
case TIFFTAG_XPOSITION:
td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
td->td_xposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
break;
case TIFFTAG_YPOSITION:
td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
td->td_yposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
break;
case TIFFTAG_RESOLUTIONUNIT:
v = (uint16) va_arg(ap, uint16_vap);
@@ -361,7 +377,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
break;
case TIFFTAG_EXTRASAMPLES:
if (!setExtraSamples(td, ap, &v))
if (!setExtraSamples(tif, ap, &v))
goto badvalue;
break;
case TIFFTAG_MATTEING:
@@ -684,7 +700,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
case TIFF_SRATIONAL:
case TIFF_FLOAT:
{
float v2 = TIFFClampDoubleToFloat(va_arg(ap, double));
float v2 = _TIFFClampDoubleToFloat(va_arg(ap, double));
_TIFFmemcpy(val, &v2, tv_size);
}
break;
+169 -41
View File
@@ -164,6 +164,7 @@ static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover);
static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
static void ChopUpSingleUncompressedStrip(TIFF*);
static void TryChopUpUncompressedBigTiff(TIFF*);
static uint64 TIFFReadUInt64(const uint8 *value);
static int _TIFFGetMaxColorChannels(uint16 photometric);
@@ -4246,6 +4247,19 @@ TIFFReadDirectory(TIFF* tif)
ChopUpSingleUncompressedStrip(tif);
}
/* There are also uncompressed stripped files with strips larger than */
/* 2 GB, which make them unfriendly with a lot of code. If possible, */
/* try to expose smaller "virtual" strips. */
if( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG &&
tif->tif_dir.td_compression == COMPRESSION_NONE &&
(tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP &&
TIFFStripSize64(tif) > 0x7FFFFFFFUL )
{
if ( !_TIFFFillStriles(tif) || !tif->tif_dir.td_stripbytecount )
return 0;
TryChopUpUncompressedBigTiff(tif);
}
/*
* Clear the dirty directory flag.
*/
@@ -5699,6 +5713,63 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
}
}
static void allocChoppedUpStripArrays(TIFF* tif, uint32 nstrips,
uint64 stripbytes, uint32 rowsperstrip)
{
TIFFDirectory *td = &tif->tif_dir;
uint64 bytecount;
uint64 offset;
uint32 i;
uint64 *newcounts;
uint64 *newoffsets;
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
"for chopped \"StripByteCounts\" array");
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
"for chopped \"StripOffsets\" array");
if (newcounts == NULL || newoffsets == NULL) {
/*
* Unable to allocate new strip information, give up and use
* the original one strip information.
*/
if (newcounts != NULL)
_TIFFfree(newcounts);
if (newoffsets != NULL)
_TIFFfree(newoffsets);
return;
}
/*
* Fill the strip information arrays with new bytecounts and offsets
* that reflect the broken-up format.
*/
offset = td->td_stripoffset[0];
bytecount = td->td_stripoffset[td->td_nstrips-1] +
td->td_stripbytecount[td->td_nstrips-1] - offset;
for (i = 0; i < nstrips; i++)
{
if (stripbytes > bytecount)
stripbytes = bytecount;
newcounts[i] = stripbytes;
newoffsets[i] = stripbytes ? offset : 0;
offset += stripbytes;
bytecount -= stripbytes;
}
/*
* Replace old single strip info with multi-strip info.
*/
td->td_stripsperimage = td->td_nstrips = nstrips;
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
_TIFFfree(td->td_stripbytecount);
_TIFFfree(td->td_stripoffset);
td->td_stripbytecount = newcounts;
td->td_stripoffset = newoffsets;
td->td_stripbytecountsorted = 1;
}
/*
* Replace a single strip (tile) of uncompressed data by multiple strips
* (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for
@@ -5714,11 +5785,8 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
uint32 rowblock;
uint64 rowblockbytes;
uint64 stripbytes;
uint32 strip;
uint32 nstrips;
uint32 rowsperstrip;
uint64* newcounts;
uint64* newoffsets;
bytecount = td->td_stripbytecount[0];
/* On a newly created file, just re-opened to be filled, we */
@@ -5769,46 +5837,106 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
return;
}
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
"for chopped \"StripByteCounts\" array");
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
"for chopped \"StripOffsets\" array");
if (newcounts == NULL || newoffsets == NULL) {
/*
* Unable to allocate new strip information, give up and use
* the original one strip information.
*/
if (newcounts != NULL)
_TIFFfree(newcounts);
if (newoffsets != NULL)
_TIFFfree(newoffsets);
return;
}
/*
* Fill the strip information arrays with new bytecounts and offsets
* that reflect the broken-up format.
*/
for (strip = 0; strip < nstrips; strip++) {
if (stripbytes > bytecount)
stripbytes = bytecount;
newcounts[strip] = stripbytes;
newoffsets[strip] = stripbytes ? offset : 0;
offset += stripbytes;
bytecount -= stripbytes;
}
/*
* Replace old single strip info with multi-strip info.
*/
td->td_stripsperimage = td->td_nstrips = nstrips;
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
_TIFFfree(td->td_stripbytecount);
_TIFFfree(td->td_stripoffset);
td->td_stripbytecount = newcounts;
td->td_stripoffset = newoffsets;
td->td_stripbytecountsorted = 1;
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
}
/*
* Replace a file with contiguous strips > 2 GB of uncompressed data by
* multiple smaller strips. This is useful for
* dealing with large images or for dealing with machines with a limited
* amount memory.
*/
static void TryChopUpUncompressedBigTiff( TIFF* tif )
{
TIFFDirectory *td = &tif->tif_dir;
uint32 rowblock;
uint64 rowblockbytes;
uint32 i;
uint64 stripsize;
uint32 rowblocksperstrip;
uint32 rowsperstrip;
uint64 stripbytes;
uint32 nstrips;
stripsize = TIFFStripSize64(tif);
assert( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG );
assert( tif->tif_dir.td_compression == COMPRESSION_NONE );
assert( (tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP );
assert( stripsize > 0x7FFFFFFFUL );
/* On a newly created file, just re-opened to be filled, we */
/* don't want strip chop to trigger as it is going to cause issues */
/* later ( StripOffsets and StripByteCounts improperly filled) . */
if( td->td_stripbytecount[0] == 0 && tif->tif_mode != O_RDONLY )
return;
if ((td->td_photometric == PHOTOMETRIC_YCBCR)&&
(!isUpSampled(tif)))
rowblock = td->td_ycbcrsubsampling[1];
else
rowblock = 1;
rowblockbytes = TIFFVStripSize64(tif, rowblock);
if( rowblockbytes == 0 || rowblockbytes > 0x7FFFFFFFUL )
{
/* In case of file with gigantic width */
return;
}
/* Check that the strips are contiguous and of the expected size */
for( i = 0; i < td->td_nstrips; i++ )
{
if( i == td->td_nstrips - 1 )
{
if( td->td_stripbytecount[i] < TIFFVStripSize64(
tif, td->td_imagelength - i * td->td_rowsperstrip ) )
{
return;
}
}
else
{
if( td->td_stripbytecount[i] != stripsize )
{
return;
}
if( i > 0 && td->td_stripoffset[i] !=
td->td_stripoffset[i-1] + td->td_stripbytecount[i - 1] )
{
return;
}
}
}
/* Aim for 512 MB strips (that will still be manageable by 32 bit builds */
rowblocksperstrip = (uint32) (512 * 1024 * 1024 / rowblockbytes);
if( rowblocksperstrip == 0 )
rowblocksperstrip = 1;
rowsperstrip = rowblocksperstrip * rowblock;
stripbytes = rowblocksperstrip * rowblockbytes;
assert( stripbytes <= 0x7FFFFFFFUL );
nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
if( nstrips == 0 )
return;
/* If we are going to allocate a lot of memory, make sure that the */
/* file is as big as needed */
if( tif->tif_mode == O_RDONLY &&
nstrips > 1000000 &&
(td->td_stripoffset[td->td_nstrips-1] > TIFFGetFileSize(tif) ||
td->td_stripoffset[td->td_nstrips-1] +
td->td_stripbytecount[td->td_nstrips-1] > TIFFGetFileSize(tif)) )
{
return;
}
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
}
int _TIFFFillStriles( TIFF *tif )
{
return _TIFFFillStrilesInternal( tif, 1 );
+5 -13
View File
@@ -28,7 +28,6 @@
* Directory Write Support Routines.
*/
#include "tiffiop.h"
#include <float.h>
#ifdef HAVE_IEEEFP
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
@@ -946,15 +945,6 @@ bad:
return(0);
}
static float TIFFClampDoubleToFloat( double val )
{
if( val > FLT_MAX )
return FLT_MAX;
if( val < -FLT_MAX )
return -FLT_MAX;
return (float)val;
}
static int8 TIFFClampDoubleToInt8( double val )
{
if( val > 127 )
@@ -1029,7 +1019,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
if (tif->tif_dir.td_bitspersample<=32)
{
for (i = 0; i < count; ++i)
((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
((float*)conv)[i] = _TIFFClampDoubleToFloat(value[i]);
ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
}
else
@@ -1893,12 +1883,14 @@ TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
n=3;
if (n==3)
{
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
if (tif->tif_dir.td_transferfunction[2] == NULL ||
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
n=2;
}
if (n==2)
{
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
if (tif->tif_dir.td_transferfunction[1] == NULL ||
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
n=1;
}
if (n==0)
+8 -3
View File
@@ -742,9 +742,14 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
#undef exp2 /* Conflict with C'99 function */
#define exp2(x) exp(M_LN2*(x))
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
(int)(x) : \
(int)((x) + rand()*(1./RAND_MAX) - .5))
static int itrunc(double x, int m)
{
if( m == SGILOGENCODE_NODITHER )
return (int)x;
/* Silence CoverityScan warning about bad crypto function */
/* coverity[dont_call] */
return (int)(x + rand()*(1./RAND_MAX) - .5);
}
#if !LOGLUV_PUBLIC
static
+2
View File
@@ -247,6 +247,8 @@ LZWSetupDecode(TIFF* tif)
/*
* Zero-out the unused entries
*/
/* Silence false positive */
/* coverity[overrun-buffer-arg] */
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
}
+3 -3
View File
@@ -640,6 +640,7 @@ PixarLogGuessDataFmt(TIFFDirectory *td)
static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
assert(m1 >= 0 && m2 >= 0);
if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
return 0;
return m1 * m2;
@@ -648,6 +649,7 @@ multiply_ms(tmsize_t m1, tmsize_t m2)
static tmsize_t
add_ms(tmsize_t m1, tmsize_t m2)
{
assert(m1 >= 0 && m2 >= 0);
/* if either input is zero, assume overflow already occurred */
if (m1 == 0 || m2 == 0)
return 0;
@@ -817,9 +819,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
TIFFErrorExt(tif->tif_clientdata, module,
"Decoding error at scanline %lu, %s",
(unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
if (inflateSync(&sp->stream) != Z_OK)
return (0);
continue;
return (0);
}
if (state != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
+7 -1
View File
@@ -103,6 +103,11 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
}
tif->tif_rawdata = new_rawdata;
}
if( tif->tif_rawdata == NULL )
{
/* should not happen in practice but helps CoverityScan */
return 0;
}
bytes_read = TIFFReadFile(tif,
tif->tif_rawdata + rawdata_offset + already_read, to_read);
@@ -1367,7 +1372,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
tif->tif_rawdataoff = 0;
tif->tif_rawdataloaded = bytecountm;
if (!isFillOrder(tif, td->td_fillorder) &&
if (tif->tif_rawdata != NULL &&
!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
TIFFReverseBits(tif->tif_rawdata,
tif->tif_rawdataloaded);
+28 -17
View File
@@ -349,6 +349,12 @@ TWebPSetupEncode(TIFF* tif)
sp->state |= LSTATE_INIT_ENCODE;
if (!WebPPictureInit(&sp->sPicture)) {
TIFFErrorExt(tif->tif_clientdata, module,
"Error initializing WebP picture.");
return 0;
}
if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
sp->quality_level,
WEBP_ENCODER_ABI_VERSION)) {
@@ -357,9 +363,13 @@ TWebPSetupEncode(TIFF* tif)
return 0;
}
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
sp->sEncoderConfig.lossless = sp->lossless;
#endif
// WebPConfigInitInternal above sets lossless to false
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
sp->sEncoderConfig.lossless = sp->lossless;
if (sp->lossless) {
sp->sPicture.use_argb = 1;
}
#endif
if (!WebPValidateConfig(&sp->sEncoderConfig)) {
TIFFErrorExt(tif->tif_clientdata, module,
@@ -367,12 +377,6 @@ TWebPSetupEncode(TIFF* tif)
return 0;
}
if (!WebPPictureInit(&sp->sPicture)) {
TIFFErrorExt(tif->tif_clientdata, module,
"Error initializing WebP picture.");
return 0;
}
return 1;
}
@@ -415,6 +419,12 @@ TWebPPreEncode(TIFF* tif, uint16 s)
/* set up buffer for raw data */
/* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
sp->buffer_size = segment_width * segment_height * sp->nSamples;
if (sp->pBuffer != NULL) {
_TIFFfree(sp->pBuffer);
sp->pBuffer = NULL;
}
sp->pBuffer = _TIFFmalloc(sp->buffer_size);
if( !sp->pBuffer) {
TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
@@ -460,7 +470,7 @@ TWebPPostEncode(TIFF* tif)
"WebPPictureImportRGB() failed");
return 0;
}
if (!WebPEncode(&sp->sEncoderConfig, &sp->sPicture)) {
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
@@ -540,15 +550,13 @@ TWebPCleanup(TIFF* tif)
}
if (sp->pBuffer != NULL) {
_TIFFfree(sp->pBuffer);
sp->pBuffer = NULL;
_TIFFfree(sp->pBuffer);
sp->pBuffer = NULL;
}
if (tif->tif_data) {
_TIFFfree(tif->tif_data);
tif->tif_data = NULL;
}
_TIFFfree(tif->tif_data);
tif->tif_data = NULL;
_TIFFSetDefaultCompressionState(tif);
}
@@ -570,6 +578,9 @@ TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
case TIFFTAG_WEBP_LOSSLESS:
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
sp->lossless = va_arg(ap, int);
if (sp->lossless){
sp->quality_level = 100.0f;
}
return 1;
#else
TIFFErrorExt(tif->tif_clientdata, module,
+20 -38
View File
@@ -124,7 +124,6 @@ ZIPSetupDecode(TIFF* tif)
static int
ZIPPreDecode(TIFF* tif, uint16 s)
{
static const char module[] = "ZIPPreDecode";
ZIPState* sp = DecoderState(tif);
(void) s;
@@ -138,12 +137,7 @@ ZIPPreDecode(TIFF* tif, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
sp->stream.avail_in = (uInt) tif->tif_rawcc;
if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
{
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
return (0);
}
sp->stream.avail_in = (uint64)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
return (inflateReset(&sp->stream) == Z_OK);
}
@@ -158,46 +152,43 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
assert(sp->state == ZSTATE_INIT_DECODE);
sp->stream.next_in = tif->tif_rawcp;
sp->stream.avail_in = (uInt) tif->tif_rawcc;
sp->stream.next_out = op;
assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised,
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
sp->stream.avail_out = (uInt) occ;
if ((tmsize_t)sp->stream.avail_out != occ)
{
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
return (0);
}
do {
int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
int state;
uInt avail_in_before = (uint64)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
uInt avail_out_before = (uint64)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
sp->stream.avail_in = avail_in_before;
sp->stream.avail_out = avail_out_before;
state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
tif->tif_rawcc -= (avail_in_before - sp->stream.avail_in);
occ -= (avail_out_before - sp->stream.avail_out);
if (state == Z_STREAM_END)
break;
if (state == Z_DATA_ERROR) {
TIFFErrorExt(tif->tif_clientdata, module,
"Decoding error at scanline %lu, %s",
(unsigned long) tif->tif_row, SAFE_MSG(sp));
if (inflateSync(&sp->stream) != Z_OK)
return (0);
continue;
return (0);
}
if (state != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
"ZLib error: %s", SAFE_MSG(sp));
return (0);
}
} while (sp->stream.avail_out > 0);
if (sp->stream.avail_out != 0) {
} while (occ > 0);
if (occ != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
(unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out);
(unsigned long) tif->tif_row, (TIFF_UINT64_T) occ);
return (0);
}
tif->tif_rawcp = sp->stream.next_in;
tif->tif_rawcc = sp->stream.avail_in;
return (1);
}
@@ -229,7 +220,6 @@ ZIPSetupEncode(TIFF* tif)
static int
ZIPPreEncode(TIFF* tif, uint16 s)
{
static const char module[] = "ZIPPreEncode";
ZIPState *sp = EncoderState(tif);
(void) s;
@@ -242,12 +232,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
sp->stream.avail_out = (uInt)tif->tif_rawdatasize;
if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize)
{
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
return (0);
}
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
return (deflateReset(&sp->stream) == Z_OK);
}
@@ -269,13 +254,9 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
sp->stream.avail_in = (uInt) cc;
if ((tmsize_t)sp->stream.avail_in != cc)
{
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
return (0);
}
do {
uInt avail_in_before = (uint64)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
sp->stream.avail_in = avail_in_before;
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
"Encoder error: %s",
@@ -286,9 +267,10 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
tif->tif_rawcc = tif->tif_rawdatasize;
TIFFFlushData1(tif);
sp->stream.next_out = tif->tif_rawdata;
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
} while (sp->stream.avail_in > 0);
cc -= (avail_in_before - sp->stream.avail_in);
} while (cc > 0);
return (1);
}
@@ -314,7 +296,7 @@ ZIPPostEncode(TIFF* tif)
tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out;
TIFFFlushData1(tif);
sp->stream.next_out = tif->tif_rawdata;
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
break;
default:
+2
View File
@@ -374,6 +374,8 @@ extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
extern double _TIFFUInt64ToDouble(uint64);
extern float _TIFFUInt64ToFloat(uint64);
extern float _TIFFClampDoubleToFloat(double);
extern tmsize_t
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
void **buf, tmsize_t bufsizetoalloc,
+5
View File
@@ -21,6 +21,11 @@ if(ANDROID AND ARMEABI_V7A AND NOT NEON)
endforeach()
endif()
# FIX for quant.h - requires C99 for() loops
ocv_check_flag_support(C "-std=c99" _varname "${CMAKE_C_FLAGS}")
if(${_varname})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
endif()
# ----------------------------------------------------------------------------------
+30
View File
@@ -0,0 +1,30 @@
Copyright (c) 2010, Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Google nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+22
View File
@@ -0,0 +1,22 @@
diff --git a/3rdparty/libwebp/src/dsp/msa_macro.h b/3rdparty/libwebp/src/dsp/msa_macro.h
index de026a1d9e..a16c0bb300 100644
--- a/3rdparty/libwebp/src/dsp/msa_macro.h
+++ b/3rdparty/libwebp/src/dsp/msa_macro.h
@@ -73,7 +73,7 @@
static inline TYPE FUNC_NAME(const void* const psrc) { \
const uint8_t* const psrc_m = (const uint8_t*)psrc; \
TYPE val_m; \
- asm volatile ( \
+ __asm__ volatile ( \
"" #INSTR " %[val_m], %[psrc_m] \n\t" \
: [val_m] "=r" (val_m) \
: [psrc_m] "m" (*psrc_m)); \
@@ -86,7 +86,7 @@
static inline void FUNC_NAME(TYPE val, void* const pdst) { \
uint8_t* const pdst_m = (uint8_t*)pdst; \
TYPE val_m = val; \
- asm volatile ( \
+ __asm__ volatile ( \
" " #INSTR " %[val_m], %[pdst_m] \n\t" \
: [pdst_m] "=m" (*pdst_m) \
: [val_m] "r" (val_m)); \
+1 -1
View File
@@ -51,4 +51,4 @@ void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
} // extern "C"
#endif
#endif /* WEBP_DEC_ALPHAI_DEC_H_ */
#endif // WEBP_DEC_ALPHAI_DEC_H_
+2 -1
View File
@@ -74,7 +74,8 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) {
} else { // RGB checks
const WebPRGBABuffer* const buf = &buffer->u.RGBA;
const int stride = abs(buf->stride);
const uint64_t size = MIN_BUFFER_SIZE(width, height, stride);
const uint64_t size =
MIN_BUFFER_SIZE(width * kModeBpp[mode], height, stride);
ok &= (size <= buf->size);
ok &= (stride >= width * kModeBpp[mode]);
ok &= (buf->rgba != NULL);
+1 -1
View File
@@ -51,4 +51,4 @@ enum { MB_FEATURE_TREE_PROBS = 3,
NUM_PROBAS = 11
};
#endif // WEBP_DEC_COMMON_DEC_H_
#endif // WEBP_DEC_COMMON_DEC_H_
+2 -9
View File
@@ -338,7 +338,6 @@ void VP8InitDithering(const WebPDecoderOptions* const options,
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
VP8QuantMatrix* const dqm = &dec->dqm_[s];
if (dqm->uv_quant_ < DITHER_AMP_TAB_SIZE) {
// TODO(skal): should we specially dither more for uv_quant_ < 0?
const int idx = (dqm->uv_quant_ < 0) ? 0 : dqm->uv_quant_;
dqm->dither_ = (f * kQuantToDitherAmp[idx]) >> 3;
}
@@ -669,15 +668,9 @@ int VP8GetThreadMethod(const WebPDecoderOptions* const options,
(void)height;
assert(headers == NULL || !headers->is_lossless);
#if defined(WEBP_USE_THREAD)
if (width < MIN_WIDTH_FOR_THREADS) return 0;
// TODO(skal): tune the heuristic further
#if 0
if (height < 2 * width) return 2;
if (width >= MIN_WIDTH_FOR_THREADS) return 2;
#endif
return 2;
#else // !WEBP_USE_THREAD
return 0;
#endif
}
#undef MT_CACHE_LINES
@@ -739,7 +732,7 @@ static int AllocateMemory(VP8Decoder* const dec) {
mem += f_info_size;
dec->thread_ctx_.id_ = 0;
dec->thread_ctx_.f_info_ = dec->f_info_;
if (dec->mt_method_ > 0) {
if (dec->filter_type_ > 0 && dec->mt_method_ > 0) {
// secondary cache line. The deblocking process need to make use of the
// filtering strength from previous macroblock row, while the new ones
// are being decoded in parallel. We'll just swap the pointers.
+26 -10
View File
@@ -140,10 +140,9 @@ static void DoRemap(WebPIDecoder* const idec, ptrdiff_t offset) {
if (NeedCompressedAlpha(idec)) {
ALPHDecoder* const alph_dec = dec->alph_dec_;
dec->alpha_data_ += offset;
if (alph_dec != NULL) {
if (alph_dec != NULL && alph_dec->vp8l_dec_ != NULL) {
if (alph_dec->method_ == ALPHA_LOSSLESS_COMPRESSION) {
VP8LDecoder* const alph_vp8l_dec = alph_dec->vp8l_dec_;
assert(alph_vp8l_dec != NULL);
assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN);
VP8LBitReaderSetBuffer(&alph_vp8l_dec->br_,
dec->alpha_data_ + ALPHA_HEADER_LEN,
@@ -167,9 +166,11 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
MemBuffer* const mem = &idec->mem_;
const int need_compressed_alpha = NeedCompressedAlpha(idec);
const uint8_t* const old_start = mem->buf_ + mem->start_;
const uint8_t* const old_start =
(mem->buf_ == NULL) ? NULL : mem->buf_ + mem->start_;
const uint8_t* const old_base =
need_compressed_alpha ? dec->alpha_data_ : old_start;
assert(mem->buf_ != NULL || mem->start_ == 0);
assert(mem->mode_ == MEM_MODE_APPEND);
if (data_size > MAX_CHUNK_PAYLOAD) {
// security safeguard: trying to allocate more than what the format
@@ -185,7 +186,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
uint8_t* const new_buf =
(uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf));
if (new_buf == NULL) return 0;
memcpy(new_buf, old_base, current_size);
if (old_base != NULL) memcpy(new_buf, old_base, current_size);
WebPSafeFree(mem->buf_);
mem->buf_ = new_buf;
mem->buf_size_ = (size_t)extra_size;
@@ -193,6 +194,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
mem->end_ = current_size;
}
assert(mem->buf_ != NULL);
memcpy(mem->buf_ + mem->end_, data, data_size);
mem->end_ += data_size;
assert(mem->end_ <= mem->buf_size_);
@@ -205,7 +207,9 @@ static int RemapMemBuffer(WebPIDecoder* const idec,
const uint8_t* const data, size_t data_size) {
MemBuffer* const mem = &idec->mem_;
const uint8_t* const old_buf = mem->buf_;
const uint8_t* const old_start = old_buf + mem->start_;
const uint8_t* const old_start =
(old_buf == NULL) ? NULL : old_buf + mem->start_;
assert(old_buf != NULL || mem->start_ == 0);
assert(mem->mode_ == MEM_MODE_MAP);
if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer!
@@ -283,10 +287,8 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec,
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
if (idec->state_ == STATE_VP8_DATA) {
VP8Io* const io = &idec->io_;
if (io->teardown != NULL) {
io->teardown(io);
}
// Synchronize the thread, clean-up and check for errors.
VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);
}
idec->state_ = STATE_ERROR;
return error;
@@ -451,7 +453,10 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
VP8Io* const io = &idec->io_;
assert(dec->ready_);
// Make sure partition #0 has been read before, to set dec to ready_.
if (!dec->ready_) {
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
}
for (; dec->mb_y_ < dec->mb_h_; ++dec->mb_y_) {
if (idec->last_mb_y_ != dec->mb_y_) {
if (!VP8ParseIntraModeRow(&dec->br_, dec)) {
@@ -473,6 +478,12 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
MemDataSize(&idec->mem_) > MAX_MB_SIZE) {
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
}
// Synchronize the threads.
if (dec->mt_method_ > 0) {
if (!WebPGetWorkerInterface()->Sync(&dec->worker_)) {
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
}
}
RestoreContext(&context, dec, token_br);
return VP8_STATUS_SUSPENDED;
}
@@ -491,6 +502,7 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
}
// Synchronize the thread and check for errors.
if (!VP8ExitCritical(dec, io)) {
idec->state_ = STATE_ERROR; // prevent re-entry in IDecError
return IDecError(idec, VP8_STATUS_USER_ABORT);
}
dec->ready_ = 0;
@@ -571,6 +583,10 @@ static VP8StatusCode IDecode(WebPIDecoder* idec) {
status = DecodePartition0(idec);
}
if (idec->state_ == STATE_VP8_DATA) {
const VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
if (dec == NULL) {
return VP8_STATUS_SUSPENDED; // can't continue if we have no decoder.
}
status = DecodeRemaining(idec);
}
if (idec->state_ == STATE_VP8L_HEADER) {
+11 -6
View File
@@ -61,12 +61,17 @@ static const uint16_t kAcTable[128] = {
void VP8ParseQuant(VP8Decoder* const dec) {
VP8BitReader* const br = &dec->br_;
const int base_q0 = VP8GetValue(br, 7);
const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
const int base_q0 = VP8GetValue(br, 7, "global-header");
const int dqy1_dc = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 4, "global-header") : 0;
const int dqy2_dc = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 4, "global-header") : 0;
const int dqy2_ac = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 4, "global-header") : 0;
const int dquv_dc = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 4, "global-header") : 0;
const int dquv_ac = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 4, "global-header") : 0;
const VP8SegmentHeader* const hdr = &dec->segment_hdr_;
int i;
+31 -26
View File
@@ -296,20 +296,21 @@ static void ParseIntraMode(VP8BitReader* const br,
// to decode more than 1 keyframe.
if (dec->segment_hdr_.update_map_) {
// Hardcoded tree parsing
block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0])
? VP8GetBit(br, dec->proba_.segments_[1])
: 2 + VP8GetBit(br, dec->proba_.segments_[2]);
block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0], "segments")
? VP8GetBit(br, dec->proba_.segments_[1], "segments")
: VP8GetBit(br, dec->proba_.segments_[2], "segments") + 2;
} else {
block->segment_ = 0; // default for intra
}
if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_);
if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_, "skip");
block->is_i4x4_ = !VP8GetBit(br, 145); // decide for B_PRED first
block->is_i4x4_ = !VP8GetBit(br, 145, "block-size");
if (!block->is_i4x4_) {
// Hardcoded 16x16 intra-mode decision tree.
const int ymode =
VP8GetBit(br, 156) ? (VP8GetBit(br, 128) ? TM_PRED : H_PRED)
: (VP8GetBit(br, 163) ? V_PRED : DC_PRED);
VP8GetBit(br, 156, "pred-modes") ?
(VP8GetBit(br, 128, "pred-modes") ? TM_PRED : H_PRED) :
(VP8GetBit(br, 163, "pred-modes") ? V_PRED : DC_PRED);
block->imodes_[0] = ymode;
memset(top, ymode, 4 * sizeof(*top));
memset(left, ymode, 4 * sizeof(*left));
@@ -323,22 +324,25 @@ static void ParseIntraMode(VP8BitReader* const br,
const uint8_t* const prob = kBModesProba[top[x]][ymode];
#if (USE_GENERIC_TREE == 1)
// Generic tree-parsing
int i = kYModesIntra4[VP8GetBit(br, prob[0])];
int i = kYModesIntra4[VP8GetBit(br, prob[0], "pred-modes")];
while (i > 0) {
i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i])];
i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i], "pred-modes")];
}
ymode = -i;
#else
// Hardcoded tree parsing
ymode = !VP8GetBit(br, prob[0]) ? B_DC_PRED :
!VP8GetBit(br, prob[1]) ? B_TM_PRED :
!VP8GetBit(br, prob[2]) ? B_VE_PRED :
!VP8GetBit(br, prob[3]) ?
(!VP8GetBit(br, prob[4]) ? B_HE_PRED :
(!VP8GetBit(br, prob[5]) ? B_RD_PRED : B_VR_PRED)) :
(!VP8GetBit(br, prob[6]) ? B_LD_PRED :
(!VP8GetBit(br, prob[7]) ? B_VL_PRED :
(!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED)));
ymode = !VP8GetBit(br, prob[0], "pred-modes") ? B_DC_PRED :
!VP8GetBit(br, prob[1], "pred-modes") ? B_TM_PRED :
!VP8GetBit(br, prob[2], "pred-modes") ? B_VE_PRED :
!VP8GetBit(br, prob[3], "pred-modes") ?
(!VP8GetBit(br, prob[4], "pred-modes") ? B_HE_PRED :
(!VP8GetBit(br, prob[5], "pred-modes") ? B_RD_PRED
: B_VR_PRED)) :
(!VP8GetBit(br, prob[6], "pred-modes") ? B_LD_PRED :
(!VP8GetBit(br, prob[7], "pred-modes") ? B_VL_PRED :
(!VP8GetBit(br, prob[8], "pred-modes") ? B_HD_PRED
: B_HU_PRED))
);
#endif // USE_GENERIC_TREE
top[x] = ymode;
}
@@ -348,9 +352,9 @@ static void ParseIntraMode(VP8BitReader* const br,
}
}
// Hardcoded UVMode decision tree
block->uvmode_ = !VP8GetBit(br, 142) ? DC_PRED
: !VP8GetBit(br, 114) ? V_PRED
: VP8GetBit(br, 183) ? TM_PRED : H_PRED;
block->uvmode_ = !VP8GetBit(br, 142, "pred-modes-uv") ? DC_PRED
: !VP8GetBit(br, 114, "pred-modes-uv") ? V_PRED
: VP8GetBit(br, 183, "pred-modes-uv") ? TM_PRED : H_PRED;
}
int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) {
@@ -514,8 +518,10 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) {
for (b = 0; b < NUM_BANDS; ++b) {
for (c = 0; c < NUM_CTX; ++c) {
for (p = 0; p < NUM_PROBAS; ++p) {
const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ?
VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p];
const int v =
VP8GetBit(br, CoeffsUpdateProba[t][b][c][p], "global-header") ?
VP8GetValue(br, 8, "global-header") :
CoeffsProba0[t][b][c][p];
proba->bands_[t][b].probas_[c][p] = v;
}
}
@@ -524,9 +530,8 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) {
proba->bands_ptr_[t][b] = &proba->bands_[t][kBands[b]];
}
}
dec->use_skip_proba_ = VP8Get(br);
dec->use_skip_proba_ = VP8Get(br, "global-header");
if (dec->use_skip_proba_) {
dec->skip_p_ = VP8GetValue(br, 8);
dec->skip_p_ = VP8GetValue(br, 8, "global-header");
}
}
+42 -39
View File
@@ -161,23 +161,26 @@ static int ParseSegmentHeader(VP8BitReader* br,
VP8SegmentHeader* hdr, VP8Proba* proba) {
assert(br != NULL);
assert(hdr != NULL);
hdr->use_segment_ = VP8Get(br);
hdr->use_segment_ = VP8Get(br, "global-header");
if (hdr->use_segment_) {
hdr->update_map_ = VP8Get(br);
if (VP8Get(br)) { // update data
hdr->update_map_ = VP8Get(br, "global-header");
if (VP8Get(br, "global-header")) { // update data
int s;
hdr->absolute_delta_ = VP8Get(br);
hdr->absolute_delta_ = VP8Get(br, "global-header");
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
hdr->quantizer_[s] = VP8Get(br) ? VP8GetSignedValue(br, 7) : 0;
hdr->quantizer_[s] = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 7, "global-header") : 0;
}
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
hdr->filter_strength_[s] = VP8Get(br) ? VP8GetSignedValue(br, 6) : 0;
hdr->filter_strength_[s] = VP8Get(br, "global-header") ?
VP8GetSignedValue(br, 6, "global-header") : 0;
}
}
if (hdr->update_map_) {
int s;
for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) {
proba->segments_[s] = VP8Get(br) ? VP8GetValue(br, 8) : 255u;
proba->segments_[s] = VP8Get(br, "global-header") ?
VP8GetValue(br, 8, "global-header") : 255u;
}
}
} else {
@@ -205,7 +208,7 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec,
size_t last_part;
size_t p;
dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2)) - 1;
dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2, "global-header")) - 1;
last_part = dec->num_parts_minus_one_;
if (size < 3 * last_part) {
// we can't even read the sizes with sz[]! That's a failure.
@@ -229,21 +232,21 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec,
// Paragraph 9.4
static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) {
VP8FilterHeader* const hdr = &dec->filter_hdr_;
hdr->simple_ = VP8Get(br);
hdr->level_ = VP8GetValue(br, 6);
hdr->sharpness_ = VP8GetValue(br, 3);
hdr->use_lf_delta_ = VP8Get(br);
hdr->simple_ = VP8Get(br, "global-header");
hdr->level_ = VP8GetValue(br, 6, "global-header");
hdr->sharpness_ = VP8GetValue(br, 3, "global-header");
hdr->use_lf_delta_ = VP8Get(br, "global-header");
if (hdr->use_lf_delta_) {
if (VP8Get(br)) { // update lf-delta?
if (VP8Get(br, "global-header")) { // update lf-delta?
int i;
for (i = 0; i < NUM_REF_LF_DELTAS; ++i) {
if (VP8Get(br)) {
hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6);
if (VP8Get(br, "global-header")) {
hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
}
}
for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) {
if (VP8Get(br)) {
hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6);
if (VP8Get(br, "global-header")) {
hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
}
}
}
@@ -352,8 +355,8 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) {
buf_size -= frm_hdr->partition_length_;
if (frm_hdr->key_frame_) {
pic_hdr->colorspace_ = VP8Get(br);
pic_hdr->clamp_type_ = VP8Get(br);
pic_hdr->colorspace_ = VP8Get(br, "global-header");
pic_hdr->clamp_type_ = VP8Get(br, "global-header");
}
if (!ParseSegmentHeader(br, &dec->segment_hdr_, &dec->proba_)) {
return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,
@@ -378,7 +381,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) {
"Not a key frame.");
}
VP8Get(br); // ignore the value of update_proba_
VP8Get(br, "global-header"); // ignore the value of update_proba_
VP8ParseProba(br, dec);
@@ -403,28 +406,28 @@ static const uint8_t kZigzag[16] = {
// See section 13-2: http://tools.ietf.org/html/rfc6386#section-13.2
static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) {
int v;
if (!VP8GetBit(br, p[3])) {
if (!VP8GetBit(br, p[4])) {
if (!VP8GetBit(br, p[3], "coeffs")) {
if (!VP8GetBit(br, p[4], "coeffs")) {
v = 2;
} else {
v = 3 + VP8GetBit(br, p[5]);
v = 3 + VP8GetBit(br, p[5], "coeffs");
}
} else {
if (!VP8GetBit(br, p[6])) {
if (!VP8GetBit(br, p[7])) {
v = 5 + VP8GetBit(br, 159);
if (!VP8GetBit(br, p[6], "coeffs")) {
if (!VP8GetBit(br, p[7], "coeffs")) {
v = 5 + VP8GetBit(br, 159, "coeffs");
} else {
v = 7 + 2 * VP8GetBit(br, 165);
v += VP8GetBit(br, 145);
v = 7 + 2 * VP8GetBit(br, 165, "coeffs");
v += VP8GetBit(br, 145, "coeffs");
}
} else {
const uint8_t* tab;
const int bit1 = VP8GetBit(br, p[8]);
const int bit0 = VP8GetBit(br, p[9 + bit1]);
const int bit1 = VP8GetBit(br, p[8], "coeffs");
const int bit0 = VP8GetBit(br, p[9 + bit1], "coeffs");
const int cat = 2 * bit1 + bit0;
v = 0;
for (tab = kCat3456[cat]; *tab; ++tab) {
v += v + VP8GetBit(br, *tab);
v += v + VP8GetBit(br, *tab, "coeffs");
}
v += 3 + (8 << cat);
}
@@ -438,24 +441,24 @@ static int GetCoeffsFast(VP8BitReader* const br,
int ctx, const quant_t dq, int n, int16_t* out) {
const uint8_t* p = prob[n]->probas_[ctx];
for (; n < 16; ++n) {
if (!VP8GetBit(br, p[0])) {
if (!VP8GetBit(br, p[0], "coeffs")) {
return n; // previous coeff was last non-zero coeff
}
while (!VP8GetBit(br, p[1])) { // sequence of zero coeffs
while (!VP8GetBit(br, p[1], "coeffs")) { // sequence of zero coeffs
p = prob[++n]->probas_[0];
if (n == 16) return 16;
}
{ // non zero coeff
const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0];
int v;
if (!VP8GetBit(br, p[2])) {
if (!VP8GetBit(br, p[2], "coeffs")) {
v = 1;
p = p_ctx[1];
} else {
v = GetLargeValue(br, p);
p = p_ctx[2];
}
out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0];
out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0];
}
}
return 16;
@@ -468,24 +471,24 @@ static int GetCoeffsAlt(VP8BitReader* const br,
int ctx, const quant_t dq, int n, int16_t* out) {
const uint8_t* p = prob[n]->probas_[ctx];
for (; n < 16; ++n) {
if (!VP8GetBitAlt(br, p[0])) {
if (!VP8GetBitAlt(br, p[0], "coeffs")) {
return n; // previous coeff was last non-zero coeff
}
while (!VP8GetBitAlt(br, p[1])) { // sequence of zero coeffs
while (!VP8GetBitAlt(br, p[1], "coeffs")) { // sequence of zero coeffs
p = prob[++n]->probas_[0];
if (n == 16) return 16;
}
{ // non zero coeff
const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0];
int v;
if (!VP8GetBitAlt(br, p[2])) {
if (!VP8GetBitAlt(br, p[2], "coeffs")) {
v = 1;
p = p_ctx[1];
} else {
v = GetLargeValue(br, p);
p = p_ctx[2];
}
out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0];
out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0];
}
}
return 16;
+1 -1
View File
@@ -182,4 +182,4 @@ WEBP_EXTERN int VP8LGetInfo(
} // extern "C"
#endif
#endif /* WEBP_DEC_VP8_DEC_H_ */
#endif // WEBP_DEC_VP8_DEC_H_
+2 -2
View File
@@ -31,7 +31,7 @@ extern "C" {
// version numbers
#define DEC_MAJ_VERSION 1
#define DEC_MIN_VERSION 0
#define DEC_MIN_VERSION 1
#define DEC_REV_VERSION 0
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
@@ -316,4 +316,4 @@ const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
} // extern "C"
#endif
#endif /* WEBP_DEC_VP8I_DEC_H_ */
#endif // WEBP_DEC_VP8I_DEC_H_
+116 -66
View File
@@ -363,11 +363,14 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
uint32_t* huffman_image = NULL;
HTreeGroup* htree_groups = NULL;
HuffmanCode* huffman_tables = NULL;
HuffmanCode* next = NULL;
HuffmanCode* huffman_table = NULL;
int num_htree_groups = 1;
int num_htree_groups_max = 1;
int max_alphabet_size = 0;
int* code_lengths = NULL;
const int table_size = kTableSize[color_cache_bits];
int* mapping = NULL;
int ok = 0;
if (allow_recursion && VP8LReadBits(br, 1)) {
// use meta Huffman codes.
@@ -384,10 +387,36 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
// The huffman data is stored in red and green bytes.
const int group = (huffman_image[i] >> 8) & 0xffff;
huffman_image[i] = group;
if (group >= num_htree_groups) {
num_htree_groups = group + 1;
if (group >= num_htree_groups_max) {
num_htree_groups_max = group + 1;
}
}
// Check the validity of num_htree_groups_max. If it seems too big, use a
// smaller value for later. This will prevent big memory allocations to end
// up with a bad bitstream anyway.
// The value of 1000 is totally arbitrary. We know that num_htree_groups_max
// is smaller than (1 << 16) and should be smaller than the number of pixels
// (though the format allows it to be bigger).
if (num_htree_groups_max > 1000 || num_htree_groups_max > xsize * ysize) {
// Create a mapping from the used indices to the minimal set of used
// values [0, num_htree_groups)
mapping = (int*)WebPSafeMalloc(num_htree_groups_max, sizeof(*mapping));
if (mapping == NULL) {
dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
goto Error;
}
// -1 means a value is unmapped, and therefore unused in the Huffman
// image.
memset(mapping, 0xff, num_htree_groups_max * sizeof(*mapping));
for (num_htree_groups = 0, i = 0; i < huffman_pixs; ++i) {
// Get the current mapping for the group and remap the Huffman image.
int* const mapped_group = &mapping[huffman_image[i]];
if (*mapped_group == -1) *mapped_group = num_htree_groups++;
huffman_image[i] = *mapped_group;
}
} else {
num_htree_groups = num_htree_groups_max;
}
}
if (br->eos_) goto Error;
@@ -403,83 +432,100 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
}
}
code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
sizeof(*code_lengths));
huffman_tables = (HuffmanCode*)WebPSafeMalloc(num_htree_groups * table_size,
sizeof(*huffman_tables));
htree_groups = VP8LHtreeGroupsNew(num_htree_groups);
code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
sizeof(*code_lengths));
if (htree_groups == NULL || code_lengths == NULL || huffman_tables == NULL) {
dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
goto Error;
}
next = huffman_tables;
for (i = 0; i < num_htree_groups; ++i) {
HTreeGroup* const htree_group = &htree_groups[i];
HuffmanCode** const htrees = htree_group->htrees;
int size;
int total_size = 0;
int is_trivial_literal = 1;
int max_bits = 0;
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
int alphabet_size = kAlphabetSize[j];
htrees[j] = next;
if (j == 0 && color_cache_bits > 0) {
alphabet_size += 1 << color_cache_bits;
}
size = ReadHuffmanCode(alphabet_size, dec, code_lengths, next);
if (size == 0) {
goto Error;
}
if (is_trivial_literal && kLiteralMap[j] == 1) {
is_trivial_literal = (next->bits == 0);
}
total_size += next->bits;
next += size;
if (j <= ALPHA) {
int local_max_bits = code_lengths[0];
int k;
for (k = 1; k < alphabet_size; ++k) {
if (code_lengths[k] > local_max_bits) {
local_max_bits = code_lengths[k];
}
huffman_table = huffman_tables;
for (i = 0; i < num_htree_groups_max; ++i) {
// If the index "i" is unused in the Huffman image, just make sure the
// coefficients are valid but do not store them.
if (mapping != NULL && mapping[i] == -1) {
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
int alphabet_size = kAlphabetSize[j];
if (j == 0 && color_cache_bits > 0) {
alphabet_size += (1 << color_cache_bits);
}
// Passing in NULL so that nothing gets filled.
if (!ReadHuffmanCode(alphabet_size, dec, code_lengths, NULL)) {
goto Error;
}
max_bits += local_max_bits;
}
}
htree_group->is_trivial_literal = is_trivial_literal;
htree_group->is_trivial_code = 0;
if (is_trivial_literal) {
const int red = htrees[RED][0].value;
const int blue = htrees[BLUE][0].value;
const int alpha = htrees[ALPHA][0].value;
htree_group->literal_arb =
((uint32_t)alpha << 24) | (red << 16) | blue;
if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) {
htree_group->is_trivial_code = 1;
htree_group->literal_arb |= htrees[GREEN][0].value << 8;
} else {
HTreeGroup* const htree_group =
&htree_groups[(mapping == NULL) ? i : mapping[i]];
HuffmanCode** const htrees = htree_group->htrees;
int size;
int total_size = 0;
int is_trivial_literal = 1;
int max_bits = 0;
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
int alphabet_size = kAlphabetSize[j];
htrees[j] = huffman_table;
if (j == 0 && color_cache_bits > 0) {
alphabet_size += (1 << color_cache_bits);
}
size = ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_table);
if (size == 0) {
goto Error;
}
if (is_trivial_literal && kLiteralMap[j] == 1) {
is_trivial_literal = (huffman_table->bits == 0);
}
total_size += huffman_table->bits;
huffman_table += size;
if (j <= ALPHA) {
int local_max_bits = code_lengths[0];
int k;
for (k = 1; k < alphabet_size; ++k) {
if (code_lengths[k] > local_max_bits) {
local_max_bits = code_lengths[k];
}
}
max_bits += local_max_bits;
}
}
htree_group->is_trivial_literal = is_trivial_literal;
htree_group->is_trivial_code = 0;
if (is_trivial_literal) {
const int red = htrees[RED][0].value;
const int blue = htrees[BLUE][0].value;
const int alpha = htrees[ALPHA][0].value;
htree_group->literal_arb = ((uint32_t)alpha << 24) | (red << 16) | blue;
if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) {
htree_group->is_trivial_code = 1;
htree_group->literal_arb |= htrees[GREEN][0].value << 8;
}
}
htree_group->use_packed_table =
!htree_group->is_trivial_code && (max_bits < HUFFMAN_PACKED_BITS);
if (htree_group->use_packed_table) BuildPackedTable(htree_group);
}
htree_group->use_packed_table = !htree_group->is_trivial_code &&
(max_bits < HUFFMAN_PACKED_BITS);
if (htree_group->use_packed_table) BuildPackedTable(htree_group);
}
WebPSafeFree(code_lengths);
ok = 1;
// All OK. Finalize pointers and return.
// All OK. Finalize pointers.
hdr->huffman_image_ = huffman_image;
hdr->num_htree_groups_ = num_htree_groups;
hdr->htree_groups_ = htree_groups;
hdr->huffman_tables_ = huffman_tables;
return 1;
Error:
WebPSafeFree(code_lengths);
WebPSafeFree(huffman_image);
WebPSafeFree(huffman_tables);
VP8LHtreeGroupsFree(htree_groups);
return 0;
WebPSafeFree(mapping);
if (!ok) {
WebPSafeFree(huffman_image);
WebPSafeFree(huffman_tables);
VP8LHtreeGroupsFree(htree_groups);
}
return ok;
}
//------------------------------------------------------------------------------
@@ -708,11 +754,11 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr,
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row);
static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows,
static void ApplyInverseTransforms(VP8LDecoder* const dec,
int start_row, int num_rows,
const uint32_t* const rows) {
int n = dec->next_transform_;
const int cache_pixs = dec->width_ * num_rows;
const int start_row = dec->last_row_;
const int end_row = start_row + num_rows;
const uint32_t* rows_in = rows;
uint32_t* const rows_out = dec->argb_cache_;
@@ -743,8 +789,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) {
VP8Io* const io = dec->io_;
uint8_t* rows_data = (uint8_t*)dec->argb_cache_;
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
ApplyInverseTransforms(dec, num_rows, rows);
ApplyInverseTransforms(dec, dec->last_row_, num_rows, rows);
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) {
// Nothing to output (this time).
} else {
@@ -884,7 +929,11 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) {
#endif
break;
case 2:
#if !defined(WORDS_BIGENDIAN)
memcpy(&pattern, src, sizeof(uint16_t));
#else
pattern = ((uint32_t)src[0] << 8) | src[1];
#endif
#if defined(__arm__) || defined(_M_ARM)
pattern |= pattern << 16;
#elif defined(WEBP_USE_MIPS_DSP_R2)
@@ -1143,6 +1192,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
VP8LFillBitWindow(br);
dist_code = GetCopyDistance(dist_symbol, br);
dist = PlaneCodeToDistance(width, dist_code);
if (VP8LIsEndOfStream(br)) break;
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) {
goto Error;
@@ -1503,7 +1553,7 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) {
const int cache_pixs = width * num_rows_to_process;
uint8_t* const dst = output + width * cur_row;
const uint32_t* const src = dec->argb_cache_;
ApplyInverseTransforms(dec, num_rows_to_process, in);
ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in);
WebPExtractGreen(src, dst, cache_pixs);
AlphaApplyFilter(alph_dec,
cur_row, cur_row + num_rows_to_process, dst, width);
@@ -1523,7 +1573,6 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,
if (dec == NULL) return 0;
assert(alph_dec != NULL);
alph_dec->vp8l_dec_ = dec;
dec->width_ = alph_dec->width_;
dec->height_ = alph_dec->height_;
@@ -1555,11 +1604,12 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,
if (!ok) goto Err;
// Only set here, once we are sure it is valid (to avoid thread races).
alph_dec->vp8l_dec_ = dec;
return 1;
Err:
VP8LDelete(alph_dec->vp8l_dec_);
alph_dec->vp8l_dec_ = NULL;
VP8LDelete(dec);
return 0;
}
+11 -11
View File
@@ -37,7 +37,7 @@ struct VP8LTransform {
int bits_; // subsampling bits defining transform window.
int xsize_; // transform window X index.
int ysize_; // transform window Y index.
uint32_t *data_; // transform data.
uint32_t* data_; // transform data.
};
typedef struct {
@@ -48,23 +48,23 @@ typedef struct {
int huffman_mask_;
int huffman_subsample_bits_;
int huffman_xsize_;
uint32_t *huffman_image_;
uint32_t* huffman_image_;
int num_htree_groups_;
HTreeGroup *htree_groups_;
HuffmanCode *huffman_tables_;
HTreeGroup* htree_groups_;
HuffmanCode* huffman_tables_;
} VP8LMetadata;
typedef struct VP8LDecoder VP8LDecoder;
struct VP8LDecoder {
VP8StatusCode status_;
VP8LDecodeState state_;
VP8Io *io_;
VP8Io* io_;
const WebPDecBuffer *output_; // shortcut to io->opaque->output
const WebPDecBuffer* output_; // shortcut to io->opaque->output
uint32_t *pixels_; // Internal data: either uint8_t* for alpha
uint32_t* pixels_; // Internal data: either uint8_t* for alpha
// or uint32_t* for BGRA.
uint32_t *argb_cache_; // Scratch buffer for temporary BGRA storage.
uint32_t* argb_cache_; // Scratch buffer for temporary BGRA storage.
VP8LBitReader br_;
int incremental_; // if true, incremental decoding is expected
@@ -86,8 +86,8 @@ struct VP8LDecoder {
// or'd bitset storing the transforms types.
uint32_t transforms_seen_;
uint8_t *rescaler_memory; // Working memory for rescaling work.
WebPRescaler *rescaler; // Common rescaler for all channels.
uint8_t* rescaler_memory; // Working memory for rescaling work.
WebPRescaler* rescaler; // Common rescaler for all channels.
};
//------------------------------------------------------------------------------
@@ -132,4 +132,4 @@ void VP8LDelete(VP8LDecoder* const dec);
} // extern "C"
#endif
#endif /* WEBP_DEC_VP8LI_DEC_H_ */
#endif // WEBP_DEC_VP8LI_DEC_H_
+1 -1
View File
@@ -130,4 +130,4 @@ int WebPAvoidSlowMemory(const WebPDecBuffer* const output,
} // extern "C"
#endif
#endif /* WEBP_DEC_WEBPI_DEC_H_ */
#endif // WEBP_DEC_WEBPI_DEC_H_
+1 -1
View File
@@ -24,7 +24,7 @@
#include "src/webp/format_constants.h"
#define DMUX_MAJ_VERSION 1
#define DMUX_MIN_VERSION 0
#define DMUX_MIN_VERSION 1
#define DMUX_REV_VERSION 0
typedef struct {
+2 -2
View File
@@ -214,7 +214,7 @@ static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first,
// Alpha detection
static int HasAlpha8b_SSE2(const uint8_t* src, int length) {
const __m128i all_0xff = _mm_set1_epi8(0xff);
const __m128i all_0xff = _mm_set1_epi8((char)0xff);
int i = 0;
for (; i + 16 <= length; i += 16) {
const __m128i v = _mm_loadu_si128((const __m128i*)(src + i));
@@ -228,7 +228,7 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) {
static int HasAlpha32b_SSE2(const uint8_t* src, int length) {
const __m128i alpha_mask = _mm_set1_epi32(0xff);
const __m128i all_0xff = _mm_set1_epi8(0xff);
const __m128i all_0xff = _mm_set1_epi8((char)0xff);
int i = 0;
// We don't know if we can access the last 3 bytes after the last alpha
// value 'src[4 * length - 4]' (because we don't know if alpha is the first
+6
View File
@@ -377,6 +377,7 @@ VP8SetResidualCoeffsFunc VP8SetResidualCoeffs;
extern void VP8EncDspCostInitMIPS32(void);
extern void VP8EncDspCostInitMIPSdspR2(void);
extern void VP8EncDspCostInitSSE2(void);
extern void VP8EncDspCostInitNEON(void);
WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) {
VP8GetResidualCost = GetResidualCost_C;
@@ -398,6 +399,11 @@ WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) {
if (VP8GetCPUInfo(kSSE2)) {
VP8EncDspCostInitSSE2();
}
#endif
#if defined(WEBP_USE_NEON)
if (VP8GetCPUInfo(kNEON)) {
VP8EncDspCostInitNEON();
}
#endif
}
}

Some files were not shown because too many files have changed in this diff Show More