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

Compare commits

...

2308 Commits

Author SHA1 Message Date
Vincent Rabaud fd2b5411e4 Fix potential NaN in cv::norm.
There can be an int overflow.
cv::norm( InputArray _src, int normType, InputArray _mask ) is fine,
not cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask ).
2021-06-15 21:21:21 +03:00
Alexander Alekhin dd66cccbbd OpenCV version '-openvino' 2021-06-10 16:51:21 +03:00
Alexander Alekhin cb97421edf Merge pull request #20257 from alalek:python_fix_extra_py_code_installation 2021-06-10 13:49:13 +00:00
Sergey Ivanov e461031d40 Merge pull request #20184 from sivanov-work:fix_gapi_empty_input
G-API: Add standalone fix for graph empty input

* Add sandalone fix for graph empty input

* Apply some review comments

* Fix whitespace

* Apply review comment: make Mat check more deeper

* Apply some comments

* Remove tracer apply exception throwing

* Apply comments: move validatio into gproto_priv.hpp

* Apply minor text correction

* Fix alignment, remove try-catch
2021-06-10 14:05:46 +03:00
Alexander Alekhin c82e4596e4 cmake: fix installation of python extra code 2021-06-10 13:51:30 +03:00
Alexander Alekhin 15ba3e123f Merge pull request #20250 from alalek:highgui_fixes 2021-06-09 13:28:33 +00:00
Ian Maquignaz 2db243b8ed Merge pull request #20247 from IanMaquignaz:inverseRectification_update
Update to initInverseRectificationMap()

* update to initInverseRectificationMap() documentation

* Restructured Calib3d_InitInverseRectificationMap unit test per feedback from alalek

* whitespace
2021-06-09 13:27:43 +00:00
Pinaev Danil b57b64b7a3 Merge pull request #20129 from aDanPin:dp/improvement_gapi_stereo_documentation
G-API: Improvement stereo documentation.

* Documentation improvement

* Set valid default values for gapi stereo

* Small doc fix

* Review response

* Review response

* Review response

* Review response

* Revie response

* Review response

* Review response

* Review response
2021-06-09 13:24:50 +00:00
Maxim Pashchenkov 8e386ac71f Merge pull request #20112 from mpashchenkov:mp/ocv-gapi-docs-part1
G-API: Documentation for Params (IE and ONNX).

* Applying comments

* Removed type of model from PramsDesc

* Added message for onnx ParamDesc

* Whitespaces

* Review

* Fix comments to review

* Fix comments

Co-authored-by: Anatoliy Talamanov <anatoliy.talamanov@intel.com>
2021-06-09 13:23:51 +00:00
Alexander Alekhin bc1af6227a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-09 10:58:37 +00:00
Alexander Alekhin 2b84c97a78 Merge pull request #20251 from alalek:python_sys_path_0_workaround 2021-06-09 10:58:18 +00:00
Alexander Alekhin 3ddf84534b Merge pull request #20248 from alalek:issue_20246 2021-06-09 10:52:16 +00:00
Dmitry Budnikov 4c2dff88de Merge pull request #20245 from dbudniko:dbudniko/mtcnn_roi_size_hotfix
Hot fix negative MTCNN PNet ROI coordinates

* fix negative roi start

* some more experiments

* clean up
2021-06-09 10:28:32 +00:00
Alexander Alekhin bd26104088 python(loader): add workaround to detect and patch sys.path[0] 2021-06-09 09:51:07 +00:00
Alexander Alekhin 80238880e6 highgui(gtk): fix initialization order of global objects 2021-06-09 09:04:29 +00:00
Alexander Alekhin f4abafb093 highgui: update error messages if no builtin backend 2021-06-09 08:39:50 +00:00
Alexander Alekhin 3e538355e2 highgui: force loading of imgcodecs module
- required for plugins on Linux (they use imwrite, but there is no link dependency)
2021-06-09 08:36:28 +00:00
Alexander Alekhin 5f80f43ff5 core: fix nSize initialization in cvIplImage() 2021-06-09 07:31:38 +00:00
Alexander Alekhin 76e9da3fe9 Merge pull request #20244 from alalek:update_ffmpeg_4.x 2021-06-08 19:23:25 +00:00
Alexander Alekhin cafa04f842 Merge pull request #20221 from komakai:java-at-function 2021-06-08 18:45:38 +00:00
Alexander Alekhin fef84f69ec Merge pull request #20220 from komakai:swift-at-function 2021-06-08 18:45:20 +00:00
Alexander Alekhin ba98cd97e5 videoio(test): skip AV1 HW tests
- FFMPEG: "[av1 @ 0000027ac07d1340] Your platform doesn't suppport hardware accelerated AV1 decoding."
2021-06-08 17:25:09 +00:00
Anna Prigarina 81b897c291 Merge pull request #20243 from APrigarina:fix_tracking_api
Tracking API: fix incorrect structure

* fix incorrect structure of best score id

* video(DaSiamRPN): specify sizes of scalar arrays
2021-06-08 15:46:57 +00:00
Alexander Alekhin 1c4d70896a Merge pull request #20138 from YashasSamaga:cuda4dnn-runtime-matmul 2021-06-08 14:47:17 +00:00
Alexander Alekhin 039bcd932a ffmpeg/4.x: update FFmpeg wrapper 2021.06
- FFmpeg 4.4
- libvpx 1.10.0
2021-06-08 14:18:24 +00:00
Alexander Alekhin eaa9228a4f Merge pull request #20242 from alalek:update_version_4.5.3-pre 2021-06-08 13:54:50 +00:00
Giles Payne a8757df963 Make Kotlin plugin version compatible with the Gradle version 2021-06-08 22:51:07 +09:00
Alexander Alekhin b221143c0f Merge pull request #20241 from alalek:fixup_20149 2021-06-08 13:44:58 +00:00
Alexander Alekhin 2c796de92b Merge pull request #20240 from alalek:fixup_20149_4.x 2021-06-08 13:44:24 +00:00
Vadim Pisarevsky 6f2a64a511 Merge pull request #20235 from IanMaquignaz:calib3d_update_hyperlinks 2021-06-08 13:27:12 +00:00
Alexander Alekhin 995841624c highgui(gtk): fix NULL ptr checks 2021-06-08 10:57:24 +00:00
Alexander Alekhin f5f675ef6c highgui(gtk): fix NULL ptr checks 2021-06-08 10:55:51 +00:00
Anatoliy Talamanov bdc8e9118b Merge pull request #20169 from TolyaTalamanov:at/doc-generic-type
[G-API] Generic type documentation

* Put doc about generic type

* Fix comments to review
2021-06-08 11:59:57 +03:00
Alexey Smirnov d9ed9a9a83 Merge pull request #20151 from smirnov-alexey:as/extend_media_frame
G-API: Extend MediaFrame to be able to extract additional info besides access

* Extend MediaFrame to be able to extract additional info besides access

* Add default implementation for blobParams()

* Add comment on the default blobParams()
2021-06-08 11:58:51 +03:00
Alexander Alekhin b57faa41c2 pre: OpenCV 4.5.3 (version++) 2021-06-08 08:52:20 +00:00
Alexander Alekhin 1b5fe91624 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-08 05:04:57 +00:00
Vadim Pisarevsky 1a305cadb3 Merge pull request #20165 from IanMaquignaz:inverseRectification 2021-06-08 01:44:57 +00:00
Alexander Alekhin bbcd06f42f Merge pull request #20236 from alalek:update_version_3.4.15-pre 2021-06-07 22:05:29 +00:00
JoeHowse 34183237ce Merge pull request #20203 from JoeHowse:clMath-patches
Fix dynamic loading of clBLAS and clFFT (formerly, clAmdBlas and clAmdFft)

* Fix dynamic loading of clBLAS and clFFT

* Update filenames and function names for clBLAS (formerly, clAmdBlas)

* Update filenames and function names for clFFT (formerly, clAmdFft)

* Uncomment teardown of clFFT; tear down clFFT in same way as clBLAS

* Fix generators for clBLAS and clFFT headers

* Update generators to parse recent clBLAS and clFFT library headers

* Update generators to be compatible with Python 3

* Re-generate OpenCV's clBLAS and clFFT headers

* Update function calls to match names in newly generated headers

* Disable (and comment on) teardown code for clBLAS and clFFT

* Renaming *clamd* files

* Renaming *clamdblas* files to *clblas*

* Renaming *clamdfft* files to *clfft*

* Update generator for CL headers

* Update generator to be compatible with Python 3
2021-06-07 20:24:27 +00:00
Alexander Alekhin 286ec92967 Merge pull request #20027 from diablodale:fix19807-UMat-usageFlags 2021-06-07 20:20:13 +00:00
Alexander Alekhin 43940f7ffc pre: OpenCV 3.4.15 (version++) 2021-06-07 20:10:34 +00:00
Ian Maquignaz b05631432b Added declaration, definition and unit test for initInverseRectificationMap()
Fixed trailing whitespace

Update to initInverseRectificationMap documentation for clarity

Added test case for initInverseRectificationMap()
Updated documentation.

Fixed whitespace error in docs

Small update to test function
Now passes success_error_level

final update to inverseRectification documentation
2021-06-07 16:01:11 -04:00
Ian Maquignaz dc92886ab6 Added markup to enable hyperlinking of functions in calib3d documentation
fixed find*, calibrate*, stereo*

fixed decompose*, convert*

Fixed recoverPose, and projectPoints

Fixed typo in docs which resulted in a docs warning
2021-06-07 15:52:22 -04:00
Alexander Alekhin 993416d9cf Merge pull request #20229 from alalek:fix_highgui_build 2021-06-07 17:36:44 +00:00
jogo- f4a79b0554 Merge pull request #20223 from jogo-:3.4_wp8_samples_typos
* Fix typo in App.xaml.cs

* Fix typo in App.xaml.cs

* Fix typo in App.xaml.cs
2021-06-07 17:32:14 +00:00
Alexander Alekhin 327109f327 highgui: update backends handling, fix WITH_OPENGL=ON build 2021-06-07 11:28:05 +00:00
Giles Payne f1f9121bc7 Add test for Java Mat.at 2021-06-06 20:09:13 +09:00
Giles Payne 3b42e19505 At-like function for Java/Kotlin 2021-06-06 20:09:13 +09:00
Giles Payne 709156ee65 Add tests for Mat.at function 2021-06-06 19:34:48 +09:00
Giles Payne 472030907b At-like function for Swift 2021-06-06 19:34:48 +09:00
Alexander Alekhin 61e30c15a9 Merge pull request #20211 from kstuedem:fix_dshow_memory_leak 2021-06-05 16:02:12 +00:00
Alexander Alekhin d332f33346 Merge pull request #20210 from kstuedem:fix_invalid_media_type 2021-06-05 16:01:51 +00:00
Kai Stüdemann 636db09d73 videoio(dshow) fix incompatible media type left set on video device 2021-06-04 10:45:39 +02:00
Kai Stüdemann 64c018507b videoio(dshow) fix memory leak 2021-06-04 10:02:48 +02:00
Alexander Alekhin 3e513ee6ab Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-06-03 16:23:36 +00:00
Alexander Alekhin c34445a496 Merge pull request #20201 from PolarNick239:3.4 2021-06-03 16:20:24 +00:00
Dale Phurrough c2ce3d927a UMat usageFlags fixes opencv/opencv#19807
- corrects code to support non- USAGE_DEFAULT settings
- accuracy, regression, perf test cases
- not tested on the 3.x branch
2021-06-03 16:33:03 +02:00
Paul Jurczak ff60abb575 Merge pull request #20080 from pauljurczak:patch-3
* Update dnn.hpp

getPerfProfile is not supported by the CUDA backend, see https://github.com/opencv/opencv/issues/20077

* dnn.hpp: fix doxygen formatting
2021-06-02 19:15:52 +00:00
Alexander Alekhin 7d91dfe339 Merge pull request #20146 from asmorkalov:as/java_test_filter 2021-06-02 17:50:29 +00:00
Alexander Alekhin 15af65d4cf Merge pull request #20149 from rogday:on_mouse_floor 2021-06-02 17:48:43 +00:00
Alexander Alekhin 0e8431d17b Merge pull request #20194 from mshabunin:doc-plugins 2021-06-02 16:36:40 +00:00
Alexander Alekhin 81afeda537 Merge pull request #20192 from alalek:update_libjpeg-turbo 2021-06-02 16:30:25 +00:00
Alexander Alekhin e10de25e86 Merge pull request #20191 from alalek:issue_20032 2021-06-02 16:29:51 +00:00
Dmitry Budnikov 826fdaf06c Merge pull request #20189 from dbudniko:dbudniko/mtcnn_sample_with_regular_transpose_kernel
Remove custom transpose kernel from MTCNN sample
2021-06-02 16:26:22 +00:00
Maksim Shabunin a4d0a1483a docs/tutorials: improve plugin sections 2021-06-02 16:18:22 +03:00
Nikolay Polyarniy 746bd47ce5 EXR reading: support Z channel if no Y channel 2021-06-02 15:53:32 +03:00
Alexander Alekhin dcb4cabb26 3rdparty: libjpeg-turbo 2.0.6 => 2.1.0
https://github.com/libjpeg-turbo/libjpeg-turbo/releases/tag/2.1.0
2021-06-01 20:01:19 +00:00
Alexander Alekhin 59b4baee0c ts: migrate from cgi.escape to html.escape in .py file 2021-06-01 19:19:05 +00:00
Maxim Pashchenkov 2610724ee0 Merge pull request #20157 from mpashchenkov:mp/ocv-gapi-pnetworks
G-API: Python. Wrapper for networks.

* Python networks

* Added pyopencv_to

* Changed work with pyopencv_to
2021-06-01 14:42:44 +00:00
rogday 61359a5bd0 Merge pull request #20175 from rogday:dnn_samples_cuda
add cuda and vulkan backends to dnn samples
2021-06-01 14:00:51 +00:00
Alexander Alekhin bb3bbd192b Merge pull request #20150 from rogday:svm_detector_test 2021-06-01 13:31:12 +00:00
Alexander Alekhin de781b306f Merge pull request #20187 from alalek:highgui_plugins_cleanup 2021-06-01 13:16:23 +00:00
Alexander Smorkalov 1212aef03b Analog of gtest_filter for java tests. 2021-06-01 11:04:18 +03:00
Developer-Ecosystem-Engineering 814550d2a6 Merge pull request #20011 from Developer-Ecosystem-Engineering:3.4
Improve performance on Arm64

* Improve performance on Apple silicon

This patch will
- Enable dot product intrinsics for macOS arm64 builds
- Enable for macOS arm64 builds
- Improve HAL primitives
  - reduction (sum, min, max, sad)
  - signmask
  - mul_expand
  - check_any / check_all

Results on a M1 Macbook Pro

* Updates to #20011 based on feedback

  - Removes Apple Silicon specific workarounds
  - Makes #ifdef sections smaller for v_mul_expand cases
  - Moves dot product optimization to compiler optimization check
  - Adds 4x4 matrix transpose optimization

* Remove dotprod and fix v_transpose

Based on the latest, we've removed dotprod entirely and will revisit in a future PR.

Added explicit cats with v_transpose4x4()

This should resolve all opens with this PR

* Remove commented out lines

Remove two extraneous comments
2021-06-01 09:39:55 +03:00
Anna Prigarina 478663b08c Merge pull request #20036 from APrigarina:tracking_api
Tracking API: added DaSiamRPN tracker

* added dasiamrpn tracker

* dasiamrpn: add test, rewrite sample

* change python samples

* fix tests

* fix params
2021-05-31 20:23:37 +00:00
Alexander Alekhin fb9a00c36d highgui: cleanup and fixes 2021-05-31 17:03:53 +00:00
Smirnov Egor fb68fe8930 bring back bounds check and switch to floor 2021-05-31 19:03:50 +03:00
Alexander Alekhin 73ee01a7f4 Merge pull request #20182 from hanliutong:master 2021-05-31 09:21:46 +00:00
Danny eb9b5fa9a5 Merge pull request #20054 from danielenricocahall:fix-robertson-calibration-bug
Fix Robertson Calibration NaN Bug

* add epsilon value for numerical stability in robertson merge

* update test to use range based for loop

* add comment to test

* move the epsilon

* address test comments

fix windows build warnings

fix vector type for tests

update tests

make threshold float

address test comments

fix tests and move epsilon again

* use scalar::all, move epsilon, and remove print
2021-05-30 23:29:39 +03:00
HAN Liutong 8bd5405228 Fix RVV toolchain conflicts. 2021-05-30 16:00:18 +08:00
Alexander Alekhin cb51a155b2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-05-29 19:00:14 +00:00
yo1990 d3be58b6d7 Merge pull request #20102 from yo1990:master
Add missing sqrt to magSpectrum().

* https://github.com/opencv/opencv/issues/20100

* slight optimization + fix for double-precision case

Co-authored-by: Yuma Oyama <yuma.oyama@acuity-inc.co.jp>
Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@me.com>
2021-05-29 17:43:21 +03:00
Jonathan Deakin 8ecfbdb4ff Merge pull request #19883 from jondea:arm-neon-optimised-color-lab-3.4
* Add Neon optimised RGB2Lab conversion

* Fix compile errors, change lambda to macro

* Change NEON optimised RGB2Lab to just use HAL

* Change [] to v_extract_n in RGB2Lab

* RGB2LAB Code quality, change to nlane agnostic

* Change RGB2Lab to use function rather than macro

* Remove whitespace

Co-authored-by: Francesco Petrogalli <25690309+fpetrogalli@users.noreply.github.com>
2021-05-28 14:20:26 +00:00
Alexander Alekhin 63256a00ff Merge pull request #20174 from alalek:issue_20159 2021-05-28 14:10:17 +00:00
Alexander Alekhin 450dc92452 Merge pull request #20172 from alalek:fixup_19334 2021-05-28 14:09:52 +00:00
Alexander Alekhin 9c16408e91 Merge pull request #20173 from alalek:videoio_test_vp9_skip 2021-05-28 09:57:43 +00:00
Alexander Alekhin d42a2b2d16 videoio(test): bailout from VP9 tests if first frame can't be read 2021-05-28 02:05:45 +00:00
Alexander Alekhin 3d2f4fa164 highgui: fix trackbar value pointer handling 2021-05-28 01:58:58 +00:00
Alexander Alekhin 3d394943e6 core(ocl): avoid limit of Image kernel args 2021-05-28 00:43:59 +00:00
Dmitry Budnikov cf96a9fd27 Merge pull request #20155 from dbudniko:dbudniko/G-API_mtcnn_demo_queue_option
Add streaming queue capacity option choice to MTCNN G-API sample

* Add streaming queue capacity option

* trying to fix mac build

* rename face detection sample
2021-05-27 18:50:13 +03:00
Alexander Alekhin 76e81dfbb0 Merge pull request #20164 from mshabunin:fix-gtk-check 2021-05-27 07:10:29 +00:00
Maksim Shabunin 684ba6fe14 highgui: fix config verification for GTK 2021-05-26 19:59:36 +03:00
Alexander Alekhin 830cb5cad7 Merge pull request #20116 from alalek:highgui_backends 2021-05-26 08:32:14 +00:00
Alexander Alekhin 3e25f32c9b Merge pull request #20158 from hyrodium:fix/latex 2021-05-26 06:31:05 +00:00
hyrodium 81567a9d3e fix latex script in the docs 2021-05-26 12:46:14 +09:00
Sergey Ivanov 2b06208bbd Merge pull request #20107 from sivanov-work:gapi_transpose_op
G-API: Add transpose operation

* Add kernels decl & def

* Add draft for UT

* Fix UT for Transpose

* Add perf test

* Fix docs

* Apply comments
2021-05-25 20:36:01 +03:00
damonyu1989 5f637e5a02 Merge pull request #19778 from damonyu1989:master-riscv-0.7.1
* Add the support for riscv64 vector 0.7.1.

* fixed GCC warnings

* cleaned whitespaces

* Remove the worning by the use of internal API of compiler.

* Update the license header.

* removed trailing whitespaces

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@me.com>
Co-authored-by: yulj <linjie.ylj@alibaba-inc.com>
Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2021-05-25 20:15:12 +03:00
Vadim Pisarevsky cc712a165d Merge pull request #19689 from andy-held:umeyama 2021-05-25 13:18:21 +00:00
Vadim Pisarevsky 4a2adba8f4 Merge pull request #20135 from mightbxg:bugfix_GaussianBlur 2021-05-25 12:54:56 +00:00
Smirnov Egor 84f78059d3 add reproducer and bugfix 2021-05-25 11:28:23 +03:00
Anatoliy Talamanov b67c0e5f4a Merge pull request #20119 from TolyaTalamanov:at/compile-arg-for-queue-capacity
* Support queue capacity as graph compilation argument

* Fix comments to review

* Fix comments to review

* Fix comments to review
2021-05-24 18:48:23 +00:00
Ilya Lavrenov 1e1ddd3279 Merge pull request #20026 from ilya-lavrenov:inference-engine-version-from-cmake
* Extract IE version from IE cmake config

* Update cmake/OpenCVDetectInferenceEngine.cmake

Co-authored-by: Maksim Shabunin <maksim.shabunin@gmail.com>
2021-05-24 16:19:07 +00:00
Alexander Alekhin 70f69cb265 highgui: backends and plugins 2021-05-24 16:12:02 +00:00
Alexander Alekhin ae4cc404c1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-05-23 21:21:48 +00:00
YashasSamaga 32df5faa25 add MatMulOp 2021-05-22 01:01:29 +05:30
Alexander Alekhin ac8e7d57dc Merge pull request #20137 from fpetrogalli:move-option 2021-05-21 18:56:23 +00:00
Francesco Petrogalli da4a531717 [build] Move OPENCV_DISABLE_FILESYSTEM_SUPPORT. [NFC]
The option as been moved away from python-related options.
2021-05-21 12:50:08 +00:00
Alexander Alekhin fea12f7806 Merge pull request #19987 from daksayli:stitching_detailed_branch 2021-05-21 11:01:13 +00:00
Xinguang Bian 7499a15c92 fix data overflow problem in GaussianBlur 2021-05-21 15:17:20 +08:00
HattrickGenerator 115e471515 Merge pull request #19967 from HattrickGenerator:master
* Adding functions rbegin() and rend() functions to matrix class.
This is important to be more standard compliant with C++ and an ever increasing number of people using standard algorithms for better code readability- and maintainability.

The functions are copy pated from their counterparts (even though they should probably call the counterparts but this gave me some troube).
They return iterators using std::reverse_iterators

Follow up of an open feature request:
https://github.com/opencv/opencv/issues/4641

* Fix rbegin() and rend() and provide tests for them

* Removing unnecessary whitespaces

* Adding rbegin and rend to Mat_ class with the right parameters so we don't need to repeat the template argument.
An instantiating cv::Mat_<int> for example can call it's rbegin() function and doesn't need rbegin<int>() with this convience addition.

Follows what is done for forward iterators

* static cast the vector size (return size_t) to an int (that is required for opencv mat constructor)

Co-authored-by: Stefan <stefan.gerl@tum.de>
2021-05-20 19:21:34 +00:00
Anatoliy Talamanov c4df8989e9 Merge pull request #19982 from TolyaTalamanov:at/new-python-operation-api
G-API: New python operations API

* Reimplement test using decorators

* Custom python operation API

* Remove wip status

* python: support Python code in bindings (through loader only)

* cleanup, skip tests for Python 2.x (not supported)

* python 2.x can't skip unittest modules

* Clean up

* Clean up

* Fix segfault python3.9

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-05-20 18:59:53 +00:00
Alexander Alekhin 0f11b1fc0d Merge pull request #20086 from rogday:vtk9_world 2021-05-19 14:25:14 +00:00
Alexander Alekhin 5f4e55bc68 Merge pull request #20123 from catree:fix_tsai_park_bib_render 2021-05-19 14:19:53 +00:00
catree c621384707 Use correct BibTeX syntax for month field. 2021-05-19 14:24:07 +02:00
thezane c0162a64d1 Merge pull request #20103 from thezane:make-div-spectrums-public
* Make divSpectrums public

* Add unit test
2021-05-19 12:14:11 +03:00
Maksym Ivashechkin 527d86a93d Merge pull request #20012 from ivashmak:bugfix_solvepnp
* fix inliers in solvePnPRansac

* fix inliers in test_usac

* fix inliers in test_usac
2021-05-19 12:09:46 +03:00
Alexander Alekhin 7d66f1e391 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-05-18 18:06:26 +00:00
Giles Payne 6265155ce4 Merge pull request #20092 from komakai:disable_swift_build
Fixes for Swift troubles

* Remove NS_SWIFT_NAME override for Point, Rect, and Size due to Darwin namespace conflict

* Fix swift_type overrides in objc generator

* Add backwards compatibility Swift typealiases for Point, Rect, Size

* Add disable-swift build option to iOS/macOS builds

* Add import directive to swift source when building with disable-swift

Co-authored-by: Chris Ballinger <cballinger@rightpoint.com>
2021-05-18 17:10:51 +03:00
Anatoliy Talamanov 70d1ff7155 Merge pull request #20106 from TolyaTalamanov:at/auto-convert-fp16
[G-API] IE backend convert fp32 to fp16

* Support FP16 in IE backend
2021-05-18 13:54:38 +00:00
Dmitry Budnikov 4753206783 Merge pull request #20065 from dbudniko:dbudniko/G-API_mtcnn_demo_PR_hotfix2
G-API MTCNN demo hotfix to align overall pipeline accuracy with the reference Python code output.

* MTCNN G-API demo aligned with Python from OMZ

* clean up

* more comments from Maxim are addressed.

* address comment from Dmitry
2021-05-18 10:58:08 +00:00
Smirnov Egor 6376a3aef2 vtk 9.0 autoinit fix 2021-05-18 10:20:54 +03:00
Alexander Alekhin 1ae16beb06 Merge pull request #20097 from komakai:fix_qrcode_test 2021-05-17 17:53:35 +00:00
Giles Payne e53a4ce64d Fix for failing QRCodeDetectorTest.testDetectAndDecodeMulti test 2021-05-17 20:09:12 +09:00
Alexander Alekhin 72655a9eea Merge pull request #20085 from changh95:fix_typo_calib3d_sample_code 2021-05-17 07:26:51 +00:00
Alexander Alekhin 125f890dc3 Merge pull request #20088 from alalek:cmake_module_linker_flags 2021-05-17 07:26:25 +00:00
changh95 101d50703c fix typo 'undistorsed'->'undistorted' 2021-05-16 15:08:37 +09:00
Alexander Alekhin 901ed5545f cmake: fix handling of CMAKE_MODULE_LINKER_FLAGS 2021-05-14 17:47:00 +00:00
Mikhail Nikolskii a604d44d06 Merge pull request #19755 from mikhail-nikolskiy:ffmpeg-umat
cv::UMat output/input in VideoCapture/VideoWriter (data stays in GPU memory)

* FFMPEG with UMat input/output

* OpenCL_D3D* context

* fix Linux build

* cosmetic changes

* fix build if USE_AV_HW_CODECS=0

* simplify how child context pointer stored in parent context

* QSV interop with OpenCL on Windows

* detect_msdk.cmake via pkg-config

* fix av_buffer_ref() usage

* revert windows-decode-mfx whitelisting; remove debug msg

* address review comments

* rename property to HW_ACCELERATION_USE_OPENCL

* fix issue with "cl_khr_d3d11_sharing" extension not reported by OpenCL GPU+CPU platform

* core(ocl): add OpenCL stubs for configurations without OpenCL

* videoio(ffmpeg): update #if guards

* Put OpenCL related code under HAVE_OPENCL; simplify reuse of media context from OpenCL context

* videoio(test): skip unsupported tests

- plugins don't support OpenCL/UMat yet
- change handling of *_USE_OPENCL flag

* videoio(ffmpeg): OpenCL dependency

* videoio(ffmpeg): MediaSDK/oneVPL dependency

* cleanup, logging

* cmake: fix handling of 3rdparty interface targets

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-05-14 16:48:50 +00:00
Alexander Alekhin bb92eb5a93 Merge pull request #20082 from jiangjiajun:master 2021-05-14 10:56:26 +00:00
Alexander Alekhin 699b4b9fc5 Merge pull request #20071 from rogday:depth_fallback_doc 2021-05-14 06:09:09 +00:00
jiangjiajun 1fb3133ec5 Update requirements and README for PaddlePaddle sample 2021-05-14 03:35:44 +00:00
Jason fea45c6911 Merge pull request #19976 from jiangjiajun:master
* Added PaddlePaddle classification model conversion case

* Modify cv2 import as cv

* Modify documents in dnn_conversion/paddlepaddle

* Modify documents in dnn_conversion/paddlepaddle
2021-05-13 21:59:41 +03:00
Smirnov Egor 1d7d18afba Document imwrite depth fallback 2021-05-12 19:55:58 +03:00
Alexander Alekhin aadbebf9d8 Merge pull request #20068 from TolyaTalamanov:at/disable-iebackend-autofusing 2021-05-12 11:24:50 +00:00
Anatoliy Talamanov 7e12af2448 Disable auto fusing in ie backend 2021-05-12 09:02:17 +03:00
Alexander Alekhin b335fe67b0 Merge pull request #20049 from jstaahl:jstaahl-static-inits 2021-05-11 17:06:11 +00:00
Alexander Alekhin 776d92e797 Merge pull request #20045 from blackliner:master 2021-05-11 16:57:03 +00:00
Alexander Alekhin dde029f105 Merge pull request #20053 from berak:core_mat_ptr_vec 2021-05-11 16:34:03 +00:00
Alexander Alekhin 7ffc02283b Merge pull request #20010 from fpetrogalli:disable_filesystem 2021-05-11 16:15:56 +00:00
Francesco Petrogalli 7a31a6edee [build][option] Build option to disable filesystem support. 2021-05-11 12:54:54 +00:00
Alexander Alekhin df05bc65c5 Merge pull request #19917 from AsyaPronina:asyadev/itt_traces_in_gstreamingexecutor 2021-05-11 14:44:59 +03:00
Anastasiya Pronina 3a49ff9e72 Added ITT traces to GStreamingExecutor 2021-05-11 12:52:47 +03:00
berak 302c2354a3 core: add missing implementation for Mat::ptr(Vec) 2021-05-09 14:15:12 +02:00
Jake Staahl 158b13e0ba Remove static initializers caused by templated static member. 2021-05-07 12:53:14 -07:00
Florian Berchtold 71e2a17fdb Update CMakeLists.txt 2021-05-07 15:49:24 +02:00
Alexander Alekhin b1dc7ed873 Merge pull request #20033 from berak:dnn_openpose_py 2021-05-07 12:42:16 +00:00
berak 1bced43e96 samples/dnn: better errormsg in openpose.py 2021-05-05 10:39:12 +02:00
Alexander Alekhin 7de627c504 Merge pull request #20019 from r2d3:cudaStreamCreate_bug 2021-05-01 18:32:46 +00:00
David Geldreich 6a4bfc0863 Stream default to Stream::Null() when no default in function prototype
this corrects bug #16592 where a Stream is created at
each GpuMat::load(arr,stream) call

a correct solution would have been to add a default to GpuMat::load
but due to circular dependence between Stream and GpuMat, this is not possible
add test_cuda_upload_download_stream to test_cuda.py
2021-05-01 10:03:28 +00:00
Alexander Alekhin 170bf6d7af Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-05-01 09:44:24 +00:00
Alexander Alekhin 8550f7e04d Merge pull request #20018 from lpea:doc_fixes_calib3d 2021-05-01 09:35:59 +00:00
Guillaume Jacob 9f3e83baf6 calib3d: Update documentation of calibrateCamera
- Added missing documentation for the CALIB_FIX_FOCAL_LENGTH flag
- Removed erroneous information about the number of distortion coefficients
returned
- Added some missing @ref tags
2021-04-30 20:34:04 +02:00
Alexander Alekhin 17ab61a40d Merge pull request #19956 from danielenricocahall:fix-edge-case-matcher-loop 2021-04-30 17:22:16 +00:00
Danny 1b844f8413 Merge pull request #19993 from danielenricocahall:fix-compute-ecc-issue
Fix unsigned int bug in computeECC

* address issue with unsigned ints in computeEcc

* remove additional logic checking firstOctave

* use swap instead of same src/dst

* simplify the unsigned check logic
2021-04-30 17:20:52 +00:00
Alexander Alekhin baa22fa808 Merge pull request #20006 from alalek:dnn_ie_gpu_cache_dir 2021-04-30 17:18:52 +00:00
Alexander Alekhin f78cebfc98 Merge pull request #20014 from alalek:fix_core_tls_process_termination 2021-04-30 16:06:40 +00:00
Alexander Alekhin d2a9ca13f1 core(tls): handle process termination / cleanup issues 2021-04-29 23:25:44 +00:00
Alexander Alekhin 71bae7c23f dnn(ie): implicit usage of IE::GPU OpenCL kernels cache 2021-04-29 12:43:22 +03:00
Alexander Alekhin 1dacea3a20 Merge pull request #19998 from asmorkalov:as/openexr_version_check 2021-04-29 09:13:46 +00:00
Alexander Smorkalov 083a7c8f0a Fix OpenCV build with OpenEXR before 2.2.0. 2021-04-29 09:50:30 +03:00
Alexander Alekhin d4f104f17f Merge pull request #19988 from alexkalmuk:fix-squares-cpp-sample 2021-04-28 22:03:14 +00:00
Alexander Alekhin fd44ba296d Merge pull request #19984 from sturkmen72:patch-4 2021-04-28 22:02:02 +00:00
Andreas Franek 4ed91ce7ed add estimateAffine3D overload that implements Umeyama's algorithm 2021-04-28 11:33:48 +02:00
Alex Kalmuk b04d6a2d9b Fix squares sample failure when a single file passed 2021-04-28 09:36:04 +03:00
Alexander Alekhin 15e2f991dd Merge pull request #19962 from mshabunin:one-vpl-support 2021-04-27 18:40:57 +00:00
Alexander Alekhin a08eac452e Merge pull request #19979 from micha137:patch-3 2021-04-27 13:31:05 +00:00
Alexander Alekhin 0c171c0749 Merge pull request #19971 from TolyaTalamanov:at/infer-hangs-fix 2021-04-27 10:58:13 +00:00
micha137 7021ea6748 Fix link 2021-04-27 11:22:07 +02:00
deniz.aksayli dbd65a3b01 fix seam finder 2021-04-27 11:10:41 +03:00
Alexander Alekhin 55aa1d4852 Merge pull request #19975 from danielenricocahall:fix-template-matcher-sqdiff 2021-04-26 22:52:13 +00:00
Antonio Rojas 971dacaf41 Merge pull request #19970 from antonio-rojas:master
Support building with OpenEXR 3.x

* Support OpenEXR 3.0

Try to find OpenEXR 3.0 using the upstream cmake config, and fallback to the previous algorithm if not found

* Add explicit ImfFrameBuffer.h include

This was transitively included with OpenEXR 2.x, but that's no longer the case with OpenEXR 3.x
2021-04-26 22:13:59 +00:00
Suleyman TURKMEN 159534313e Update CMakeLists.txt 2021-04-26 22:43:04 +03:00
Alexander Alekhin 2f68c43e39 Merge pull request #19983 from hartmannathan:typo-fix-download 2021-04-26 19:25:56 +00:00
Nathan Hartman e2483aa072 Fix typo: 'DOWNLAOD' to 'DOWNLOAD' 2021-04-26 11:01:13 -04:00
Lukas-Alexander Weber 6c53af8e41 Merge pull request #19931 from lukasalexanderweber:patch-1
Stitching Detailed Tutorial Improvements

* Add Vertical Wave Correction

The user has the possibility to pass "vert" as wave_correct parameter. However, in the code "cv.detail.WAVE_CORRECT_HORIZ" ist fixed. This change proposes changes so that the wave correction is done vertically if the user passes "vert" as wave_correct parameter. The variable "do_wave_correct" is replaced by None which is passed to the variable "wave_correct" if the user chooses "no" for wave correction.

* Correct fixed conf_thresh

According to the documentation, [cv.detail.leaveBiggestComponent](https://docs.opencv.org/4.5.1/d7/d74/group__stitching__rotation.html#ga855d2fccbcfc3b3477b34d415be5e786) takes features, the pairwise_matches and the conf_threshold as input.
In the tutorial, however, conf_threshold is fixed at 0.3 even though the user can pass conf_thresh as parameter which is 1 by default. Fixing this parameter at 0.3 causes the script to include images into the panorama which are not part of it.
2021-04-26 14:47:50 +00:00
Maksim Shabunin c4ca9a7bae Initial oneVPL support 2021-04-26 17:42:20 +03:00
Alexander Alekhin c69f37343c Merge pull request #19980 from zchrissirhcz:fix-CV_XADD-missing-return-type 2021-04-26 14:10:51 +00:00
Alexander Alekhin aec62a7fc5 Merge pull request #19969 from alalek:issue_19850 2021-04-26 13:23:29 +00:00
Zhuo Zhang bf26050f7e Fix missing return type for unsafe CV_XADD function 2021-04-26 20:08:45 +08:00
danielenricocahall 402bce1a31 address template matching sqdiff bug 2021-04-25 22:17:07 -04:00
Alexander Alekhin e68657cdb2 Merge pull request #19934 from alalek:videoio_plugin_query_api 2021-04-24 18:13:05 +00:00
Anatoliy Talamanov e00cfe067d Fix infer hanging 2021-04-24 18:02:35 +03:00
Alexander Alekhin 8868350888 doxygen: fix quotes in add_toggle macro 2021-04-23 22:31:04 +00:00
Harald Scheirich fcaeeac931 Merge pull request #19780 from HarryDC:feature/index-multiimage-tiff
Add reading of specific images from multipage tiff

* Add reading of specific images from multipage tiff

* Fix build issues

* Add missing flag for gdal

* Fix unused param warning

* Remove duplicated code

* change public parameter type to int

* Fix warnings

* Fix parameter check
2021-04-23 20:48:32 +00:00
Dmitry Budnikov a53582d706 Merge pull request #19923 from dbudniko:dbudniko/G-API_mtcnn_demo_PR
G-API MTCNN sample

* add face detection demo

* clean up

* enable back accumulate

* additional input

* meta args workaround

* additional arg

* add init

* roll back

* fix shadowing

* roll back

* clean up and PNet copy from debug branch which now works

* try nets operator

* more clean up

* more clean up

* add 6 layers pyramid experimental code

* final clean up and ready for PR

* original image resize

* Remove Pnet declarations. Generic infer is used now.

* scales and sizes calculation added

* fix assert, and add ceil to size calculation

* try doubles for scales

* Address comments from Dmitry.

* use half scale option

* fix half scale

* clean up debug outputs

* try to get input image width and height

* clean up

* trailing spaces and review from Maxim

* more comments from Maxim are addressed

* try to fix warnings

* try to fix warnings and address more comments from Dmitry

* crop fix and clean up

* more warnings fixes

* more warnings fixes

* more comments from Maxim are addressed

* even more consts

* copy_n for regressions

* address more comments from Dmitry

* more comments from Maxim
2021-04-23 10:26:53 +00:00
Alexander Alekhin e655083e3c Merge pull request #19937 from Mstrodl:fix/cmake-version-change 2021-04-22 18:21:03 +00:00
Stefano Allegretti 1b64851fa8 Merge pull request #19951 from stal12:3.4
* Fix #4363 - wrong hierarchy (CV_RETR_TREE) in findContours

* Add regression test for findContours

* use C++11 => C++98 on 3.4 branch
2021-04-22 18:20:12 +00:00
Alexander Alekhin 40a7c70969 Merge pull request #19959 from QuellaZhang:quella/c++20 2021-04-21 18:45:37 +00:00
Aleksandr Voron 2e143b8799 Merge pull request #19961 from alvoron:dnn_ngraph_int64_fix
Explicit usage of int64_t in CropAndResizeLayer (IE backend)

* Update crop_and_resize_layer.cpp
2021-04-21 18:29:19 +00:00
Quella Zhang (Beyondsoft Corporation) 5105a937d1 Add namespace specifier for format() 2021-04-21 14:08:52 +08:00
danielenricocahall 3930c9a492 fix loop boundary condition 2021-04-20 22:08:01 -04:00
Alexander Alekhin 29fb4f98b1 Merge pull request #19942 from berak:calib3d_fix_usac_mask 2021-04-20 19:49:20 +00:00
Alexander Alekhin f0839d2703 Merge pull request #19944 from berak:patch-1 2021-04-20 17:16:52 +00:00
berak 405e820fe1 Update contrast_preserve.hpp
fix a build warning:

```
C:\Slave\workspace\precommit\windows10\opencv\modules\photo\src\contrast_preserve.hpp(289): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data
        with
        [
            _Tp=float
        ]
C:\Slave\workspace\precommit\windows10\opencv\modules\photo\src\contrast_preserve.hpp(361): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data
        with
        [
            _Tp=float
        ]
```

(from https://build.opencv.org.cn/job/precommit/job/windows10/1633/console)
2021-04-20 12:59:36 +02:00
berak 3386efddba calib3d: fix masks for usac 2021-04-20 11:57:42 +02:00
Mary Strodl c41650db20 CMakeLists: remove extraneous checks, minimum required version is 3.5.1 2021-04-19 21:01:37 -04:00
Alexander Alekhin a0ff55db7d Merge pull request #19928 from alalek:cmake_videoio_fix_handling_of_disabled_plugins 2021-04-19 19:05:31 +00:00
Alexander Alekhin 896bffb543 videoio(plugin): add query API for plugins 2021-04-19 14:25:45 +00:00
Alexander Alekhin 0df6159149 cmake: fix handling of VIDEOIO_ENABLE_PLUGINS=OFF 2021-04-19 02:12:25 +00:00
Alexander Alekhin cfb77091ca Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-15 20:50:26 +00:00
Alexander Alekhin 6598e9d506 Merge pull request #19908 from CSBVision:patch-2 2021-04-15 20:45:30 +00:00
Alexander Alekhin 8c2cf89845 Merge pull request #19913 from mshabunin:fix-san-build 2021-04-15 11:15:37 +00:00
Maksim Shabunin aeb8dfc52d Fix header sorting for modules without headers 2021-04-15 12:13:15 +03:00
Alexander Alekhin 0649a2fbdb Merge pull request #19886 from alalek:issue_19875 2021-04-14 16:14:44 +00:00
CSBVision ec32061f5f Update __init__.py to support symbolic links
Currently, the LOADER_DIR is set as os.path.dirname(os.path.abspath(__file__)). This does not point to the true library path if the cv2 folder is symlinked into the Python package directory such that importing cv2 under Python fails. The proposed change only resolves symbolic links correctly by calling os.path.realpath(__file__) first and does not change anything if __file__ contains no symbolic link.
2021-04-14 16:13:45 +00:00
Alexander Alekhin f2da1a0a7a Merge pull request #19900 from berak:doc_fix_python_retval 2021-04-13 17:38:07 +00:00
Alexander Alekhin fda1e6f148 Merge pull request #19901 from alalek:ml_update_checks 2021-04-13 15:47:01 +00:00
berak 2a48730166 docs:fix python retvals 2021-04-13 15:48:31 +02:00
Alexander Alekhin 0bdbc745c4 ml: update checks 2021-04-13 11:09:14 +00:00
Alexander Alekhin 6f70b0524a Merge pull request #19894 from alalek:fix_ml_tree_legacy_import 2021-04-12 20:33:34 +00:00
Alexander Alekhin b9b19185bc ml: fix legacy import in DTreesImpl 2021-04-12 19:21:48 +00:00
Alexander Alekhin 63ba9970bd Merge pull request #19851 from sturkmen72:update_documentation 2021-04-11 21:44:03 +00:00
Alexander Alekhin 1f726e81f9 Merge pull request #19881 from AndreiCostinescu:patch-1 2021-04-09 16:57:13 +00:00
Danny a9a6801c6d Merge pull request #19884 from danielenricocahall:fix-prediction-features-bug
Fix bug with predictions in RTrees/Boost

* address bug where predict functions with invalid feature count in rtrees/boost models

* compact matrix rep in tests

* check 1..n-1 and n+1 in feature size validation test
2021-04-09 16:56:14 +00:00
Alexander Alekhin 222af8e7e4 core: avoid process cleanup deadlock if TlsStorage is not used 2021-04-09 16:08:08 +00:00
Andrei Costinescu df71853075 Update text in linux_install.markdown 2021-04-09 07:17:20 +02:00
Alexander Alekhin bfb10d74eb Merge pull request #19873 from crackwitz:issue-19870 2021-04-08 21:55:53 +00:00
Suleyman TURKMEN ec8b7c933a Update Documentation 2021-04-08 22:29:45 +03:00
Alexander Alekhin 68d15fc62e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-08 11:23:24 +00:00
Christoph Rackwitz f479935cda fix for #19870
HAVE_QT and HAVE_WIN32UI can both be true at the same time
if HAVE_QT, window_w32.cpp is not included in the build, see CMakeLists.txt
2021-04-08 12:59:06 +02:00
Danny 76860933f0 Merge pull request #19859 from danielenricocahall:fix-blob-detector-single-thresh
Fix Single ThresholdBug in Simple Blob Detector

* address bug with using min dist between blobs in blob detector

cast type in comparison and remove docs

address bug with using min dist between blobs in blob detector

use scalar instead of int

address bug with using min dist between blobs in blob detector

* fix namespace and formatting
2021-04-08 10:39:26 +00:00
Alexander Alekhin 19a936fc03 Merge pull request #19836 from 103yiran:warpaffine 2021-04-08 10:32:27 +00:00
Alexander Alekhin be17fce657 Merge pull request #19847 from gasparitiago:expose-max-iters 2021-04-08 10:31:36 +00:00
Alexander Alekhin 9a1d7736f8 Merge pull request #19838 from mshabunin:fix-intel-ipp-link 2021-04-07 09:42:32 +00:00
Tiago De Gaspari 9f295b2c91 Expose maxIters in findEssentialMat
Lets the user choose the maximum number of iterations the robust
estimator runs for, similary to findFundamentalMat
and findHomography functions.
2021-04-07 00:07:33 -03:00
Alexander Alekhin 6e8daaec0f Merge pull request #19855 from komakai:fix-android-ndk-camera-conversions 2021-04-06 21:31:26 +00:00
Alexander Alekhin 3a8154051f Merge pull request #19810 from aarongreig:aaron/core/relaxClArithmTest 2021-04-06 19:56:46 +00:00
Aaron Greig f3f46096d6 Relax accuracy requirements in the OpenCL sqrt perf arithmetic test.
Also bring perf_imgproc CornerMinEigenVal accuracy requirements in line with
the test_imgproc accuracy requirements on that test and fix indentation on
the latter.

Partially addresses issue #9821
2021-04-06 17:32:48 +01:00
Alexander Alekhin ace37df941 Merge pull request #19854 from gasparitiago:fundamentalMat-fix 2021-04-06 10:19:57 +00:00
Alexander Alekhin de7377485b Merge pull request #19861 from mpashchenkov:mp/ocv-gapi-stream-test 2021-04-05 21:22:07 +00:00
Maxim Pashchenkov e23578acd9 Added skip for TestTwoVideosDifferentLength 2021-04-05 15:52:48 +03:00
Giles Payne 770445ae2a Log warning that Exposure/ISO have no effect unless AutoExposure is off 2021-04-04 22:14:40 +09:00
Giles Payne b9b65e9392 Fix Android NDK camera's color format conversions 2021-04-04 12:39:29 +09:00
Tiago De Gaspari ac9182f20d Add maxIters parameter to LMeDS method in findFundamentalMat
This commit passes the parameter maxIters that represent
the maximum number of iterations, that can be passed to findFundamentalMat
to the method LMeDS.

This parameter were added to the function findFundamentalMat and
were passed just for the RANSAC method, but should be passed to
both methods to be consistent.
2021-04-03 21:56:05 -03:00
Alexander Alekhin 125b9f6057 Merge tag '4.5.2' 2021-04-02 17:30:52 +00:00
Alexander Alekhin 69357b1e88 release: OpenCV 4.5.2 2021-04-02 11:23:54 +00:00
Alexander Alekhin e9e9e3898a Merge remote-tracking branch 'upstream/3.4' 2021-04-02 11:22:33 +00:00
Alexander Alekhin 9ef20ad20e Merge pull request #19833 from alalek:workaround_19678 2021-04-02 10:37:29 +00:00
Alexander Alekhin 2cf1a13755 Merge tag '3.4.14' 2021-04-02 09:31:32 +00:00
Maksim Shabunin 6465e393b6 IPP: use linker workaround for Intel compiler on Linux 2021-04-02 10:44:32 +03:00
103yiran 6e6c0f31f7 delete unused variable 2021-04-02 10:30:27 +08:00
Anastasia M 1263949e70 Merge pull request #18237 from LupusSanctus:am/pytorch_tf_det_tutorial
[GSoC] Added TF and PyTorch detection model conversion cases

* Added object detection convertion pipeline and tutorials

* Added tutorial corrections
2021-04-02 01:50:35 +00:00
Alexander Alekhin 12d80b9e64 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-01 21:48:52 +00:00
Alexander Alekhin d0e3e638c3 release: OpenCV 3.4.14 2021-04-01 21:37:19 +00:00
Anastasia M ad333e0d22 Merge pull request #17801 from LupusSanctus:am/pytorch_tf_segm
[GSoC] Added TF and PyTorch segmentation conversion cases

* WIP: Added conversion of segmentation models

* Added tutorial mds

* remove unused
2021-04-01 20:42:08 +00:00
Orest Chura 34a8a45a6a Merge pull request #19828 from OrestChura:oc/fix_garray_garray_input
[G-API] Fix bug of GArray<GArray> passing through a graph

* Add test to check GArray<GArray> passing through a graph (assertion failed)

* G-API: Flatten GArray<T> to std::vector<T> when capturing VCtr

- Also: Fix formatting in garray.hpp

* Refactored test, added valuable check

* Initialize size_t

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2021-04-01 20:39:31 +00:00
Alexander Alekhin 6a72bf5085 Merge pull request #19823 from alalek:issue_contrib_2895 2021-04-01 20:38:46 +00:00
Alexander Alekhin 1e51f87298 Merge pull request #19817 from alalek:cmake_fix_tracking_headers 2021-04-01 20:38:14 +00:00
Alexander Alekhin 8095f601d1 gapi(test): avoid compilation failure with GCC11 2021-04-01 20:23:29 +00:00
Alexander Alekhin 0ff57e3292 Merge pull request #19830 from alalek:issue_19368 2021-04-01 15:30:18 +00:00
Alexander Alekhin 5db484b6c2 Merge pull request #19831 from alalek:backport_19771 2021-04-01 14:05:09 +00:00
Alexander Alekhin b40d24ad75 Merge pull request #19829 from alalek:hotfix_19693 2021-04-01 14:04:36 +00:00
Alexander Alekhin 6865787a75 Merge pull request #19827 from alalek:build_videoio_macosx_override_3.4 2021-04-01 12:34:23 +00:00
Alexander Alekhin 7f664850f5 Merge pull request #19825 from alalek:cmake_fix_headers_order_python_3.4 2021-04-01 12:34:10 +00:00
Alexander Alekhin 2907fb88f5 Merge pull request #19822 from alalek:core_wui_backward_compatibility 2021-04-01 12:32:33 +00:00
Alexander Alekhin f839fa4070 Merge pull request #19820 from alalek:issue_19405 2021-04-01 12:32:09 +00:00
Kun Liang 32d51313d0 Merge pull request #19771 from lionkunonly:opencvjsNodeFix
* fix the perf tests of OpenCV.js so that it can run on Node.js successfully

* do not modify the CMakeLists.txt

Co-authored-by: lionkun <871518554@qq.com>
2021-04-01 12:29:48 +00:00
Alexander Alekhin 69341edfe6 Merge pull request #19816 from alalek:python_customize_namespaces 2021-04-01 12:27:04 +00:00
Alexander Alekhin 81f0b0e0dc cmake: fix tracking detail headers 2021-04-01 12:21:18 +00:00
Alexander Alekhin d7cb2ea210 videoio(dshow): add NULL ptr check 2021-04-01 11:28:41 +00:00
Alexander Alekhin 28f919d9d2 apps(model_diagnostics): fix invalid callback 2021-04-01 10:26:22 +00:00
Alexander Alekhin 4ae2c11520 videoio(build): eliminate inconsistent 'override' warnings 2021-04-01 09:56:21 +00:00
Alexander Alekhin 3e1673e8b2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-04-01 09:54:57 +00:00
Alexander Alekhin 1b3e0b27af cmake: fix files order in Python bindings
- with changes backport from 4.x
2021-04-01 09:48:50 +00:00
Alexander Alekhin e4b0251e9d cuda: fix inplace condition in cv::cuda::flip 2021-04-01 02:26:59 +00:00
Alexander Alekhin b26f5b9468 core: backward compatibility for vx_store/vx_store_aligned calls 2021-04-01 02:17:47 +00:00
Alexander Alekhin 5340dc6686 Merge pull request #19819 from alalek:cmake_fix_headers_order 2021-04-01 01:34:21 +00:00
Alexander Alekhin 174753921d Merge pull request #19818 from alalek:workaround_python_build_failures 2021-04-01 01:12:07 +00:00
Alexander Alekhin aa32e3deb1 cmake: fix ADE dependency handling 2021-03-31 23:40:19 +00:00
Alexander Alekhin 2b86de217a cmake: fix order of headers
- cmake uses filesystem's order which may vary
- unpredictable headers order may cause build failures (primary bindings)
2021-03-31 23:16:46 +00:00
Alexander Alekhin 1615afd7f4 Merge pull request #19814 from alalek:pyopencv_to_safe 2021-03-31 22:58:18 +00:00
Alexander Alekhin 908957317f Merge pull request #19813 from alalek:issue_19506 2021-03-31 22:57:50 +00:00
Alexander Alekhin 6fa2bdd7f2 Merge pull request #19812 from alalek:workaround_19634 2021-03-31 22:57:15 +00:00
Alexander Alekhin f82303d614 Merge pull request #19811 from alalek:issue_19599 2021-03-31 22:56:48 +00:00
Alexander Alekhin 6773fa03e2 Merge pull request #19808 from alalek:3.4_python_fix_wrap_as 2021-03-31 22:56:14 +00:00
Alexander Alekhin 47fe017a6c build: workaround sporadic failures of python binding compilation 2021-03-31 22:44:27 +00:00
Alexander Alekhin 7baae20c20 Merge pull request #19815 from OrestChura:oc/fix_garray_garray_input 2021-03-31 22:33:14 +00:00
OrestChura 921c4551d9 Fix conversion of the kernel's input for GArray<GArray<U>> -> vector<vector<U>> 2021-03-31 23:37:44 +03:00
Alexander Alekhin c20a424e3a gapi(python): rename cv.gapi_wip_op / cv.gapi_wip_kernels 2021-03-31 20:34:04 +00:00
Alexander Alekhin 2e005f5dc2 python: allow to customize Python namespaces
- extra methods through PYOPENCV_EXTRA_METHODS_<NS_UPPER> macros
- extra constants through PYOPENCV_EXTRA_CONSTANTS_<NS_UPPER> macros
2021-03-31 20:33:38 +00:00
Alexander Alekhin 9f13fdb840 Merge pull request #19732 from aDanPin:danpin/gapi/stereo_operation_and_test
G-API Stereo operation and tests
2021-03-31 23:22:29 +03:00
aDanPin e6f52b0996 Adding stereo operation and tests 2021-03-31 20:09:10 +03:00
Alexander Alekhin d651ff8d6b python: exception-free pyopencv_to() wrapper 2021-03-31 14:18:32 +00:00
Alexander Alekhin e11408f6ad Merge pull request #18903 from mpashchenkov:mp/onnx-disable-output
G-API: ONNX. Disable unnecessary outputs
2021-03-31 16:46:22 +03:00
Alexander Alekhin 8069a6b4f8 core(IPP): disable some ippsMagnitude_32f calls 2021-03-31 13:38:57 +00:00
Alexander Alekhin b697b3162f videoio(mjpeg): disable parallel encoder 2021-03-31 12:35:12 +00:00
Alexander Alekhin 53a16b1186 Merge pull request #19809 from alalek:issue_19513 2021-03-31 10:50:20 +00:00
Alexander Alekhin a2a92999be core(arithm_op): workaround problem with scalars handling 2021-03-31 10:35:52 +00:00
Alexander Alekhin 40c0830b63 videoio(avfoundation): add getCaptureDomain() 2021-03-31 09:35:11 +00:00
eplankin 6f1eefec69 Merge pull request #19681 from eplankin:link_problem
* Workaround for IPP linking problem

* Apply -Bsymbolic to all cases when IPP is on

* Tried to hide symbols on MacOS

* Tried on --exclude-libs option

* Fixed macos and win warnings

* Fixed win build

* cmake(IPP): move --exclude-libs,libippcore.a to IPP CMake file

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-31 09:24:37 +00:00
Maxim Pashchenkov 61a4100d0c Added overload for cfgPostPros 2021-03-31 12:20:04 +03:00
Alexander Alekhin bb6e15f2c0 python: fix CV_WRAP_AS handling 2021-03-30 22:02:48 +00:00
Alexander Alekhin 0dcb99cf23 Merge pull request #19798 from LupusSanctus:am/reduce_sum_ch 2021-03-30 21:37:13 +00:00
Maxim Pashchenkov 69fc0acd1a Merge pull request #19752 from mpashchenkov:mp/onnx-int64-to-32
G-API: ONNX. Adding INT64-32 conversion for output.

* Added int64 to 32 conversion

* Added warning

* Added type checks for all toCV

* Added type checks for tests

* Small fixes

* Const for fixture in test

* std::tuple if retutn value for toCV

* Mistake

* Changed toCV for tests

* Added Assert

* Fix for comments

* One conversion for ONNX and IE

* Clean up

* One more fix

* Added copyFromONNX

* Removed warning

* Apply review comments
2021-03-30 21:08:43 +00:00
Anatoliy Talamanov 3f14cb073b Merge pull request #19804 from TolyaTalamanov:at/python-custom-op
[G-API] Introduce custom python operator API

* Introduce custom python operator API

* Add wip namespace
2021-03-30 20:59:02 +00:00
Anastasia Murzova cc6d48959e Added reduce sum by channel support 2021-03-30 23:01:22 +03:00
Alexander Alekhin 5ffe32439d Merge pull request #19806 from rgarnov:rg/fix_double_nv12_y_accessor_test_instantiation 2021-03-30 18:25:32 +00:00
Ruslan Garnov 76a9c0ccb0 Fixed Y accessor in BGR accessor test, added more instantiations 2021-03-30 19:51:48 +03:00
Vitaly Tuzov aab62aa6dd Merge pull request #18952 from terfendail:wui_doc
* Updated UI documentation to address WUI

* Added documentation for vx_ calls

* Removed vx_store operation overload

* Doxyfile updated to enable wide UI

* Enable doxygen documentation for vx_ WUI functions

* Wide intrinsics definition rework

* core: fix SIMD C++ emulator build (supports 128-bit only)
2021-03-30 16:18:03 +00:00
Alexander Alekhin c89084e6b7 Merge pull request #19223 from YashasSamaga:cuda4dnn-halfpix-linear-resize 2021-03-30 13:19:41 +00:00
Alexander Alekhin 64072e44cc Merge pull request #19351 from TolyaTalamanov:at/python-backend 2021-03-29 21:54:44 +00:00
Maxim Pashchenkov e7007668a6 Merge pull request #19792 from mpashchenkov:mp/ie-add-int32
G-API: IE. Adding support for INT32 type.

* Added support for int32

* Added sample for semantic-segmentation-adas-0001

* Alignment

* Alignment 2

* Rstrt build

* Removed test for sem seg
2021-03-29 20:59:55 +00:00
Alexander Alekhin 105b57c8d9 Merge pull request #19802 from rgarnov:rg/fix_accessor_tests_valgrind_warnings 2021-03-29 20:57:57 +00:00
Anatoliy Talamanov 79d4a38d87 Implement python backend 2021-03-29 22:51:24 +03:00
Anastasia M e08de1101d Merge pull request #19693 from LupusSanctus:onnx_diagnostic
ONNX diagnostic tool

* Final

* Add forgotten Normalize layer to the set of supported types

* ONNX diagnostic tool corrections

* Fixed CI test warnings

* Added code minor corrections

Co-authored-by: Sergey Slashchinin <sergei.slashchinin@xperience.ai>
2021-03-29 16:38:28 +00:00
Ruslan Garnov b5339cc01b Fixed valgrind warnings in accessors tests 2021-03-29 17:42:53 +03:00
Alexander Alekhin ac9f3a1242 Merge pull request #19793 from aarongreig:aaron/imgproc/relaxCornerEigenValTest 2021-03-29 13:41:44 +00:00
Aaron Greig 53652a6194 Relax accuracy requirement on OpenCL MinEigenVal corner kernel test.
The MinEigenVal path through the corner.cl kernel makes use of native_sqrt,
a math builtin function which has implementation defined accuracy.

Partially addresses issue #9821
2021-03-29 12:06:02 +01:00
lionkun 8d232a63ad fix the perf tests of OpenCV.js so that it can run on Node.js successfully 2021-03-27 21:52:44 +00:00
Alexander Alekhin 35eaacd1db Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-27 15:35:16 +00:00
Alexander Alekhin bf03f5fa3a Merge pull request #19786 from alalek:build_opencv_winpack_dldt_2021.3.0 2021-03-26 22:38:52 +00:00
Alexander Alekhin 6e8022a3af Merge pull request #19773 from jondea:add-aarch64-specialised-v_expand-3.4 2021-03-26 16:54:51 +00:00
Alexander Alekhin d27eb79fa6 Merge pull request #19785 from alalek:dnn_ocl_fix_async_kernels 2021-03-26 12:27:58 +00:00
Anastasia M 3e48a91d97 Merge pull request #19546 from LupusSanctus:am/slice_steps
* Added Steps support in DNN Slice layer

* Added code corrections

* dnn(slice): fix OCL and OCL_FP16 processing
2021-03-26 11:04:57 +00:00
Orest Chura ad2f5ccc66 Merge pull request #19712 from OrestChura:oc/Kalm_ptest
[G-API]: Performance tests for KalmanFilter

* Kalman perf.tests and some tests refactoring

* Input generation moved to a separate function; Slowest case sneario testing added

* Generating refactored

* Generating refactoring

* Addressing comments
2021-03-26 09:41:54 +00:00
Alexander Alekhin 77bfd9434b Merge pull request #19782 from TolyaTalamanov:at/rmat-plaidml-backend 2021-03-26 09:36:38 +00:00
Alexander Alekhin 144443d011 build: winpack_dldt with dldt 2021.3.0 2021-03-26 08:58:00 +00:00
Anatoliy Talamanov 6ba99068c9 Support RMat for PlaidML backend 2021-03-26 09:00:18 +03:00
Alexander Alekhin 86d0a86141 dnn(ocl): fix gemm kernel scheduling 2021-03-26 00:35:00 +00:00
Alexander Alekhin b7f6584dab Merge pull request #19784 from alalek:gapi_win32_build_warning 2021-03-26 01:57:59 +03:00
Alexander Alekhin 3290a5f370 gapi(build): eliminate Win32 build warning 2021-03-25 22:15:06 +00:00
Mikhail Nikolskii bf9f67e93f Merge pull request #19783 from mikhail-nikolskiy:interop-perf
Performance optimization in DirectX and VAAPI interop

* optimization in OpenCL NV12<>BGR kernels

* reduce kernel work-size
2021-03-25 21:27:31 +00:00
Alexander Alekhin 26ea4760ad Merge pull request #19774 from aarongreig:aaron/dnn/oclTestAccuracyThresholds 2021-03-25 16:58:07 +00:00
Anatoliy Talamanov 0753408e10 Merge pull request #19318 from TolyaTalamanov:at/python-generic-infer
[G-API] Python ROI generic inference

* Python generic infer overloads

* Move wrappers to appropriate file
2021-03-25 16:55:29 +00:00
Aaron Greig f59917bea1 Introduce relaxed accuracy thresholds for CL target in some dnn tests.
Partially addresses #9821
2021-03-25 10:58:23 +00:00
Alexander Alekhin b62d015285 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-24 18:58:46 +00:00
Alexander Alekhin a394c8b10b Merge pull request #19770 from alalek:dnn_openvino_2021.3.0 2021-03-24 18:50:47 +00:00
Alexander Alekhin 24002a5dfe Merge pull request #19731 from rgarnov:rg/basic_frame_drop 2021-03-24 15:20:38 +00:00
Lukas-Alexander Weber 7c4b873ba3 Merge pull request #19762 from lukasalexanderweber:master
* Error Message for SURF if not implemented

In OpenCV 4.5.1 

import cv2 as cv
cv.xfeatures2d_SURF.create

will not create an AttributeError, even if the function is excluded (no nonfree option)

In Line 305 (now 306) however ´finder = FEATURES_FIND_CHOICES[args.features]()´ will raise an 

error: OpenCV(4.5.1) ..\opencv_contrib\modules\xfeatures2d\src\surf.cpp:1029: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SURF::create'

So we should check with cv.xfeatures2d_SURF.create() correctly if SURF is available
2021-03-24 15:02:20 +00:00
Alexander Alekhin e56e4876e7 dnn(test): update tests for OpenVINO 2021.3 2021-03-24 14:50:42 +00:00
Alexander Alekhin 7949983c41 Merge pull request #19325 from AsyaPronina:asyadev/extract_y
[G-API] Added Y, UV accessors for cv::MediaFrame
2021-03-24 16:37:05 +03:00
Alexander Alekhin 56bdd7db5c dnn: use OpenVINO 2021.3 defines
original commit: 6291503793
2021-03-24 10:26:24 +00:00
Alexander Alekhin 3df6bc58e9 Merge pull request #19765 from LupusSanctus:am/mobilenetv3 2021-03-24 09:43:27 +00:00
Anastasiya Pronina b0d66e06f4 Added Y, UV accessors to cv::MediaFrame 2021-03-24 12:34:44 +03:00
Anastasia Murzova e75f1b071b Added reshape corrections 2021-03-24 10:53:11 +03:00
Anastasia Murzova 7a2b3ed471 Corrected DNN elementwise multiplication 2021-03-24 10:53:11 +03:00
Anastasia M 551d4a8ec1 Merge pull request #19477 from LupusSanctus:am/eltwice_vec
* Aligned OpenCV DNN and TF sum op behaviour

Support Mat (shape: [1, m, k, n] ) + Vec (shape: [1, 1, 1, n]) operation
by vec to mat expansion

* Added code corrections: backend, minor refactoring
2021-03-23 22:16:09 +00:00
Jonathan Deakin 29a289dfa1 Add v_expand for AArch64, fuse vmovl+vget_high into vmovl_high 2021-03-23 15:06:41 +00:00
Alexander Alekhin a00d6b8377 Merge pull request #19763 from TolyaTalamanov:at/blockingdesc-order-fix 2021-03-23 13:39:58 +00:00
Alexander Alekhin ca8c3dd9b5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-22 12:05:23 +00:00
Anatoliy Talamanov c434ca74a2 Blocking dims order fix 2021-03-22 13:57:57 +03:00
Alexander Alekhin bdd2b57e5d Merge pull request #19757 from alalek:js_setLogLevel 2021-03-21 17:37:05 +00:00
Alexander Alekhin a97f6f8058 js: support setLogLevel() / getLogLevel() calls 2021-03-20 18:14:10 +00:00
Liubov Batanina c0dd82fb53 Merge pull request #19632 from l-bat:lb/ie_arm_target
Added OpenVINO ARM target

* Added IE ARM target

* Added OpenVINO ARM target

* Delete ARM target

* Detect ARM platform

* Changed device name in ArmPlugin

* Change ARM detection
2021-03-20 11:20:02 +00:00
Alexander Alekhin 94f00cf096 Merge pull request #19747 from alalek:issue_19733 2021-03-19 12:53:32 +00:00
Alexander Alekhin 1211a8b9cd Merge pull request #19745 from alalek:issue_19729 2021-03-19 12:52:34 +00:00
Anatoliy Talamanov 50a264d832 Merge pull request #19310 from TolyaTalamanov:at/generic-infer-overloads
[G-API] Support generic infer overloads

* Overloads for generic infer

* Fix build

* Refactoring

* Fix docs

* Put extra stuff to detail namespace

* Add doc for usings

* Remove uneccessary template in Priv
2021-03-19 12:50:45 +00:00
Alexander Alekhin 3f52d0e46c Merge pull request #19738 from TolyaTalamanov:at/giebackend-blockingdesc-fix 2021-03-19 11:54:43 +00:00
Ruslan Garnov 716bdd5ee5 Implemented basic frame drop functionality 2021-03-19 14:26:14 +03:00
Anatoliy Talamanov bad08d26da Fix blocking desc usage 2021-03-19 12:47:17 +03:00
Alexander Alekhin a41394c885 core(parallel): fix plugins handling if no filesystem available 2021-03-18 23:05:12 +00:00
Alexander Alekhin f680505086 features2d(mser): chi_table.h notes 2021-03-18 21:30:12 +00:00
Alexander Alekhin ae60bbc7e4 Merge pull request #19741 from alalek:ml_logistic_regression_use_opencv_license_header 2021-03-18 20:47:44 +00:00
Anatoliy Talamanov dc31e20925 Merge pull request #19709 from TolyaTalamanov:at/async-inferlist-infer2
G-API: Implement async version for InferList & Infer2

* Implement async version for InferList & Infer2

* Fix warning

* Fix bug with roi ordering

* Post input meta instead of empty

* Fix comments to review
2021-03-18 23:33:19 +03:00
Alexander Alekhin 7664e6d090 ml: use OpenCV license header for logistic regression 2021-03-17 20:29:52 +00:00
Alexander Alekhin af63fffb63 Merge pull request #19739 from alalek:fix_valgrind_run 2021-03-17 13:59:52 +00:00
Alexander Alekhin 0a6adedaf1 valgrind: filter out hardware-accelerated videoio tests 2021-03-17 08:59:56 +00:00
Alexander Alekhin b19f860384 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-13 13:02:18 +00:00
Ziachnix 960f501cc1 Merge pull request #19284 from Ziachnix:feature/js-qr-code-detector
Add QRCodeDetector to JavaScript Build

* ADD: js support for qrCodeDetector

- cherry picked commit to solve rebase error

* CHG. Revert haarcascade path

* FIX: Tests without images

* ADD: decodeCurved

* js(docs): don't require OPENCV_TEST_DATA_PATH

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-13 12:52:44 +00:00
Alexander Alekhin 7a8e171691 Merge pull request #19720 from alalek:ocl_test_skip_spir_amd 2021-03-13 12:48:20 +00:00
Alexander Alekhin 7ca9740da5 Merge pull request #19718 from alalek:backport_19683 2021-03-13 12:46:24 +00:00
Alexander Alekhin 68fae94cbb Merge pull request #19717 from danbey:bad_value_param_should_be_passed_by_reference 2021-03-13 12:45:55 +00:00
Alexander Alekhin 6da5c7c1d0 Merge pull request #19716 from l-bat:lb/fix_resize 2021-03-13 12:45:07 +00:00
Alexander Alekhin 87e607a19b core(ocl): skip SPIR test on AMD devices if problem detected 2021-03-13 06:12:52 +00:00
Dale Phurrough cbe236652b noexcept def construct Mat, UMat, Mat_, MatSize, MatStep
original commit: 1b0f781b7c
2021-03-12 20:26:32 +00:00
Dan Ben Yosef d4d805cb3e Avoiding copy by passing param by reference
It is best to pass bad_value_ param by reference to avoid copy.
2021-03-12 14:17:11 -05:00
Liubov Batanina 8d29a902e4 Added ngraph::op::v6::MVN 2021-03-12 21:02:03 +03:00
Alexander Alekhin 4c1d5840bb Merge pull request #19707 from AsyaPronina:asyadev/upstream_fixes_from_release 2021-03-12 14:27:41 +00:00
Alexander Alekhin f136adcad5 Merge pull request #19715 from seiko2plus:issue_19698 2021-03-12 09:45:19 +00:00
Liubov Batanina 95ab9468c1 Added ngraph::op::v4::Interpolation 2021-03-12 12:00:59 +03:00
Sayed Adel f8181fbef8 core:ppc64 fix detecting CPU features when optimization is off 2021-03-12 02:02:31 +00:00
Alexander Alekhin c5c2b6f9bf Merge pull request #19683 from diablodale:add_defconstruct_noexcept_matumat 2021-03-11 22:02:06 +00:00
Xinguang Bian b995de4ff3 Merge pull request #19253 from mightbxg:bugfix_PnPRansac
* fix unexpected Exception in solvePnPRansac caused by input points

* calib3d: solvePnPRansac - keep minimal changes to handle DLT 6 points requirement

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-12 00:53:06 +03:00
Alexander Alekhin 825dadfbdd Merge pull request #19703 from danbey:setting_StereoSGBMParams_in_init_list 2021-03-11 21:33:19 +00:00
Anastasiya Pronina 0f4b27c300 Upstream fixes from release 2021-03-11 23:27:23 +03:00
Dan Ben Yosef 63048812c7 Init params (StereoSGBMParams) in StereoSGBMImpl constructor initialization list
To improve preformence it is better to init the params (StereoSGBMParams) in the
    initialization list.
2021-03-10 13:05:35 -05:00
Alexander Alekhin fbb38cc245 Merge pull request #19222 from YashasSamaga:cuda4dnn-fix-build-diagnostics 2021-03-10 17:40:36 +00:00
Orest Chura c1a57a10a4 Merge pull request #19542 from OrestChura:oc/BGSub_ptest
[G-API]: Performance tests for BackgroundSubtractor

* Perf.Tests for BackgroundSubtractor kernel

* Fix CI

* Addressing comments

* Addressing a comment

* Test cycle and validation changes

* Addressing  comment

* Added assert
2021-03-10 17:37:55 +00:00
Alexander Alekhin e4692ac079 Merge pull request #19613 from WeiChungChang:NMS_refine 2021-03-10 17:36:57 +00:00
Maxim Pashchenkov 12fa8d8444 Merge pull request #18240 from mpashchenkov:mp/ocv-gapi-input-cnn-reshape
[G-API]: Adding reshape for CNN input.

* Added CNN input IE reshape

* rbs

* Added unordered_set instead vector

* Alignment
2021-03-10 16:06:46 +00:00
Qoo 47337e2196 boost NMS performance 2021-03-10 15:59:26 +00:00
Alexey Smirnov ddd2447192 Merge pull request #19617 from smirnov-alexey:as/extend_kernel_package_api
G-API: Extend GKernelPackage and serialization API

* Extend GKernelPackage API

* Adding tests

* Extend serialization API

* Address review comments
2021-03-10 15:58:34 +00:00
Alexander Alekhin 1d6a1e5f9c Merge pull request #19692 from seiko2plus:issue_19647 2021-03-09 18:14:41 +00:00
Amir Tulegenov 04d907fb97 Merge pull request #19619 from amirtu:OCV-221_get_and_set_cameras_on_stitcher
* Get and set cameras for sticher.

* Code review fixes.

Co-authored-by: amir.tulegenov <amir.tulegenov@xperience.ai>
Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
2021-03-09 17:51:40 +00:00
Sayed Adel 84fcc4ab9b core:ppc64 fix the build with the newer versions of Eigen on IBM/Power
It also fixes the build when universal intrinsics is disabled
   via `-DDCV_ENABLE_INTRINSICS=OFF`.
2021-03-09 19:20:18 +02:00
Daniel Playfair Cal 65b51e1538 Merge pull request #19690 from hedgepigdaniel:fix/calibration_fisheye
* fix(samples/camera_calibration): set new camera matrix for fisheye

* fix(camera_calibration): ignore inapplicable flags for fisheye
2021-03-09 15:09:08 +00:00
Alexander Alekhin e2610df073 Merge pull request #19688 from alalek:videoio_docs_hwaccel 2021-03-09 15:06:43 +00:00
Alexander Alekhin 6c9be1bc1d Merge pull request #19675 from asmorkalov:as/pylint_warnings 2021-03-09 09:43:52 +00:00
Alexander Smorkalov 4c48f1eed2 Removed unused variables found by pylint. 2021-03-09 10:56:45 +03:00
Dan Ben-Yosef 31f66766b7 Merge pull request #19685 from danbey:setting_stereoBMImpl_in_init_list
Init params (StereoBMParams) in StereoBMImpl constructor initialization list

* Init StereoBMImpl in initialization list

To improve preformence it is better to init the params (StereoBMImpl) in the
initialization list.

* coding style

* drop useless copy/move ctor

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-07 20:06:08 +03:00
Alexander Alekhin 601690695e Merge pull request #19687 from alalek:videoio_docs_fixes_3.4 2021-03-07 16:23:24 +00:00
Alexander Alekhin 4287961aed videoio(doc): add 'videoio_hwaccel' group, fix typos 2021-03-07 04:47:22 +00:00
Alexander Alekhin 85009800b3 videoio(docs): fixes 2021-03-07 04:26:49 +00:00
Alexander Alekhin d643a90efa Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-06 17:31:08 +00:00
Vitaly Tuzov 04a9ff88d8 Merge pull request #19622 from terfendail:ref_doc
* Updated cpp reference implementations for a few intrinsics to address wide universal intrinsics as well

* Updated cpp reference implementations for a few more universal intrinsics
2021-03-06 17:22:21 +00:00
Alexander Alekhin dc24663e8d Merge pull request #19641 from LupusSanctus:am/tf_reshape 2021-03-06 17:21:34 +00:00
Alexander Alekhin d2cc63e779 Merge pull request #19680 from alalek:cmake_update_python_linters 2021-03-06 17:20:02 +00:00
YashasSamaga d0fe6ad109 fix checkVersions() 2021-03-06 19:03:03 +05:30
Alexander Alekhin 358878caf7 Merge pull request #19671 from SamFC10:sam-darknet 2021-03-05 15:12:21 +00:00
cyy b450dd7a87 Merge pull request #19565 from cyyever:minor_fix
Local objects optimization in calibration init

* use emplace_back

* use {} initilization

* remove a tailing white space
2021-03-05 15:04:51 +00:00
Mradul Agrawal 640f188ca2 Merge pull request #19583 from theroyalpekka:patch-1
* Update polynom_solver.cpp

This pull request is in the response to Issue  #19526. I have fixed the problem with the cube root calculation of 2*R. The Issue was in the usage of pow function with negative values of R, but if it is calculated for only positive values of R then changing x0 according to the parity of R, the Issue is resolved. Kindly consider it, Thanks!

* add cv::cubeRoot(double)

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-05 13:55:52 +00:00
Alexander Alekhin a1e2c4f338 Merge pull request #19655 from raaldrid:EXR_rw_alpha_support_16115 2021-03-05 16:54:31 +03:00
Alexander Alekhin 625d4fc884 cmake: update Python linters handling
- exclude from getBuildInformation()
- fix pylint version
2021-03-05 12:54:51 +00:00
Alexander Alekhin f821530eb0 Merge pull request #19677 from APrigarina:detection_fix 2021-03-05 08:40:27 +00:00
Anastasia Murzova 7894cd3c73 Aligned TF Reshape layer behaviour 2021-03-05 01:01:37 +03:00
APrigarina 125cc79c17 fix false positive detection 2021-03-04 19:20:31 +03:00
Alexander Smorkalov 2e429268ff Merge pull request #19668 from asmorkalov:as/filesystem_py
* Add Python Bindings for getCacheDirectory function

* Added getCacheDirectory interop test with image codecs.

Co-authored-by: Sergey Slashchinin <sergei.slashchinin@xperience.ai>
2021-03-04 16:17:57 +00:00
Alexander Alekhin 2a808aeec0 Merge pull request #19674 from l-bat:lb/fix_ie_tests 2021-03-04 14:52:20 +00:00
Liubov Batanina 94533e12eb Determine layout 2021-03-04 13:05:01 +03:00
Alexander Alekhin a0008de281 Merge pull request #19607 from alalek:backport_19606 2021-03-03 21:10:57 +00:00
SamFC10 a42d4da003 Added Spatial Attention Module in Darknet Importer 2021-03-03 22:42:47 +05:30
Alexander Smorkalov e2ca50f1cb Merge pull request #19539 from asmorkalov:as/calib_fix_focal_length
* Added CALIB_FIX_FOCAL_LENGTH to fisheye calibration #13450

Sometimes you want to calibrate just the principal point of a camera, or just the distortion coefficients. In this case, you can pass the CALIB_FIX_FOCAL_LENGTH flag to keep Fx and Fy

* Added test for CALIB_FIX_FOCAL_LENGTH option in fisheye callinration.
2021-03-03 14:06:59 +00:00
Alexander Alekhin be24659c03 Merge pull request #19666 from alalek:update_ffmpeg_4.x 2021-03-03 13:06:44 +00:00
Alexander Alekhin 2dc157246b Merge pull request #19669 from alalek:fix_static_analyzer_issues_4.x 2021-03-03 12:26:54 +00:00
Alexander Alekhin b6670f3ac3 ffmpeg/4.x: update FFmpeg wrapper 2021.03
- FFmpeg 4.3.2
2021-03-03 11:41:36 +00:00
Alexander Alekhin 0689c70dba Merge pull request #19665 from alalek:update_ffmpeg_3.4 2021-03-03 11:22:56 +00:00
Alexander Alekhin d2ac304ade Merge pull request #19667 from alalek:hotfix_ffmpeg_hw_accel 2021-03-03 11:08:55 +00:00
Alexander Alekhin 16c3522f4e static analyzer issues 2021-03-03 09:18:40 +00:00
Alexander Alekhin 7ac6abe02a videoio(ffmpeg): fix VIDEO_ACCELERATION_ANY handling
- default is VIDEO_ACCELERATION_NONE
2021-03-03 08:44:46 +00:00
Alexander Alekhin 6af20d3907 Merge pull request #19657 from alalek:update_version_4.5.2-pre 2021-03-03 00:26:37 +00:00
Alexander Alekhin 75ad74c893 ffmpeg/3.4: update FFmpeg wrapper 2021.03
- FFmpeg 3.4.8
2021-03-02 23:59:38 +00:00
Alexander Alekhin cbfd38bd41 core: rework code locality
- to reduce binaries size of FFmpeg Windows wrapper
- MinGW linker doesn't support -ffunction-sections (used for FFmpeg Windows wrapper)
- move code to improve locality with its used dependencies
- move UMat::dot() to matmul.dispatch.cpp (Mat::dot() is already there)
- move UMat::inv() to lapack.cpp
- move UMat::mul() to arithm.cpp
- move UMat:eye() to matrix_operations.cpp (near setIdentity() implementation)
- move normalize(): convert_scale.cpp => norm.cpp
- move convertAndUnrollScalar(): arithm.cpp => copy.cpp
- move scalarToRawData(): array.cpp => copy.cpp
- move transpose(): matrix_operations.cpp => matrix_transform.cpp
- move flip(), rotate(): copy.cpp => matrix_transform.cpp (rotate90 uses flip and transpose)
- add 'OPENCV_CORE_EXCLUDE_C_API' CMake variable to exclude compilation of C-API functions from the core module
- matrix_wrap.cpp: add compile-time checks for CUDA/OpenGL calls
- the steps above allow to reduce FFmpeg wrapper size for ~1.5Mb (initial size of OpenCV part is about 3Mb)

backport is done to improve merge experience (less conflicts)
backport of commit: 65eb946756
2021-03-02 23:24:28 +00:00
Alexander Alekhin a823b06fa5 pre: OpenCV 4.5.2 (version++) 2021-03-02 23:20:59 +00:00
Alexander Alekhin cbb0151303 Merge pull request #19606 from alalek:reduce_ffmpeg_wrapper_size_4.x 2021-03-02 23:20:44 +00:00
Alexander Alekhin ec4baf337a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-03-02 21:47:19 +00:00
Alexander Alekhin 2ab1f3f166 Merge pull request #19656 from alalek:update_version_3.4.14-pre 2021-03-02 21:44:19 +00:00
Alexander Alekhin a123c48d4d pre: OpenCV 3.4.14 (version++) 2021-03-02 20:47:29 +00:00
Alexander Alekhin 1c88e1fd19 Merge pull request #19661 from alalek:ffmpeg_fixes_3.4
* videoio(ffmpeg): eliminate MSVC build warnings

* videoio(ffmpeg): update initialization code

- repair FFmpeg logger settings on each .open() call
2021-03-02 20:41:05 +00:00
Rachel A cc22a73d0f EXR alpha support for 4 channel reading and writing. Issue https://github.com/opencv/opencv/issues/16115. 2021-03-02 11:49:56 -08:00
Alexander Alekhin 325bdf952c Merge pull request #19663 from mshabunin:fix-ffmpeg-1x 2021-03-02 12:19:00 +00:00
Alexander Alekhin 6fbf93750b Merge pull request #19660 from alalek:update_openjpeg 2021-03-02 12:16:43 +00:00
Alexander Alekhin ba7d0c5b23 Merge pull request #19659 from alalek:update_libtiff 2021-03-02 12:15:33 +00:00
Alexander Alekhin 5d499a185b Merge pull request #19658 from alalek:update_libwebp
* 3rdparty: update libwebp 1.1.0 => 1.2.0

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

* 3rdparty(libwebp): re-apply OpenCV patches
2021-03-02 12:14:56 +00:00
Alexander Alekhin 65eb946756 core: rework code locality
- to reduce binaries size of FFmpeg Windows wrapper
- MinGW linker doesn't support -ffunction-sections (used for FFmpeg Windows wrapper)
- move code to improve locality with its used dependencies
- move UMat::dot() to matmul.dispatch.cpp (Mat::dot() is already there)
- move UMat::inv() to lapack.cpp
- move UMat::mul() to arithm.cpp
- move UMat:eye() to matrix_operations.cpp (near setIdentity() implementation)
- move normalize(): convert_scale.cpp => norm.cpp
- move convertAndUnrollScalar(): arithm.cpp => copy.cpp
- move scalarToRawData(): array.cpp => copy.cpp
- move transpose(): matrix_operations.cpp => matrix_transform.cpp
- move flip(), rotate(): copy.cpp => matrix_transform.cpp (rotate90 uses flip and transpose)
- add 'OPENCV_CORE_EXCLUDE_C_API' CMake variable to exclude compilation of C-API functions from the core module
- matrix_wrap.cpp: add compile-time checks for CUDA/OpenGL calls
- the steps above allow to reduce FFmpeg wrapper size for ~1.5Mb (initial size of OpenCV part is about 3Mb)
2021-03-02 11:27:58 +00:00
Maksim Shabunin 137ec1c846 videoio: av_frame_unref compilation fix 2021-03-02 14:20:24 +03:00
Alexander Alekhin b0afb4d63c Merge pull request #19651 from LaurentBerger:py_finTransformECC 2021-03-02 10:12:07 +00:00
Alexander Alekhin 51fd26b19b 3rdparty: update openjpeg 2.3.1 => 2.4.0
- https://github.com/uclouvain/openjpeg/releases/tag/v2.4.0
2021-03-01 23:56:13 +00:00
Alexander Alekhin eab8ac9a71 3rdparty: update libtiff 4.1.0 => 4.2.0
- https://gitlab.com/libtiff/libtiff/-/tags/v4.2.0
2021-03-01 23:19:00 +00:00
Dale Phurrough 1b0f781b7c noexcept def construct Mat, UMat, Mat_, MatSize, MatStep 2021-03-01 22:42:13 +01:00
LaurentBerger d1c04af603 relative to https://forum.opencv.org/t/cv2-findtransformecc-sometimes-missing-defaults/1870 2021-03-01 17:32:56 +01:00
Anatoliy Talamanov eb82ba36a3 Merge pull request #19322 from TolyaTalamanov:at/python-callbacks
[G-API] Introduce cv.gin/cv.descr_of for python

* Implement cv.gin/cv.descr_of

* Fix macos build

* Fix gcomputation tests

* Add test

* Add using to a void exceeded length for windows build

* Add using to a void exceeded length for windows build

* Fix comments to review

* Fix comments to review

* Update from latest master

* Avoid graph compilation to obtain in/out info

* Fix indentation

* Fix comments to review

* Avoid using default in switches

* Post output meta for giebackend
2021-03-01 15:52:11 +00:00
Mikhail Nikolskii 7bcb51eded Merge pull request #19460 from mikhail-nikolskiy:videoio-hw
videoio: HW decode/encode in FFMPEG backend; new properties with support in FFMPEG/GST/MSMF

* HW acceleration in FFMPEG backend

* fixes on Windows, remove D3D9

* HW acceleration in FFMPEG backend

* fixes on Windows, remove D3D9

* improve va test

* Copyright

* check LIBAVUTIL_BUILD >= AV_VERSION_INT(55, 78, 100) // FFMPEG 3.4+

* CAP_MSMF test on .mp4

* .mp4 in test

* improve va test

* Copyright

* check LIBAVUTIL_BUILD >= AV_VERSION_INT(55, 78, 100) // FFMPEG 3.4+

* CAP_MSMF test on .mp4

* .mp4 in test

* .avi for GStreamer test

* revert changes around seek()

* cv_writer_open_with_params

* params.warnUnusedParameters

* VideoCaptureParameters in GStreamer

* open_with_params

* params->getUnused

* Reduce PSNR threshold 33->32 (other tests use 30)

* require FFMPEG 4.0+; PSNR 30 as in other tests

* GStreamer AVI-demux plugin not installed in Ubuntu test environment?

* fix build on very old ffmpeg

* fix build on very old ffmpeg

* fix build issues

* fix build issues (static_cast)

* FFMPEG built on Windows without H264 encoder?

* fix for write_nothing test on VAAPI

* fix warnings

* fix cv_writer_get_prop in plugins

* use avcodec_get_hw_frames_parameters; more robust fallback to SW codecs

* internal function hw_check_device() for device check/logging

* two separate tests for HW read and write

* image size 640x480 in encode test

* WITH_VA=ON (only .h headers used in OpenCV, no linkage dependency)

* exception on VP9 SW encoder?

* rebase master; refine info message

* videoio: fix FFmpeg standalone plugin build

* videoio(ffmpeg): eliminate MSVC build warnings

* address review comments

* videoio(hw): update videocapture_acceleration.read test

- remove parallel decoding by SW code path
- check PSNR against the original generated image

* videoio: minor fixes

* videoio(test): disable unsupported MSMF cases (SW and HW)

* videoio(test): update PSNR thresholds for HW acceleration read

* videoio(test): update debug messages

* "hw_acceleration" whitelisting parameter

* little optimization in test

* D3D11VA supports decoders, doesn't support encoders

* videoio(test): adjust PSNR threshold in write_read_position tests

* videoio(ffmpeg): fix rejecting on acceleration device name mismatch

* videoio(ffmpeg): fix compilation USE_AV_HW_CODECS=0, add more debug logging

* videoio: rework VideoAccelerationType behavior

- enum is not a bitset
- default value is backend specific
- only '_NONE' and '_ANY' may fallback on software processing
- specific H/W acceleration doesn't fallback on software processing. It fails if there is no support for specified H/W acceleration.

* videoio(test): fix for current FFmpeg wrapper

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-01 15:51:04 +00:00
Alexander Alekhin f70e80a6ba Merge pull request #19640 from alalek:issue_19639
calib3d(usac): do not crash on empty models

* calib3d(test): regression test for issue 19639

* calib3d(usac): do not crash in setModelParameters()

* calib3d(usac): handle empty models in isModelGood()
2021-02-28 21:39:30 +00:00
Alexander Alekhin 19865a26e5 Merge pull request #19642 from alalek:backport_19545 2021-02-28 21:37:30 +00:00
SamFC10 96947c30c0 Added exp layer
backport of commit: 6111935835
partial backport of commit: dd5976162b
2021-02-28 19:59:40 +00:00
Alexander Alekhin e0265c67c6 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-27 17:41:57 +00:00
Alexander Alekhin 19f1bac18c Merge pull request #19603 from federicohml:fix-ub-copy-make-const-border-8u 2021-02-27 17:32:42 +00:00
Alexander Alekhin b3b80f85fe Merge pull request #19636 from LaurentBerger:blendlinear_py 2021-02-27 17:31:59 +00:00
Federico Bolelli 9695165877 Merge pull request #19631 from prittt:sota-ccl
* Add Spaghetti algorithm for CCL

* Add stat tests for new and old algorithms

* Switch license header to short version
2021-02-27 17:27:24 +00:00
LaurentBerger 84080c12fd python binding blendLinear 2021-02-27 16:47:35 +00:00
Alexander Alekhin 1a855fed8f Merge pull request #19628 from alalek:fix_19566 2021-02-26 21:43:37 +00:00
Federico Martinez 773262bc09 Fix UB in CopyMakeConstBoder_8u
Caused by overflow of arithmetic operators conversion rank
2021-02-26 19:15:50 +00:00
Anatoliy Talamanov 28c064f345 Merge pull request #19487 from TolyaTalamanov:at/support-nireq-option
[G-API] Support multiple asynchronous requests

* Support nireq option

* Disable tests to check CI

* Fix bug with hanging

* WA to green CI

* Snapshot

* Simplify RequestPool

* Add default values to id

* Fix win warning
2021-02-26 12:53:30 +00:00
Alexander Alekhin c7f03814ea Merge pull request #19633 from mshabunin:add-gstreamer-video 2021-02-26 11:45:53 +00:00
Maksim Shabunin 90623498a2 gstreamer: add video module 2021-02-26 12:51:03 +03:00
Orest Chura 21b2e33ebb Merge pull request #19497 from OrestChura:oc/kmeans_ptest
[G-API]: Performance tests for kmeans

* - Perf.Tests for kmeans(2D, 3D (Point2f/3f), ND (Mat))
 - New file for common parts of acc. and perf. tests for core kernels added
 - Some typos corrections

* Applying comments
2021-02-25 21:58:52 +00:00
Alexander Alekhin fadb25baf8 imgproc(warpAffine): avoid buffer indexes overflow in SIMD code 2021-02-25 20:16:50 +00:00
Giles Payne 0553543e6e Merge pull request #19597 from komakai:android-ndk-camera
Android NDK camera support

* Add native camera video backend for Android

* In the event of a "No buffer available error" wait for the appropriate callback and retry

* Fix stale context when creating a new AndroidCameraCapture

* Add property handling
2021-02-25 19:14:11 +00:00
Alexander Alekhin 543379d343 Merge pull request #19627 from mshabunin:plugin-default-suffix 2021-02-25 16:33:55 +00:00
Alexander Alekhin 20a46b31cd Merge pull request #19625 from mshabunin:static-analysis-issues-34 2021-02-25 16:31:47 +00:00
Alexander Alekhin 37eba84056 Merge pull request #19620 from mshabunin:static-analysis-issues 2021-02-25 16:30:17 +00:00
Maksim Shabunin 293e777fce plugins: add suffix to default OUTPUT_NAME 2021-02-25 18:00:29 +03:00
Maksim Shabunin b2321576bc Fixed several issues found by static analysis 2021-02-25 15:44:15 +03:00
Maksim Shabunin dd5976162b Fixed several issues found by static analysis 2021-02-25 15:08:39 +03:00
Alexander Alekhin 7328600a7a Merge pull request #19609 from alalek:videoio_fix_gstreamer_alignment_bug 2021-02-25 07:55:38 +00:00
Alexander Alekhin 67b6ef4c2a Merge pull request #19503 from komakai:fix-android-putget 2021-02-24 21:07:13 +00:00
Alexander Alekhin 3d0a421ab4 Merge pull request #19618 from alalek:videoio_plugin_exception_messages 2021-02-24 21:03:01 +00:00
Alexander Alekhin 831d48d971 videoio: dump exception's messages in plugins 2021-02-24 17:48:04 +00:00
Alexander Alekhin 3a062eed5b Merge pull request #19610 from mshabunin:plugin-va-compile 2021-02-24 10:08:11 +00:00
Alexander Alekhin 52a6a823ad Merge pull request #19568 from alalek:cmake_plugin_fix_osx_standalone 2021-02-24 09:28:47 +00:00
Alexander Alekhin 9d61b1e754 videoio(gstreamer): rework retrieveFrame() to handle strides 2021-02-24 09:07:57 +00:00
Maksim Shabunin b89410a266 Fix standalone plugin compilation for Windows 2021-02-24 12:05:33 +03:00
Maksim Shabunin 317db39a5e Enable VA only on selected x86/64 platforms 2021-02-24 12:04:58 +03:00
Alexander Alekhin 7ffc4b57aa Merge pull request #19535 from alalek:issue_18897 2021-02-23 22:42:51 +00:00
WeiChungChang d4d12164aa Merge pull request #19529 from WeiChungChang:3.4
* improve map allocation check

* fix accoring to CR
2021-02-23 21:09:55 +00:00
Alexander Alekhin 34d5746553 Merge pull request #19601 from alalek:hotfix_19536 2021-02-23 06:44:04 +03:00
Alexander Alekhin 86cb435adf dnn: fix build (nullptr issue) 2021-02-23 03:31:29 +00:00
Alexander Alekhin 513f5a8869 Merge pull request #19536 from WeiChungChang:ReduceMemory 2021-02-22 20:04:11 +00:00
Alexander Alekhin 1de02b9c57 Merge pull request #19564 from sturkmen72:patch-4 2021-02-22 20:02:40 +00:00
WeiChungChang f6bc4fd4c6 Merge pull request #19552 from WeiChungChang:partialSort
apply partial sort to save computations

* apply partial sort

* fix typo

* fix accroding to CR
2021-02-22 19:44:00 +03:00
Alexander Alekhin 9d89edff2f Merge pull request #19594 from alalek:hotfix_19470 2021-02-22 08:29:10 +00:00
Alexander Alekhin 599d64a405 core(parallel): fix JS build, fix OpenMP version dump 2021-02-21 22:55:01 +00:00
Alexander Alekhin 0a6f216f83 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-21 20:14:09 +00:00
Suleyman TURKMEN 9b399f3960 Update python samples 2021-02-21 23:02:16 +03:00
Larry Wei 98c2ccfaa3 Merge pull request #19586 from larryw3i:patch-2
* Update py_setup_in_ubuntu.markdown
2021-02-21 19:22:43 +00:00
Alexander Alekhin 1d0334fc07 Merge pull request #19584 from diablodale:fix19573_ocl_move 2021-02-21 19:20:03 +00:00
Alexander Alekhin 309e1e2b1d core(InputArray): replace STD_ARRAY to MATX
- remove duplication kind
2021-02-21 19:12:21 +00:00
Sergey Krivohatskiy af13f61a43 Merge pull request #19580 from SergeyKrivohatskiy:patch-1
* Fixed OCL implementation of pyrlk

If prevPts size is (N, 1) (which is a default layout for converting `vector<Point2f>` to `UMat`) the `prevPts.cols == 1` and optical flow will be calculated for the first point only.
Getting `prevPts.total()` as in line 1048 is the correct way to get points count.

* fixed compilation warning (size_t to int)

Signed-off-by: Sergey Krivohatskiy <s.krivohatskiy@gmail.com>
2021-02-21 15:57:18 +00:00
Alexander Alekhin 6c57428742 Merge pull request #19585 from alalek:hotfix_19540 2021-02-20 22:54:55 +00:00
Alexander Alekhin 0f35412dcd Merge pull request #19545 from SamFC10:exp 2021-02-20 22:47:35 +00:00
Alexander Alekhin d093ac6a0f Merge pull request #19582 from alalek:backport_19572 2021-02-20 22:46:55 +00:00
Alexander Alekhin 6d81a88288 build warning (windows 32-bit) 2021-02-20 18:30:49 +00:00
Dale Phurrough 96a15434a2 add move construct/assigns to cv::ocl main classes
- enables inline construct and assigns with r-values
- enables compiler-created default move
  construct/assigns
- includes test cases
2021-02-20 18:56:04 +01:00
SamFC10 6111935835 Added exp layer 2021-02-20 22:16:00 +05:30
Alexander Smorkalov c131c12fd7 Merge pull request #19540 from asmorkalov:as/openexr_comression_options
OpenEXR compression options

* Adding possibility to select the compression type for the OpenEXR format.

There are compression modes other than the default that are more suited for certain data. Mainly grainy/noisy data.

* Code review fixes.

Co-authored-by: Daniel Rydstrom <daniel.rydstrom@sick.se>
2021-02-20 16:28:08 +00:00
Dale Phurrough 4badf640bf add noexcept to default constructors of cv::ocl
- follows iso c++ guideline C.44
- enables default compiler-created constructors to
  also be noexcept

original commit: 77e26a7db3

- handled KernelArg, Image2D
2021-02-20 16:20:25 +00:00
Alexander Alekhin ca7518c13b Merge pull request #19572 from diablodale:fix19571_ocl_noexcept 2021-02-20 15:59:38 +00:00
Dale Phurrough 77e26a7db3 add noexcept to default constructors of cv::ocl
- follows iso c++ guideline C.44
- enables default compiler-created constructors to
  also be noexcept
2021-02-20 14:16:47 +01:00
Alexander Alekhin a7c1838c69 cmake(plugins): build without opencv_*.so on OSX 2021-02-19 16:40:15 +00:00
Alexander Alekhin 54d80d9168 Merge pull request #19561 from mshabunin:plugin-load-now 2021-02-19 11:53:04 +00:00
Alexander Alekhin db2cefd12b Merge pull request #19562 from alalek:libva_dynamic 2021-02-19 11:45:00 +00:00
Alexander Alekhin 8f6ba5a089 Merge pull request #19541 from alalek:core_includes 2021-02-19 11:03:31 +00:00
Alexander Alekhin a40d308d6a samples(va): fix build warnings, use cv::format() 2021-02-19 10:36:26 +00:00
Alexander Alekhin 3dd55d284d core(libva): use dynamic loader 2021-02-19 10:32:59 +00:00
Giles Payne 5cf08b0722 Fix/optimize Android put/get functions 2021-02-19 17:10:11 +09:00
Alexander Alekhin 504ff978c5 Merge pull request #19560 from mshabunin:va-sample-fix 2021-02-18 19:42:08 +00:00
Alexander Alekhin 0421c3991d Merge pull request #19534 from tomoaki0705:fixCudaFiltersRace 2021-02-18 19:41:21 +00:00
Alexander Alekhin 50a1a33d07 Merge pull request #19559 from APrigarina:calib3d_fix 2021-02-18 15:33:02 +00:00
Maksim Shabunin 9a7df7a85d VA sample: device autodetection changed 2021-02-18 17:19:47 +03:00
APrigarina 96570820ef handle empty cameraMatrix 2021-02-18 16:18:19 +03:00
Maksim Shabunin b5a4bd22fb plugins: use RTLD_NOW instead of RTLD_LAZY 2021-02-18 14:45:08 +03:00
Anastasia M eb90186614 Merge pull request #19417 from LupusSanctus:am/text_graph_identity
* Corrected SSD text graph generation for Identity nodes

* Added minor code corrections
2021-02-17 18:01:41 +00:00
Alexander Alekhin 8d21c84e7d Merge pull request #19474 from aryanshomray:darknet_tanh 2021-02-17 17:10:44 +00:00
Liangqian 0aca3fb5af Merge pull request #19026 from chargerKong:dualquat
Dual quaternion

* create dual quaternion;
basic operations, functions(exp,log,norm,inv), to/from mat, sclerp.

* add dqb, dqs, gdqb, to/from affine3;
change algorithm of norm, inv, getTranslation, createFromPitch, normalize;
change type translation to Vec3;
comment improve;

* try fix warning: unreferenced local function

* change exp calculation;
add func(obj) operations;

* Change the algorithm of log function;
add assumeUnit in getRotation;
remove dqs;
change std::vector to InputArray

* fix warning: doxygen and Vec<double, 0>

* fix warning: doxygen and Vec<double, 0>

* add inputarray param for gdqb

* change int to size_t

* win cl warning fix

* replace size_t by int at using Mat.at() function

* replace double by float

* interpolation fix

* replace (i, 0) to (i)

* core(quat): exclude ABI, test_dualquaternion=>test_quaternion.cpp

Co-authored-by: arsaratovtsev <arsaratovtsev@intel.com>
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-02-17 17:05:08 +00:00
Andrey Golubev b50c1ba9e6 Merge pull request #19496 from andrey-golubev:master
[G-API] Change memory measurement statistic in Fluid tests

* Change memory measurement statistic in Fluid tests

* Delete irrelevant comment
2021-02-17 15:23:29 +00:00
Aryansh Omray 601851cc7e TanH darknet and test 2021-02-17 18:49:52 +05:30
Anatoliy Talamanov 413c056504 Merge pull request #19533 from TolyaTalamanov:at/async-requests-hotfix
[G-API] Async infer request hotfix

* Fix hanging on empty roi list

* Prevent possible data race

* Clean up
2021-02-17 14:43:18 +03:00
Alexander Alekhin 29f55810cf Merge pull request #19550 from Nico769:patch-1 2021-02-17 10:19:20 +00:00
Nicola Landolfi f76ba285c9 Fix single-word typo 2021-02-17 10:03:16 +01:00
Matt Alvarado 0a7a54f312 Merge pull request #19498 from mattalvarado:fix_findcirclesgrid
* Properly handle empty centers in findCirclesGrid

* Address alalek comments. Add unit test to validate bugfix

* fix build warnings, remove unrelated comment
2021-02-16 16:18:43 +00:00
Alexander Alekhin 5b16b190c1 Merge pull request #19543 from alalek:hotfix_19439 2021-02-16 16:05:09 +00:00
Alexander Alekhin 0885a79c28 imgcodecs(test): don't include png.h 2021-02-16 13:26:51 +00:00
Alexander Alekhin 20d5d1c4c2 Merge pull request #19470 from alalek:core_parallel_plugins 2021-02-16 11:12:05 +00:00
Alexander Alekhin 6d3502833f core: include version.hpp in cvdef.h, fix precomp.hpp usage 2021-02-16 11:10:45 +00:00
Qoo bc8727786b save allocation of memory for fake image 2021-02-15 20:14:07 -05:00
Alexander Alekhin 928d5ae315 Merge pull request #19528 from smirnov-alexey:as/gapi_optional_fix 2021-02-15 23:00:11 +03:00
Dan Ben-Yosef f0445295bd Merge pull request #19525 from danbey:Fix-cppcheck-error-in-carotete-lib
* Reduce if statement as it has the same expression on both sides of '&&'

If statement has the same expression on both sides so this can be reduce

Signed-off-by: Dan Ben Yosef <danbey@gmail.com>

* The if statement is to check width and height
2021-02-15 19:58:37 +00:00
Dmitry Budnikov 0cdbdfdf9f Merge pull request #19516 from dbudniko:dbudniko/gapi_render_frame_cpu
Render Frame NV12 on CPU

* render frame on CPU

* doxygen fix

* address review from Alexey

* comment fixes

* Address comments from Ruslan

* remove NV12 specific

* mat clone and more renaming

* misprint fix
2021-02-15 19:57:22 +00:00
Amir Tulegenov 47426a8ae5 Merge pull request #19392 from amirtu:OCV-165_finalize_goodFeaturesToTrack_returns_also_corner_value_PR
* goodFeaturesToTrack returns also corner value

(cherry picked from commit 4a8f06755c)

* Added response to GFTT Detector keypoints

(cherry picked from commit b88fb40c6e)

* Moved corner values to another optional variable to preserve backward compatibility

(cherry picked from commit 6137383d32)

* Removed corners valus from perf tests and better unit tests for corners values

(cherry picked from commit f3d0ef21a7)

* Fixed detector gftt call

(cherry picked from commit be2975553b)

* Restored test_cornerEigenValsVecs

(cherry picked from commit ea3e11811f)

* scaling fixed;
mineigen calculation rolled back;
gftt function overload added (with quality parameter);
perf tests were added for the new api function;
external bindings were added for the function (with different alias);
fixed issues with composition of the output array of the new function (e.g. as requested in comments) ;
added sanity checks in the perf tests;
removed C API changes.

* minor change to GFTTDetector::detect

* substitute ts->printf with EXPECT_LE

* avoid re-allocations

Co-authored-by: Anas <anas.el.amraoui@live.com>
Co-authored-by: amir.tulegenov <amir.tulegenov@xperience.ai>
2021-02-15 19:55:57 +00:00
Alexander Alekhin cc73c36e32 core(parallel): plugins support 2021-02-15 17:07:36 +00:00
Alexander Alekhin 5a06d679cf Merge pull request #19532 from amirtu:OCV-166_getDefaultName_overload 2021-02-15 15:33:54 +00:00
Alexander Alekhin 76cc034df2 Merge pull request #19519 from alalek:issue_19485 2021-02-15 15:15:27 +00:00
amir.tulegenov cbb230fdfc fix getDefaultName() 2021-02-15 19:21:53 +06:00
Tomoaki Teshima 5d1540f4fc remove danger race condition 2021-02-15 21:01:41 +09:00
Smirnov Alexey fdd5c26eb8 Fix optional move constructor 2021-02-15 00:20:08 +03:00
Zhuo Zhang a5a421a9f1 Merge pull request #19522 from zchrissirhcz:3.4-fix-android-find-zlib-shared-since-ndk19
* fix find zlib.so instead of zlib.a when NDK >= 19

On Android platform, `libopencv_imgcodecs.a` is built, expected to
depend on `libz.so`. However, since Android NDK r19, NDK's `libz.a`
is found instead of `libz.so`, leading to link error
(not found libz.a) on machines without same NDK version & direcotry.

Since Android NDK-r19, toolchain pieces are installed to
`$NDK/toolchains/llvm/prebuilt/<host-tag>/...`, including `libz.so`.
Also installed to old paths (`<NDK>/platforms` and `<NDK>/sysroot`)
in NDK r19, r20, r21, but since NDK 22, old paths are removed.

- https://github.com/android/ndk/wiki/Changelog-r19
- https://github.com/android/ndk/wiki/Changelog-r22

With this commit, `libz.so` can be correctly found in NDK<19 and NDK>=19.

`ZLIB_LIBRARIES` is also simplified as `z`, by appending match (regex)
patterns for new toolchain installation directory's libz.so's paths.

* simplify libz.so match pattern for abbreviation
2021-02-14 21:38:53 +03:00
Zhuo Zhang 743099f9f9 Merge pull request #19521 from zchrissirhcz:3.4-fix-core-module-android-arm64-build
* fix core module android arm64 build

* fix core module android build when neon is off

When building for Android ARM platform, cmake with
`-D CV_DISABLE_OPTIMIZATION=ON`, the expected behavior is
not using ARM NEON, using naive computation instead.

This commit fix the un-expected compile error for neon intrinsincs.
2021-02-14 21:37:11 +03:00
Alexander Alekhin ad66b070a7 Merge pull request #19501 from komakai:android-ndk22 2021-02-14 12:41:33 +00:00
Alexander Alekhin 6f6dd227f8 Merge pull request #19523 from the-sparrow:master 2021-02-13 22:44:32 +00:00
Alexander Alekhin d2d6eba16a cmake: fix add_apple_compiler_options() calls and OBJCXX handling 2021-02-13 18:37:30 +00:00
Alexander Alekhin cceec84139 Merge pull request #19520 from WeiChungChang:refine 2021-02-13 18:18:12 +00:00
the-sparrow 3d5f9e8b14 fix the spell error 2021-02-13 17:08:56 +08:00
Giles Payne 2cb48e034e Build for NDK 22 2021-02-13 13:00:19 +09:00
Qoo c909693d45 refine 2021-02-12 20:53:09 -05:00
Alexander Alekhin e5d78960c6 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-12 21:34:49 +00:00
Alexander Alekhin fba70f7991 Merge pull request #19515 from zchrissirhcz:3.4-fix-mislinked-zlib-in-vcpkg-by-adjust-link-order 2021-02-12 20:28:52 +00:00
Zhuo Zhang 84a290097b fix link order: put zlib after png/tiff/openexr
Previous link dependency: imgcodecs --> zlib --> libpng
this can generate imgcodecs shared lib, until Visual Studio integrated
with vcpkg, which will additionally specify LIBPATH, pointing to vcpkg
installed zlib (if any), which links the wrong zlib.

Fixed link dependency: imgcodecs --> libpng --> zlib
in this fixed case, symbols in zlib referenced in libpng will be found
in the build-from-source static zlib, instead of the vcpkg one.

related discussion:
- https://github.com/microsoft/vcpkg/issues/16165
- https://github.com/opencv/opencv/issues/17051
- https://github.com/opencv/opencv/issues/10576

MSVC linking order reference pages:
- https://docs.microsoft.com/en-us/cpp/build/reference/link-input-files?view=msvc-160
  for link order
- https://docs.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-160
  LIB environment variable, for library file searching
- https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath?view=msvc-160
  LIBPATH option, for library file searching
2021-02-12 22:19:35 +08:00
Anatoliy Talamanov ba8d20e9ae Merge pull request #19425 from TolyaTalamanov:at/async-infer
[G-API] Implement async infer

* Implement async infer

* Fix typo
2021-02-12 12:28:37 +00:00
Alexander Alekhin 767127c92e Merge pull request #19505 from alalek:hotfix_19456 2021-02-11 18:52:56 +00:00
Alexander Alekhin 65b5d34aee cmake: use INTERFACE_COMPILE_DEFINITIONS with definition 2021-02-11 14:06:54 +00:00
Francesco Petrogalli 6ee23c9b85 Merge pull request #19486 from fpetrogalli:dotprod_fast-3.4
* [hal][neon] Optimize the v_dotprod_fast intrinsics for aarch64.

On Armv8 in AArch64 execution mode, we can skip the sequence

   v<op>_<ty>(vget_high_<ty>(x), vget_high_<ty>(y))

in favour of

   v<op>_high_<ty>(x, y)

This has better changes for recent compilers to use less data movement
operations and better register allocation. See for example:

   https://godbolt.org/z/bPq7vd

* [hal][neon] Fix build failure on armv7.

* [hal][neon] Address review comments in PR.

PR: https://github.com/opencv/opencv/pull/19486

* [hal][neon] Define macro to check for the AArch64 execution state of Armv8.

* [hal][neon] Fix macro definition for AArch64.

The fix is needed to prevent warnings when building for Armv7.
2021-02-11 13:24:09 +00:00
Alexander Alekhin cac5b0fe5a Merge pull request #19494 from derbosper:js-build-config-fix 2021-02-10 19:43:16 +00:00
Tsukasa Sugiura 107f233626 Merge pull request #19484 from UnaNancyOwen:fix_highlevelapi
* [dnn] fix high level api for python

* [dnn] add test_textdetection_model_db

* [dnn] fix textdetection test only check type and shape
2021-02-10 19:42:00 +00:00
Cuntian Liu 0677f3e21c Merge pull request #19452 from ctuu:patch-1
* fix: findCUDNN script

* Update FindCUDNN.cmake
2021-02-10 19:38:34 +00:00
Alexander Alekhin 93783df42a Merge pull request #19439 from raaldrid:Exif_support_for_PNG_issue_16579 2021-02-10 19:35:31 +00:00
Dmitry Budnikov 1162cef978 Merge pull request #19495 from dbudniko:gapi_media_frame_size
Add Media Frame size function and corresponding tests

* add media frame size and tests

* Address comments from Ruslan and Asya
2021-02-10 19:23:54 +00:00
Mieszko Boczkowski a3fb64d1cd Pass custom config file path as absolute 2021-02-10 12:45:35 +01:00
Alexander Alekhin 7079e7ea5e Merge pull request #19480 from vrabaud:3.4 2021-02-09 22:48:59 +00:00
Alexander Alekhin 4f39f8a8d0 Merge pull request #19488 from asmorkalov:as/nonfree_check 2021-02-09 20:38:30 +00:00
Alexander Alekhin 27bada6737 Merge pull request #19471 from sturkmen72:patch-5 2021-02-09 18:57:43 +00:00
Rachel A 650836d700 Exif parsing for PNG files to support Exif orientation tag. Moved decoder specific Exif parsing to JPEG and PNG decoders, respectively. Issue 16579 2021-02-09 10:35:27 -08:00
Anatoliy Talamanov c527b3cefd Merge pull request #19319 from TolyaTalamanov:at/introduce-gopaque-garray-for-python
[G-API] Introduce GOpaque and GArray for python

* Introduce GOpaque and GArray for python

* Fix ctor

* Avoid code duplication by using macros

* gapi: move Python-specific files to misc/python

* Fix windows build

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-02-09 13:55:16 +00:00
Alexander Smorkalov 3b9aebee11 Not not test stitiching with SURF, if NONFREE is disabled 2021-02-09 16:54:06 +03:00
Vincent Rabaud 847b16fb76 Disable thread sanitization when CV_USE_GLOBAL_WORKERS_COND_VAR is not set.
This fixes #19463
2021-02-09 14:12:39 +01:00
Ilya Churaev 8fa013309e Merge pull request #19479 from ilyachur:remove_v0_multiply
* Switched to v1 Multiply

* Apply changes only for new OV
2021-02-09 09:46:28 +00:00
Anna Khakimova 7ab3a80d0a Merge pull request #19233 from anna-khakimova:ak/simd_absdiffc
GAPI: SIMD optimization for AbsDiffC kernel

* SIMD optimization for AbsDiffC kernel

* Applied comments

* Applying comments and refactoring: Remove new univ intrinsics.

* Performance experiment

* Applied comments.Step2

* Applied comments. Step3
2021-02-08 13:02:35 +00:00
Alexander Alekhin e5518ee657 Merge pull request #19422 from alalek:js_tutorial_intelligent_scissors_note 2021-02-07 20:07:19 +00:00
Suleyman TURKMEN 2387813428 Update imageSegmentation.cpp, imageSegmentation.py 2021-02-07 17:42:52 +03:00
Alexander Alekhin 0c31c0756c Merge pull request #19468 from hmaarrfk:fix_apple_check 2021-02-06 14:54:49 +00:00
Mark Harfouche 7405075ede CHange import order to avoid apple check error 2021-02-05 23:24:56 -05:00
Alexander Alekhin 6b474c4051 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-02-06 00:44:11 +00:00
Alexander Alekhin a9c954e821 Merge pull request #19467 from alalek:hotfix_19411 2021-02-06 00:42:26 +00:00
Alexander Alekhin b6933dbf3a highgui(pollKey): properly handle no-GUI case 2021-02-05 23:51:52 +00:00
Alexander Alekhin f46b1252c4 Merge pull request #19466 from alalek:hotfix_19259 2021-02-05 23:46:24 +00:00
Alexander Alekhin e6959055b5 core(cuda.hpp): fix GpuMatND compilation with GCC < 5 2021-02-05 22:42:56 +00:00
Polina Smolnikova 0be18f5cb0 Merge pull request #19407 from rayonnant14:issue_19363
QRCodeDetector::decodeMulti() fixed invalid usage fixedType()

* fixed invalid usage fixedType()
changed default barcode type to CV_8UC1
added tests
added assert in case multi channel straight barcode input

* deleted extra wrap into OutputArray

* fix warnings

* objdetect(qr): remove unnecessary checks

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-02-05 21:24:27 +00:00
Namgoo Lee 7ea21c4b3c Merge pull request #19259 from nglee:dev_gpumatnd1
Minimal implementation of GpuMatND

* GpuMatND - minimal implementation

* GpuMatND - createGpuMatHeader

* GpuMatND - GpuData, offset, getDevicePtr(), license

* reviews

* reviews
2021-02-05 20:30:37 +00:00
Alexander Alekhin 9d227641c9 Merge pull request #19411 from crackwitz:highgui-pollkey 2021-02-05 20:18:53 +00:00
Alexander Alekhin 2a2e4e78bf Merge pull request #19451 from alalek:cmake_mkl_tbb_oneapi_workaround 2021-02-05 14:22:43 +00:00
Anna Khakimova fb3b297369 Merge pull request #18466 from anna-khakimova:ak/simd_addw_bitwise
GAPI: SIMD optimization for AddWeighted kernel.

* Add, sub, absdiff kernels optimization

* AddW kernel

* And, or kernels

* AddWeighted refactoring and SIMD opt for AbsDiffC kernel

* Remove simd opt of AbsDiffC kernel

* Refactoring

* Applied comments

* Refactoring.Step2

* Applied comments.Step2
2021-02-05 14:21:42 +00:00
Alexander Alekhin 050327a1e2 Merge pull request #19456 from alalek:fixup_19447 2021-02-04 16:03:24 +00:00
Alexander Alekhin 4f08bb5046 Merge pull request #19428 from alalek:dnn_drop_misbehaved_clamp 2021-02-04 11:57:19 +00:00
Jebastin Nadar 09d2ca17cf Merge pull request #19449 from SamFC10:tf-leakyrelu
* add LeakyRelu to tf-importer

* fix whitespace error

* added test for leakyrelu
2021-02-04 08:50:08 +00:00
Alexander Alekhin 83aa711346 dnn: rename clamp() => normalize_axis() 2021-02-04 08:13:55 +00:00
Alexander Alekhin fcff767a7f cmake(tbb): fix target_compile_definitions() with "UNKNOWN" target
- https://gitlab.kitware.com/cmake/cmake/-/issues/19434
2021-02-03 22:18:39 +00:00
Alexander Alekhin 7a282a8892 cmake: workaround oneAPI problem with -DMKL_WITH_TBB=ON 2021-02-03 19:41:54 +00:00
Alexander Alekhin 863ecded30 Merge pull request #19440 from paroj:pyexcept 2021-02-03 11:08:24 +00:00
Alexander Alekhin 3e34cec96b Merge pull request #19408 from crackwitz:ogl-wndprop-vsync 2021-02-03 09:56:57 +00:00
Alexander Alekhin 6ca46afa63 Merge pull request #19286 from diablodale:add-cuda-stream-constructor 2021-02-03 09:55:02 +00:00
Alexander Alekhin 0a86ddc36c Merge pull request #19435 from l-bat:lb/onnx_normalize 2021-02-03 09:16:06 +00:00
Christoph Rackwitz ab0e1c573a highgui: expose VSYNC window property for OpenGL on W32
property getter/setter code conditional on HAVE_OPENGL
getter: return -1 upon specific OpenGL errors
2021-02-03 09:53:13 +01:00
Christoph Rackwitz 26da491053 implementation of pollKey, companion to waitKey
w32 backend: implemented
other backends: stubbed or fallback to waitKey
documentation: cross-linked and more precise in some places
2021-02-02 22:24:54 +01:00
Alexander Alekhin 674ecc5581 Merge pull request #19447 from alalek:cmake_tbb_workaround_msvc 2021-02-02 20:33:26 +00:00
Pavel Rojtberg 6c1a433c4c python: also catch general c++ exceptions
they might be thrown from third-party code (notably Ogre in the ovis
module).
While Linux is kind enough to print them, they cause instant termination
on Windows.
Arguably, they do not origin from OpenCV itself, but still this helps
understanding what went wrong when calling an OpenCV function.
2021-02-02 21:16:01 +01:00
Alexander Alekhin eced4dd023 cmake: workaround oneTBB build issues with MSVC 2021-02-02 15:03:27 +00:00
Alexander Alekhin 23734aff74 Merge pull request #19443 from asmorkalov:as/guard_nonfree 2021-02-02 11:12:14 +00:00
Alexander Smorkalov 0016c25b58 Guard non-free usage in stitching as contrib can be built without it. 2021-02-02 13:24:59 +03:00
LaurentBerger 94e1126678 Merge pull request #19423 from LaurentBerger:houg_acc
Return accumulator value in HoughLines algorithm

* try to solve #17050

use cv_wrap_as

add python test

parameters

* review

* move wrapper to imgproc/bindings.hpp
2021-02-01 21:22:10 +00:00
Liubov Batanina 68eb54dc13 Added ONNX NormalizeL2 subgraph 2021-02-01 12:44:48 +03:00
Liangda-w b08d67c4e1 Merge pull request #19419 from Liangda-w:patch-1
* Fix error in documentation for RGB->HSV convertion

* Update colors.markdown
2021-02-01 09:17:54 +00:00
Alexander Alekhin 2b787eb4b8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-31 17:44:15 +00:00
Alexander Alekhin 5ab4623c2a Merge pull request #19430 from alalek:fixup_19216 2021-01-31 17:41:24 +00:00
Alexander Alekhin cdf73f2e05 Merge pull request #19427 from alalek:issue_19426 2021-01-31 14:24:37 +00:00
Alexander Alekhin 30bef20e22 js: fix SIMD build 2021-01-31 00:12:51 +00:00
Alexander Alekhin 4be077163f Merge pull request #19424 from alalek:cmake_linters_update 2021-01-30 12:37:57 +00:00
Alexander Alekhin b9dfffc237 Merge pull request #19057 from sl-sergei:changes_for_cuda_1d 2021-01-30 11:39:43 +00:00
Alexander Alekhin c5bf15e009 build: fix cv2.cpp compilation 2021-01-30 11:32:27 +00:00
Sergey Slashchinin e2949c7d0a Align 3.4 branch with master 2021-01-29 23:48:08 +03:00
Alexander Alekhin e448f4f6ef cmake: fix pylint/flake8 detection, update flake8 exclude 2021-01-29 17:06:54 +00:00
Maxim Pashchenkov e250bae356 Merge pull request #18943 from mpashchenkov:mp/onnx-padding
G-API: ONNX. Support for networks with three dimensional input.

* Padding without tests

* Removed padding

* Some small fixes

* Added wstring_convert

* Alignment fix, m b

* Small fixes

* Moved include from onnx.hpp
2021-01-29 14:53:42 +00:00
Alexander Alekhin ebd91459f2 Merge pull request #19395 from Ixarias:patch-1 2021-01-29 12:34:00 +00:00
Alexander Alekhin 1a5b411ae4 js(tutorial): add note about CVAT integration 2021-01-29 10:27:47 +00:00
Olivier Le Doeuff 4c7f56263e Merge pull request #19370 from OlivierLDff:patch-dshow-convertrgb
VideoCapture/DSHOW : Allow to set CAP_PROP_CONVERT_RGB before FOURCC/FPS/CHANNEL/WIDTH/HEIGHT.

* 🐛 cap_dshow : Allow to set CAP_PROP_CONVERT_RGB before FOURCC/FPS/CHANNEL

* 🐛 cap_dshow : fix g_VI.setConvertRGB not being called with correct boolean value on first property set.

*  cap_dshow : Test CAP_PROP_CONVERT_RGB persistence

* 🚨 Fix cast from bool to double

* 🚨 Fix trailing whitespace
2021-01-29 10:18:09 +00:00
Alexander Alekhin 6be9496d73 Merge pull request #19384 from mshabunin:support-onetbb 2021-01-29 06:44:36 +00:00
Maksim Shabunin 46b2da409b MKL-TBB: removed tbb from dependencies list 2021-01-29 02:38:05 +03:00
Maksim Shabunin 694fe3e7d2 core, gapi: supported build with oneTBB 2021 2021-01-29 02:38:05 +03:00
Alexander Alekhin 900051cd04 Merge pull request #19413 from alalek:videoio_plugins_capture_params 2021-01-28 15:17:36 +00:00
Dale Phurrough 34c3f0f495 add cuda::Stream constructor with cuda flags 2021-01-28 16:14:01 +01:00
Alexander Alekhin e705414bea videoio(plugins): support VideoCaptureParameters, CAPTURE_API_VERSION=1
- example: ffmpeg
2021-01-28 06:09:23 +00:00
MaximMilashchenko 467870415b Merge pull request #19394 from MaximMilashchenko:params
add video capture parameters

* add parameters

* videoio: revert unnecessary massive changes

* videoio: support capture parameters in backends API

- add tests
- FFmpeg backend sample code
- StaticBackend API is done
- support through PluginBackend API will be added later

Co-authored-by: Milashchenko <maksim.milashchenko@intel.com>
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-01-27 22:07:43 +00:00
Alexander Alekhin ff8a624189 Merge pull request #19404 from LupusSanctus:am/text_graph_preproc 2021-01-27 18:32:33 +00:00
Alexander Alekhin 37c12db366 Merge pull request #19365 from alalek:parallel_api 2021-01-27 18:12:15 +00:00
Anastasia Murzova 449ebc1b70 Corrected SSD text graph generation 2021-01-27 19:53:52 +03:00
Alexander Alekhin b73bf03bfc core: parallel backends API
- allow to replace parallel_for() backend
2021-01-27 14:15:33 +00:00
Ixarias 3f14341629 Change Keymap wording for gray image in curve mode
Instead of being a copy of line 76, line 79 instead correctly indicates that it will show a histogram for a gray image in curve mode, as given by the code block at line 103 referencing image "gray" instead of image "im".
2021-01-26 16:30:50 -06:00
Alexander Alekhin ca9cbab532 Merge pull request #19403 from diablodale:fix_19402_python_test_filter_34 2021-01-26 19:23:12 +00:00
Dale Phurrough 5c70a2015f fix python test runner wildcard handling
* fix opencv/opencv#19402
2021-01-26 19:05:40 +01:00
Anastasia M 8c221981bf Merge pull request #17604 from LupusSanctus:am/pytorch_tf_cls_tutorial
[GSoC] Added TF and PyTorch classification conversion cases

* Added TF and PyTorch classification conversion cases

* Modified structure, some processing scripts. Added evaluation pipeline

* Minor structure change

* Removed extra functions, minor structure change

* Modified structure, code corrections

* Updated classification code block, added classification tutorials

* Added minor modifications of paths

* Classification block corrections in accordance with comments
2021-01-26 11:06:15 +00:00
Alexander Alekhin e85b41f9be Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-25 22:42:13 +00:00
Alexander Alekhin 573812d0ff Merge pull request #19373 from l-bat:lb/tf_matmul_shared 2021-01-25 22:08:24 +00:00
Liubov Batanina c12930cdde Merge pull request #19372 from l-bat:lb/onnx_pads_calc
* Fixed bug with constant Div

* Supported constant mul and div for inputs with different shapes
2021-01-25 22:07:50 +00:00
Alexander Alekhin 857f339914 Merge pull request #19385 from alalek:ocl_isOpenCLActivated_update 2021-01-25 13:54:00 +00:00
Alexander Alekhin b1ffe7a153 Merge pull request #19390 from tomoaki0705:fixCudaLegacyCalib3d 2021-01-25 13:32:43 +00:00
Alexander Alekhin f54f6627c3 Merge pull request #19388 from GArik:orbbec 2021-01-25 13:29:28 +00:00
Alexander Alekhin 62b60b11bb Merge pull request #19344 from VadimLevin:dev/vlevin/generic-sequence-conversion 2021-01-25 08:22:57 +00:00
Tomoaki Teshima 96e0902f39 fix peaky test failure
* follow the review comment
2021-01-25 17:14:37 +09:00
Vadim Levin 1d3207d7c7 feat: common fixed size sequence conversion for Python bindings 2021-01-25 08:08:38 +03:00
ZhM 13a1105318 Merge pull request #19078 from zihaomu:dasiamrpn_tracker_c_plus_plus
Add DaSiamRPN tracker sample of c++ version

* add sample dasiamrpn_tracker of c++ version.

* samples(dasiamrpn_tracker.cpp): apply clang-format

- exclude "keys" variable

* samples(dasiamrpn_tracker.cpp): coding style and UX fixes
2021-01-24 22:22:25 +00:00
Alexander Alekhin 8e5e1b62aa Merge pull request #19380 from alalek:python_fix_rect_conversion 2021-01-24 22:19:28 +00:00
Igor Murzov 19ef9505e8 Small corrections to Orbbec Astra cameras tutorial 2021-01-24 19:13:36 +03:00
Orest Chura e982ad2284 Merge pull request #19337 from OrestChura:oc/fLine_fCont_perftests
[G-API]: Performance tests for fitLine and findContours

* Perf.Test for findContours(H)

* Perf.Test for fitLine(2D.3D;Mat,vector<Point2i/2f/2d/3i/3f/3d>)

* Reducing the template specializations number

* Applying comments
2021-01-24 15:41:04 +00:00
Alexander Alekhin fb0abdeb4f Merge pull request #19383 from tomoaki0705:fixWrongIndex 2021-01-24 15:23:34 +00:00
Alexander Alekhin 331f1b9961 Merge pull request #19382 from crackwitz:highgui-w32-remove-gutter 2021-01-24 15:23:04 +00:00
Tomoaki Teshima 3cfe7b9af9 fix wrong index 2021-01-24 20:29:52 +09:00
Alexander Alekhin 37e656082b core(ocl): update isOpenCLActivated()
- reuse g_isOpenCLAvailable variable instead
2021-01-24 01:25:17 +00:00
Christoph Rackwitz 0c0cf8b19f highgui: remove gutter in window_w32 2021-01-23 16:01:07 +01:00
Alexander Alekhin 7825abd540 python: handle errors in Rect conversions 2021-01-23 03:07:38 +00:00
Alexander Alekhin cd59516433 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-22 21:29:21 +00:00
Alexander Alekhin bbad38b2c5 Merge pull request #19376 from alalek:fixup_19105 2021-01-22 20:22:36 +00:00
Alexander Alekhin 413febf657 Merge pull request #19334 from alalek:fix_19134 2021-01-22 20:05:58 +00:00
Alexander Alekhin d5447d859f js(doc): fix path 2021-01-22 19:50:25 +00:00
Alexander Alekhin 1a3a25f825 Merge pull request #19364 from asmorkalov:as/capture_buffer_safety_test 2021-01-22 19:18:14 +00:00
Liubov Batanina 38a49f92ab Added shared weights for MatMul 2021-01-22 16:47:02 +03:00
Alexander Smorkalov b4e941d431 VideoCapture test to ensure that cv::VideoCapture does not share output buffers between frames. 2021-01-22 16:42:48 +03:00
Sergei Slashchinin ea41f89b40 Merge pull request #19058 from sl-sergei:cuda_1d
Conv1D and Pool1D for CUDA backend

* CUDA-independent changes

* Add Conv1D and Pool1D for CUDA backend

* CUDA-independent changes

* Fix typo

* fix comment

* Update fix

* make changes more correct for pooling layer

* Minor fixes for review

* Split skip blocks
2021-01-21 22:16:56 +00:00
Alexander Alekhin 7a790d0d35 Merge pull request #19355 from alalek:fixup_19050 2021-01-20 22:46:05 +00:00
Alexander Alekhin 995c308a49 Merge pull request #19353 from mshabunin:new-forum-links-master 2021-01-19 22:29:36 +00:00
Alexander Alekhin 1d5589296e gapi: fix build warning 2021-01-19 22:10:05 +00:00
Alexander Alekhin 0f968e3b6d Merge pull request #19352 from mshabunin:new-forum-links 2021-01-19 21:56:42 +00:00
Alexander Alekhin 8a44e712f8 Merge pull request #19345 from Ryyyc:patch-1 2021-01-19 21:52:14 +00:00
Maksim Shabunin e4e10e54df Updated more links to forum.opencv.org 2021-01-19 22:03:22 +03:00
Maksim Shabunin f65d75f5c8 Updated more links to forum.opencv.org 2021-01-19 21:55:45 +03:00
Alexander Alekhin d93790717d Merge pull request #19340 from tomoaki0705:fixStitchingExposure 2021-01-18 20:35:41 +00:00
Alexander Alekhin 291dbdfbe6 Merge pull request #19336 from kyshel:patch-1 2021-01-18 20:16:04 +00:00
Alexander Alekhin 5e5f47321b Merge pull request #19320 from alalek:videoio_plugins_api_split_capture_write
videoio(plugins): split capture and writer APIs
2021-01-18 23:14:57 +03:00
Alexander Alekhin 6ce9bb6f7a Merge pull request #19312 from VadimLevin:dev/vlevin/clear-msg-for-failed-overload-resolution 2021-01-18 20:14:10 +00:00
Ruan 109637e213 Update essential_mat_reconstr.cpp
A small clerical error of an author. The correct expression should be "xy += x_*y_;".
2021-01-18 23:56:34 +08:00
Vadim Levin a0bdb78a99 feat: add overload resolution exception for Python bindings 2021-01-18 16:29:17 +03:00
kyshel 321f26f450 update xrange() to range()
update xrange() to range() as Python 2 has been deprecate, more info:
1.  Python 2 has been no longer supported officially since January 1, 2020.  Check  https://www.python.org/doc/sunset-python-2/
2.  xrange() was renamed to range() in Python 3. Check  https://stackoverflow.com/questions/17192158/nameerror-global-name-xrange-is-not-defined-in-python-3/17192181#17192181

update xrange() to range()

Update py_fourier_transform.markdown

update xrange() to range()
2021-01-18 19:52:37 +08:00
Alexander Alekhin 212815a10d core(ocl): fix lifetime handling of Image kernel args 2021-01-18 06:24:36 +00:00
Alexander Alekhin 104e64dd0f Merge pull request #19339 from ichisadashioko:modules_highgui_src_window_w32_typo 2021-01-17 22:00:00 +00:00
Tomoaki Teshima e49ae68524 workaround the test failure 2021-01-18 06:03:43 +09:00
Alexander Alekhin 49127b6a26 Merge pull request #19331 from alalek:gapi_lazy_initialization_kernel_intrinsics 2021-01-17 19:20:18 +00:00
Alexander Alekhin 255853a819 Merge pull request #19326 from alalek:gapi_async_service_lazy_initialization 2021-01-17 19:19:48 +00:00
shioko 5967acc9ca fix typo of the word storage 2021-01-17 18:59:20 +00:00
Alexander Alekhin 28c0cd8460 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-16 19:03:42 +00:00
Alexander Alekhin eea4397b12 Merge pull request #19332 from alalek:xcode_ccache 2021-01-16 18:58:02 +00:00
Alexander Alekhin a122a53e72 Merge pull request #19330 from l-bat:lb/onnx_mish_subgraph 2021-01-16 18:42:19 +00:00
Alexander Alekhin 8215380336 cmake: support ccache with Xcode generator 2021-01-15 19:58:01 +00:00
Alexander Alekhin 10ef76905c gapi: avoid global static initializers
- use lazy on-demand initialization
2021-01-15 17:22:03 +00:00
Liubov Batanina af9597f454 Added Mish ONNX subgraph 2021-01-15 14:01:48 +03:00
Alexander Alekhin e43375cc68 gapi(async): use lazy-initialization of async_service singleton 2021-01-15 04:47:54 +00:00
Alexander Alekhin 63bb2abada Merge pull request #19321 from alalek:fixup_19027 2021-01-14 12:08:10 +00:00
Francesco Petrogalli 235e648bf5 Merge pull request #19268 from fpetrogalli:tabs-summary-output
* [ts][summary.py] Extend `-o` to support tabs separated output.

* [ts][summary.py] Improve TABS sepatated output.

There is no need to print TAB at the beginning and at the end of each
row in the table.

Cosmetic change: using python list comprehension instead of for loop
to process a single row.
2021-01-14 12:01:36 +00:00
Alexander Alekhin 5202186681 Merge pull request #19050 from anton-potapov:fix_range_var_clang_warnings 2021-01-14 10:44:42 +00:00
Alexander Alekhin 98889e41b0 videoio: fix API/ABI_VERSION macros before plugin_api.hpp 2021-01-14 10:36:10 +00:00
Alexander Alekhin 962cdc2d98 videoio: split capture/writer plugin APIs
- migrate GStreamer backed
- migrate FFmpeg backend (with switch on legacy API)
- cv_videoio_capture_retrieve_cb_t uses Mat type instead of number of channels
2021-01-14 06:19:23 +00:00
Alexander Alekhin 71acf078ba videoio: preserve git history in plugin_*.hpp files 2021-01-13 22:37:46 +00:00
Alexander Alekhin b3233de1c2 videoio: mv plugin_api.hpp (preserve git history) 2021-01-13 22:36:53 +00:00
Alexander Alekhin 63982d6771 videoio: preserve git history in backend_plugin_legacy.impl.hpp 2021-01-13 22:26:18 +00:00
Alexander Alekhin 2cd540b9c4 videoio: backup backend_plugin_legacy.impl.hpp 2021-01-13 22:25:19 +00:00
Alexander Alekhin bbdae291ed Merge pull request #19108 from ReID-Team:sample_person_reid 2021-01-13 14:22:41 +00:00
mznw f9f33a7bb5 sample of person ReIDentification. 2021-01-13 11:21:00 +08:00
Orest Chura d34a34f328 Merge pull request #19215 from OrestChura:oc/bRect_perftests
[G-API]: Performance tests for boundingRect

* Update boundingRect() tests with the changes from fitLine() PR

* Add performance tests for boundingRect

* Applying comment about g_type_of_t

* Addressing comments

* Addressing comment: replace cmp_f by CompareF in perf.tests + add the default constructor for CompareF

* Fix typo
2021-01-12 21:33:05 +00:00
Maxim Pashchenkov 3eaeca58da Merge pull request #18902 from mpashchenkov:mp/onnx-const-input
G-API: ONNX. Const input

* Added const input for ONNX backend

* Returned initMatrixRandu, added some comments, rebase
2021-01-12 21:31:15 +00:00
Alexander Alekhin d3bc563c6e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-01-12 18:34:33 +00:00
Alexander Alekhin fbcc532de5 Merge pull request #19300 from alkasm:patch-2 2021-01-12 18:28:58 +00:00
Alexander Alekhin 72894a1a90 Merge pull request #19216 from terfendail:wasm_fall 2021-01-12 17:57:24 +00:00
Alexander Reynolds e3856dfe5d hotfix: call isOpened() in python bg sub tutorial
https://github.com/opencv/opencv/issues/19299
2021-01-11 14:04:56 -08:00
Alexander Alekhin 62420b900e Merge pull request #19301 from krush11:3.4 2021-01-11 20:58:33 +00:00
Alexander Alekhin 89ef676613 Merge pull request #19297 from raaldrid:Template_Match_Tutorial_fix_17739 2021-01-11 20:54:54 +00:00
Alexander Alekhin 83e14f602f Merge pull request #19296 from raaldrid:Doc_issue_fix_18836_FULL 2021-01-11 20:04:49 +00:00
Alexander Alekhin 5389309d40 Merge pull request #19291 from gpiffault:docs-js_usage-fix_imshow 2021-01-11 20:03:29 +00:00
Alexander Alekhin 058460ddf4 Merge pull request #19248 from LaurentBerger:forum 2021-01-11 20:02:51 +00:00
Rachel A 380009ac58 Template Matching Tutorial issue fix https://github.com/opencv/opencv/issues/17739 2021-01-11 11:19:59 -08:00
Alexander Alekhin 2775099a32 Merge pull request #19220 from alalek:dnn_tf_importer_error_reporting 2021-01-11 19:12:41 +00:00
Rachel A f98e567f49 Solution to documentation issue https://github.com/opencv/opencv/issues/18836 2021-01-11 10:43:26 -08:00
LaurentBerger 9fb48d5f44 update forum link 2021-01-11 18:39:46 +00:00
Vitaly Tuzov 8f653ba8de Inlined WASM fallback intrinsics to avoid using of V_TypeTraits 2021-01-11 18:12:21 +03:00
krush11 87b3b48fe0 added multi-config to regexp 2021-01-10 11:11:23 +05:30
Grégoire Piffault 0043d9bf13 docs(tutorial_js_usage): fix imshow usage 2021-01-09 14:53:35 +01:00
notmatthancock 2d2d72afbb Merge pull request #19258 from notmatthancock:doc/update-sift-patent-blurb
* Remove sentences about SIFT patent and code location

* Add note about patent in opencv-specific section
2021-01-05 11:33:57 +00:00
Alexander Alekhin 941a9792f7 Merge pull request #19247 from kloczek:master 2021-01-03 13:33:49 +00:00
Your Name 646a023ff4 Fix building opencv using gcc 11.x #19244
Add missing `#include <thread>` in modules/gapi/test/test_precomp.hpp
2021-01-02 17:43:11 +00:00
Alexander Alekhin 4f9cb3871a copyright: 2021 2021-01-01 13:40:32 +00:00
Alexander Alekhin 005508a07b copyright: 2021 2021-01-01 13:40:01 +00:00
Alexander Alekhin 5b598c1812 Merge pull request #19239 from justinchuby:justinchuby-doc-typo-hough-lines 2020-12-31 10:33:59 +00:00
Alexander Alekhin 701744c621 Merge pull request #19191 from OrestChura:oc/morphEx_perftest 2020-12-31 10:32:51 +00:00
Liangqian e4c7fca755 Merge pull request #19098 from chargerKong:EulerAngle
* add to/from Euler Angles

* restruct codes

* quat: optimize implementation

* cleanup debug code

* correct spelling errors

* create QuatEnum for enum EulerAnglesType

* use for loop for test_quaternion

* drop template from isIntAngleType & add minimal error information in test_quaternion.cpp

Co-authored-by: ShanChenqi <shanchenqi@huawei.com>
Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2020-12-31 10:32:12 +00:00
Justin Chu 8f66dad65b Fix typo in hough_lines tutorial
Argument `minLinLength` -> `minLineLength`
2020-12-30 16:20:27 -05:00
Alexander Alekhin bec7b297ed Merge pull request #19235 from alalek:fix_test_swift_minAreaRect 2020-12-30 15:24:55 +00:00
Alexander Alekhin ee17b5de6e swift(test): fix minAreaRect test 2020-12-29 22:56:19 +00:00
Alexander Alekhin a0041125c6 Merge pull request #19230 from IanMaquignaz:quickFix_calib3d_parameters 2020-12-29 20:02:26 +00:00
Ian Maquignaz 378a634de8 Updated Calib3d documentation to fix missing @ref in master 2020-12-28 10:57:19 -05:00
Alexander Alekhin 8a05850302 Merge pull request #19213 from alalek:ocl_execution_context_tests_param 2020-12-27 22:02:33 +00:00
YashasSamaga 8c74d7e4fa add half pixel centers and align corners param 2020-12-27 15:05:39 +05:30
Alexander Alekhin 55f06b76f9 dnn: improve debugging of TensorFlow parsing errors 2020-12-26 15:31:30 +00:00
Alexander Alekhin ba3f150b14 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-25 16:25:14 +00:00
Alexander Alekhin 2f8c62999f Merge pull request #19194 from alalek:intelligent_scissors 2020-12-25 13:16:19 +00:00
Alexander Alekhin 3eea3dd46b imgproc: add IntelligentScissors 2020-12-25 10:57:11 +00:00
Alexander Alekhin ba2b331461 core(ocl): parametrize OpenCLExecutionContext tests 2020-12-24 19:33:43 +00:00
Alexander Alekhin a6f7dca685 Merge pull request #19027 from alalek:videoio_plugins_api_versioning 2020-12-24 17:08:36 +00:00
Alexander Alekhin 282605ea76 Merge pull request #19209 from alalek:fix_docs_build_options_parallel 2020-12-24 17:02:19 +00:00
Zhuo Zhang 6e1da2ef91 Merge pull request #19203 from zchrissirhcz:fix-cvSaveImage
Fix cvSaveImage( ) function bug

* fix cvSaveImage crash

* replace emplace_back with {}, no C++11 required

* fix MacOSX build with vector's push_back
2020-12-24 16:58:16 +00:00
Anatoliy Talamanov 244511e434 Merge pull request #19205 from TolyaTalamanov:at/remove-streamingbackend-export
[G-API] Fix streaming kernels in standalone

* Move streaming kernels from public header

* Add streaming backend to standalone
2020-12-24 16:46:10 +00:00
Maxim Pashchenkov 656b20a169 Merge pull request #19070 from mpashchenkov:mp/onnx-gframe
G-API: Support GFrame for ONNX infer 

* Added GFrame for ONNX

* Cut test

* Removed IE from assert

* Review comments

* Added const/bbot rstrt

* View instead unique_ptr in func. sig.

* Added extractMat function, ONNXCompiled contains exMat - cv::Mat with non processed input data

* Added meta check for inferList2
2020-12-24 13:55:33 +00:00
Alexander Alekhin 50bb344a9d Merge pull request #19206 from OrestChura:oc/fix_plugconfparams_n_align 2020-12-24 13:54:02 +00:00
Alexander Alekhin 1ec2ade65b Merge pull request #19210 from alalek:backport_19199 2020-12-24 10:01:37 +00:00
Alexander Alekhin 13148df9f2 Merge pull request #19208 from alalek:js_build_reuse_python 2020-12-24 10:01:17 +00:00
Alexander Alekhin 5a10261111 Merge pull request #19207 from alalek:issue_19198 2020-12-24 10:00:56 +00:00
Ilya Lavrenov 064d48771d Find only shared IE libraries, not plugins
original commit: 3ed376d103
2020-12-24 06:48:54 +00:00
Alexander Alekhin 1c078c59e3 docs: fix table cells 2020-12-24 05:49:49 +00:00
Alexander Alekhin 7eeba4d485 js(build): reuse Python executable used to run main script
- don't switch between Python versions in the middle of the build
2020-12-24 05:25:38 +00:00
Alexander Alekhin cd68cc1f46 Merge pull request #19195 from diablodale:win32AlignAlloc 2020-12-23 17:33:58 +00:00
Alexander Alekhin 0681deb3c9 js: fix Python 3 support in make_umd.py 2020-12-23 15:07:12 +00:00
OrestChura e80f6624ed - Replace plugin config parameters with the working ones
- refactor for consistency
2020-12-23 17:06:45 +03:00
Dale Phurrough 109255a730 add windows native aligned malloc + unit test case
* implements https://github.com/opencv/opencv/issues/19147
* CAUTION: this PR will only functions safely in the
  4+ branches that already include PR 19029
* CAUTION: this PR requires thread-safe startup of the alloc.cpp
  translation unit as implemented in PR 19029
2020-12-23 14:59:28 +01:00
Stefan Dragnev b13b5d86f6 Merge pull request #19109 from tailsu:sd/imdecode-jp2k-codestream
* OpenJPEG: decoder for J2K codestreams

* code review fixes

* exclude .j2c from GDAL tests
2020-12-23 12:33:33 +00:00
Alexander Alekhin 0ffa78b66a Merge pull request #19193 from alalek:samples_python_3.9 2020-12-23 12:09:07 +00:00
Alexander Alekhin 15265918a7 Merge pull request #19133 from diablodale:fix19132-opencvactivated 2020-12-23 12:08:38 +00:00
Alexander Alekhin ed00088f17 Merge pull request #19199 from ilya-lavrenov:find-shared-libraries-only 2020-12-23 08:33:49 +00:00
Ilya Lavrenov 3ed376d103 Find only shared IE libraries, not plugins 2020-12-23 09:51:23 +03:00
OrestChura e2930c7898 Perf test for morphologyEx 2020-12-22 00:03:06 +03:00
Alexander Alekhin 84676fefe3 Merge tag '4.5.1' 2020-12-21 20:35:51 +00:00
Alexander Alekhin 1363496c11 release: OpenCV 4.5.1 2020-12-21 20:01:38 +00:00
Alexander Alekhin a029f03edc Merge pull request #19187 from alalek:samples_python_3.9 2020-12-21 18:16:00 +00:00
Alexander Alekhin 03df48899c Merge pull request #19186 from AsyaPronina:asyadev/fix_gframe_as_internal_data_for_gexecutor 2020-12-21 18:15:24 +00:00
Alexander Alekhin b51ae87828 samples: check for Python 3.9 2020-12-21 14:59:34 +00:00
Alexander Alekhin 68fb8dd873 Merge tag '3.4.13' 2020-12-21 14:55:54 +00:00
Anastasiya Pronina cdbea6f0a0 GFrame as internal node in GExecutor 2020-12-21 14:06:47 +03:00
Alexander Alekhin 8869dc7762 release: OpenCV 3.4.13 2020-12-20 22:15:49 +00:00
Alexander Alekhin 6659d55a9d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-20 18:40:22 +00:00
Alexander Alekhin e6c9291e32 Merge pull request #19180 from alalek:fixup_19161 2020-12-20 18:39:01 +00:00
Alexander Alekhin a6f14ca97c js(build): fix generator with Python3
- class_info.props is a 'list'
2020-12-20 17:42:47 +00:00
Alexander Alekhin c555a6747d Merge pull request #19177 from alalek:doxygen_drop_TCL_SUBST 2020-12-20 16:40:58 +00:00
Alexander Alekhin dd276dbb59 Merge pull request #19176 from alalek:issue_19131 2020-12-20 16:40:28 +00:00
Alexander Alekhin 70d82017fe Merge pull request #19175 from alalek:issue_18520 2020-12-20 16:39:56 +00:00
Alexander Alekhin 663bd73518 Merge pull request #19164 from fpetrogalli:tranform_16u 2020-12-20 16:38:59 +00:00
Francesco Petrogalli c526705f4f [cv::transform] Enable CV_SIMD for the 16U case on AArch64. 2020-12-20 15:58:21 +00:00
Alexander Alekhin c84d2cb32a Merge pull request #18604 from vrabaud:master 2020-12-20 15:50:33 +00:00
Vincent Rabaud ff211371bc Replace FLANNException by CV_Error. 2020-12-20 14:17:28 +01:00
Alexander Alekhin e9a4734a57 doxygen: drop deprecated TCL_SUBST 2020-12-20 05:05:48 +00:00
Alexander Alekhin 3359bdc464 docs(core): fix process_video_frame() code snippet 2020-12-20 02:27:46 +00:00
Alexander Alekhin 17faee5d81 imgproc: add rotatedRectangleIntersection empty input handling 2020-12-20 02:06:50 +00:00
Alexander Alekhin b4795086fe Merge pull request #19168 from alalek:abi_experimental_quaternion 2020-12-19 19:22:52 +00:00
Alexander Alekhin 5cd852f9bd Merge pull request #19170 from vrabaud:3.4 2020-12-19 19:22:30 +00:00
Vincent Rabaud 4c75b1c102 Fix comment typos. 2020-12-19 08:22:37 +01:00
Alexander Alekhin a6b5771297 ABI: exclude quaternion header from ABI/API check
- this API is experimental for now
2020-12-18 21:45:08 +00:00
Alexander Alekhin dac298ef41 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-18 20:47:56 +00:00
Alexander Alekhin ef27c11d50 Merge pull request #19162 from alalek:backport_18985 2020-12-18 20:29:49 +00:00
Alexander Alekhin cd3939a153 Merge pull request #19158 from alalek:build_opencv_winpack_dldt_2021.2.0 2020-12-18 20:29:33 +00:00
Alexander Alekhin 9f5463ce42 Merge pull request #19152 from LupusSanctus:am/color_issue 2020-12-18 20:28:12 +00:00
Anastasia Murzova 3bc1b53962 Added YUV conversion fix
Fixed OpenCV issue #18878
2020-12-18 21:40:32 +03:00
Alexander Alekhin de1b919641 Merge pull request #19161 from alalek:js_robust_code_generation 2020-12-18 15:12:17 +00:00
Alexander Alekhin 3e9158acd6 Merge pull request #19128 from asmorkalov:as/gapi_phase_tolerance 2020-12-18 13:43:07 +00:00
Alexander Alekhin 03e224ee83 Merge pull request #19127 from asmorkalov:as/photo_fix_arm64 2020-12-18 13:42:26 +00:00
Steffen Urban c2bc171ef6 js: backport PR18985
original commit: b82700ae41
2020-12-18 12:12:10 +00:00
Alexander Alekhin f8740e124c js: robust code generation
- avoid randomized output due to unpredictable dict/set order
2020-12-18 12:02:48 +00:00
Steffen Urban b82700ae41 Merge pull request #18985 from ZEISS:feature/aruco_js_fix
Aruco javascript fix and added functionality

* whitespace

* updated docu. updated regexp.

* update docu

* embindgen regex

* removed parser arg

* remove whitespace

* removed aruco hint

* remove whitespace

* removed aruco hint

* new docu string

* removed extra line

* remove whitespace

* removed aruco hint

* new docu string

* removed extra line
2020-12-18 12:01:48 +00:00
Alexander Smorkalov 009860e98a arm64 fix: Replaced float value strong equal checks with check with tolerance. 2020-12-18 14:57:51 +03:00
Alexander Smorkalov 57da381ae3 Increased Photo_CalibrateDebevec.regression test tolerance to pass on arm64 with gcc 9.3. 2020-12-18 14:46:40 +03:00
Alexander Alekhin 935cb4076b Merge pull request #19154 from alalek:fixup_19089 2020-12-18 11:23:02 +00:00
Alexander Alekhin b2ea15da35 Merge pull request #19137 from VadimLevin:dev/vlevin/safe-string-conversion 2020-12-18 11:20:50 +00:00
Alexander Alekhin 9733177083 Merge pull request #19105 from alalek:js_build_update 2020-12-18 11:12:30 +00:00
Alexander Alekhin fa665141bb Merge pull request #19104 from alalek:docs_cmake_msvs2019 2020-12-18 11:10:52 +00:00
Alexander Alekhin 64720f15a2 doc(windows): update how to handle MSVS 2019 2020-12-18 08:24:26 +00:00
Alexander Alekhin 8df0f13230 build: winpack_dldt with dldt 2021.2.0 2020-12-18 06:54:51 +00:00
Alexander Alekhin 624d532000 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-17 21:05:34 +00:00
Alexander Alekhin 94e7be3714 docs(calib3d): avoid reference on legacy C API constants 2020-12-17 21:03:27 +00:00
Alexander Alekhin 9b4adc9acb Merge pull request #19146 from alalek:dnn_openvino_2021.2.0 2020-12-17 19:50:36 +00:00
Alexander Alekhin e27162397a Merge pull request #19143 from vrabaud:stack 2020-12-17 19:47:43 +00:00
Alexander Alekhin 99d750d597 Merge pull request #19139 from vrabaud:find1 2020-12-17 19:40:22 +00:00
Vadim Pisarevsky c51f5e8d76 Merge pull request #19082 from vpisarev:rvv_copyright 2020-12-17 17:10:17 +00:00
Vadim Pisarevsky ba7dbca018 added information about the contribution & ISCAS copyright 2020-12-17 18:28:17 +08:00
Vincent Rabaud 8391a23600 Optimize calls to std::string::find() and friends for a single char.
The character literal overload is more efficient. More info at:

http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html
2020-12-17 09:39:23 +01:00
Vincent Rabaud ec3ef520e6 Move big objects (>20k) from stack to heap. 2020-12-17 09:36:51 +01:00
Alexander Alekhin 28aab134db dnn(test): update tests for OpenVINO 2021.2 2020-12-17 07:53:35 +00:00
Alexander Alekhin 752cc26ad6 dnn: use OpenVINO 2021.2 defines
original commit: 4699d2ba0c
2020-12-16 22:22:17 +00:00
Alexander Alekhin d159417474 Merge pull request #19101 from alalek:issue_5209 2020-12-16 22:13:18 +00:00
Alexander Alekhin 7d7ab462d6 Merge pull request #19130 from dmatveev:dm/fix_docs_ocv451 2020-12-16 20:26:41 +00:00
Alexander Alekhin c4c21c2fa7 Merge pull request #19142 from rgarnov:rg/include_format_in_core 2020-12-16 20:26:05 +00:00
Ruslan Garnov e06a497c7c Added format.hpp include to core.hpp 2020-12-16 19:29:06 +03:00
Vadim Levin 7b0d7d0c9a fix: conversion to string in python bindings
If provided `PyObject` can't be converted to string `TypeError` is
 reported instead of `SytemError` without any message.
2020-12-16 15:11:58 +03:00
Ruslan Garnov f7cab121fe Merge pull request #19112 from rgarnov:rg/generic_copy_kernel
Generic copy kernel

* Moved RMat wrapping of cv::Mats to StreamingInput

* Generalized GCopy kernel

* Generic GCopy kernel: applied review comments
2020-12-16 11:18:08 +00:00
Dale Phurrough bb59b81d82 remove g_isOpenCVActivated assign and clarify 2020-12-16 00:27:32 +01:00
Alexander Alekhin 7631056b8a Merge pull request #19114 from alalek:issue_18937 2020-12-15 20:47:05 +00:00
Alexander Alekhin 4107dc7355 Merge pull request #19089 from IanMaquignaz:fix_34_calib3d_parameterReferences 2020-12-15 20:46:09 +00:00
Dmitry Matveev b74804f61f G-API: Fix various Doxygen isses for the 4.5.1 release 2020-12-15 23:21:46 +03:00
Anatoliy Talamanov 50baf76cc2 Merge pull request #19107 from TolyaTalamanov:at/hotfix-gstreamingbackend
[G-API] GStreamingBackend hotfix

* GStreamingBackend hotfix

* Fix comments to review

* Add strides

* Removew while loop inside actor
2020-12-15 18:05:26 +00:00
Ian Maquignaz 085a131801 Applied '@ref' linking for 3.4 Calib3D parameters and added enum cv::fisheye::CALIB_ZERO_DISPARITY == cv::CALIB_ZERO_DISPARITY == 0x400 == 1 << 10.
Fisheye test has been updated to use new enum cv::fisheye::CALIB_ZERO_DISPARITY and included CV_StaticAssert(...) to ensure cv::CALIB_ZERO_DISPARITY == cv::fisheye::CALIB_ZERO_DISPARITY.
2020-12-15 12:33:43 -05:00
Alexander Alekhin 50fed1d774 Merge pull request #19115 from alalek:dnn_ocl_conv_fp16_consistency 2020-12-15 16:09:15 +00:00
Alexander Alekhin c240355cc6 dnn(ocl): avoid mess FP16/FP32 in convolution layer 2020-12-15 08:51:24 +00:00
Alexander Alekhin a9edcc1705 Merge pull request #19110 from alalek:test_videoio_require_ffmpeg 2020-12-15 08:48:23 +00:00
Alexander Alekhin 4b3d2c8834 dnn(ocl): fix gemm kernels with beta=0
- dst is not initialized, may include NaN values
- 0*NaN produces NaN
2020-12-15 00:58:43 +00:00
Orest Chura fcdd69fd97 Merge pull request #19103 from OrestChura:oc/cvtI420_perftests
[G-API]: Performance tests for color conversion kernels

* Performance tests for 5 new color conversion kernels:
 - BGR2RGB
 - BGR2I420
 - RGB2I420
 - I4202BGR
 - I4202RGB

* Addressing comment
2020-12-14 22:45:41 +00:00
Alexander Alekhin 48d9031efb videoio(test): add FFmpeg backend check
- configure through OPENCV_TEST_VIDEOIO_BACKEND_REQUIRE_FFMPEG environment variable
2020-12-14 18:29:52 +00:00
Alexander Alekhin a8adb99e94 Merge pull request #19106 from xerus:fix_typo 2020-12-14 16:27:53 +00:00
Pavel Grunt b01ae2de05 Fix a typo s/VERISON/VERSION/ 2020-12-14 12:02:25 +01:00
Anna Khakimova 46e275dfe4 Merge pull request #18869 from anna-khakimova:ak/kalman
* GAPI: Kalman filter stateful kernel

* Applied comments

* Applied comments. Second iteration

* Add overload without control vector

* Remove structure constructor and dimension fields.

* Add sample as test

* Remove visualization from test-sample + correct doxygen comments

* Applied comments.
2020-12-14 08:56:37 +00:00
Alexander Alekhin af71b03000 js: update documentation and builds scripts
- support modern Emscripten build process
- replaced Docker image
- replaced Emscripten's web URLs
2020-12-14 04:42:15 +00:00
Alexander Alekhin 392991fa0b core(opencl): add version check before clCreateFromGLTexture() call 2020-12-13 20:57:26 +00:00
Jonathan Cole 743f1810c7 Merge pull request #19088 from Rightpoint:task/colejd/make-xcframework-output-path-explicit
Make xcframework output path argument explicit and required

* Make output path argument explicit and required

* Improve xcframework documentation

* Add TODOs for future breaking changes on build_framework.py scripts
2020-12-12 17:35:25 +00:00
Alexander Alekhin dd1494eebf Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-11 19:27:20 +00:00
Alexander Alekhin 1bfc75ac23 Merge pull request #19079 from alalek:issue_18713 2020-12-11 19:15:26 +00:00
Alexander Alekhin 5bb45baa6c Merge pull request #19085 from OrestChura:oc/fix_new_streaming_tests 2020-12-11 19:14:29 +00:00
Alexander Alekhin def679554f Merge pull request #19084 from alalek:issue_16197 2020-12-11 19:13:40 +00:00
Alexander Alekhin 08b6abd711 Merge pull request #19068 from alalek:issue_18157 2020-12-11 19:11:04 +00:00
Alexander Alekhin 33761ee06b Merge pull request #19064 from alalek:cmake_update_mkl 2020-12-11 19:10:16 +00:00
Alexander Alekhin a04479746a Merge pull request #19045 from alalek:issue_17553
* flann: avoid dangling pointers on lost features data

* flann: fix Index::load()
2020-12-11 19:09:35 +00:00
Alexander Alekhin d2b8fd6401 Merge pull request #19062 from alalek:3.4_issue_17553 2020-12-11 19:08:46 +00:00
Alexander Alekhin 8ac304517e Merge pull request #19055 from alalek:4.x_issue_18244 2020-12-11 19:07:57 +00:00
Alexander Alekhin 4f236d1c50 Merge pull request #19054 from alalek:3.4_issue_18244 2020-12-11 19:07:34 +00:00
Alexander Alekhin f9f9e2ad4a Merge pull request #19049 from alalek:issue_17282 2020-12-11 19:06:47 +00:00
Alexander Alekhin e52291cbcc Merge pull request #19048 from alalek:android_gradle_5.6.4 2020-12-11 19:06:13 +00:00
Alexander Alekhin 23c246882e Merge pull request #19071 from LupusSanctus:am/dnn_nearest_resize_3.4 2020-12-11 18:25:55 +00:00
Alexander Alekhin f290ff215e features2d: fix ORB::setFirstScale() handling 2020-12-11 18:05:24 +00:00
OrestChura 79b4dc14a3 Fix new streaming tests for CI 2020-12-11 20:26:39 +03:00
Anatoliy Talamanov 8ed0fc6f0c Merge pull request #19009 from TolyaTalamanov:at/media-frame-copy
[G-API] GStreamingBackend

* Snapshot

* Implement StreamingBackend

* Refactoring

* Refactoring 2

* Clean up

* Add missing functionality to support MediaFrame as output

* Partially address review comments

* Fix build

* Implement reshape for gstreamingbackend and add a test on it

* Address more comments

* Add format.hpp to gapi.hpp

* Fix debug build

* Address review comments

Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
2020-12-11 16:29:34 +00:00
Alexander Alekhin 9f01b97e14 Merge pull request #19024 from komakai:cmake319-proposal2 2020-12-11 15:14:43 +00:00
Sergei Slashchinin 1f3255d76b Merge pull request #18591 from sl-sergei:download_utilities
Scripts for downloading models in DNN samples

* Initial commit. Utility classes and functions for downloading files

* updated download script

* Support YAML parsing, update download script and configs

* Fix problem with archived files

* fix models.yml

* Move download utilities to more appropriate place

* Fix script description

* Update README

* update utilities for broader range of files

* fix loading with no hashsum provided

* remove unnecessary import

* fix for Python2

* Add usage examples for downloadFile function

* Add more secure cache folder selection

* Remove trailing whitespaces

* Fix indentation

* Update function interface

* Change function for temp dir, change entry name in models.yml

* Update getCacheDirectory function call

* Return python implementation for cache directory selection, use more specific env variable

* Fix whitespace
2020-12-11 10:15:32 +00:00
Yosshi999 fdeac73a59 Merge pull request #18983 from Yosshi999:bitexact-gaussian-16U-faster
support SIMD for larger symmetric Bit-exact 16U gaussian blur

* support SIMD for bit-exact 16U symmetric gaussian blur

* use tighter SIMD registers
2020-12-11 10:14:15 +00:00
Alexander Alekhin 175cd03ff2 calib3d: fix findCirclesGrid hang
- detect case with infinite loop and raise NoConv exception
- handle such exception
- add support for case with missing `blobDetector` (image contains Point2f array of candidates)
- add regression test
- undone rectification for "failed" detections too
- drop redirectError() usage
2020-12-11 07:31:50 +00:00
Jonathan Cole 9f52244574 Merge pull request #19076 from Rightpoint:bugfix/colejd/fix-path-resolution-bugs
Fix path resolution bugs for XCFramework builds

* Fix incorrect paths for intermediate frameworks

* Remove unnecessary `./` prepend preventing use of absolute paths
2020-12-11 07:14:28 +00:00
Alexander Alekhin d6a7f5e1e0 Merge pull request #19075 from alalek:dnn_fix_halide_build 2020-12-10 20:37:37 +00:00
Alexander Alekhin fce8d8e090 Merge pull request #19074 from alalek:dnn_test_tolerance_east 2020-12-10 20:29:36 +00:00
Alexander Alekhin 8ce08dedfe Merge pull request #19072 from mshabunin:sink-sync-off 2020-12-10 20:05:47 +00:00
Alexander Alekhin 32377ce57d android: add -llog for libprotobuf 2020-12-10 20:00:58 +00:00
Alexander Alekhin d84a9484b7 dnn: fix build with Halide, skip tests with crashes 2020-12-10 18:23:24 +00:00
Alexander Alekhin 8ff27a07bb dnn(test): adjust EAST test tolerance 2020-12-10 16:39:20 +00:00
Maksim Shabunin 55a2bcbe15 videoio: turn off syncronized sink in GStreamer 2020-12-10 16:07:28 +03:00
Anastasia Murzova f2422ace7d Added TF nearest neighbour resize behaviour alignment
Relates to OpenCV issue #18721
2020-12-10 15:53:24 +03:00
Giles Payne d1ea2ad143 CMake version checks for iOS and macOS builds 2020-12-10 21:43:26 +09:00
Alexander Alekhin 3e5d7e1718 imgproc: fix minAreaRect() 2020-12-10 08:57:58 +00:00
Alexander Alekhin de385009ae Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-09 18:09:00 +00:00
Alexander Alekhin 114848d313 Merge pull request #18712 from mshabunin:doc-update-2 2020-12-09 21:05:17 +03:00
Alexander Alekhin 8286d84fb1 Merge pull request #19061 from alalek:dnn_load_face_detector_with_external_protobuf 2020-12-09 18:03:52 +00:00
Alexander Alekhin c42d0c8374 Merge pull request #19060 from alalek:issue_18097 2020-12-09 18:02:41 +00:00
Alexander Alekhin 37bfb3c48d Merge pull request #19059 from alalek:fixup_19000 2020-12-09 18:01:04 +00:00
Alexander Alekhin b3937288e5 cmake: update MKL library searching
- allow to specify MKL_LIBRARIES through command-line
2020-12-09 16:36:15 +00:00
Anatoliy Talamanov a55150b1bc Merge pull request #19002 from TolyaTalamanov:at/infer_gframe
[G-API] Support GFrame for infer

* GInfer(GFrame), currently broken

* Fixed (API only)

* Support GFrame in GIEBackend

* Fix comments to review

* Fix comments to review

* Fix doxygen

* Fix building with different IE versions

* Fix warning on MacOS

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
2020-12-09 14:00:56 +00:00
Alexander Alekhin 7eaa548b6d flann: drop wrapping of Index class
- due to lifetime restrictions on passed 'features' parameter and its dangling pointers
- dangling pointer issue is fixed for OpenCV 4.5.1+
2020-12-09 05:39:35 +00:00
Alexander Alekhin d7e936de5c dnn(caffe): add DetectionOutputParameter.clip to .proto file
- allow to load opencv_face_detector with external unpatched protobuf
2020-12-09 05:21:07 +00:00
Alexander Alekhin d2bc0e5fe0 js(wasm): use fallback on missing intrinsics in Emscripten 2.0.0+ 2020-12-09 04:19:53 +00:00
Alexander Alekhin d8107a5125 Merge pull request #18996 from LupusSanctus:am/dnn_bilinear_resize 2020-12-08 21:09:41 +00:00
Anastasia Murzova a82c50eac2 Added TF resize_bilinear behaviour alignment
Fixes OpenCV issue #18721
2020-12-08 22:51:38 +03:00
Alexander Alekhin 7fa9efbfd8 cmake: fix handling of wrappers dependencies 2020-12-08 19:10:04 +00:00
Alexander Alekhin b5a9ef6b7b Merge pull request #19052 from diablodale:fix18888-opencl-doc 2020-12-08 18:03:19 +00:00
Alexander Alekhin 8ebe320270 cmake: don't define ENABLE_NEON flags in non-cross-compiling mode
- NEON / ANDROID_ARM_NEON are toolchain-specific flags
- they are usually not defined for native builds
- let work CPU_BASELINE=DETECT properly
2020-12-08 18:01:03 +00:00
Alexander Alekhin fe3893ff01 cmake: don't define ENABLE_NEON flags in non-cross-compiling mode
- NEON / ANDROID_ARM_NEON are toolchain-specific flags
- they are usually not defined for native builds
- let work CPU_BASELINE=DETECT properly
2020-12-08 18:00:40 +00:00
Orest Chura f41327df0c Merge pull request #18969 from OrestChura:oc/fix_notes_returns
[G-API] Multiple return/note fix

* Fix doxygen:
 - multiple return
 - multiple notes

* Addressing comments
 - divide description of split(merge)3/4
2020-12-08 15:44:33 +00:00
Dale Phurrough f77276311d clarify opencl execution context doc
- fix opencv/opencv#18888
2020-12-08 16:08:53 +01:00
Alexander Alekhin e8348e5f64 Merge pull request #19046 from alalek:issue_16861 2020-12-08 11:34:20 +00:00
Anton Potapov da5bfefc78 GAPI: fix Clang warning for dangling references in for loop variable 2020-12-08 14:18:46 +03:00
Alexander Alekhin 619cc01ca1 Merge pull request #19044 from OrestChura:oc/fix_coverity_warn_kmeans 2020-12-08 10:31:31 +00:00
Dale Phurrough ad94d8cc4f Merge pull request #19029 from diablodale:fix19004-memthreadstart
add thread-safe startup of fastMalloc and fastFree

* add perf test core memory allocation

* fix threading in isAlignedAllocationEnabled()

* tweaks requested by maintainer
2020-12-08 10:05:14 +00:00
Alexander Alekhin c3cebc3ac5 android: use gradle 5.6.4 2020-12-08 07:18:30 +00:00
Alexander Alekhin fb85974d01 android: use protected fields in JavaCamera2View 2020-12-08 05:18:21 +00:00
OrestChura 02488c5cbb Moved G-API output to the first place of arguments in comparison functions 2020-12-08 02:44:01 +03:00
Alexander Alekhin 3377ddaf09 Merge pull request #19041 from alalek:issue_19025 2020-12-07 22:31:53 +00:00
Alexander Alekhin 40ca8f4695 Merge pull request #19035 from berak:fix_dnn_net_dump_colors 2020-12-07 22:11:49 +00:00
Alexander Alekhin 962f5c9b82 videoio(test): skip GStreamer in 'frame_timestamp' tests
- CAP_PROP_POS_MSEC is not reliable
2020-12-07 21:35:01 +00:00
Alexander Alekhin 2c634eeef2 Merge pull request #19023 from alalek:core_update_allocator_stats_type 2020-12-07 20:41:37 +00:00
Alexander Alekhin c6e60f06eb Merge pull request #19019 from alalek:cmake_avoid_excessive_trace_dump 2020-12-07 20:40:56 +00:00
Alexander Alekhin e5d2642780 Merge pull request #19015 from alalek:dnn_use_fma 2020-12-07 20:40:21 +00:00
berak cf28b5e5be dnn: add another color to Net::Impl::dump() 2020-12-07 17:58:40 +01:00
Maksim Shabunin c79a1528ad Added TOC to most of tutorials 2020-12-07 19:13:54 +03:00
Alexander Alekhin 31619faa70 Merge pull request #19021 from alalek:4.x_build_warnings_gcc_4.8.5 2020-12-06 17:22:45 +00:00
Alexander Alekhin 9e6b7f5dc1 videoio: plugins API versioning 2020-12-06 16:19:13 +00:00
Alexander Alekhin a9f4f8ded4 Merge pull request #19022 from alalek:cmake_avoid_duplication_of_winit_self 2020-12-06 16:14:25 +00:00
joshdoe 541a09b7ac Merge pull request #18535 from joshdoe:gray16_gstreamer_writing
Add CV_16UC1/GRAY16_LE support to GStreamer backend for VideoWriter

* videoio(backend): add Writer_open_with_params to plugin API

This will allow arbitrary parameters to be passed to plugin backends

* videoio(gstreamer): add GRAY16_LE/CV_16UC1 writing support to GStreamer

This introduces a new property VIDEOWRITER_PROP_DEPTH, which defaults to
CV_8U, but for GStreamer can be set to CV_16U.

Also, fix another test to not fail if plugin isn't found, copying logic
from the read_write test.

* videoio(plugin): fix handling plugins with previous API level

* videoio: coding style

* fix warning
2020-12-05 21:28:07 +00:00
Alexander Alekhin 26e8048a0a core: update handling of allocator stats type
- don't use OPENCV_ALLOCATOR_STATS_COUNTER_TYPE definition in non C++11 builds
- don't use with MinGW
2020-12-05 20:54:47 +00:00
Alexander Alekhin 6bfb0dda85 cmake: avoid duplication of -Winit-self flag 2020-12-05 20:18:02 +00:00
Alexander Alekhin d1b5a78171 build warnings
- GCC 4.8.5 / CentOS 7
2020-12-05 20:08:29 +00:00
Alexander Alekhin 753ccd6b17 Merge pull request #19018 from alalek:issue_19016 2020-12-05 19:59:22 +00:00
Alexander Alekhin 8ae1552a5b cmake: avoid excessive output from cmake --trace/--trace-expand
- `cmake . --trace-expand -DCMAKE_TRACE_MODE=1`
2020-12-05 13:29:43 +00:00
Alexander Alekhin 08bee40fa2 samples: replace regex
- GCC 4.8.5 doesn't support regex
2020-12-05 12:50:37 +00:00
Alexander Alekhin 00f36a3149 dnn: prefer to use v_fma() instead of v_c += v_a * v_b 2020-12-05 11:51:03 +00:00
Maksim Shabunin 461e26b60b doc: tutorial refactor 2020-12-05 01:57:36 +03:00
Alexander Alekhin 6fdb7aee84 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-12-04 18:26:58 +00:00
Alexander Alekhin 12a36b5a94 Merge pull request #18955 from alalek:test_debug_flag 2020-12-04 18:10:00 +00:00
Wenqing Zhang 22d64ae08f Merge pull request #17570 from HannibalAPE:text_det_recog_demo
[GSoC] High Level API and Samples for Scene Text Detection and Recognition

* APIs and samples for scene text detection and recognition

* update APIs and tutorial for Text Detection and Recognition

* API updates:
(1) put decodeType into struct Voc
(2) optimize the post-processing of DB

* sample update:
(1) add transformation into scene_text_spotting.cpp
(2) modify text_detection.cpp with API update

* update tutorial

* simplify text recognition API
update tutorial

* update impl usage in recognize() and detect()

* dnn: refactoring public API of TextRecognitionModel/TextDetectionModel

* update provided models
update opencv.bib

* dnn: adjust text rectangle angle

* remove points ordering operation in model.cpp

* update gts of DB test in test_model.cpp

* dnn: ensure to keep text rectangle angle

- avoid 90/180 degree turns

* dnn(text): use quadrangle result in TextDetectionModel API

* dnn: update Text Detection API
(1) keep points' order consistent with (bl, tl, tr, br) in unclip
(2) update contourScore with boundingRect
2020-12-03 18:47:40 +00:00
Alexander Alekhin e371592f75 Merge pull request #18965 from alalek:cmake_gen_js_code 2020-12-03 18:10:30 +00:00
Alexander Alekhin 84a3654371 Merge pull request #19000 from alalek:cmake_fix_order_of_bindings_generators 2020-12-03 18:08:40 +00:00
Alexander Alekhin 7e5c4fe1cd cmake(js): update js targets
- unconditional js bindings source code generation
- use common name for tests: opencv_test_js
2020-12-03 14:18:54 +00:00
Alexander Alekhin 5ecf693774 Merge pull request #18997 from alalek:disable_github_action_workflow 2020-12-03 16:55:35 +03:00
Alexander Alekhin 773ccc4bf8 Merge pull request #18993 from alalek:issue_18984 2020-12-03 13:55:07 +00:00
Alexander Alekhin b31ce408ae cmake: fix processing order of <wrapper>_bindings_generator
- ensure that wrapped modules are already processed
2020-12-03 13:01:46 +00:00
Alexander Alekhin 7983c484b2 Merge pull request #18998 from upupming:patch-1 2020-12-03 10:59:59 +00:00
Alexander Alekhin 6502737bd5 Merge pull request #18992 from vertexcite:patch-1 2020-12-03 10:58:47 +00:00
Alexander Alekhin b98dd728ca Merge pull request #18966 from Staticity:add_live_timestamps_to_msmf 2020-12-03 10:57:25 +00:00
Randall Britten 7f3ba5963d Fixed minor typo "poins" in documentation page 2020-12-03 12:46:23 +03:00
Yiming Li 43e58de918 fix: typo 2020-12-03 17:06:41 +08:00
Alexander Alekhin b7a70fda79 github(actions): manual trigger for arm64-build-checks.yml 2020-12-03 02:21:35 +00:00
Alexander Alekhin e309ad8465 Merge pull request #18994 from alalek:umat_drop_unavailable_methods 2020-12-02 22:54:47 +00:00
Jaime Rivera 2fa624aef0 Add Timestamps to MSMF Video Capture by index
Enable frame timestamp tests for MSMF

Add functional test for camera live timestamps

Remove trailing whitespace

Add timestamp test to all functional tests. Protect div by 0

Add Timestamps to MSMF Video Capture by index
2020-12-02 16:36:09 -05:00
Vadim Pisarevsky b023fcd264 Merge pull request #18911 from chargerKong:quat 2020-12-02 19:14:47 +00:00
Alexander Alekhin e958600f32 Merge pull request #18986 from alalek:fix_ipp_17453_2 2020-12-02 19:09:24 +00:00
Alexander Alekhin 484251c52b Merge pull request #18831 from rjiejie:master-opt@pipeline 2020-12-02 19:07:38 +00:00
Alexander Alekhin e98c845f0b Merge pull request #18977 from Rightpoint:objc-collision-fix 2020-12-02 19:06:57 +00:00
Vadim Pisarevsky e4ed1d08f4 Merge pull request #18462 from joy2myself:riscv_toolchian 2020-12-02 18:38:17 +00:00
Kong Liangqian 8e32566583 Add adding and subtraction operations between a number and a quaternion;
fix a typo;
Add documentation of quaternion operators;
Restrict the type of scalar: the same as quaternion;
2020-12-03 01:38:15 +08:00
Alexander Alekhin 512be4ab65 Merge pull request #18991 from alalek:workaround_12959 2020-12-02 17:34:22 +00:00
Alexander Alekhin 6f8120cb3a core(UMat): drop unavailable methods 2020-12-02 15:02:43 +00:00
Vadim Pisarevsky a3de45741e Merge pull request #18971 from GArik:orbbec 2020-12-02 13:33:32 +00:00
Vadim Pisarevsky 7d7d907de7 Merge pull request #18228 from joy2myself:rvv 2020-12-02 13:27:35 +00:00
Alexander Alekhin c42d47d94a cmake: clean cached INTERNAL variable used for 3rdparty deps 2020-12-02 12:34:24 +00:00
Alexander Alekhin d35e2f5339 core(ipp): workaround getIppTopFeatures() value mismatch 2020-12-02 11:33:55 +00:00
Zhangyin 673e4e20f0 Added RISC-V backend of universal intrinsics 2020-12-02 14:25:03 +08:00
Igor Murzov 38a4eaf8a3 Orbbec tutorial: Sync frames from two streams and process depth & color simultaneously 2020-12-02 00:07:28 +03:00
Giles Payne 29b453eb86 Objective-C name clash avoidance 2020-12-01 11:22:57 -08:00
Alexander Alekhin ef0eed8d3c Merge pull request #18981 from anton-potapov:fix_gnet_package_compilation_std_17 2020-12-01 17:42:12 +00:00
Alexander Alekhin 91ce6ef190 core(ipp): disable SSE4.2 code path in countNonZero() 2020-12-01 14:01:42 +00:00
Daniel Cauchi 9d37cdaa66 Merge pull request #18891 from CowKeyMan:NMS_boxes_with_different_labels
Add option for NMS for boxes with different labels

* DetectionModel impl

* Add option for NMS for boxes with different labels

In the detect function in modules/dnn/include/opencv2/dnn/dnn.hpp, whose implementation can be found at modules/dnn/src/model.cpp, the Non Max Suppression (NMS) is applied only for objects of the same label. Thus, a flag
was added with the purpose to allow developers to choose if they want to keep the default implementation or wether they would like NMS to be applied to all the boxes, regardless of label.

The flag is called nmsDifferentLabels, and is given a default value of false, which applies the current default implementation, thus allowing existing projects to update opencv without disruption

Solves issue opencv#18832

* Change return type of set & Add default constr

* Add assertions due to default constructor
2020-12-01 13:50:24 +00:00
Alexander Alekhin 3f686a6ab8 Merge pull request #18967 from anton-potapov:reuse_move_through_copy 2020-12-01 12:57:06 +00:00
Alexander Alekhin db3e3a766a Merge pull request #18978 from Rightpoint:testing-ios-deployment-target 2020-12-01 12:53:53 +00:00
Sergei Slashchinin 9cef41000a Merge pull request #18973 from sl-sergei:fix_vulkan_build
* Fix build when HAVE_VULKAN is ON

* Fix warnings
2020-12-01 12:52:09 +00:00
Alexander Alekhin fc54853d44 Merge pull request #18972 from Rightpoint:task/colejd/prevent-existing-xcframework-error 2020-12-01 12:36:29 +00:00
Alexander Alekhin 6f5af6eb42 Merge pull request #18982 from anton-potapov:sole_tbb_executor_async_test 2020-12-01 12:34:12 +00:00
Anton Potapov eb6d8e6af2 TBB executor for GAPI: fix race consition in Async test
The test has race condition, which is addressed by the patch.

The race is next:

    Master thread is calling execute (effectively blocked, waiting for
callback to be called)
    "Async" thread picks up the callback
    Call the callback
    Then sets the variables in test
    After call back is called, master thread is unblocked and may check
the variables (set in point 4 by the "async" thread) earlier then they
actually changed

Changes:

    callback should be called as the last step (after flag variables are
    set), as it effectively unblock the master thread

fixes #18974
2020-12-01 11:12:36 +03:00
Anton Potapov 446f344818 GAPI: fix C++17 compilation errors in GNetPackage (fixes #17385)
- explicitly declared default constructor
- made initilizer_list  constructor to accept the list by copy
   -- as it is  more canonical (and as copying the initializer_list does
not force copy of the list items)
   -- current version anyway does not do what it is intended to
2020-12-01 09:34:53 +03:00
Chris Ballinger 3c40f87af3 Bump default IPHONEOS_DEPLOYMENT_TARGET to 9.0 2020-11-30 17:34:34 -08:00
Alexander Alekhin aac30e772f Merge pull request #18968 from asmorkalov:as/cap_prop_frame_msec_test 2020-11-30 22:49:54 +00:00
Jonathan Cole 69e1167882 Delete xcframework if it already exists before building a new one 2020-11-30 16:51:48 -05:00
Alexander Alekhin acc142d4ba Merge pull request #18930 from alalek:issue_18502 2020-11-30 18:22:59 +00:00
Alexander Alekhin e726ff3296 Merge pull request #18948 from alalek:python_syntax 2020-11-30 18:11:43 +00:00
Anna Khakimova 56568dae31 Merge pull request #18674 from anna-khakimova:ak/backgroundSubtractor
GAPI: New BackgroundSubtractor stateful kernel

* New BackgroundSubtractorMOG2 kernel

* Add BS parameters
2020-11-30 18:09:42 +00:00
Alexander Smorkalov 24fac5f56d Added test for VideoCapture CAP_PROP_FRAME_MSEC option.
- Suppressed FFMPEG + h264, h265 as it does not pass tests with CI configuration.
- Suppressed MediaFoundation backend as it always returns zero for now.
2020-11-30 20:08:21 +03:00
Anton Potapov 74b6646737 GAPI: reuse copy_through_move_t in the gasync.cpp file 2020-11-30 16:26:54 +03:00
Orest Chura 986ad4ff06 Merge pull request #18857 from OrestChura:oc/kmeans
[G-API]: kmeans() Standard Kernel Implementation

* cv::gapi::kmeans kernel implementation
 - 4 overloads:
    - standard GMat - for any dimensionality
    - GMat without bestLabels initialization
    - GArray<Point2f> - for 2D
    - GArray<Point3f> - for 3D
 - Accuracy tests:
   - for every input - 2 tests
   1) without initializing. In this case, no comparison with cv::kmeans is done as kmeans uses random auto-initialization
   2) with initialization
   - in both cases, only 1 attempt is done as after first attempt kmeans initializes bestLabels randomly

* Addressing comments
 - bestLabels is returned to its original place among parameters
 - checkVector and isPointsVector functions are merged into one, shared between core.hpp & imgproc.hpp by placing it into gmat.hpp (and implementation - to gmat.cpp)
 - typos corrected

* addressing comments
 - unified names in tests
 - const added
 - typos

* Addressing comments
 - fixed the doc note
 - ddepth -> expectedDepth, `< 0 ` -> `== -1`

* Fix unsupported cases of input Mat
 - supported: multiple channels, reversed width
 - added test cases for those
 - added notes in docs
 - refactored checkVector to return dimentionality along with quantity

* Addressing comments
 - makes chackVector smaller and (maybe) clearer

* Addressing comments

* Addressing comments
 - cv::checkVector -> cv::gapi::detail

* Addressing comments
 - Changed checkVector: returns bool, quantity & dimensionality as references

* Addressing comments
 - Polishing checkVector
 - FIXME added

* Addressing discussion
 - checkVector: added overload, separate two different functionalities
 - depth assert - out of the function

* Addressing comments
 - quantity -> amount, dimensionality -> dim
 - Fix typos

* Addressing comments
 - fix docs
 - use 2 variable's definitions instead of one (for all non-trivial variables)
2020-11-30 13:18:43 +00:00
Anton Potapov 95ce8f45ea Merge pull request #17851 from anton-potapov:sole_tbb_executor
* TBB executor for GAPI

 - the sole executor
 - unit tests for it
 - no usage in the GAPI at the momnet

* TBB executor for GAPI

 - introduced new overload of execute to explicitly accept tbb::arena
   argument
 - added more basic tests
 - moved arena creation code into tests
 -

* TBB executor for GAPI

 - fixed compie errors & warnings

* TBB executor for GAPI

 - split all-in-one execute() function into logicaly independant parts

* TBB executor for GAPI

 - used util::variant in in the tile_node

* TBB executor for GAPI

 - moved copy_through_move to separate header
 - rearranged details staff in proper namespaces
 - moved all implementation into detail namespace

* TBB executor for GAPI

 - fixed build error with TBB 4.4.
 - fixed build warnings

* TBB executor for GAPI

 - aligned strings width
 - fixed spaces in expressions
 - fixed english grammar
 - minor improvements

* TBB executor for GAPI

 - added more comments
 - minor improvements

* TBB executor for GAPI

 - changed ITT_ prefix for macroses to GAPI_ITT

* TBB executor for GAPI

 - no more "unused" warning for GAPI_DbgAssert
 - changed local assert macro to man onto GAPI_DbgAssert

* TBB executor for GAPI

 - file renamings
 - changed local assert macro to man onto GAPI_DbgAsse

* TBB executor for GAPI

 - test file renamed
 - add more comments

* TBB executor for GAPI

 - minor clenups and cosmetic changes

* TBB executor for GAPI

 - minor clenups and cosmetic changes

* TBB executor for GAPI

 - changed spaces and curly braces alignment

* TBB executor for GAPI

 - minor cleanups

* TBB executor for GAPI

 - minor cleanups
2020-11-30 13:15:13 +00:00
Zhiming-Zeng 4e4458416d Merge pull request #18064 from akineeic:gsoc_2020_dnn
[GSoC] Develop OpenCV.js DNN modules for promising web use cases together with their tutorials

* [Opencv.js doc] Init commit to add image classification example in opencv.js tutorial

* [Opencv.js doc] Make the code snippet interactive and put the functions into code snippet.

* Fix the utils.loadOpenCv for promise module

* [Opencv.js doc] Code modify and fixed layout issue.

* [Opencv.js doc] Add a JSON file to store parameters for models and show in the web page.

* [Opencv.js doc] Change let to const.

* [Opencv.js doc] Init commit to add image classification example with camera in opencv.js tutorial

* [Opencv.js doc] Init commit to add semantic segmentation example in opencv.js tutorial

* [Opencv.js doc] Add object detection example, supprot YOLOv2

* [Opencv.js doc] Support SSD model for object detection example

* [Opencv.js doc] Add fast neural style transfer example with opencv.js

* [Opencv.js doc] Add pose estimation example in opencv.js tutorial

* Delete whitespace for code check

* [Opencv.js doc] Add object detection example with camera

* [Opencv.js doc] Add json files containing model information to each example

* [Opencv.js doc] Add a js file for common function in dnn example

* [Opencv.js doc] Create single function getBlobFromImage

* [Opencv.js doc] Add url of model into webpage

* [OpenCV.js doc] Update UI for running

* [Opencv.js doc] Load dnn model by input button

* [Opencv.js doc] Fix some UI issues

* [Opencv.js doc] Change code format

Co-authored-by: Ningxin Hu <ningxin.hu@intel.com>
2020-11-29 10:09:42 +00:00
Alexander Alekhin da2978f607 ts: cvtest::debugLevel / --test_debug=<N> option 2020-11-28 13:13:28 +00:00
Anatoliy Talamanov 7521f207b1 Merge pull request #18762 from TolyaTalamanov:at/support-garray
[G-API] Wrap GArray

* Wrap GArray for output

* Collect in/out info in graph

* Add imgproc tests

* Add cv::Point2f

* Update test_gapi_imgproc.py

* Fix comments to review
2020-11-27 17:39:46 +00:00
Alexander Alekhin 2155296a13 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-27 14:08:06 +00:00
Alexander Alekhin 23be514886 Merge pull request #18935 from rgarnov:rg/remove_double_handle_new_stream_call 2020-11-27 14:05:01 +00:00
Alexander Alekhin 77b986c7a1 apple/build_xcframework.py: python syntax
- make happy old Python linters
2020-11-27 13:54:14 +00:00
Alexander Alekhin f90673ef4c Merge pull request #18938 from alalek:issue_18865 2020-11-27 08:55:49 +00:00
Alexander Alekhin df18431b45 Merge pull request #18285 from YashasSamaga:cuda4dnn-update-tests 2020-11-27 08:26:45 +00:00
Alexander Alekhin 7c78c59e64 Merge pull request #18939 from alalek:unstable_test_18937 2020-11-27 08:21:25 +00:00
Alexander Alekhin 5c987e4c75 Merge pull request #18924 from alalek:4.x-xcode12
(4.x) build: Xcode 12 support

* build: xcode 12 support, cmake fixes

* ts: eliminate clang 11 warnigns

* 3rdparty: clang 11 warnings

* features2d: eliminate build warnings

* test: warnings

* gapi: warnings from 18928
2020-11-26 22:56:59 +00:00
Alexander Alekhin 0cc92bd67c Merge pull request #18922 from alalek:3.4-xcode12 2020-11-26 22:14:55 +00:00
Alexander Alekhin 7efc0011fd gapi(test): avoid anonymous namespace types as template parameters 2020-11-26 21:37:54 +00:00
Alexander Alekhin 2cf2456f4c dnn(test): skip unstable GatherMultiOutput OCL_FP16 test 2020-11-26 21:30:21 +00:00
Ruslan Garnov ece14eae24 Removed redundant call of handleNewStream in streaming executor 2020-11-26 22:46:26 +03:00
Alexander Alekhin 3c9d03c36f Merge pull request #18929 from alalek:gapi_test_eliminate_rand 2020-11-26 16:03:35 +00:00
Alexander Alekhin 8c5b3c4150 Merge pull request #17077 from i386x:check-negative-values 2020-11-26 15:07:58 +00:00
Alexander Alekhin 36d771affc python: restore sys.path in bootstrap()
- multiprocessing need to start from bootstrap code
- loading may fail due to missing os.add_dll_directory() calls
2020-11-26 13:10:25 +00:00
Alexander Alekhin 7afd48658c gapi: eliminate std::rand() and RAND_MAX from tests 2020-11-26 10:20:02 +00:00
Alexander Alekhin 387a76ba59 build: xcode 12 support, cmake fixes 2020-11-26 07:54:03 +00:00
Alexander Alekhin f601e817fe Merge pull request #18914 from alalek:videoio_fix_missing_get_capture_domain 2020-11-25 13:46:57 +00:00
Alexander Alekhin 3fd0d0dafb Merge pull request #18918 from gabrielnhn:patch-2 2020-11-25 13:46:37 +00:00
Gabriel Nascarella Hishida f28895cd6b doc: Fix example code using deprecated xrange
xrange was abandoned and doesn't exist in Python 3. range() works just the same
2020-11-25 09:34:38 -03:00
Alexander Alekhin d65c6af3a5 Merge pull request #18907 from diablodale:exec_context_create_addref 2020-11-25 09:25:57 +00:00
Dale Phurrough c08e38acd0 fix missing addref() in ocl::Context::create(str)
- fix https://github.com/opencv/opencv/issues/18906
- unable to add related test cases as there is
  no public access to Context:Impl refcounts
2020-11-25 01:53:41 +01:00
Alexander Alekhin 0800f6f91b videoio: add missing getCaptureDomain() methods 2020-11-24 22:26:10 +00:00
Jonathan Cole 85b0fb2a9c Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework
Support XCFramework builds, Catalyst

* Early work on xcframework support

* Improve legibility

* Somehow this works

* Specify ABIs in a place where they won't get erased

If you pass in the C/CXX flags from the Python script, they won't be respected. By doing it in the actual toolchain, the options are respected and Catalyst successfully links.

* Clean up and push updates

* Actually use Catalyst ABI

Needed to specify EXE linker flags to get compiler tests to link to the Catalyst ABIs.

* Clean up

* Revert changes to common toolchain that don't matter

* Try some things

* Support Catalyst build in OSX scripts

* Remove unnecessary iOS reference to AssetsLibrary framework

* Getting closer

* Try some things, port to Python 3

* Some additional fixes

* Point Cmake Plist gen to osx directory for Catalyst targets

* Remove dynamic lib references for Catalyst, copy iOS instead of macos

* Add flag for building only specified archs, remove iOS catalyst refs

* Add build-xcframework.sh

* Update build-xcframework.sh

* Add presumptive Apple Silicon support

* Add arm64 iphonesimulator target

* Fix xcframework build

* Working on arm64 iOS simulator

* Support 2.7 (replace run with check_output)

* Correctly check output of uname_m against arch

* Clean up

* Use lipo for intermediate frameworks, add python script

Remove unneeded __init__.py

* Simplify python xcframework build script

* Add --only-64-bit flag

* Add --framework-name flag

* Document

* Commit to f-strings, improve console output

* Add i386 to iphonesimulator platform in xcframework generator

* Enable objc for non-Catalyst frameworks

* Fix xcframework builder for paths with spaces

* Use arch when specifying Catalyst build platform in build command

* Fix incorrect settings for framework_name argparse configuration

* Prefer underscores instead of hyphens in new flags

* Move Catalyst flags to where they'll actually get used

* Use --without=objc on Catalyst target for now

* Remove get_or_create_folder and simplify logic

* Remove unused import

* Tighten up help text

* Document

* Move common functions into cv_build_utils

* Improve documentation

* Remove old build script

* Add readme

* Check for required CMake and Xcode versions

* Clean up TODOs and re-enable `copy_samples()`

Remove TODO

Fixup

* Add missing print_function import

* Clarify CMake dependency documentation

* Revert python2 change in gen_objc

* Remove unnecessary builtins imports

* Remove trailing whitespace

* Avoid building Catalyst unless specified

This makes Catalyst support a non-breaking change, though defaults should be specified when a breaking change is possible.

* Prevent lipoing for the same archs on different platforms before build

* Rename build-xcframework.py to build_xcframework.py

* Check for duplicate archs more carefully

* Prevent sample copying error when directory already exists

This can happen when building multiple architectures for the same platform.

* Simplify code for checking for default archs

* Improve build_xcframework.py header text

* Correctly resolve Python script paths

* Parse only known args in ios/osx build_framework.py

* Pass through uncaptured args in build_xcframework to osx/ios build

* Fix typo

* Fix typo

* Fix unparameterized build path for intermediate frameworks

* Fix dyanmic info.plist path for catalyst

* Fix utf-8 Python 3 issue

* Add dynamic flag to osx script

* Rename platform to platforms, remove armv7s and i386

* Fix creation of dynamic framework on maccatalyst and macos

* Update platforms/apple/readme.md

* Add `macos_archs` flag and deprecate `archs` flag

* Allow specification of archs when generating xcframework from terminal

* Change xcframework platform argument names to match archs flag names

* Remove platforms as a concept and shadow archs flags from ios/osx .py

* Improve documentation

* Fix building of objc module on Catalyst, excluding Swift

* Clean up build folder logic a bit

* Fix framework_name flag

* Drop passthrough_args, use unknown_args instead

* minor: coding style changes

Co-authored-by: Chris Ballinger <cballinger@rightpoint.com>
2020-11-24 21:54:54 +00:00
Maxim Pashchenkov 19d825aa16 Merge pull request #18904 from mpashchenkov:mp/ocv-gapi-skip-gm-tests
G-API: Adding skip for GraphMeta tests

* Added skip for GraphMeta tests

* Removed false
2020-11-24 17:51:02 +00:00
Sergei Slashchinin f4f462c50b Merge pull request #18862 from sl-sergei:support_pool1d
Support for Pool1d layer for OpenCV and OpenCL targets

* Initial version of Pool1d support

* Fix variable naming

* Fix 1d pooling for OpenCL

* Change support logic, remove unnecessary variable, split the tests

* Remove other depricated variables

* Fix warning. Check tests

* Change support check logic

* Change support check logic, 2
2020-11-24 16:52:45 +00:00
Alexander Alekhin e1a8fc0417 Merge pull request #18905 from alalek:objc_fix_return_type_handling 2020-11-24 11:39:01 +00:00
Alexander Alekhin eafe6ccdbe objc: fix handling of std::vector<std::vector<T>> return type 2020-11-23 19:16:23 +00:00
Alexander Alekhin 359ecda4fc Merge pull request #18896 from alalek:cmake_fix_eigen_detection 2020-11-23 17:19:18 +00:00
Alexander Alekhin bf0846f0ea Merge pull request #18895 from oravital7:flip-module 2020-11-23 17:18:59 +00:00
Alexander Alekhin 0401d5920c Merge pull request #18845 from joegeisbauer:fix_reduce_mean_index_error 2020-11-23 17:03:47 +00:00
Alexander Alekhin ac418e999d cmake: update condition for find_package(Eigen3 CONFIG) 2020-11-22 16:28:53 +00:00
Alexander Alekhin ae42815b7d Merge pull request #18887 from HollowMan6:patch-1 2020-11-22 14:40:30 +00:00
Or Avital 5a3a915a9b Remove unnecessary condition (will never reach) 2020-11-22 14:19:20 +02:00
Hollow Man 632a08ff40 Fix typo in docs
adatapted -> adapted
2020-11-22 00:38:37 +08:00
YashasSamaga 0f8ab0557e enable fusion tests, update thresholds and fix missed eltwise fusions 2020-11-21 17:35:20 +05:30
Alexander Alekhin 1b3dd8f38b Merge pull request #18882 from alalek:build_warning_calib3d_drop_register 2020-11-20 22:46:31 +00:00
Jiri Kucera ce31c9c448 core(matrix): Negative values checks
Add checks that prevents indexing an array by negative values.
2020-11-20 22:51:06 +01:00
Alexander Alekhin bc434e8f67 calib3d: eliminate 'register' build warning 2020-11-20 20:32:59 +00:00
Alexander Alekhin 0105f8fa38 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-20 20:32:00 +00:00
Joe e05c2e0f1d Fix Reduce Mean error for MobileNets DNN
Fix for index error for Reduce Mean

Correct Reduce Mean indexing error
2020-11-20 11:17:02 -06:00
Nathan Godwin 2255973b0f Merge pull request #18371 from nathanrgodwin:sqpnp_dev
Added SQPnP algorithm to SolvePnP

* Added sqpnp

* Fixed test case

* Added fix for duplicate point checking and inverse func reuse

* Changes for 3x speedup

Changed norm method (significant speed increase), changed nearest rotation computation to FOAM

* Added symmetric 3x3 inverse and unrolled loops

* Fixed error with SVD

* Fixed error from with indices

Indices were initialized negative. When nullspace is large, points coplanar, and rotation near 0, indices not changed.
2020-11-20 11:25:17 +00:00
Julien ac24a72e66 Merge pull request #18841 from JulienMaille:patch-2
Fixing dnn Resize layer for variable input size

* Fix onnx loading of resize/upsample layers for different opset

* group all DynamicResize tests

* cleaned up scales checks

* Simplify branching
2020-11-20 11:14:00 +00:00
Alexander Alekhin 049b50d9c0 Merge pull request #18858 from fegorsch:improve-persistence-doc 2020-11-20 11:12:25 +00:00
Alexander Alekhin 12fd382fec Merge pull request #18868 from mpashchenkov:mp/onnx-small-cmake-fix 2020-11-20 08:37:21 +00:00
Felix Gorschlüter c996fd1c06 Small improvements to persistence-API doc 2020-11-20 10:49:51 +03:00
Jonathan Cole c4c9cdd2b1 Merge pull request #18855 from Rightpoint:feature/colejd/add-apple-conversions-to-framework-builds
Expose CGImage <-> Mat conversion for iOS platforms

* Add apple_conversions to framework builds

This exposes CGImage <-> Mat conversion.

* Export Mat <-> CGImage methods on iOS targets

* Add CGImage converters to iOS objc helper class

* Add CF_RETURNS_RETAINED annotations to methods returning CGImageRef
2020-11-19 21:20:32 +00:00
Maxim Pashchenkov 34c4e454c5 Added small cmake fix 2020-11-19 21:22:19 +03:00
chargerKong 11cfa64a10 Merge pull request #18335 from chargerKong:master
Ordinary quaternion

* version 1.0

* add assumeUnit;
add UnitTest;
check boundary value;
fix the func using method: func(obj);
fix 4x4;
add rodrigues vector transformation;
fix mat to quat;

* fix blank and tab

* fix blank and tab
modify test;cpp to hpp

* mainly improve comment;
add rvec2Quat;fix toRodrigues;
fix throw to CV_Error

* fix bug of quatd * int;
combine hpp and cpp;
fix << overload error in win system;
modify include in test file;

* move implementation to quaternion.ini.hpp;
change some constructor to createFrom* function;
change Rodrigues vector to rotation vector;
change the matexpr to mat of 3x3 return type;
improve comments;

* try fix log function error in win

* add enums for assumeUnit;
improve docs;
add using std::cos funcs

* remove using std::* from header;
add std::* in affine.hpp,warpers_inl.hpp;

* quat: coding style

* quat: AssumeType => QuatAssumeType
2020-11-19 16:59:33 +00:00
Alexander Alekhin adafb20d1e Merge pull request #18854 from GArik:orbbec 2020-11-19 12:00:59 +00:00
Ian Maquignaz bb067c7ebf Merge pull request #18849 from IanMaquignaz:fix_findFundamentalMat_parameters
Minimum change to address issue #18837
2020-11-19 11:20:20 +00:00
Alexander Alekhin 599bb9c457 Merge pull request #18848 from IanMaquignaz:fixEpipolarGeometryTutorial 2020-11-19 11:18:03 +00:00
Alexander Alekhin dbfa1bfba4 Merge pull request #18863 from l-bat:lb/fix_test 2020-11-19 11:01:14 +00:00
Igor Murzov f8c7862f69 Add tutorial on how to use Orbbec Astra 3D cameras 2020-11-19 13:31:22 +03:00
Liubov Batanina b86f129393 Fixed Test_Model.DetectionOutput 2020-11-19 12:11:52 +03:00
Jojo R 12b8d542b7 norm.cpp(normL2Sqr_): improve performance of pipeline
The most of target machine use one type cpu unit resource
to execute some one type of instruction, e.g.
all vx_load API use load/store cpu unit,
and v_muladd API use mul/mula cpu unit, we interleave
vx_load and v_muladd to improve performance on most targets like
RISCV or ARM.
2020-11-19 09:49:49 +08:00
Ian Maquignaz fef23768fe Fixed issue with Epipolar Geometry Tutorial 2020-11-18 12:34:27 -05:00
Alexander Alekhin 328883b6ea Merge pull request #18675 from sturkmen72:update-documentation 2020-11-18 16:50:35 +00:00
Alexander Alekhin 87ed750510 Merge pull request #17839 from malliaridis:master 2020-11-18 16:48:36 +00:00
Suleyman TURKMEN cc7f17f011 update documentation 2020-11-18 17:07:04 +03:00
Christos Malliaridis 3c25fd1ba5 Update and expand erosion / dilation tutorial
- Add python explanation for erosion and dilation
- Add java explanation for erosion and dilation
- Restructure and reword specific sections
2020-11-18 13:32:24 +01:00
Alexander Alekhin e8536c4a0e Merge pull request #18825 from alalek:update_version_4.5.1-pre 2020-11-18 14:20:22 +03:00
Alexander Alekhin 2687a2b6dc pre: OpenCV 4.5.1 (version++) 2020-11-18 11:04:54 +00:00
Alexander Alekhin aab6362705 Merge pull request #18838 from alalek:video_tracking_api
Tracking API: move to video/tracking.hpp

* video(tracking): moved code from opencv_contrib/tracking module

- Tracker API
- MIL, GOTURN trackers
- applied clang-format

* video(tracking): cleanup unused code

* samples: add tracker.py sample

* video(tracking): avoid div by zero

* static analyzer
2020-11-18 11:04:15 +00:00
Maxim Pashchenkov 94e8a08d1d Merge pull request #18819 from mpashchenkov:mp/ocv-gapi-skip-centos-tests
G-API: Adding a skip for failed streaming tests

* Skip tests

* Pathfinding

* Pathfinding part 2

* Pathfinding part 3

* Fix review comments
2020-11-17 22:57:57 +00:00
Alexander Alekhin ce8027c6fb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-17 21:56:26 +00:00
Alexander Alekhin 301c078d19 Merge pull request #18824 from alalek:update_version_3.4.13-pre 2020-11-18 00:51:21 +03:00
Alexander Alekhin 9485113923 pre: OpenCV 3.4.13 (version++) 2020-11-17 21:50:30 +00:00
Alexander Alekhin 9acbfc6e05 Merge pull request #18711 from alalek:dnn_fix_model_public_api 2020-11-17 21:47:59 +00:00
Alexander Alekhin 4f3130f562 Merge pull request #18145 from sl-sergei:fix_17914 2020-11-17 21:46:08 +00:00
Alexander Alekhin a783bf4a93 Merge pull request #18839 from alalek:update_libjpeg-turbo
3rdparty: libjpeg-turbo 2.0.5 => 2.0.6
2020-11-18 00:14:55 +03:00
Alexander Alekhin f7e8dc770a Merge pull request #18834 from l-bat:update_reducemax 2020-11-17 21:14:10 +00:00
Alexander Alekhin 34909d97b4 Merge pull request #18840 from alalek:dnn_test_skip_myriad_gather_multi_output 2020-11-17 23:45:37 +03:00
Alexander Alekhin 474a67231c dnn(test): skip gather_multi_output test on Myriad 2020-11-17 19:52:07 +00:00
Omar Alzaibaq a316b11aaa Merge pull request #18220 from Omar-AE:hddl-supported
* added HDDL VPU support

* changed to return True in one line if any device connected

* dnn: use releaseHDDLPlugin()

* dnn(hddl): fix conditions
2020-11-17 19:47:24 +00:00
Alexander Alekhin b645fc10a3 Merge pull request #18782 from alalek:issue_18779 2020-11-17 19:13:15 +00:00
Alexander Alekhin 8e1e08ee38 Merge pull request #18833 from sl-sergei:disable_conv1d_wb_test 2020-11-17 19:11:38 +00:00
Alexander Alekhin d266fee8bb 3rdparty: libjpeg-turbo 2.0.5 => 2.0.6
https://github.com/libjpeg-turbo/libjpeg-turbo/releases/tag/2.0.6
2020-11-17 18:28:52 +00:00
Alexander Alekhin 8357e865bc Merge pull request #18828 from ichisadashioko:fix-calibration-sample-typo 2020-11-17 17:13:43 +00:00
Orest Chura 2c6a2f0381 Merge pull request #18790 from OrestChura:oc/fitLine
[G-API]: fitLine() Standard Kernel Implementation

* fitLine API (Mat, 32S, 32F) (2D, 3D)

* Complete fitLine kernel & accuracy tests
 - initialization for vectors of cv::Point and Mats via vectors added
 - comparison functions for Vec<T, n> added:
   - straight average difference comparison
   - comparison by equasion for 2d line
 - stream overload for cv::DistanceTypes added

* Fix precommit warnings

* Fix docs

* Address comments
Try to fix warning

* Disable warning in tests
2020-11-17 15:59:59 +00:00
shioko fe9a8ebea2 Fix typo 'Applicatioin' 2020-11-17 15:02:55 +00:00
Dmitry Matveev b866d0dc38 Merge pull request #18793 from dmatveev:dm/in_graph_metadata
G-API: Introduce runtime in-graph metadata

* G-API: In-graph metadata -- initial implementation

* G-API: Finish the in-graph metadata implementation for Streaming

* G-API: Fix standalone build & warnings for in-graph metadata

* G-API: In-graph meta -- fixed review comments

* G-API: Fix issues with desync causing failing tests
2020-11-17 14:04:19 +00:00
Alexander Alekhin 2b558a3787 core: fix F16C compilation check 2020-11-17 12:22:49 +00:00
Liubov Batanina 72d06080c6 [ONNX] Added Reduce ops for batch and channel 2020-11-17 14:45:36 +03:00
Sergey Slashchinin 3cdf926454 disable Conv1d test on NGRAPH/MYRIAD 2020-11-17 14:33:39 +03:00
Alexander Alekhin 23baf1a75e dnn: fix High-Level public API (cv::dnn::Model class)
- proxy selected Net methods only (don't derive from Net directly)
- default Model ctor is protected
2020-11-17 11:01:31 +00:00
Alexander Alekhin 025a9647af Merge pull request #18830 from l-bat:issue_18785 2020-11-17 10:40:53 +00:00
Sergey Slashchinin 32e7ef8a3d Add fixes and tests for different layers 2020-11-17 13:39:32 +03:00
Sergei Slashchinin 2b82f8f12c Merge pull request #18296 from sl-sergei:fix_16783
Fix loading issue for Faster RCNN model from #16783

* Add a reproducer with multi-output Gather

* Fix an issue with ONNX graph simplifier

* fix build

* Move checks to correct class

* Minor changes for better code appearence
2020-11-17 09:52:08 +00:00
Alexander Alekhin b5c162175b Merge pull request #18823 from alalek:issue_contrib_2750 2020-11-17 09:47:39 +00:00
Alexander Alekhin 60c76cc289 Merge pull request #18822 from alalek:java_workaround_base_class_issue 2020-11-17 09:47:04 +00:00
Alexander Alekhin efd556b1a9 Merge pull request #18818 from alalek:objc_skip_nested_classes_namespaces 2020-11-17 09:44:46 +00:00
Liubov Batanina 3a184ae677 [ONNX] Added handler for int32 tensors 2020-11-17 10:17:06 +03:00
Alexander Alekhin b4b2a276c8 Merge pull request #18756 from andy-held:add_ueye_capture 2020-11-16 22:28:54 +00:00
Alexander Alekhin 464d53bb16 python: emit "string" => "std::string" 2020-11-16 21:34:42 +00:00
Alexander Alekhin 4c9e3723e8 objc: skip unsupported inner namespaces 2020-11-16 19:52:16 +00:00
Maxim Pashchenkov 06477743ab Merge pull request #18744 from mpashchenkov:mp/onnx-dynamic-input-tensor
G-API: ONNX. Support tensor input for CNN with dynamic input 

* Added support for dynamic input tensor, refactored one input/output tests

* Added multiple input/output fixture, test for mobilenet

* Removed whitespace

* Removed mistake in inferROI

* Small fixes

* One more fix

* Code cleanup

* Code cleanup X2

* bb rstrt

* Fix review comments

* One more fix review comments

* Mistake
2020-11-16 19:24:55 +00:00
Alexander Alekhin e4a9ad1730 Merge pull request #18688 from rgarnov:rg/add_gmatdesc_s11n_nd_test 2020-11-16 19:18:38 +00:00
Alexander Alekhin d0b6637c1d Merge pull request #18720 from rgarnov:rg/nd_rmat_view 2020-11-16 12:05:08 +00:00
Ruslan Garnov 58268b6eef Added ND GMatDesc serialization test 2020-11-16 13:03:18 +03:00
Alexander Alekhin 14aa8affe5 Merge pull request #18811 from alalek:objc_headers_import 2020-11-16 09:52:26 +00:00
Alexander Alekhin 56074c2eb3 Merge pull request #18763 from GArik:orbbec 2020-11-16 09:12:25 +00:00
Alexander Alekhin 3da1e8b2f8 Merge pull request #18805 from alalek:cmake_objc_generator 2020-11-16 08:44:14 +00:00
Alexander Alekhin 786cecfe66 Merge pull request #18817 from alalek:fixup_objc_tests 2020-11-16 07:58:48 +00:00
Alexander Alekhin dde3cb3b99 java: workaround handling of base class 2020-11-16 06:03:30 +00:00
Alexander Alekhin 24f2b7dd3f objc(test): repair binary resource files 2020-11-16 05:22:45 +00:00
Alexander Alekhin 936530f795 Merge pull request #18808 from alalek:objc_robust_binding_code 2020-11-15 21:36:14 +00:00
Alexander Alekhin cfbdbffcad objc: rework headers import
- 'AdditionalImports' can be removed from misc/objc/gen_dict.json
- avoid using of legacy 'opencv.hpp'
2020-11-15 05:24:01 +00:00
Alexander Alekhin 71db9d3b57 Merge pull request #18801 from alalek:java_improve_nested_classes_namespaces 2020-11-14 22:55:33 +00:00
Alexander Alekhin b455e1cf52 Merge pull request #18810 from AntonVeselskyi:bugfix-18807 2020-11-14 22:48:49 +00:00
Alexander Alekhin 564d1a0f79 Merge pull request #18802 from aitikgupta:typo 2020-11-14 22:46:48 +00:00
Alexander Alekhin 90bea15e35 objc: robust code generation
- the same generated code from Python2/3
- avoid randomized output due to unpredictable dict/set order
2020-11-14 22:31:47 +00:00
Alexander Alekhin 892cac9e1b Merge pull request #18809 from alalek:objc_string 2020-11-14 22:13:27 +00:00
Anton Veselskyi f58f36dc88 Changed sample code, fixes #18807 2020-11-14 23:29:51 +02:00
Alexander Alekhin 9e84b860f2 cmake: update objc generator scripts
- allow to run generator without strong requirement of building 'objc' module
2020-11-14 20:59:55 +00:00
Alexander Alekhin 2e7ef6f4e8 objc: fix std::string handling
- arg types may be passed as string instead of std::string
2020-11-14 20:01:58 +00:00
Alexander Alekhin cea137f313 Merge pull request #18806 from quaresmajose:cmake 2020-11-14 18:17:31 +00:00
Jose Quaresma 79a82013ad samples: cmake: digits needs opencv_dnn module to build
Intrudeced in commit 397ba2d9aa:
add OpenCV sample for digit and text recongnition, and provide multiple OCR models.
https://github.com/opencv/opencv/commit/397ba2d9aafb5312e777ce2f886d7b568109e931

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
2020-11-14 09:36:43 +00:00
Aitik Gupta 05c011e842 Small typo-fix 2020-11-14 10:54:15 +05:30
Alexander Alekhin 3826158547 java: 'namespace_' class prefix, support inner classes
- support multi-level namespaces
- support inner classes (Params)
- reduce scope of 'using namespace' in JNI C++ code
2020-11-13 23:21:03 +00:00
Alexander Alekhin a7c150ec66 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-13 22:29:14 +00:00
Sergei Slashchinin 61144f935e Merge pull request #18783 from sl-sergei:fix_conv1d
Add support for Conv1D on OpenCV backend

* Add support for Conv1D on OpenCV backend

* disable tests on other targets/backends

* Fix formatting

* Restore comment

* Remove unnecessary flag and fix test logic

* Fix perf test

* fix braces

* Fix indentation, assert check and remove unnecessary condition

* Remove unnecessary changes

* Add test cases for variable weights and bias

* dnn(conv): fallback on OpenCV+CPU instead of failures

* coding style
2020-11-13 22:22:10 +00:00
Alexander Alekhin d23435baac Merge pull request #18798 from alalek:java_robust_binding_code 2020-11-13 21:26:23 +00:00
Alexander Alekhin 389495f76a Merge pull request #18499 from RidgeRun:optional-gstreamer-mainloop 2020-11-13 21:07:30 +00:00
Andreas Franek a3f3fbe05d add rudimentary support for uEye cameras
uEye are cameras from IDS, c.f. https://en.ids-imaging.com/
Supports driver version 4.94 and up currently, since the event system was overhauled there.
Supports setting/getting the properties: fps,width,height
2020-11-13 18:38:51 +01:00
Chris Ballinger 4d00ed8df7 Merge pull request #18771 from chrisballinger:xcode-12-fixes
Xcode 12 and Python 2/3 fixes

* Fix compilation issues using Xcode 12 on macOS Catalina

* Fix macOS scripts to work on Python 2 or 3

* Fix additional issues with Python 3

* Fix additional Python 2/3 issue

* Fix another Python 2/3 issue

* Remove dependency on builtins module
2020-11-13 15:30:53 +00:00
Alexander Alekhin 41e906d1a4 Merge pull request #18729 from rgarnov:rg/extend_parse_yolo 2020-11-13 15:18:55 +00:00
Alexander Alekhin 41c2669476 java: robust code generation
- the same generated code from Python2/3
- avoid randomized output due to unpredictable dict/set order
2020-11-13 13:42:26 +00:00
Ruslan Garnov 0e4b5b88dc Added support of 1x1x1xN input for parseYolo 2020-11-13 16:20:45 +03:00
Igor Murzov 011d8e80d8 videoio: Support Orbbec Astra 3D cameras using OpenNI2 API
Only depth sensor is supported. Color sensor is accessible as a
regular UVC camera.
2020-11-13 16:08:06 +03:00
Alexander Alekhin 1f8f0abe92 Merge pull request #18795 from aitikgupta:stiching-bug 2020-11-13 11:20:37 +00:00
Aitik Gupta d9c5b85671 Use in-place sort 2020-11-13 09:00:54 +05:30
Alexander Alekhin 76cf31bee7 Merge pull request #18786 from mshabunin:fix-kw-2 2020-11-12 15:41:18 +00:00
Alexander Alekhin ed3591ed1f Merge pull request #18774 from alalek:bindings_namespace_inline 2020-11-12 12:23:37 +00:00
Maksim Shabunin d986cc4861 calib3d: uninitialzed fields in usac 2020-11-12 13:38:26 +03:00
Ruslan Garnov 724001aa0f Added multidimensional RMat::View steps 2020-11-12 13:15:02 +03:00
Alexander Alekhin 5564d73071 Merge pull request #18770 from mshabunin:fix-kw-1 2020-11-11 16:14:15 +00:00
Orest Chura 3fc1c73064 Merge pull request #18510 from OrestChura:oc/boundingRect
[G-API]: findContours() and boundingRect() Standard Kernels Implementation

* Add findContours() standard kernel
 - API and documentation provided:
   - as OpenCV provides two overloads whether to calculate hierarchy or not, but they differ by only the output in sight of G-API, two different G-API functions and kernels implemented
   - G-API Imgproc documentation divided into more parts according to imgproc module parts
   - some typos connected with division into parts corrected
 - `GArray<GArray<U>>` overload for `get_out` function provided to coonvert correctly into `vector<vector<U>>`
 - OCV backend supported
 - accuracy tests provided

* Add boundingRect() standard kernel
     - API and documentation provided:
       - GOpaque<Rect> used as an output
       - as OpenCV provides two possibilities whether to take a gray-scale image or a set of 2D points (`Point2i` or `Point2f` supported), three different overloads of a single G-API function and three kernels implemented
          - for a gray-scale image the overload via `GMat`
          - for a set of `Point2i` - the one via GArray<`Point2i`>
          - set of `Point2f` -> GArray<`Point2f`>
     - OCV backend supported
     - accuracy tests provided
       - comparison function for Rects provided
     - some typos in `gapi_tests_common` corrected

* Fix precommit windows warnings

* - Addressing comments:
   - split tests
 - Fix Windows warnings

* Static_cast for warnings

* - Remove randomness
 - Fix unnecessary precision losses

* - Forgot reference for RNG

* addressing comments

* equalizeHist -> no group

* `const` addedin new functions

* Address suggestions:
 - Hierarchical -> H
 - added cv::GMatDesc::isVectorPoins()
 - added support of giving a set of points to boundingRect()

* Addressing comments
 - IoU comparison function added for Rects
 - isPointsVector moved from a GMatDesc method to a separate function in imgproc.hpp
 - enums instead of int
 - typos corrected

* Addressing comments
 - findContours: Point offset -> GOpaque<Point>
 - removed "straight" comparison for Rects, IoU available only
 - changed vectors initialization -> fix Debug test run
 - Some typos

* added comment for later upgrades

* Fix not to corrupt docs by FIXME

* Addressing commens
 - overload without offset added (as a temporary workaround)
 - checkMetaForFindingContours -> validateFindingContoursMeta
 - added ostream overload for enums used in tests
2020-11-11 12:13:10 +00:00
Maksim Shabunin 1b0dca9c2c Fix issues found by static analysis 2020-11-11 13:59:01 +03:00
Alexander Alekhin 5dae278652 bindings: "inline namespace" 2020-11-11 10:38:15 +00:00
Alexander Alekhin ef32d7fd16 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-10 20:09:18 +00:00
Alexander Alekhin 30d91e8ed6 Merge pull request #18765 from GArik:tutorials 2020-11-10 20:08:29 +00:00
Orest Chura 5f1ca33c6f Merge pull request #18652 from OrestChura:oc/morphologyEx
[G-API]: morphologyEx() Standard Kernel Implementation

* cv::gapi::morphologyEx() kernel
 - implemented (without separate 3x3 version)
 - tests added: check only different operations, not kernels/borders

* Address comments: add `const` where needed

* Replaced fundamental tyeps -> enums where needed
 - added operator<< overload for cv::MorphTypes for tests output
2020-11-10 18:57:52 +00:00
Alexander Alekhin c69417149d Merge pull request #18764 from alalek:doxygen_image_path 2020-11-10 18:55:10 +00:00
Igor Murzov 08271e5591 Fix code snippets inclusion into video tutorials
Code snippets need a section marked with ### above to render properly
2020-11-10 21:54:23 +03:00
Alexander Alekhin a104e7c593 doxygen: adjust IMAGE_PATH, allow custom OPENCV_DOCS_EXTRA_IMAGE_PATH
- add opencv/modules
- add opencv_contrib/modules
2020-11-10 12:43:46 +00:00
Alexander Alekhin c3e7a23da5 Merge pull request #18752 from alalek:dnn_defines_openvino_2021.1.0 2020-11-08 18:09:52 +00:00
Alexander Alekhin 083edb201c Merge pull request #18753 from catree:fix_FindOpenBLAS_typo 2020-11-08 18:09:27 +00:00
catree df7bf9a048 Fix typo in OpenCVFindOpenBLAS.cmake file. 2020-11-08 14:42:47 +01:00
Alexander Alekhin bed5debca6 dnn: use OpenVINO 2021.1 defines 2020-11-07 17:27:33 +00:00
Alexander Alekhin caa1658a4c Merge pull request #18746 from alalek:backport_18741 2020-11-07 15:47:15 +00:00
Roman Kazantsev bb5b628cce Use explicit opset of Unsqueeze from nGraph
backporting commit eb24575e2c
2020-11-06 22:29:35 +00:00
Alexander Alekhin e12adcdf08 Merge pull request #18742 from AsyaPronina:asyadev/fix_preprocessing_for_import_network 2020-11-06 16:39:03 +00:00
Alexander Alekhin 127a44f2b9 Merge pull request #18732 from junxnone:master 2020-11-06 16:36:58 +00:00
Alexander Alekhin 527cedd848 Merge pull request #18741 from rkazants:fix/rkazants/39665_unsqueeze 2020-11-06 13:26:25 +00:00
Anastasiya Pronina ec5065eb53 Fixed Inputs/OutputsDataMap conversion 2020-11-06 15:43:56 +03:00
Alexander Alekhin 90524a8528 Merge pull request #18740 from rgarnov:rg/fix_rmat_media_missing_in_standalone 2020-11-06 10:11:17 +00:00
junxnone ad71a1633c fix truncate threshold example display issue in py_tutorials
Signed-off-by: junxnone <junchen0102@gmail.com>
2020-11-06 16:38:03 +08:00
Roman Kazantsev eb24575e2c Use explicit opset of Unsqueeze from nGraph
The change is needed due to removing default opset namespace for Unsqueeze
in the scope of this refactoring activity: https://github.com/openvinotoolkit/openvino/pull/2767

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-11-06 09:51:40 +03:00
Ruslan Garnov d9877efe1d Added rmat.cpp and media.cpp to files being built in standalone 2020-11-06 01:59:09 +03:00
Alexander Alekhin 7459613623 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-05 18:59:10 +00:00
Alexander Alekhin fb69620a27 Merge pull request #18699 from alalek:support_ceres_2.0.0 2020-11-05 18:55:57 +00:00
Alexander Alekhin a6e15b2f57 cmake: prefer using Eigen configuration files
- for better compatibility with Ceres 2.0.0 CMake scripts
2020-11-05 17:01:23 +00:00
Alexander Alekhin 39ecd96b09 Merge pull request #18736 from mshabunin:mfx-frame-size-34 2020-11-05 17:00:35 +00:00
Maksim Shabunin 21a8d9569d videoio: added frameSize to MFX capture 2020-11-05 17:40:48 +03:00
Alexander Alekhin 07736c912f Merge pull request #18719 from dmatveev:dm/upstream_desync_fix 2020-11-05 11:20:08 +00:00
Alexander Alekhin 24d60da553 Merge pull request #18724 from S-o-T:fix_confusing_naming_for_keypoints_comparator 2020-11-03 20:20:12 +00:00
Mark Shachkov 039795b405 Change naming of keypoints comparator 2020-11-03 21:54:56 +03:00
Dmitry Matveev a110ede0a2 Merge pull request #18716 from dmatveev:dm/upstream_onnx
* G-API: Introduce ONNX backend for Inference

- Basic operations are implemented (Infer, -ROI, -List, -List2);
- Implemented automatic preprocessing for ONNX models;
- Test suite is extended with `OPENCV_GAPI_ONNX_MODEL_PATH` env for test data
  (test data is an ONNX Model Zoo repo snapshot);
- Fixed kernel lookup logic in core G-API:
  - Lookup NN kernels not in the default package, but in the associated
    backend's aux package. Now two NN backends can work in the same graph.
- Added Infer SSD demo and a combined ONNX/IE demo;

* G-API/ONNX: Fix some of CMake issues

Co-authored-by: Pashchenkov, Maxim <maxim.pashchenkov@intel.com>
2020-11-03 18:39:16 +00:00
Anatoliy Talamanov 2a3cdba724 Merge pull request #18701 from TolyaTalamanov:at/introduce-config-for-ie-params
Expand ie::Params to support config

* Add config to IE params

* Add test

* Remove comments from tests

* Rename to pluginConfig

* Add one more overloads for pluginConfig

* Add more tests
2020-11-03 17:47:05 +00:00
Dmitry Matveev 099ad1a259 G-API: Desync -- fix the queue saturation problem
Set queue size = 1 to Copy island right after the desync.
In this case, Copy won't read more data from a "last_written"
container than required, while feeding the desynchronized path.

Sometimes Copy don't get fused into an island and behaves
on its own -- in this case, it reads more data in advance
so the slow (desync) part actually processes some data in-sync
(more than actually required)
2020-11-03 14:26:32 +03:00
Alexander Alekhin 6df92b3bca Merge pull request #18651 from AsyaPronina:asyadev/add_possibility_to_check_that_gcompilearg_has_serialize 2020-11-02 17:58:50 +00:00
AsyaPronina 48ccbe39b4 Changed behaviour of cv::gapi::serialize, cv::gapi::deserialize for GCompileArgs
- cv::gapi::serialize bypasses compile arguments which have no S11N specialization with serialize/deserialize callbacks for underlying types
- cv::gapi::deserialize can accept arbitraty number of serialized compile args in a stream but will return only those which are requested by user via template parameter pack if they are presented in the stream. If some or all of them are not presented cv::gapi::deserialize will ignore and return only those which are presented
- cv::gapi::deserialize can accept only types which can be deserialized (have S11N<T> specialization with the user callbacks)
- Added cv::gapi::s11n::detail::has_S11N_spec<T> trait to separate compile arguments which have S11N<T> specialization with the user callbacks
2020-11-02 18:55:54 +03:00
Alexander Alekhin 716450ceb5 Merge pull request #18158 from legrosbuffle:3.4-vectorize-dft-radix 2020-10-30 22:05:50 +00:00
Alexander Alekhin 691c3d1e3c Merge pull request #18673 from dmatveev:dm/upstream_desync 2020-10-29 18:55:24 +00:00
Dmitry Matveev ca8bb8d053 G-API: Introduce streaming::desync and infer(ROI)
- desync() is a new (and for now, the only one) intrinsic
  which splits the graph execution into asynchronous parts
  when running in Streaming mode;
- desync() makes no effect when compiling in Traditional mode;
- Added tests on desync() working in various scenarios;
- Extended GStreamingExecutor to support desync(); also extended
  GStreamingCompiled() with a new version of pull() returning a
  vector of optional values;
- Fixed various issues with storing the type information & proper
  construction callbacks for GArray<> and GOpaque;

- Introduced a new infer(Roi,GMat) overload with a sample;

- Introduced an internal API for Islands to control fusion
  procedure (to fuse or not to fuse);
- Introduced handleStopStream() callback for island executables;
- Added GCompileArgs to metadata of the graph (required for other
  features).
2020-10-29 20:19:15 +03:00
Jack·Boos·Yu 56d2b7137c Merge pull request #18658 from JackBoosY:master
* Fix cmake configure error

* judge the cmake version

* Add comments
2020-10-29 13:50:25 +00:00
Alexander Alekhin d9a62c42e5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-28 14:41:08 +00:00
Alexander Alekhin 97eaddd93b Merge pull request #18672 from alalek:cmake_3rdparty_exclude_from_all 2020-10-28 14:40:47 +00:00
Alexander Alekhin e3ce0fbee3 Merge pull request #18685 from APrigarina:fix_curved_qrcodes 2020-10-28 14:02:08 +00:00
Alexander Alekhin 364702b1c9 cmake(3rdparty): use EXCLUDE_FROM_ALL 2020-10-28 11:56:12 +00:00
Alexander Alekhin 978f387961 Merge pull request #18663 from alalek:core_cleanup_inline_code_4.x 2020-10-28 11:40:50 +00:00
Alexander Alekhin 209f6cdcc7 Merge pull request #18671 from rgarnov:rg/rmat_and_s11n_fixes 2020-10-28 10:38:56 +00:00
APrigarina 0f7b2eb79f fix curved qrcodes decoding 2020-10-28 12:54:54 +03:00
Alexander Alekhin 4a0760719e Merge pull request #18664 from ackbar345:mikkel/fix-manual-page-size 2020-10-27 17:49:22 +00:00
Mikkel Green d011383a3d Bugfix: Manual page sizes now overwrite the default page size if they are both specified. Remove redudant .upper() call, 1 to 1 key matching enforced
by argparse choices.
2020-10-26 18:21:06 -07:00
Alexander Alekhin 1fe276d041 core: move inline code from mat.inl.hpp (OpenCV 4.x additions)
base commit: aac7c5465b
2020-10-26 22:58:30 +00:00
Alexander Alekhin f345ed564a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-26 20:07:47 +00:00
Anatoliy Talamanov 3d4563913d Merge pull request #18600 from TolyaTalamanov:at/implement-render-using-stateful
[G-API] Implement render using stateful kernel

* Implement render using stateful kernel

* Move freetype to backends folder

* Fix freetype compilation

* Fix freetype smoke test

* Fix comments

* Refactoring
2020-10-26 19:55:43 +00:00
Anatoliy Talamanov 93c3775927 Merge pull request #18491 from TolyaTalamanov:at/wrap-inference
[G-API] Wrap cv::gapi::infer<Generic> into python

* Introduce generic infer

* Move Generic to infer.hpp

* Removew num_outs

* Fix windows warnings

* Fix comments to review

* Fix doxygen

* Add comment

* Fix comments to review

* Wrap inference to python

* Add default ctor to Params

* Add test

* Fix clang build

* Implement GInferInputs/GInferOutputs as Pimpl

* Add checkIEtarget to infer test

* Fix path

* Supress warning

* Use getAvailableDevices insted of checkIETarget

* Move PyParams to bindings_ie

* Add namespace

* Update CMakeLists.txt
2020-10-26 19:02:03 +00:00
Ruslan Garnov afbf383ba3 Minor s11n and RMat improvements:
- Changed descr_of(RMat) to use canDescribeHelper to correctly handle planar case
 - Added export of createMat
 - Added setting of Storage::INPUT and Storage::OUTPUT in deserialization routine of GComputation
2020-10-26 15:48:27 +03:00
Quentin Chateau 36598677cf Merge pull request #18646 from qchateau:wave-auto
* stitching: add WAVE_CORRECT_AUTO

* stitching: use CV_EXPORTS
2020-10-25 15:58:27 +00:00
Alexander Alekhin 0ec94630d4 Merge pull request #18640 from alalek:core_cleanup_inline_code 2020-10-24 17:06:08 +00:00
ann c71f2714c6 Merge pull request #18003 from APrigarina:curved_qrcodes_decoding
Detection and decoding of curved QR-codes

* temp changes for curved qrcodes

* added api for curved qr code decoding

* fixed prototypes

* refactored curved qr code decoding

* refactored curved qr code decoding 2nd part

* refactored curved qr code decoding 3rd part

* refactored curved qr code decoding 4th part

* added tests for curved qr code decoding

* refactored curved qr code decoding 5th part
2020-10-23 18:42:45 +00:00
Alexander Alekhin 71462d9f99 Merge pull request #18633 from laelath:master 2020-10-23 16:47:38 +00:00
Giles Payne 72dfd4846e Merge pull request #18637 from komakai:build-for-distribution
Add support for Swift version independence

* Build for distribution (Swift version independence) when new Xcode build system is available

* Add module map and set "Defines Modules" flag
2020-10-23 11:19:36 +00:00
Justin Frank 61a8cf8ba7 Fix TypeError when building for WebAssembly with Python 3 2020-10-22 12:38:28 -07:00
Alexander Alekhin bd40952097 Merge pull request #18622 from TolyaTalamanov:at/fix-namespace 2020-10-22 17:43:23 +00:00
Alexander Alekhin 8869d3212f Merge pull request #18641 from rtimpe:fix_cuda_stubs 2020-10-22 12:25:56 +00:00
Quentin Chateau ea1e3fb90d Merge pull request #18624 from qchateau:similarity-mask
* support similarity masks

* add test for similarity threshold

* short license in test

* use UMat in buildSimilarityMask

* fix win32 warnings

* fix test indentation

* fix umat/mat sync

* no in-place argument for erode/dilate
2020-10-22 12:24:58 +00:00
Alexander Alekhin 3a99fb9d34 Merge pull request #18607 from zteffi:warp-point-backward 2020-10-22 12:22:26 +00:00
Alexander Alekhin e1b56e376e Merge pull request #18476 from dmatveev:dm/gapi_text_detection 2020-10-22 12:21:55 +00:00
Alexander Alekhin aac7c5465b core: move inline code from mat.inl.hpp 2020-10-21 23:06:09 +00:00
Rob Timpe 22ee5c0c4d Fix errors when building with cuda stubs
Fixes two errors when building with the options WITH_CUDA=ON and BUILD_CUDA_STUBS=ON on a machine without CUDA.

In the cudaarithm module, make sure cuda_runtime.h only gets included when CUDA is installed.

In the stitching module, don't assume that cuda is present just because cudaarithm and cudawarping are present (as is the case when building with the above options).
2020-10-21 15:51:46 -07:00
Alexander Alekhin e8058b9fdb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-21 15:55:23 +00:00
Martin Štefaňák d31b6c3480 stitching: add warpPointBackward to warpers
test by projecting and reprojecting back random points
2020-10-21 17:26:52 +02:00
Dmitry Matveev 95ff928228 G-API: Introduced a Text Detection sample
This sample models the Text Detection demo from OMZ:
https://github.com/openvinotoolkit/open_model_zoo/tree/2020.4/demos/text_detection_demo

Also: renamed cv::gapi::size() to cv::gapi::streaming::size()
2020-10-21 17:25:56 +03:00
Anna Khakimova 510dc17c2e Merge pull request #18338 from anna-khakimova:ak/opt_arithm_kernel
Univ Intrinsics implementation of Add, Sub, Absdiff kernels

* Add, sub, absdiff kernels optimization

* avoid unused conditions

* add conditions for tail processing
2020-10-21 10:52:03 +00:00
Alexey Smirnov 2669d8ce73 Merge pull request #18584 from smirnov-alexey:as/rmat_s11n
[G-API]: Introduce RMat serialization API

* Introduce RMat serialization API

* Fix RunArgs deserialization

* Address review comments

* Export operators for GRunArg serialization

* Fix warning and add handling for RMat in bind()

* Update CMakeLists.txt

* G-API: RMat S11N -- probably fix the Windows warning
2020-10-20 20:58:54 +00:00
Alexander Alekhin 7f3d8de26f Merge pull request #18628 from innerlee:patch-1 2020-10-20 20:03:50 +00:00
lizz 331b73c8e4 Typo in docstring of distanceTransform 2020-10-20 17:57:10 +08:00
Alexander Alekhin 1729297ef3 Merge pull request #18588 from damonmo:fix-issue-18553 2020-10-19 22:53:05 +00:00
Alexander Alekhin 9138c98b25 Merge pull request #18614 from ZhiyuanChen:patch-1 2020-10-19 22:42:48 +00:00
Zhiyuan Chen 456af21d8b fixes #18613 2020-10-19 21:42:04 +00:00
Nikolai b87f7a625e Merge pull request #18426 from Varvrar:add-HEVC-codec-iOS-Mac
* add HEVC(H.265) codec to iOS,Mac VideoWriter

* Update cap_avfoundation_mac.mm

add CV_FOURCC('h','v','c','1') for HEVC codec

* Update cap_avfoundation.mm

add CV_FOURCC('h','v','c','1') for HEVC codec

* feat: add availability check for HEVC codec on iOS and OS X

Co-authored-by: Vadim Levin <vadim.levin@xperience.ai>
2020-10-19 17:39:19 +00:00
Alexander Alekhin c3e8790dfd Merge pull request #18621 from dbudniko:gapi_ww43_2020_KW_fixes 2020-10-19 17:16:12 +00:00
Daniel Motilla bf49149c97 Enable imshow to take GpuMat inputs in Python 2020-10-19 14:35:03 +02:00
Anatoliy Talamanov 49d5960a32 Fix namespace for OCVCallHelper 2020-10-19 14:19:17 +03:00
Dmitry Budnikov dcfa23d5d2 KW fixes 2020-10-19 13:46:23 +03:00
masa-iwm 5ac0712cf1 Merge pull request #18593 from masa-iwm:master
Add support thread-local directx (OpenCL interop) initialization

* support thread-local directx (OpenCL interop) initialization

* reflect reviews

* Remove verbose function prototype declarations

* Countermeasures for VC warnings. (declaration of 'platform' hides class member)

* core(directx): remove internal stuff from public headers
2020-10-18 21:22:06 +00:00
Kun Liang c82417697a Merge pull request #18068 from lionkunonly:gsoc_2020_simd
[GSoC] OpenCV.js: WASM SIMD optimization 2.0

* gsoc_2020_simd Add perf test for filter2d

* add perf test for kernel scharr and kernel gaussianBlur

* add perf test for blur, medianBlur, erode, dilate

* fix the errors for the opencv PR robot

fix the trailing whitespace.

* add perf tests for kernel remap, warpAffine, warpPersepective, pyrDown

* fix a bug in  modules/js/perf/perf_imgproc/perf_remap.js

* add function smoothBorder in helpfun.js and remove replicated function in perf test of warpAffine and warpPrespective

* fix the trailing white space issues

* add OpenCV.js loader

* Implement the Loader with help of WebAssembly Feature Detection, remove trailing whitespaces

* modify the explantion for loader in js_setup.markdown and fix bug in loader.js
2020-10-18 20:30:36 +00:00
Alexander Alekhin adac1da64e Merge pull request #18598 from aleromar:Issue18595_UsacParams_PythonBinding 2020-10-18 19:28:46 +00:00
Alexander Alekhin 9c8626bf3c Merge pull request #18605 from komakai:fix-swift-binding 2020-10-17 16:57:04 +00:00
Giles Payne ef21fd3cf8 Fix handling of properties with enum type 2020-10-17 14:31:24 +09:00
Alexander Alekhin bd19f991a5 Merge pull request #18602 from alalek:issue_18597 2020-10-16 20:22:58 +00:00
Alexander Alekhin e87ba1d317 Merge pull request #18590 from krush11:master 2020-10-16 19:47:03 +00:00
Alexander Alekhin f9d1f5196a Merge pull request #18533 from paroj:imwritemulti 2020-10-16 19:46:24 +00:00
Alexander Alekhin b5717f82a0 core: fix __clang_major__ typo regression 2020-10-16 15:35:51 +00:00
arodrigu aa51382dbc Fix: UsacParams Python bindings 2020-10-16 14:41:41 +02:00
Pavel Rojtberg bc6a70c689 imwrite: multi-image overload for bindings 2020-10-16 11:27:09 +00:00
Krushnal Patel 1fb6c6e6e5 Update demosaicing.cpp 2020-10-16 11:15:42 +00:00
Alexander Alekhin d2dbc9d7a0 Merge pull request #18589 from alalek:issue_13328 2020-10-15 18:43:48 +00:00
Anatoliy Talamanov 8bf451a3e0 Merge pull request #18542 from TolyaTalamanov:at/import-network
[G-API] Support ImportNetwork for cv::gapi::infer

* wip

* Refactoring

* Fix comments to review

* Fix warning

Co-authored-by: Ruslan Garnov <ruslan.garnov@intel.com>
2020-10-15 13:59:02 +00:00
Anatoliy Talamanov 0d3e05f9b3 Merge pull request #18493 from TolyaTalamanov:at/wrap-streaming
[G-API Wrap streaming

* Wrap streaming

* Fix build

* Add comments

* Remove comment

* Fix comments to review

* Add test for python pull overload
2020-10-14 22:21:09 +00:00
Alexander Alekhin 8c4d415412 Merge pull request #18582 from weltonrodrigo:remap_inter_doc 2020-10-14 21:13:54 +00:00
Alexander Alekhin 06a09d5991 Merge pull request #18583 from weltonrodrigo:remap_inter_doc_4 2020-10-14 18:06:59 +00:00
Alexander Alekhin 57c894f44d Merge pull request #18566 from mtfrctl:mat-objc-swift-data-pointer 2020-10-14 16:59:44 +00:00
mtfrctl 7de189114b Merge pull request #18547 from mtfrctl:objc-conversions-macosx
Mat conversions for macOS/AppKit

* Extract CoreGraphics conversion logics from ios_conversions.mm to apple_conversions.h, apple_conversions. Add macosx_conversions.mm

* Add macosx.h

* Add Mat+Conversions.h and Mat+Conversions.mm

* Delete duplicated declaration from apple_conversion.mm

* Use short license header

* Add compile guard

* Delete unused imports

* Move precomp.hpp import from header to implementation

* Add macosx.h to skip headers

* Fix compile guard condition

* Use short license header

* Remove commented out unused code
2020-10-14 16:58:06 +00:00
Anna Khakimova 4c048a487e Merge pull request #18516 from anna-khakimova:ak/bgr2rgb
GAPI: Addition new Color conversion kernels to CPU backend.

* Add BGR2RGB kernel to CPU backend

* Add BGR2I420 and RGB2I420 kernels to CPU backend

* Add I4202BGR and I4202RGB kernels to CPU backend
2020-10-14 16:51:35 +00:00
Welton Rodrigo Torres Nascimento 09a62012b2 Doc update. INTER_LINEAR_EXACT unsupported in remap 2020-10-14 11:09:12 -03:00
Alexander Alekhin b494de6a01 Merge pull request #18559 from maxint:fix-rang-loop-construct-warnings 2020-10-14 10:17:16 +00:00
Alexander Alekhin dbeec7715d Merge pull request #18581 from alalek:winpack_dldt_videoio_plugins 2020-10-13 20:28:09 +00:00
Welton Rodrigo Torres Nascimento 25163eb008 Doc: INTER_LINEAR_EXACT unsupported in remap
Update documentation to reflect INTER_LINEAR_EXACT being
unsupported in remap
2020-10-13 11:51:23 -03:00
Alexander Alekhin 1048feac3b build: winpack_dldt with videoio plugins 2020-10-13 13:41:07 +00:00
Alexander Alekhin 96e8b83d41 Merge pull request #18568 from catree:fix_deepgreen_colormap_fig 2020-10-13 10:02:39 +00:00
Alexander Alekhin 78476a0fe2 Merge tag '4.5.0' 2020-10-11 21:29:42 +00:00
Alexander Alekhin d5fd2f0155 release: OpenCV 4.5.0 2020-10-11 21:26:07 +00:00
Alexander Alekhin c8ebe0eb86 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-11 17:19:22 +00:00
catree de93782fab Move colorscale_deepgreen.jpg to the correct folder. 2020-10-11 17:18:05 +02:00
mtfrctl 16561ed71e Add data pointer bridge method to Mat for Objective-C/Swift 2020-10-11 19:16:03 +09:00
Alexander Alekhin 4bfdf7cf2a Merge pull request #18564 from alalek:dnn_test_openvino_4.x 2020-10-11 08:08:20 +00:00
Alexander Alekhin e58da86efc dnn(test): update tests for OpenVINO 2021.1 (OpenCV 4.x) 2020-10-10 21:34:15 +00:00
Alexander Alekhin 7ed82aea38 Merge tag '3.4.12' 2020-10-10 20:18:09 +00:00
Alexander Alekhin dc15187f1b release: OpenCV 3.4.12 2020-10-10 20:14:29 +00:00
Alexander Alekhin ae1a249a0a Merge pull request #18557 from alalek:cuda_cmake_fix_auto 2020-10-10 20:02:03 +00:00
maxint 2dd2d60955 Fix warnings: "-Wrange-loop-construct" in gapi 2020-10-10 07:13:23 +00:00
Alexander Alekhin 171fbf879f cmake: fix typo in CUDA_GENERATION=Auto cache 2020-10-09 22:00:02 +00:00
Alexander Alekhin 1b443219ed Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-09 20:09:26 +00:00
Alexander Alekhin 8a1caa0d16 Merge pull request #18554 from alalek:issue_17945 2020-10-09 19:54:17 +00:00
Alexander Alekhin cdcf7e62f3 dnn(opencl): bypass unsupported fusion cases 2 2020-10-09 18:59:08 +00:00
Alexander Alekhin 083727b0a6 Merge pull request #18551 from alalek:issue_17964 2020-10-09 16:08:12 +00:00
Alexander Alekhin 718dd9f170 dnn(opencl): bypass unsupported fusion cases 2020-10-09 12:33:06 +00:00
Anatoliy Talamanov 76be3529f4 Merge pull request #18419 from TolyaTalamanov:at/generic-inference
[G-API] Introduce generic version for cv::gapi::infer

* Introduce generic infer

* Move Generic to infer.hpp

* Removew num_outs

* Fix windows warnings

* Fix comments to review

* Fix doxygen

* Add comment

* Fix comments to review

* standoalone ifdef in ginfer.cpp

* Fix test
2020-10-08 22:12:25 +00:00
Alexander Alekhin 6c218c7b0f Merge pull request #18545 from alalek:enable_tests_17953 2020-10-08 21:39:48 +00:00
Alexander Alekhin e87a0baa4b dnn(test): enable tests from issue 17953 2020-10-08 20:27:03 +00:00
Alexander Alekhin 8ee5f2ad89 Merge pull request #18534 from alalek:build_opencv_winpack_dldt_2021.1.0 2020-10-08 15:32:03 +00:00
Alexander Alekhin ee76cef1ff Merge pull request #18527 from alalek:dnn_test_openvino 2020-10-08 15:27:50 +00:00
Alexander Alekhin 6a51e3b39a Merge pull request #18539 from mshabunin:fix-doc-warnings 2020-10-08 15:22:40 +00:00
Alexander Alekhin 6da05f7086 dnn(test): update tests for OpenVINO 2021.1 2020-10-08 10:22:31 +00:00
Maksim Shabunin ae265a48c7 Doc: fixed warnings when CUDA modules are missing 2020-10-08 11:50:07 +03:00
Anastasiya(Asya) Pronina af2f8c69f0 Merge pull request #18496 from AsyaPronina:comp_args_serialization
Serialization && deserialization for compile arguments

* Initial stub

* Add test on serialization of a custom type

* Namespaces rework

* Fix isSupported in test struct

* Fix clang lookup issue

* Initial implementation

* Drop the isSupported flag

* Initial implementation

* Removed internal header inclusion

* Switched to public API

* Implemented serialization

* Adding desirialize: WIP

* Fixed merge errors

* Implemented

* Final polishing

* Addressed review comments and added debug throw

* Added FluidROI test

* Polishing

* Polishing

* Polishing

* Polishing

* Polishing

* Updated CMakeLists.txt

* Fixed comments

* Addressed review comments

* Removed decay from deserialize_arg

* Addressed review comments

* Removed extra inclusion

* Fixed Win64 warning

* Update gcommon.hpp

* Update serialization.cpp

* Update gcommon.hpp

* gapi: drop GAPI_EXPORTS_W_SIMPLE from GCompileArg

Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
Co-authored-by: AsyaPronina <155jj@mail.ru>
2020-10-07 21:48:49 +00:00
Alexander Alekhin e24b1629a0 Merge pull request #18536 from alalek:backport_doxygen_style_18195 2020-10-07 21:35:58 +00:00
Maksim Shabunin 46ccde82cf Merge pull request #18195 from mshabunin:linux-tutorial
Installation tutorials rework

* Doc: general installation, config reference, linux installation

* Doc: addressed review comments

* Minor fixes
2020-10-07 21:35:06 +00:00
Anatoliy Talamanov 537494f4dd Merge pull request #18512 from TolyaTalamanov:at/fix-untyped-np-array-for-gapi-python
[G-API] Numpy array with int64 failed in cv.gin

* Fix bug with numpy array precision in G-API python

* Fix comments to review
2020-10-07 20:38:59 +00:00
Alexander Alekhin d9ea9bedb2 doxygen: backport style changes 2020-10-07 20:16:40 +00:00
Alexander Alekhin 1546b9bf99 build: winpack_dldt with dldt 2021.1.0 2020-10-07 16:16:53 +00:00
Alexander Alekhin 39d5e14c1f Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-07 09:09:37 +00:00
Alexander Alekhin 62b5d37b6b Merge pull request #18526 from alalek:fix_uninitialized_warnings 2020-10-06 22:49:55 +00:00
Alexander Alekhin d78d9bf151 Merge pull request #18519 from alalek:fix_javadoc 2020-10-06 22:48:21 +00:00
Alexander Alekhin a5f0fb6008 Merge pull request #18518 from alalek:backport_17993 2020-10-06 22:47:45 +00:00
Alexander Alekhin f2bb3d0d80 videoio(dc1394_v2): ensure variable initialization 2020-10-06 21:00:36 +00:00
Maksym Ivashechkin d5dce63254 Merge pull request #18356 from ivashmak:update_ransac
* update new RANSAC

* fix warning

* change gamma values table

* resolve conflict

* resolve conflict

* GammaValues as singleton
2020-10-06 20:37:49 +00:00
Alexander Alekhin 01981ed290 Merge pull request #18522 from alalek:fix_18152 2020-10-06 20:33:37 +00:00
Alexander Alekhin 037a72debd Merge pull request #18517 from alalek:backport_18031 2020-10-06 19:56:49 +00:00
Alexander Alekhin 1ef4b7ae5a Merge pull request #18515 from alalek:test_18473 2020-10-06 19:39:28 +00:00
Alexander Alekhin b314cc4c23 Merge pull request #18506 from alalek:issue_18472 2020-10-06 19:37:40 +00:00
Alexander Alekhin 6f5d56d994 core(logger): avoid destruction of GlobalLoggingInitStruct object
- keep logger available until the program termination
2020-10-06 12:50:32 +00:00
Alexander Alekhin 644de8f22a java: fix javadoc generation 2020-10-06 04:28:25 +00:00
Maksim Doronin 36f61f3879 [IE][VPU]: Refactor vpu configs
backported commit: 7fe87d9a5b
2020-10-05 20:27:52 +00:00
Ilya Churaev aa11f7d8a3 Removed get_output_as_single_output_node method
backported commit: 5fd3d36fe8
2020-10-05 20:24:21 +00:00
Alexander Alekhin 793b2b9ad9 Merge pull request #18494 from dmatveev:dm/gframe_02_integration 2020-10-05 19:23:49 +00:00
Dmitry Matveev 050c960dfc G-API: Integrated cv::MediaFrame as I/O type + CPU backend 2020-10-05 20:21:15 +03:00
Alexander Alekhin f30aafc3cc core(test): regression test for 18473 2020-10-05 17:14:22 +00:00
Alexander Alekhin 2f065b8b4c Merge pull request #18509 from alalek:issue_18392 2020-10-05 17:03:27 +00:00
Alexander Alekhin aece3e732e Merge pull request #18507 from sizeofvoid:openbsd 2020-10-05 17:02:38 +00:00
Alexander Alekhin aabeb8a18e Merge pull request #18505 from alalek:fix_python_test 2020-10-05 17:01:46 +00:00
Alexander Alekhin ebe9327a92 Merge pull request #18473 from BioDataAnalysis:bda_fix_cv_mat_steps 2020-10-05 16:59:05 +00:00
Alexander Alekhin d7d51e4cc7 python: replace numpy.full() to support numpy<1.13 2020-10-05 15:15:49 +00:00
Mario Emmenlauer 102d8f67cd matrix.cpp::setSize(): fixed out-of-bounds access on cv::Mat steps 2020-10-05 10:19:53 +02:00
Alexander Alekhin a00fe15abd dnn: check for empty Net in .forward() 2020-10-05 06:23:47 +00:00
Rafael Sadowski 3acf8cfd63 Add an OpenBSD check 2020-10-05 08:23:23 +02:00
Ruslan Garnov 5224d016e9 Merge pull request #18339 from rgarnov:rg/rmat_integration
[GAPI] RMat integration into the framework

* RMat integration

* Added initialization of input mat in GArray initialization tests

* Fixed klocwork warnings in RMat tests, changed argument order in EXPECT_EQ
2020-10-04 18:57:41 +00:00
Alexander Alekhin d34717d8c9 core: allow to disable including of unsupported/Eigen/CXX11/Tensor
- define OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT
2020-10-04 15:14:46 +00:00
Alexander Alekhin 199687a1c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-02 15:58:45 +00:00
Alessandro de Oliveira Faria (A.K.A.CABELO) b5a6c8e2b2 Merge pull request #18399 from cabelo:realsense
* Modified for Intel Realsense webcam

* Fix whitespace

* Update page title

* Uppercase
2020-10-02 15:05:46 +00:00
Alexander Alekhin a5b8f163d7 Merge pull request #18488 from alalek:maxflow_missing_check 2020-10-02 15:04:28 +00:00
Alexander Alekhin 6add3b9161 Merge pull request #18487 from aitikgupta:unnecessary-variable 2020-10-02 15:03:59 +00:00
Alexander Alekhin 955909bdb5 Merge pull request #18483 from ivashmak:bugfix_graph 2020-10-02 15:02:57 +00:00
Alexander Alekhin 1ddd61f98a Merge pull request #18458 from sturkmen72:Update_window_w32_cpp 2020-10-02 15:00:44 +00:00
Alexander Alekhin 3503a36e5e Merge pull request #18444 from aitikgupta:check-minimum-points 2020-10-02 14:59:07 +00:00
Alexander Alekhin 2ea7269450 Merge pull request #18431 from zhuqiang00099:fix-darknet_relu 2020-10-02 14:58:48 +00:00
zhuqiang00099 a968eadbf1 fix darknet-relu bug in darknet_io.cpp 2020-10-02 06:16:38 +00:00
Alexander Alekhin c6b63e0e28 calib3d/imgproc: add GCGraph::maxFlow() missing empty checks 2020-10-02 05:15:20 +00:00
Aitik Gupta 7bd8ddc8fa removed no-affect variable 2020-10-02 09:27:16 +05:30
Michael Gruner e3da18121f Enable a GMainLoop when capturing using GStreamer
A running GMainLoop processes many events on the GLib/GStreamer
world. While some things may work without it, many others wont.
Examples of these are signals, timers and many other source
events. The problem becomes more concerning by the fact that
some GStreamer elements rely on signals to work.

This commit allows the user to specify an OpenCV option to
start a main loop, if needed. Since the loop blocks, this is
done in a separate thread.
2020-10-01 19:48:15 -06:00
Maksym Ivashechkin 0c4a8e2ca8 change flags and bugfix graph 2020-10-01 20:52:28 +02:00
Alexey Smirnov a3e7c2d8e3 Merge pull request #18452 from smirnov-alexey:as/export_serialization_api
[G-API] Export a part of serialization interface

* Initial stub

* Add test on serialization of a custom type

* Namespaces rework

* Fix isSupported in test struct

* Fix clang build and rework namespaces

* Remove redundant header
2020-10-01 18:11:23 +00:00
Orest Chura 40b8b58bc6 Merge pull request #18451 from OrestChura:oc/count_non_zero
[G-API]: countNonZero() Standard Kernel Implementation

* Add countNonZero() standard kernel
 - API and documentation provided
 - OCV backend supported
 - accuracy and performance tests provided
 - some refactoring of related documentation done

* Fix GOpaque functionality for OCL Backend
 - test for OCL Opaque usage providied

* countNonZero for GPU
 - OCL Backend implementation for countNonZero() added
 - tests provided

* Addressing comments
2020-09-30 16:07:35 +00:00
Alexander Alekhin fc1a156262 Merge pull request #18460 from alalek:build_warnings 2020-09-30 13:23:05 +00:00
Alexander Alekhin 8cbd20b380 eliminate build warnings 2020-09-29 21:32:16 +00:00
Dmitry Matveev 43d306fc2d Merge pull request #18415 from dmatveev:dm/gframe_01_new_host_type
* G-API: Introduce cv::MediaFrame, a host type for cv::GFrame

* G-API: RMat -- address review comments
2020-09-29 19:19:54 +00:00
Suleyman TURKMEN 14e264f646 Update window_w32.cpp 2020-09-29 21:50:06 +03:00
Alexander Alekhin 01e23a2222 Merge pull request #18439 from komakai:opencl 2020-09-29 15:07:28 +00:00
Alexander Alekhin f88d89ad82 Merge pull request #18341 from TolyaTalamanov:at/wrap-gin-gout-for-grunargs 2020-09-29 14:23:22 +00:00
Alexander Alekhin 969b55036f Merge pull request #18438 from alalek:dnn_onnx_importer_error_reporting 2020-09-29 13:49:02 +00:00
Giles Payne b29f73d5e0 Android OpenCL support 2020-09-29 21:55:31 +09:00
Anatoliy Talamanov e998d89e88 Implement cv.gin and multiple output for python 2020-09-29 13:45:40 +03:00
ZhangYin b91e701f35 modified rvv option for clang to match LLVM upstream 2020-09-29 14:15:11 +08:00
Alexander Alekhin 295afd5882 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-09-28 21:33:29 +00:00
Aitik Gupta cbf978d1f7 added minPoints Homography test 2020-09-29 01:04:15 +05:30
Aitik Gupta 94e0ac7d9f need atleast 4 corresponding points to calculate homography 2020-09-29 01:04:01 +05:30
Alexander Alekhin 08b36e4f48 Merge pull request #18449 from alalek:ios_dont_disable_world_automatically 2020-09-28 18:46:28 +00:00
Alexander Alekhin d62d880316 Merge pull request #18447 from alalek:fix_17953 2020-09-28 18:45:31 +00:00
Alexander Alekhin 361b5e0ebf Merge pull request #18430 from alalek:ippicv_tpp 2020-09-28 18:45:00 +00:00
Alexey Smirnov 8da1b9aafa Merge pull request #18401 from smirnov-alexey:as/serialization_more_types
[G-API] Add support for more types serialization

* Support more types

* Add std::string support

* Fix GOpaque and gin interaction

* Fix tests on kind

* Make map serialization support templates and add tests on kind
2020-09-28 18:20:04 +00:00
Alexander Alekhin c16e2e6234 ios: don't force BUILD_opencv_world=OFF in case of excluded modules 2020-09-28 01:11:15 +00:00
Alexander Alekhin 19f4cc57c1 Merge pull request #18436 from komakai:fix-install-name 2020-09-28 01:09:40 +00:00
Alexander Alekhin c08f29c803 dnn(opencl): fix convolution kernel w/o bias with activation 2020-09-27 23:42:30 +00:00
Alexander Alekhin ecb6d03ccd Merge pull request #18445 from alalek:fix_test_python_ml 2020-09-27 23:12:02 +00:00
Alexander Alekhin e59793cc75 dnn: improve debugging of ONNX parsing errors 2020-09-27 23:04:48 +00:00
Alexander Alekhin 236ad4aeda Merge pull request #18441 from alalek:core_check_force_string_literals 2020-09-27 23:03:18 +00:00
Alexander Alekhin 97bb91d5fa ml: fix python test 2020-09-27 21:14:55 +00:00
Giles Payne 80d4d4d92c Update tests and samples to work with changes to dynamic build 2020-09-27 21:12:28 +09:00
Giles Payne 6a7df4e973 Modify install_name 2020-09-27 21:12:27 +09:00
Giles Payne 098f07664d Fix support for --without build flag on iOS/macOS build 2020-09-27 21:12:18 +09:00
Alexander Alekhin 233030e417 core: force check for string literals are used in the message 2020-09-27 06:37:44 +00:00
Alexander Alekhin 6256e425f3 Merge pull request #18434 from tomoaki0705:loosenDNNEps 2020-09-26 21:08:13 +00:00
Dmitry Matveev 4dbb8ac4b2 Merge pull request #18387 from dmatveev:dm/slides_upd_44
Update G-API slides to OpenCV 4.4

* G-API: Updated slides to v4.4 (+ sample)

* Slight formatting changes + Python API page

* Some more updates to slides:

- Added more info on 4.2 and 4.4 versions
- Added explanation on Operations and their functional wrappers
2020-09-26 20:59:26 +00:00
Tomoaki Teshima 48368dc9a1 loosen threshold for Mali 2020-09-27 00:37:52 +09:00
Alexander Alekhin 691c655630 ippicv: install third-party-programs.txt file 2020-09-25 22:09:25 +00:00
Alexander Alekhin e7f2af5fdb Merge pull request #18429 from alalek:ocl_fix_platforminfo 2020-09-25 20:28:19 +00:00
Alexander Alekhin 4419f4093e Merge pull request #18423 from alalek:fix_build_videoio_plugins_with_enabled_eigen 2020-09-25 19:51:04 +00:00
Alexander Alekhin b88ad7f2d9 Merge pull request #18427 from tomoaki0705:improveFlipTest 2020-09-25 19:49:26 +00:00
Alexander Alekhin b300b6b3bd Merge pull request #18424 from tomoaki0705:addRTX3080s 2020-09-25 19:48:04 +00:00
Alexander Alekhin c945ea125a ocl: fix PlatformInfo usage 2020-09-25 19:22:12 +00:00
Alexander Alekhin c32e349332 Merge pull request #18410 from mshabunin:fix-va-build 2020-09-25 15:29:26 +00:00
Alexander Alekhin 118218754b Merge pull request #18408 from rgarnov:rg/fix_standalone_windows_build 2020-09-25 15:28:51 +00:00
Tomoaki Teshima 234117800f brush up by following the comments 2020-09-25 23:57:15 +09:00
Alexander Alekhin 00c61cf197 Merge pull request #18422 from mshabunin:fix-python-limited 2020-09-25 13:43:28 +00:00
Alexander Alekhin f6901ab877 videoio: fix plugins build with enabled Eigen 2020-09-25 13:37:07 +00:00
Tomoaki Teshima ac58b2f857 compute capability 8.6
- CC for RTX3090, RTX3080 and RTX3070
2020-09-25 22:33:55 +09:00
Odianosen Ejale 862fc06b6f Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
Maksim Shabunin 89ed813585 python: fixed limited API build 2020-09-25 14:16:46 +03:00
Alexander Alekhin 0dc28d3446 Merge pull request #18397 from mshabunin:fix-gapi-test 2020-09-24 22:36:53 +00:00
Ruslan Garnov 50657e2324 Added linkage of s11n required libs in standalone 2020-09-24 17:44:58 +03:00
Alexander Alekhin 7c22cd49a7 Merge pull request #18400 from mshabunin:videoio-mfx-test-name 2020-09-23 18:28:08 +00:00
Alexander Alekhin 220b37144b Merge pull request #18395 from tomoaki0705:fixNativePow 2020-09-23 18:27:45 +00:00
Maksim Shabunin c012490399 Merge pull request #18393 from mshabunin:fix-dnn-test
* dnn: fixed HighLevelApi tests
2020-09-23 18:26:46 +00:00
Dmitry Matveev e937d9b559 Merge pull request #18391 from dmatveev:dm/gframe_00_new_type
* G-API: Make GFrame a new (distinct) G-type, not an alias to GMat

- The underlying host type is still cv::Mat, a new cv::MediaFrame
  type is to be added as a separate PR

* Fix warnings and review comments

- Somewhow there was a switch() without a default: clause in Fluid
2020-09-23 18:25:14 +00:00
Maksim Shabunin 688aea6bec videoio: naming MFX tests 2020-09-23 17:36:43 +03:00
Maksim Shabunin 7186c46377 gapi: fix building wihout video module, fix infer test 2020-09-23 16:51:36 +03:00
Tomoaki Teshima 74c8ccb45b fix build error of kernel on Mali 2020-09-23 21:38:12 +09:00
NesQl 3fc1487cc9 Merge pull request #18323 from liqi-c:tengine-lite-update
Tengine lite update

* update tengine

* Modify for arm32 build.

* format optimization

* add teng_ befor some tengine api

* update graph_t to teng_graph_t

* update graph_t to teng_graph_t

* Code structure optimization

* optimization

* optimization

* remove space

* update tengine url

Co-authored-by: liqi <qli@openailab.com>
2020-09-23 09:34:29 +00:00
Julien 48ddb53332 Merge pull request #18386 from JulienMaille:patch-1
* Make sure there is a cuda device before getting it

* Update init.hpp
2020-09-23 09:15:02 +00:00
Alexander Alekhin 9cfe981e1f Merge pull request #18378 from nathanrgodwin:ippe_fix 2020-09-23 09:13:49 +00:00
Alexander Alekhin f584c6d723 Merge pull request #18384 from AsyaPronina:asyadev/18373_quick_workaround 2020-09-22 17:36:07 +00:00
AsyaPronina 3ea9022c5f Disabled failed test instantiations 2020-09-22 15:45:31 +03:00
Alexander Alekhin 45ee8e2532 Merge pull request #18365 from dervon:master 2020-09-22 08:46:28 +00:00
Nathan Godwin 2f9072efdc Fixed assertions on ippe solver 2020-09-21 21:56:28 -05:00
Alexander Alekhin f7b8f522ff Merge pull request #18374 from alalek:openjpeg_extra_checks 2020-09-21 20:33:30 +00:00
Alexey Smirnov f6aa9ac304 Merge pull request #18292 from smirnov-alexey:as/osd_serialization
[G-API]: Support render primitives serialization

* Add GOpaque and GArray serialization support

* Address review comments

* Remove holds() method

* Add serialization mechanism for render primitives

* Fix standalone mode

* Fix wchar_t error on win64

* Fix assert on windows

* Address review comments

* Fix GArray and GOpaque reset() method to store proper kind

* Reset wchar before deserializing it

* Fix wchar_t cross-platform issue

* Address review comments

* Fix wchar_t serialization and tests

* Remove FText serialization
2020-09-21 19:08:58 +00:00
Alexander Alekhin 6c575e8826 imgcodecs(openjpeg): add checks for input 2020-09-21 18:10:51 +00:00
Alexander Alekhin f52a2cf5e1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-09-19 17:03:08 +00:00
Alexander Alekhin 5e90802b1a Merge pull request #18363 from alalek:issue_18349 2020-09-19 16:53:34 +00:00
Alexander Alekhin 45fee13f3d Merge pull request #18362 from alalek:ocl_async_kernel_reschedule_bug 2020-09-19 16:53:16 +00:00
Dervon 5bfb779d82 typo error 2020-09-19 16:11:12 +08:00
Alexander Alekhin 261ad78122 core: emit more clear messages in OutputArray::create() 2020-09-18 15:25:29 +00:00
Alexander Alekhin 4fa82809df ocl: avoid rescheduling of async kernels 2020-09-18 14:53:50 +00:00
Orest Chura 95fd61c9b4 Merge pull request #18261 from OrestChura:oc/fluid_convert_mask
[G-API]: Fluid: add mask, extend convertTo for CV_16S

* Add Fluid `mask` kernel + Acc. and Perf. tests
 - simple cycle implementation with restrictions on mask type and input/output type like in OCV/GPU kernels (mask - CV_8UC1 only, input/output - CV_8UC1, CV_16UC1, CV_16SC1)

* Added convertions from/to 16S

* `convertTo()` perf tests refactoring
 - add testing of `alpha` and `beta` parameters
 - fixed unreliable comparison
 - added instances to OCV, Fluid and GPU tests according to the changes

* Addressing comments
 - fixed multiple-channel mistake - prohibited multiple-channeling

* Reduced perf tests
2020-09-18 14:24:34 +00:00
Orest Chura d1cdef596c Merge pull request #18257 from OrestChura:oc/fluid_operator_bitwise_and_scalar
[G-API]: Add Fluid bitwise operations implementation for (GMat, GScalar)

* Added Fluid `bitwise` with `Scalar` + acc.tests
 - simple loop implementation for Fluid used (no `hal`);
   - `Scalar` is casted to `int` in the beginning
 - tests just modified to work with `Scalar`
 - expected output in operators' tests fixed (operators can't change Mat's depth)
 - `float` `Scalar` `RNG` added, `RNG` reworked (`time` is used now), initialization of test fixtures reworked
   - if input or output is `float` Scalar is initialized by `float`
 - some problems with Fluid/OCV floating-point comparison difference stashed by `AbsSimilarPoints()` usage, FIXME added
 - divide-by-zero is now fixed differently and everywhere

* - Added perf_tests for bitwise_Scalar operations
 - due to errors of Fluid floating-point comparison operations, added support of different validation in Cmp perf_tests; added FIXME

 - reworked integral initialization of Scalar

* Addressing comments
 - NULL -> nullptr
 - Scalar convertion moved to the function
 - avoid -> avoiding

* Addressing comments

* CV_assert -> GAPI_assert

* Addressed DM comments
 - refactored convertScalarForBitwise()
 - removed unnecessary braces for switch

* Changed the operators tests
 - switch via `enum` implemented
 - infrastructure for that refactored
2020-09-18 13:44:47 +00:00
Alexander Alekhin 7163781639 Merge pull request #18343 from TolyaTalamanov:at/support-return-tuple
[G-API] Support std::tuple for return type
2020-09-18 16:38:37 +03:00
Maxim Pashchenkov a63cee2139 Merge pull request #18287 from mpashchenkov:mp/ocv-gapi-blue-branch
[G-API]: Add four kernels to parse NN outputs & provide information in Streaming scenarios

* Kernels from GL "blue" branch, acc and perf tests

* Code cleanup

* Output fix

* Comment fix

* Added new file for parsers, stylistic corrections

* Added end line

* Namespace fix

* Code cleanup

* nnparsers.hpp moved to gapi/infer/, nnparsers -> parsers

* Removed cv:: from parsers.hpp
2020-09-18 13:31:16 +00:00
Alexander Alekhin 3e3787ecb6 Merge pull request #18360 from tomoaki0705:fixClampFailure 2020-09-18 13:10:36 +00:00
Alexander Alekhin a723aaedd8 Merge pull request #18354 from takehirokj:fix_typo_in_doc 2020-09-18 13:10:10 +00:00
Maxim Pashchenkov 830d8d6b75 Merge pull request #18196 from mpashchenkov:mp/garray-initialization
[G-API]: Add GArray initialization support

* Added GArray initialization (CONST_VALUE, GScalar analog) and test for this

* Whitespaces

* And one more space

* Trailing whitespace

* Test name changed. Build with magic commands.

* GArray works with rvalue initialization

* Code cleanup

* Ternary operator in the initialization list.
2020-09-18 13:06:23 +00:00
Liubov Batanina ebb528976f Merge pull request #18353 from l-bat:issue_18350
* Fixed bug in ONNX Mul op

* Replaced node
2020-09-18 13:01:14 +00:00
Tomoaki Teshima f77c2d700f add explicit cast for half 2020-09-18 21:04:24 +09:00
Takehiro Kajihara 8c44b8306b Fix typo in videoio doc 2020-09-18 07:34:10 +09:00
Anatoliy Talamanov a07f064e50 Merge pull request #18332 from TolyaTalamanov:at/wrap-GIn-GOut
[G-API] Wrap GIn & GOut

* Wrap GIn & GOut into python

* Remove extra brackets

* Use reinterpret_cast
2020-09-17 19:00:03 +00:00
Alexander Alekhin e668cff573 Merge pull request #18348 from tomoaki0705:fixNppFlipInplace 2020-09-17 13:56:17 +00:00
Ruslan Garnov ea4b491a73 Merge pull request #18213 from rgarnov:rg/rmat_api
Basic RMat implementation

* Added basic RMat implementation

* Fix typos in basic RMat implementation

Co-authored-by: Anton Potapov <anton.potapov@intel.com>
2020-09-17 12:39:10 +00:00
Sergei Slashchinin fa953e4205 Merge pull request #18316 from sl-sergei:fix_18253
Fix loading of ONNX models with Resize operation with Opset 11 for newer versions of Pytorch

* Add reproducer for Resize operation from newer versions of Pytorch

* Fix loading of scales parameter for Resize layer

* Change check type for better diagnostic messages
2020-09-17 11:05:22 +00:00
Anatoliy Talamanov 986bc65e1f Change imports order for copytomask 2020-09-17 11:09:41 +03:00
Maksim Shabunin 540982cc9d Merge pull request #18331 from or-toledano:3.4 2020-09-16 21:00:05 +00:00
Anatoliy Talamanov 5218443784 Support tuple for python bindings 2020-09-16 16:22:46 +03:00
Tomoaki Teshima a61546680b use only even number for inplace flip 2020-09-16 15:45:03 +09:00
Alexander Alekhin 8cb7eae5c9 Merge pull request #18294 from mshabunin:install-bin-samples 2020-09-15 19:38:02 +00:00
Alexander Alekhin 18440c1faf Merge pull request #18314 from gilsho:components 2020-09-14 20:15:38 +00:00
Alexander Alekhin 9f69ca503a Merge pull request #18325 from alalek:issue_18166 2020-09-14 18:17:58 +00:00
or-toledano 49ba744130 Fix np row,column to cv y,x
This explanation was created to avoid confusion, but it seems like the author was confused :D
2020-09-14 14:23:38 +03:00
Alexander Alekhin 3b00ee2afb Merge pull request #18320 from choffmann:master 2020-09-13 13:30:57 +00:00
Alexander Alekhin 4b24ddd70d Merge pull request #18317 from sl-sergei:restored_pr_17629 2020-09-13 12:51:41 +00:00
Gil Shotan 1612db5f91 Fix signed integer overflow in connected components 2020-09-13 11:20:42 +00:00
Alexander Alekhin 7dfe68cac6 imgcodecs: lazy on-demand codecs initialization 2020-09-13 11:14:56 +00:00
Alexander Alekhin 7d832337ae Merge pull request #18310 from ShadyD45:patch-1 2020-09-12 22:03:12 +00:00
Anatoliy Talamanov a258404a58 Merge pull request #18309 from TolyaTalamanov:at/wrap-apply-overloads
[G-API] Wrap cv::gapi::mean kernel into python

* Wrap cv::gapi::mean kernel into python

* Fix test
2020-09-12 22:02:21 +00:00
Alexander Alekhin 83807811cd Merge pull request #18299 from l-bat:onnx_reduce_max 2020-09-12 22:01:09 +00:00
Christoph Gringmuth a3048239b3 Fix implicitly-deleted default constructor 2020-09-12 22:28:11 +02:00
Shubham Singh 23e71d1aa2 fixes #17187 probably
Added Eltwise Layer Support
2020-09-11 18:53:42 +03:00
Shubham Dhumal f787c73841 Typo fix: CV.rabCutClasses to CV.grabCutClasses 2020-09-10 17:58:34 +05:30
Liubov Batanina b542a1804c Support global reduce ops 2020-09-09 11:56:20 +03:00
Maksim Shabunin 2dff2f36bf Install: added prebuilt samples installation 2020-09-08 20:22:26 +03:00
Alexander Alekhin 1604ea3b27 Merge pull request #18290 from alalek:update_ffmpeg_4.x 2020-09-08 11:30:10 +00:00
Alexander Alekhin 6b674709b8 Merge pull request #18284 from alalek:update_ffmpeg_3.4 2020-09-08 11:26:48 +00:00
Alexander Alekhin b23d377567 ffmpeg/4.x: update FFmpeg wrapper
- FFmpeg 4.3.1
2020-09-08 10:18:37 +00:00
Alexander Alekhin f445b826d0 Merge pull request #18288 from alalek:update_version_4.5.0-pre 2020-09-08 09:07:23 +00:00
Alexander Alekhin a12ceb04bb pre: OpenCV 4.5.0 (version++) 2020-09-08 06:08:58 +00:00
Alexander Alekhin 623aaaccd4 Merge pull request #18286 from extrowerk:patch-1 2020-09-08 06:03:23 +00:00
extrowerk da0fd62c23 Haiku: build fix
Haiku is POSIX compatible
2020-09-07 21:07:38 +02:00
Alexander Alekhin f56445d7ca ffmpeg/3.4: update FFmpeg wrapper
- FFmpeg 3.4.8
2020-09-07 17:55:22 +00:00
Alexander Alekhin a10d289997 Merge pull request #18281 from dtrodrigues:issue-template-typo 2020-09-07 17:11:46 +00:00
Alexander Alekhin 750b1aba8d Merge pull request #18280 from dtrodrigues:vtk-9 2020-09-07 17:11:09 +00:00
Alexey Smirnov a3e8c6e866 Merge pull request #18127 from smirnov-alexey:as/gapi_serialization
[G-API]: Add GOpaque and GArray serialization support

* Add GOpaque and GArray serialization support

* Address review comments

* Remove holds() method

* Address review comments

* Remove comments

* Align streaming with kind changes

* Fix kind in kernel

* Address review comments
2020-09-07 17:10:03 +00:00
Alexander Alekhin 03bee14372 Merge pull request #18282 from alalek:update_version_3.4.12-pre 2020-09-07 16:57:21 +00:00
Alexander Alekhin 50ff40d684 pre: OpenCV 3.4.12 (version++) 2020-09-06 22:26:32 +00:00
Dustin Rodrigues bfd056ceb1 ISSUE_TEMPLATE: fix typo 2020-09-06 16:53:25 -04:00
Alexander Alekhin 620629593b Merge pull request #18270 from komakai:swift-inout-arrays 2020-09-06 20:12:16 +00:00
Dustin Rodrigues 05ad3a535f don't use VTK_USE_FILE for VTK >= 8.90 2020-09-06 15:47:43 -04:00
Alexander Alekhin 5c76f99fdd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-09-05 19:37:38 +00:00
Danny c31164bf1e Merge pull request #18126 from danielenricocahall:add-oob-error-sample-weighting
Account for sample weights in calculating OOB Error

* account for sample weights in oob error calculation

* redefine oob error functions

* fix ABI compatibility
2020-09-05 18:52:10 +00:00
Alexander Alekhin 3835ab394e Merge pull request #18265 from alalek:fixup_17489 2020-09-04 17:02:08 +00:00
Danny 20b23da8e2 Merge pull request #18061 from danielenricocahall:fix-kd-tree
Fix KD Tree kNN Implementation

* Make KDTree mode in kNN functional

remove docs and revert change

Make KDTree mode in kNN functional

spacing

Make KDTree mode in kNN functional

fix window compilations warnings

Make KDTree mode in kNN functional

fix window compilations warnings

Make KDTree mode in kNN functional

casting

Make KDTree mode in kNN functional

formatting

Make KDTree mode in kNN functional

* test coding style
2020-09-04 17:01:05 +00:00
Alexander Alekhin f6795d75a6 videoio: repair build of FFmpeg windows wrapper 2020-09-04 15:36:10 +00:00
Alexander Alekhin 36915db699 Merge pull request #18260 from alalek:static_code_fixes_2 2020-09-03 21:25:38 +00:00
Alexander Alekhin 17640d6008 Merge pull request #18258 from alalek:opencl_multiple_execution_contexts_fixup 2020-09-03 21:25:20 +00:00
Alexander Alekhin 8711653530 ocl: fixes for OpenCL multiple contexts support 2020-09-03 20:34:49 +00:00
Alexander Alekhin 7e019af50d checks and fixes from static code analyzers results (2) 2020-09-03 18:28:27 +00:00
Giles Payne 8b61719a9d Swift native in/out array handling 2020-09-03 21:31:11 +09:00
Alexander Alekhin fa11b98800 Merge pull request #18255 from alalek:backport_18243 2020-09-02 22:50:21 +00:00
Alexander Alekhin 5ae9892170 Merge pull request #18243 from alalek:static_code_fixes 2020-09-02 22:50:00 +00:00
Alexander Alekhin 6426101433 Merge pull request #18186 from alalek:opencl_multiple_execution_contexts 2020-09-02 22:49:13 +00:00
Alexander Alekhin cf8322c0d3 Merge pull request #18194 from VadimLevin:dev/vlevin/openjpeg-source-intergration 2020-09-02 22:48:09 +00:00
Alexander Alekhin 64c67a93d3 Merge pull request #18246 from YashasSamaga:dnn-permute-fix-unwanted-ocl-init 2020-09-02 21:15:19 +00:00
Vadim Levin 0384eb7d8c 3rdparty: integrate OpenJPEG build to the OpenCV CMake
- adopted build scripts
- OpenJPEG build warnings are suppressed
2020-09-02 20:45:35 +00:00
Vadim Levin 0c84b91dde 3rdparty: add OpenJPEG library source code (tag v2.3.1)
- https://github.com/uclouvain/openjpeg/releases/tag/v2.3.1
- src/lib/openjp2
- readme files
2020-09-02 20:17:01 +00:00
Alexander Alekhin 154380ccf5 Merge pull request #18234 from l-bat:onnx_reshape 2020-09-02 19:31:22 +00:00
Orest Chura 7a796b20ea Merge pull request #18182 from OrestChura:oc/operators_to_cv
[G-API]: Relocation of operators' overloads

* Relocates overloaded operators for `cv::GMat` and `cv::GScalar` to `cv::` namespace
 - adds test to check usage of operators compilation

* Add tests for all the operators

* Address comments
2020-09-02 19:28:10 +00:00
Alexander Alekhin 1f2c83845d backport: checks and fixes from static code analyzers results
original commit: 71f665bd8c
2020-09-02 19:05:47 +00:00
Alexander Alekhin 71f665bd8c checks and fixes from static code analyzers results 2020-09-02 21:59:34 +03:00
Liubov Batanina 2349a09736 Support Reshape with zero dim 2020-09-02 11:58:43 +03:00
YashasSamaga 1df533c914 fix typo in fusion tests 2020-09-02 14:25:36 +05:30
YashasSamaga 44bf748479 do not allocate UMat in non-OpenCL targets 2020-09-02 12:18:41 +05:30
Alexander Alekhin 2129c72bc0 core(OpenCL): thread-local OpenCL execution context 2020-09-02 05:04:20 +00:00
Alexander Alekhin 0428dce27d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-09-01 20:59:00 +00:00
Alexander Alekhin f9fbd29c14 Merge pull request #18225 from dmici:fix_missing_0.5_factor_in_anisotropic_segmentation_tutorial 2020-09-01 20:49:59 +00:00
pemmanuelviel 31dc3e9256 Merge pull request #18211 from pemmanuelviel:pev--handle-dna-vectors
* DNA-mode: update miniflann to handle DNA

* DNA-mode: update hierarchical kmeans to handle DNA sequences
2020-09-01 20:38:21 +00:00
Yosshi999 698b2bf729 Merge pull request #18167 from Yosshi999:bit-exact-gaussian
Bit exact gaussian blur for 16bit unsigned int

* bit-exact gaussian kernel for CV_16U

* SIMD optimization

* template GaussianBlurFixedPoint

* remove template specialization

* simd support for h3N121 uint16

* test for u16 gaussian blur

* remove unnecessary comments

* fix return type of raw()

* add typedef of native internal type in fixedpoint

* update return type of raw()
2020-09-01 10:28:25 +00:00
Alexander Alekhin 1d42560018 Merge pull request #18235 from alalek:ocl_off_cleanup 2020-08-31 20:37:41 +00:00
Alexander Alekhin efcf307b4c ocl: cleanup dead code in case of disabled OpenCL 2020-08-31 11:30:42 +00:00
dmici 6876f3b91d fix missing 0.5 factor in anisotropic segmentation tutorial 2020-08-30 10:17:50 +02:00
Giles Payne 60354e3901 Merge pull request #18094 from komakai:macos-universal-binary
* Universal Build for Big Sur

* Refactor MacOS/iOS build to only ever build one architecture at a time + improve code readability

* Workaround for CMake issue 20989
2020-08-30 01:41:54 +03:00
Alexander Alekhin 2e6e9c14b5 Merge pull request #18210 from VadimLevin:dev/vlevin/openjpeg-reduce-filesize 2020-08-28 18:29:44 +00:00
Yosshi999 7495a4722f Merge pull request #18053 from Yosshi999:bit-exact-resizeNN
Bit-exact Nearest Neighbor Resizing

* bit exact resizeNN

* change the value of method enum

* add bitexact-nn to ResizeExactTest

* test to compare with non-exact version

* add perf for bit-exact resizenn

* use cvFloor-equivalent

* 1/3 scaling is not stable for floating calculation

* stricter test

* bugfix: broken data in case of 6 or 12bytes elements

* bugfix: broken data in default pix_size

* stricter threshold

* use raw() for floor

* use double instead of int

* follow code reviews

* fewer cases in perf test

* center pixel convention
2020-08-28 21:20:05 +03:00
Alexander Alekhin 721ab68bec Merge pull request #18208 from mshabunin:lower-ffmpeg-version 2020-08-27 17:15:42 +00:00
Alexander Alekhin 192e5c8166 Merge pull request #18203 from catree:feat_robot_world_hand_eye_calib 2020-08-27 17:14:32 +00:00
Alexander Alekhin 7ce56b3a47 Merge pull request #18207 from pemmanuelviel:pev--fix-memset 2020-08-27 17:10:23 +00:00
Vadim Levin bce5d364df feat: change OpenJPEG encoder to lossy with default parameters 2020-08-27 15:11:45 +03:00
Maksim Shabunin 2dfb163281 videoio: reduce min libavcodec version 2020-08-27 13:25:04 +03:00
Pierre-Emmanuel Viel 5376863c0c bugfix 2020-08-27 12:21:02 +02:00
catree 417d7a38de Add Robot-World/Hand-Eye calibration function. 2020-08-27 07:24:07 +02:00
Alessandro de Oliveira Faria (A.K.A.CABELO) a86e036594 Merge pull request #18184 from cabelo:yolov4-in-model
ADD yolov4 in models.yml
2020-08-26 22:30:12 +00:00
Alexander Alekhin ba147d2be2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-08-26 15:51:25 +00:00
Alexander Alekhin 01324b02e7 Merge pull request #18136 from nglee:dev_cudaEqualizeHistBitExact 2020-08-26 12:11:43 +00:00
Alexander Alekhin 792722865f Merge pull request #17919 from zhaoyue-zephyrus:flownet2_with_anysize 2020-08-26 11:43:17 +00:00
Sergei Slashchinin 9aa401a7d0 Merge pull request #17978 from sl-sergei:fix_17516_17531
* Fix ONNX loading in issues opencv#17516, opencv#17531

* Add tests for Linear and Matmul layers

* Disable tests for IE versions lower than 20.4

* Skip unstable tests with OpenCL FP16 on Intel GPU

* Add correct test filtering for OpenCL FP16 tests
2020-08-26 10:15:59 +00:00
jinyup100 a160e4fb6b Merge pull request #17647 from jinyup100:add-siamrpnpp
[GSoC] Add siamrpnpp.py

* Updated base branch with siamrpnpp.py

* Addition of Parsers

* Merged to using few ONNX files, Changes to Parsers, Links to Repo

* Deleted whitespace

* Adjusting flake8 error

* Fixes according to review

* Fix according to review

* Addition of OpenVINO backends and Computation target devices

* Fix on backend after review

* Fixes after review

* Remove extra white space

* Removed Repeated Varaibles
2020-08-25 20:01:16 +00:00
Alexander Alekhin c7422e4d90 Merge pull request #18171 from catree:fix_pnp_doc 2020-08-25 18:24:30 +00:00
Anastasiya(Asya) Pronina 1192cbe4ab Merge pull request #17163 from AsyaPronina:gcompound_kernel_gmatp_coop
* Fixed cooperation of Compound kernel and GMatP type

* Added test for GCompound kernel + GMatP type cooperation
2020-08-25 13:51:43 +00:00
Alexander Alekhin 485d2b593c Merge pull request #18178 from catree:improve_camera_matrix_doc 2020-08-25 13:33:39 +00:00
Alexander Alekhin 1bea537731 Merge pull request #18165 from catree:fix_hand_eye_calibration_Andreff_NaN_3.4 2020-08-25 13:28:21 +00:00
Alexander Alekhin 75e88d613f Merge pull request #18185 from VadimLevin:dev/vlevin/ffmpeg-versions-guard-fix 2020-08-25 07:29:42 +00:00
catree 379b83e946 Fix cubic root computation to be able to handle negative values. Improve doc. Add regression test. 2020-08-25 03:37:56 +02:00
catree dda1bf1887 Add broken implementation note for DLS and UPnP.
Add CV_LOG_DEBUG.
2020-08-25 03:07:00 +02:00
Vadim Levin f7e524cbe6 fix: libavcodec version check for AVDISCARD_NONINTRA
- AVDISCARD_NONINTRA flag is supported only for FFMPEG libraries pack
2020-08-24 23:12:49 +03:00
Vadim Levin e503ac508e fix: libavcodec version check for AV_CODEC_FLAG_GLOBAL_HEADER 2020-08-24 23:07:25 +03:00
Vadim Levin 458bd1652d Merge pull request #18146 from VadimLevin:dev/vlevin/ffmpeg-remove-obsolte-versions-support
Remove obsolete FFMPEG versions support

* refactor: removed obsolete FFMPEG version support

 - Oldest available version via official FFMPEG repository mirror has tag v.0.5
 LIBAVFORMAT version for this tag is 52.31.0

* refactor: prefer std::min function to MIN macro

* refactor: use appropriate macro instead of manual version calculation

* refactor: remove macros for versions prior 0.5.15 release

* refactor: remove libavcodec macros for versions < 54.35.1 (default to Ubuntu 14.04)

* refactor: remove libavformat macro for versions < 54.20.4 (default ubuntu 14.04)

* refactor: remove libavutil macro for versions < 52.3.0 (default ubuntu 14.04)

* refactor: remove missed macros for libavcodec and libavformat

* refactor: remove unused _opencv_ffmpeg_free function

* build: add FFMPEG libraries versions checks

 - Add verbose message about what FFMPEG libraries are missing.
 - Add minimal versions check set to libav 9.20 release (default ubuntu 14.04) and FFMPEG 1.1.16 release.
   If the check is failed CMake produces user-friendly message instead of build error.

* fix: libavcodec version guard for AVDISCARD_NONINTRA

* fix: libav check of libavcodec version guard for AVDISCARD_NONINTRA

* fix: version check for AV_CODEC_FLAG_GLOBAL_HEADER

* fix: missing FFMPEG libraries output
2020-08-24 18:39:05 +00:00
Alexander Alekhin f5ba3f51ce Merge pull request #18181 from l-bat:onnx_pow 2020-08-24 14:18:08 +00:00
Orest Chura e5e08ec523 Merge pull request #18148 from OrestChura:oc/fluid_core_perf
[G-API]: Fluid Core kernels performance tests

* Add performance tests for a list of Fluid Core kernels

* Update gapi_core_perf_tests_fluid.cpp

Addressing a comment
2020-08-24 11:46:32 +00:00
Liubov Batanina d392b11dfb Supported ONNX Pow op 2020-08-24 11:20:18 +03:00
catree cd01ee9a54 Use camera intrinsic matrix everywhere. Add cameramatrix, distcoeffs and distcoeffsfisheye macros to avoid copy/paste errors. 2020-08-24 05:39:23 +02:00
Ian Maquignaz 8c1af09989 Merge pull request #18083 from IanMaquignaz:fix_gen_pattern_centering
* Fixed centering issue with make_cicle_pattern and make_acircle_pattern()

* Fixed issue where asymmetric circles were not at 45 degree angles. Also fixed support for inch measurement by converting parsing to usage of floating points for page size

* Fixed copy-paste error from experimental workspace
2020-08-23 22:32:58 +00:00
Alexander Alekhin 3547ac4b49 Merge pull request #17675 from zihaomu:GSoC_digit_text_detect_and_recog 2020-08-22 20:21:49 +03:00
Alexander Alekhin f6c2bf21c8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-08-21 19:57:34 +00:00
Alexander Alekhin f53ff0d01c Merge pull request #18151 from alalek:core_trace_fix_location 2020-08-21 18:54:40 +00:00
Alexander Alekhin 4f48dab023 Merge pull request #18150 from alalek:ocl_async_cleanup_no_warning 2020-08-21 18:54:08 +00:00
Zihao Mu 397ba2d9aa add OpenCV sample for digit and text recongnition, and provide multiple OCR models. 2020-08-22 01:02:13 +08:00
Namgoo Lee a7ffcaab28 Remove compiler warnings 2020-08-21 23:52:30 +09:00
Namgoo Lee f617f18e46 bit-exact cuda::equalizeHist 2020-08-21 22:53:40 +09:00
Alexander Alekhin 4372d75b26 Merge pull request #18135 from AnnaPetrovicheva:logo_text 2020-08-21 13:07:26 +00:00
Clement Courbet da555a2c9b Optimize opencv dft by vectorizing radix2 and radix3.
This is useful for non power-of-two sizes when WITH_IPP is not an option.

This shows consistent improvement over openCV benchmarks, and we measure
even larger improvements on our internal workloads.

For example, for 320x480, `32FC*`, we can see a ~5% improvement}, as
`320=2^6*5` and `480=2^5*3*5`, so the improved radix3 version is used.
`64FC*` is flat as expected, as we do not specialize the functors for `double`
in this change.

```
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, 0, false)                                1.239  1.153     1.07
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, 0, true)                                 0.991  0.926     1.07
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_COMPLEX_OUTPUT, false)               1.367  1.281     1.07
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_COMPLEX_OUTPUT, true)                1.114  1.049     1.06
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_INVERSE, false)                      1.313  1.254     1.05
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_INVERSE, true)                       1.027  0.977     1.05
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   1.296  1.217     1.06
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    1.039  0.963     1.08
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_ROWS, false)                         0.542  0.524     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_ROWS, true)                          0.293  0.277     1.06
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_SCALE, false)                        1.265  1.175     1.08
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC1, DFT_SCALE, true)                         1.004  0.942     1.07
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, 0, false)                                1.292  1.280     1.01
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, 0, true)                                 1.038  1.030     1.01
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_COMPLEX_OUTPUT, false)               1.484  1.488     1.00
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_COMPLEX_OUTPUT, true)                1.222  1.224     1.00
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_INVERSE, false)                      1.380  1.355     1.02
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_INVERSE, true)                       1.117  1.133     0.99
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   1.372  1.383     0.99
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    1.117  1.127     0.99
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_ROWS, false)                         0.546  0.539     1.01
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_ROWS, true)                          0.293  0.299     0.98
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_SCALE, false)                        1.351  1.339     1.01
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 64FC1, DFT_SCALE, true)                         1.099  1.092     1.01
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, 0, false)                                2.235  2.123     1.05
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, 0, true)                                 1.843  1.727     1.07
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_COMPLEX_OUTPUT, false)               2.189  2.109     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_COMPLEX_OUTPUT, true)                1.827  1.754     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_INVERSE, false)                      2.392  2.309     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_INVERSE, true)                       1.951  1.865     1.05
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   2.391  2.293     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    1.954  1.882     1.04
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_ROWS, false)                         0.811  0.815     0.99
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_ROWS, true)                          0.426  0.437     0.98
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_SCALE, false)                        2.268  2.152     1.05
dft::Size_MatType_FlagsType_NzeroRows::(320x480, 32FC2, DFT_SCALE, true)                         1.893  1.788     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, 0, false)                                4.546  4.395     1.03
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, 0, true)                                 3.616  3.426     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_COMPLEX_OUTPUT, false)               4.843  4.668     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_COMPLEX_OUTPUT, true)                3.825  3.748     1.02
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_INVERSE, false)                      4.720  4.525     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_INVERSE, true)                       3.743  3.601     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   4.755  4.527     1.05
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    3.744  3.586     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_ROWS, false)                         1.992  2.012     0.99
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_ROWS, true)                          1.048  1.048     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_SCALE, false)                        4.625  4.451     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC1, DFT_SCALE, true)                         3.643  3.491     1.04
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, 0, false)                                4.499  4.488     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, 0, true)                                 3.559  3.555     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_COMPLEX_OUTPUT, false)               5.155  5.165     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_COMPLEX_OUTPUT, true)                4.103  4.101     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_INVERSE, false)                      5.484  5.474     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_INVERSE, true)                       4.617  4.518     1.02
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   5.547  5.509     1.01
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    4.553  4.554     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_ROWS, false)                         2.067  2.018     1.02
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_ROWS, true)                          1.104  1.079     1.02
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_SCALE, false)                        4.665  4.619     1.01
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 64FC1, DFT_SCALE, true)                         3.698  3.681     1.00
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, 0, false)                                8.774  8.275     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, 0, true)                                 6.975  6.527     1.07
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_COMPLEX_OUTPUT, false)               8.720  8.270     1.05
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_COMPLEX_OUTPUT, true)                6.928  6.532     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_INVERSE, false)                      9.272  8.862     1.05
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_INVERSE, true)                       7.323  6.946     1.05
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false)   9.262  8.768     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)    7.298  6.871     1.06
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_ROWS, false)                         3.766  3.639     1.03
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_ROWS, true)                          1.932  1.889     1.02
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_SCALE, false)                        8.865  8.417     1.05
dft::Size_MatType_FlagsType_NzeroRows::(800x600, 32FC2, DFT_SCALE, true)                         7.067  6.643     1.06
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, 0, false)                              10.014 10.141    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, 0, true)                               7.600  7.632     1.00
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_COMPLEX_OUTPUT, false)             11.059 11.283    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_COMPLEX_OUTPUT, true)              8.475  8.552     0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_INVERSE, false)                    12.678 12.789    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_INVERSE, true)                     10.445 10.359    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 12.626 12.925    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  10.538 10.553    1.00
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_ROWS, false)                       5.041  5.084     0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_ROWS, true)                        2.595  2.607     1.00
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_SCALE, false)                      10.231 10.330    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC1, DFT_SCALE, true)                       7.786  7.815     1.00
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, 0, false)                              13.597 13.302    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, 0, true)                               10.377 10.207    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_COMPLEX_OUTPUT, false)             15.940 15.545    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_COMPLEX_OUTPUT, true)              12.299 12.230    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_INVERSE, false)                    15.270 15.181    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_INVERSE, true)                     12.757 12.339    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 15.512 15.157    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  12.505 12.635    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_ROWS, false)                       6.359  6.255     1.02
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_ROWS, true)                        3.314  3.248     1.02
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_SCALE, false)                      13.937 13.733    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 64FC1, DFT_SCALE, true)                       10.782 10.495    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, 0, false)                              18.985 18.926    1.00
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, 0, true)                               14.256 14.509    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_COMPLEX_OUTPUT, false)             18.696 19.021    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_COMPLEX_OUTPUT, true)              14.290 14.429    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_INVERSE, false)                    20.135 20.296    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_INVERSE, true)                     15.390 15.512    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 20.121 20.354    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  15.341 15.605    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_ROWS, false)                       8.932  9.084     0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_ROWS, true)                        4.539  4.649     0.98
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_SCALE, false)                      19.137 19.303    0.99
dft::Size_MatType_FlagsType_NzeroRows::(1280x1024, 32FC2, DFT_SCALE, true)                       14.565 14.808    0.98
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, 0, false)                              22.553 21.171    1.07
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, 0, true)                               17.850 16.390    1.09
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_COMPLEX_OUTPUT, false)             24.062 22.634    1.06
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_COMPLEX_OUTPUT, true)              19.342 17.932    1.08
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_INVERSE, false)                    28.609 27.326    1.05
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_INVERSE, true)                     24.591 23.289    1.06
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 28.667 27.467    1.04
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  24.671 23.309    1.06
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_ROWS, false)                       9.458  9.077     1.04
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_ROWS, true)                        4.709  4.566     1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_SCALE, false)                      22.791 21.583    1.06
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC1, DFT_SCALE, true)                       18.029 16.691    1.08
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, 0, false)                              25.238 24.427    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, 0, true)                               19.636 19.270    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_COMPLEX_OUTPUT, false)             28.342 27.957    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_COMPLEX_OUTPUT, true)              22.413 22.477    1.00
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_INVERSE, false)                    26.465 26.085    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_INVERSE, true)                     21.972 21.704    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 26.497 26.127    1.01
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  22.010 21.523    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_ROWS, false)                       11.188 10.774    1.04
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_ROWS, true)                        6.094  5.916     1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_SCALE, false)                      25.728 24.934    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 64FC1, DFT_SCALE, true)                       20.077 19.653    1.02
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, 0, false)                              43.834 40.726    1.08
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, 0, true)                               35.198 32.218    1.09
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_COMPLEX_OUTPUT, false)             43.743 40.897    1.07
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_COMPLEX_OUTPUT, true)              35.240 32.226    1.09
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_INVERSE, false)                    46.022 42.612    1.08
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_INVERSE, true)                     36.779 33.961    1.08
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 46.396 42.723    1.09
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  37.025 33.874    1.09
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_ROWS, false)                       17.334 16.832    1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_ROWS, true)                        9.212  8.970     1.03
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_SCALE, false)                      44.190 41.211    1.07
dft::Size_MatType_FlagsType_NzeroRows::(1920x1080, 32FC2, DFT_SCALE, true)                       35.900 32.888    1.09
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, 0, false)                              40.948 38.256    1.07
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, 0, true)                               33.825 30.759    1.10
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_COMPLEX_OUTPUT, false)             53.210 53.584    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_COMPLEX_OUTPUT, true)              46.356 46.712    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_INVERSE, false)                    47.471 47.213    1.01
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_INVERSE, true)                     40.491 41.363    0.98
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 46.724 47.049    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  40.834 41.381    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_ROWS, false)                       14.508 14.490    1.00
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_ROWS, true)                        7.832  7.828     1.00
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_SCALE, false)                      41.491 38.341    1.08
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC1, DFT_SCALE, true)                       34.587 31.208    1.11
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, 0, false)                              65.155 63.173    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, 0, true)                               56.091 54.752    1.02
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_COMPLEX_OUTPUT, false)             71.549 70.626    1.01
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_COMPLEX_OUTPUT, true)              62.319 61.437    1.01
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_INVERSE, false)                    61.480 59.540    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_INVERSE, true)                     54.047 52.650    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 61.752 61.366    1.01
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  54.400 53.665    1.01
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_ROWS, false)                       20.219 19.704    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_ROWS, true)                        11.145 10.868    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_SCALE, false)                      66.220 64.525    1.03
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 64FC1, DFT_SCALE, true)                       57.389 56.114    1.02
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, 0, false)                              86.761 88.128    0.98
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, 0, true)                               75.528 76.725    0.98
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_COMPLEX_OUTPUT, false)             86.750 88.223    0.98
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_COMPLEX_OUTPUT, true)              75.830 76.809    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_INVERSE, false)                    91.728 92.161    1.00
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_INVERSE, true)                     78.797 79.876    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, false) 92.163 92.177    1.00
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_INVERSE|DFT_COMPLEX_OUTPUT, true)  78.957 79.863    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_ROWS, false)                       24.781 25.576    0.97
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_ROWS, true)                        13.226 13.695    0.97
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_SCALE, false)                      87.990 89.324    0.99
dft::Size_MatType_FlagsType_NzeroRows::(2048x2048, 32FC2, DFT_SCALE, true)                       76.732 77.869    0.99
```
2020-08-21 14:06:09 +02:00
Anna Petrovicheva 885fb703cf Added a note about OpenCV logo 2020-08-21 11:18:40 +03:00
Alexander Alekhin cd00d8f3f0 core(trace): lazy quering for OPENCV_TRACE_LOCATION
- fixes proper initialization of non-trivial variable
2020-08-20 21:48:05 +00:00
Alexander Alekhin b3755e617c ocl: silence warning in case of async cleanup
- OpenCL kernel cleanup processing is asynchronous and can be called even after forced clFinish()
- buffers are released later in asynchronous mode
- silence these false positive cases for asynchronous cleanup
2020-08-20 19:33:37 +00:00
Alexander Alekhin fc0f9da7a7 Merge pull request #18084 from pemmanuelviel:pev--add-DNA-distances 2020-08-20 13:26:02 +00:00
Alexander Alekhin 277961fa25 Merge pull request #18085 from pemmanuelviel:pev--add-DbgAssert-checks 2020-08-20 13:25:02 +00:00
Alexander Alekhin 8cc2cbf1c4 Merge pull request #18121 from ivashmak:fixing_usac 2020-08-20 13:23:12 +00:00
Alexander Alekhin 14a9103fc0 Merge pull request #18129 from pemmanuelviel:pev--update-stereo-sample 2020-08-20 13:21:58 +00:00
Pierre-Emmanuel Viel 6d1f7c2b1b Update the stereo sample:
* add the HH4 mode
* option to display disparity with a color map
* display current settings in the title bar
* don't close app when wanting to take screenshots
2020-08-20 12:20:25 +02:00
Alexander Alekhin 2c1f3487a4 Merge pull request #18037 from danielenricocahall:improve-brisk-init-perf 2020-08-18 20:06:17 +00:00
Alexander Alekhin acc6189da0 Merge pull request #18022 from SoheibKadi:Update_CornerSubPix_Documentation 2020-08-18 13:19:18 +00:00
danielenricocahall ac177b849c Improve initialization performance of Brisk
reformatting

Improve initialization performance of Brisk

fix formatting

Improve initialization performance of Brisk

formatting

Improve initialization performance of Brisk

make a lookup table for ring

use cosine/sine lookup table for theta in brisk and utilize trig identity

fix ring lookup table

use cosine/sine lookup table for theta in brisk and utilize trig identity

formatting

use cosine/sine lookup table for theta in brisk and utilize trig identity

move scale radius product to ring loop to ensure it's not recomputed for each rot

revert change

move scale radius product to ring loop to ensure it's not recomputed for each rot

remove rings lookup table

move scale radius product to ring loop to ensure it's not recomputed for each rot

fix formatting of for loop

move scale radius product to ring loop to ensure it's not recomputed for each rot

use sine/cosine approximations for brisk lookup table.

add documentation for sine/cosine lookup tables

Improve initialization performance of BRISK
2020-08-18 07:11:21 -04:00
Alexander Alekhin d696d7f9ea Merge pull request #17989 from Yikun:arm64-check-action 2020-08-18 13:22:25 +03:00
Alexander Alekhin 29aeebf5bc Merge pull request #18119 from tomoaki0705:fixFfmpegBuildFailure 2020-08-17 19:25:55 +00:00
Alexander Alekhin 41548a091b Merge pull request #17993 from Maxim-Doronin:vpu/mdoronin/refactor_vpu_configs 2020-08-17 19:20:04 +00:00
Maksym Ivashechkin c9e1386e44 fix CV_Check warnings 2020-08-17 21:15:19 +02:00
Tomoaki Teshima cc769ff19d fix build error on odroid-n2-plus 2020-08-17 21:24:54 +09:00
Vadim Pisarevsky 5108e3ced6 Merge pull request #18073 from vpisarev:apache2_license
changed OpenCV license from BSD to Apache 2 license

* as discussed and announced earlier, changed OpenCV license from BSD to Apache 2. Many files still contain old-style copyrights though

* changed wording a bit; preserve the original OpenCV BSD license
2020-08-17 11:49:11 +00:00
Alexander Alekhin 8753203df0 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-08-17 10:29:12 +00:00
Yosshi999 1834eed809 Merge pull request #18001 from Yosshi999:sift-8bit-descr
* 8-bit SIFT descriptors

* use clearer parameter

* update docs

* propagate type info

* overload function for avoiding ABI-break

* bugfix: some values are undefined when CV_SIMD is absent
2020-08-17 10:28:44 +00:00
Alexander Alekhin b34234ac14 Merge pull request #18105 from alalek:highgui_gtk_dont_terminate 2020-08-17 08:52:01 +00:00
Alexander Alekhin 7ec9f52509 highgui: don't terminate if we can't initialize GTK backend
- allow Users to handle such case
- exception will be thrown instead
2020-08-16 09:30:09 +00:00
Maksym Ivashechkin a66f61748f Merge pull request #17683 from ivashmak:homography
[GSoC] New RANSAC. Homography part

* change enum and squash commits

* add small improvements

* change function to static, update magsac

* remove path from samples, remove license, small updates

* update pnp solver, small improvements

* fix warnings

* add tutorial, comments

* fix markdown warnings

* fix markdown warnings

* fix markdown warnings
2020-08-14 22:42:26 +00:00
Alexander Alekhin b45273eccb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-08-14 19:45:45 +00:00
nhlsm 68f527267b Merge pull request #18080 from nhlsm:improve-mat-operator-assign-scalar
* improve Mat::operator=(Scalar)

* touch

* remove trailing whitespace

* TEST: check if old code pass test or not

* remove CV_Error

* remove warning

* fix: is -> Scalar

* 1) Mat *mat -> Mat &mat 2) return bool, add output param

* add comment
2020-08-14 17:21:23 +00:00
Alexander Alekhin 7f22b34c78 Merge pull request #18092 from alalek:ocl_fix_image_format 2020-08-14 17:10:36 +00:00
Liubov Batanina ad63d24dba Merge pull request #18096 from l-bat:update_onnx_importer
* Added ReduceSum to ONNX importer

* Fix comments

* Fix Mul
2020-08-14 16:49:42 +00:00
Alexander Alekhin 3b5813c035 Merge pull request #18078 from l-bat:fix_matmul 2020-08-14 13:46:46 +00:00
Liubov Batanina 339b963e6b Fix MatMul and Add axes 2020-08-14 11:18:58 +03:00
Alexander Alekhin 00890aecdf core(ocl): fix ocl::Image2d::isFormatSupported()
in case of OPENCV_OPENCL_DEVICE=disabled
2020-08-13 18:33:18 +00:00
Maksim Doronin 7fe87d9a5b [IE][VPU]: Refactor vpu configs 2020-08-13 15:25:01 +03:00
Yashas Samaga B L 2171cae8ff Merge pull request #17976 from YashasSamaga:dnn-fusion-tests-fix-ocl
dnn: add exhaustive fusion tests, enable more eltwise fusions

* add eltwise fusion tests, enable more eltwise fusions

* merge weighted eltwise tests with eltwise tests
2020-08-13 10:55:41 +00:00
Pierre-Emmanuel Viel 3f55152ca0 Add debug assert to check in FLANN the vectors size is multiple of the architecture word size 2020-08-12 23:07:35 +02:00
Liubov Batanina f3cebb3e1b Merge pull request #18077 from l-bat:reduce_sum
* Supported ReduceSum op

* Skip test
2020-08-12 14:32:16 +00:00
Alexander Alekhin 2b227f00f2 Merge pull request #18074 from pemmanuelviel:pev--kmeans-refactoring 2020-08-12 13:18:20 +00:00
Pierre-Emmanuel Viel 98de57c6c4 Refactoring to prepare for other vector types while mutualizing some methods 2020-08-12 00:57:37 +02:00
zhaoyue-zephyrus e231be86b7 support flownet2 with arbitary input size
revise default proto to match the filename in documentations

fix a bug

beautify python codes

fix bug

beautify codes

add test samples with larger/smaller size

remove unless code

using bytearray without creating tmp file

remove useless codes
2020-08-12 00:50:58 +08:00
Yikun Jiang a37f7cce52 Add arm64-build-checks github action 2020-08-11 18:06:33 +08:00
Elizarov Ilya 7ec221e734 Merge pull request #18033 from ieliz:dasiamrpn
Improving DaSiamRPN tracker sample

* changed layerBlobs in dnn.cpp and added DaSiamRPN tracker

* Improving DaSiamRPN tracker sample

* Docs fix

* Removed outdated changes

* Trying to reinitialize tracker without reloading models. Worked with LaSOT-based benchmark with reinit rate=250 frames

* Trying to reverse changes

* Moving the model in the constructor

* Fixing some issues with names

* Variable name changed

* Reverse parser arguments changes
2020-08-11 11:46:47 +03:00
Alexander Alekhin 949fe93d5a Merge pull request #18059 from komakai:improve-swift-docs 2020-08-10 20:28:41 +00:00
Alexander Alekhin b4e9b4fe7d Merge pull request #18060 from YashasSamaga:cuda4dnn-fix-detection-output-cterr 2020-08-10 20:26:50 +00:00
Alexander Alekhin c3ced6db4e Merge pull request #18062 from pemmanuelviel:pev-multiple-kmeans-trees 2020-08-10 20:25:49 +00:00
Alexander Alekhin 0b38571920 Merge pull request #18065 from komakai:fix-converter 2020-08-10 20:24:54 +00:00
Alexander Alekhin 2ffe15f22f Merge pull request #18031 from ilyachur:feature/ichuraev/remove_goe 2020-08-10 17:36:58 +00:00
pemmanuelviel fe9ff64d64 Merge pull request #17643 from pemmanuelviel:pev--new-flann-demo
* Add a FLANN example showing how to search a query image in a dataset

* Clean: remove warning

* Replace dependency to boost::filesystem by calls to core/utils/filesystem

* Wait for escape key to exit

* Add an example of binary descriptors support

* Add program options for saving and loading the flann structure

* Fix warnings on Win64

* Fix warnings on 3.4 branch still relying on C++03

* Add ctor to img_info structure

* Comments modification

* * Demo file of FLANN moved and renamed

* Fix distances type when using binary vectors in the FLANN example

* Rename FLANN example file

* Remove dependency of the flann example to opencv_contrib's SURF.

* Remove mention of FLANN and other descriptors that aimed at giving hint on the other options

* Cleaner program options management

* Make waitKey usage minimal in FLANN example

* Fix the conditions order

* Use cv::Ptr
2020-08-10 13:26:40 +00:00
Giles Payne 31ddd98c8e Fix Objective-C declaration of Mat_to_vector_Point2d 2020-08-10 20:32:42 +09:00
Alexander Alekhin 3f65c12d0c Merge pull request #17982 from nglee:dev_cudaGpuMatConvertToInplaceFix 2020-08-09 20:21:17 +00:00
Pierre-Emmanuel Viel 759c9522fd Merge the two KMeansIndexParams ctor on master 2020-08-09 21:56:21 +02:00
YashasSamaga f0149cdae2 fix compile-time errors, disable unsupported tests 2020-08-09 14:43:20 +05:30
Giles Payne bedabc15ae Obj-C/Swift docs improvements 2020-08-09 16:53:10 +09:00
Alexander Alekhin 565f14655c Merge pull request #18039 from peters:master 2020-08-07 10:34:22 +00:00
Peter Rekdal Sunde 760e7e8efa Add support for using new ffmpeg encoding API when writing a video. 2020-08-06 23:43:47 +02:00
Alexander Alekhin 336627a776 Merge pull request #18048 from l-bat:onnx_torchvision 2020-08-06 20:21:47 +00:00
Alexander Alekhin fa25faa2d2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-08-06 14:15:52 +00:00
Liubov Batanina 6226ea0085 Fix bug in ONNX Gather op 2020-08-06 15:47:34 +03:00
Alexander Alekhin dbab8d8c38 Merge pull request #18043 from opencv:garybradski-patch-1 2020-08-06 08:34:04 +03:00
Gary Bradski 9f02b8742e Update README.md
I think there should be something under ### Resources for example:
* Additional OpenCV functionality: <https://github.com/opencv/opencv_contrib>
2020-08-05 17:00:56 -07:00
Alexander Alekhin 1067cd0649 Merge pull request #18036 from alalek:backport_17858 2020-08-04 20:16:22 +00:00
Vadim Pisarevsky 1537ecd931 * added depth-wise convolution; gives ~20-30% performance improvement in MobileSSD networks
* hopefully, eliminated compile warnings, errors, as well as failure in one test

* * fixed a few typos
* decreased buffer size in some cases
* added more optimal im2row branch in the case of 1x1 convolutions
* tuned fastConv to reduce the number of passes over arrays

backport of commit 77b01deb80
2020-08-04 17:34:48 +00:00
Alexander Alekhin 5b5c42d2c7 Merge pull request #18027 from dkurt:dnn_backport_ngraph 2020-08-04 16:24:11 +00:00
Alexander Alekhin 161890dad4 Merge pull request #18017 from danielenricocahall:add-relu-to-darknet 2020-08-04 16:17:07 +00:00
Alexander Alekhin 35846fe735 Merge pull request #18008 from gsmatos:document-patchnans 2020-08-04 16:15:53 +00:00
Alexander Alekhin 422f802ec9 Merge pull request #17922 from joy2myself:build_riscv_with_c++_intrin 2020-08-04 09:45:32 +00:00
Ilya Churaev 5fd3d36fe8 Removed get_output_as_single_output_node method 2020-08-04 08:18:38 +03:00
Gabriel 96ce65f021 Document PatchNANs input type 2020-08-03 22:57:18 -03:00
danielenricocahall 8457e471fd add relu as activation option in darknet
add relu option

add relu as activation option in darknet

simplify the setParams if-else ladder

add relu as activation option in darknet

correct activation_param type

format

format

add relu as activation option in darknet

spacing

spacing

add relu as activation option in darknet
2020-08-03 19:19:35 -04:00
Ilya Churaev 246de2b7f5 Replaced copy_with_new_args to clone_with_new_inputs 2020-08-03 23:08:29 +03:00
Ilya Churaev e8c26963e9 Fixed removing is_parameter, is_constant, is_output 2020-08-03 23:08:22 +03:00
pemmanuelviel 793e7c0d9f Merge pull request #18019 from pemmanuelviel:pev--multiple-kmeans-trees
* Possibility to set more than one tree for the hierarchical KMeans (default is still 1 tree).

This particularly improves NN retrieval results with binary vectors, allowing better quality
compared to LSH for similar processing time when speed is the criterium.

* Add explanations on the FLANN's hierarchical KMeans for binary data.
2020-08-03 18:29:57 +00:00
Alexander Alekhin 3b337a12c9 Merge pull request #18018 from danielenricocahall:add-compose-panorama-python-binding 2020-08-03 18:28:18 +00:00
Alexander Alekhin 2c32cb743c Merge pull request #18016 from pemmanuelviel:pev--cleaner-hierarchical-clustering 2020-08-03 18:27:11 +00:00
Alexander Alekhin 11eff8bae0 Merge pull request #18014 from lpea:fix_build_with_aravis 2020-08-03 18:26:53 +00:00
Alexander Alekhin 883b995fd6 Merge pull request #18012 from sturkmen72:update_doc_and_sample 2020-08-03 18:26:12 +00:00
Alexander Alekhin 27b2059662 Merge pull request #18011 from YashasSamaga:cuda4dnn-feature-mvn 2020-08-03 18:25:14 +00:00
Alexander Alekhin a28533933f Merge pull request #17998 from dkurt:dnn_fix_ngraph 2020-08-03 18:23:11 +00:00
Liubov Batanina d695208727 Merge pull request #17967 from l-bat:non_const_weights_for_conv
* Supported convolution with non-const weights

* Fix opencl blobs

* Update tests
2020-08-03 18:02:49 +00:00
pemmanuelviel e6ec42d462 Merge pull request #17735 from pemmanuelviel:pev-fix-trees-descent
* Fix trees parsing behavior in hierarchical_clustering_index:
Before, when maxCheck was reached in the first descent of a tree, time was still wasted parsing
the next trees till their best leaf, just to skip the points stored there.
Now we can choose either to keep this behavior, and so we skip parsing other trees after reaching
maxCheck, or we choose to do one descent in each tree, even if in one tree we reach maxCheck.

* Apply the same change to kdtree.
As each leaf contains only 1 point (unlike hierarchical_clustering), difference is visible if trees > maxCheck

* Add the new explore_all_trees parameters to miniflann

* Adapt the FlannBasedMatcher read_write test to the additional search parameter

* Adapt java tests to the additional parameter in SearchParams

* Fix the ABI dumps failure on SearchParams interface change

* Support of ctor calling another ctor of the class is only fully supported from C+11
2020-08-03 18:00:59 +00:00
kadi soheib 613ff61de7 Added reference to paper. 2020-08-03 18:07:36 +03:00
Alexander Alekhin 65b02cc8f2 Merge pull request #17742 from SoheibKadi/DetectionOutput_layer_doc
Adding comment from source code to DetectionOutputLayer class documentation
2020-08-03 17:17:04 +03:00
Alexander Alekhin 1c8ee3f957 Merge pull request #17885 from alalek:dnn_ocl_slice_update
DNN: OpenCL/slice update

* dnn(ocl/slice): make slice kernel VTune friendly

- more unique names
- inline code of copy functions

* dnn(ocl/slice): prefer to spawn more work groups

- even in case with 1D copy
- perf improvement up to 2x of kernel time (due to changed configuration 128x1x1 => 128x32x1)

* dnn(ocl/slice): cache kernel exec info
2020-08-03 14:13:34 +00:00
Yosshi999 922108060d Merge pull request #17907 from Yosshi999:gsoc_asift-py2cpp
* Implement ASIFT in C++

* '>>' should be '> >' within a nested template

* add a sample for asift usage

* bugfix empty keypoints cause crash

* simpler initialization for mask

* suppress the number of lines

* correct tex document

* type casting

* add descriptorsize for asift

* smaller testdata for asift

* more smaller test data

* add OpenCV short license header
2020-08-03 14:11:55 +00:00
Alexander Alekhin ce74285c5e Merge pull request #17478 from tomoaki0705:dropOldCC 2020-08-03 13:00:41 +00:00
Zhangyin ff4c3873f2 Added cmake toolchain for RISC-V with clang.
- Added cross compile cmake file for target riscv64-clang
- Extended cmake for RISC-V and added instruction checks
- Created intrin_rvv.hpp with C++ version universal intrinsics
2020-08-03 20:18:56 +08:00
Alexander Alekhin 1192734131 Merge pull request #17882 from komakai:objc-contrib-wrappers 2020-08-03 11:10:37 +00:00
Suleyman TURKMEN c262eea84a Update warpPerspective_demo.cpp 2020-08-03 12:14:01 +03:00
danielenricocahall f2ca7e664a add python binding and tests for composePanorama
fix tests

    pick 54039c2afd add python binding and tests for composePanorama
2020-08-02 19:29:16 -04:00
Dmitry Kurtaev cf8f65d806 Do not use size_t for nGraph layers 2020-08-02 20:50:44 +03:00
Pierre-Emmanuel Viel bc221bdb90 Cleaner code for hierarchical_clustering 2020-08-02 18:05:54 +02:00
lpea 29976a04c5 videoio: fix compilation with Aravis enabled 2020-08-02 14:27:44 +02:00
YashasSamaga a3106d424b add MVNOp 2020-08-02 12:44:35 +05:30
Vadim Pisarevsky 77b01deb80 Merge pull request #17858 from vpisarev:dnn_depthwise_conv
* added depth-wise convolution; gives ~20-30% performance improvement in MobileSSD networks

* hopefully, eliminated compile warnings, errors, as well as failure in one test

* * fixed a few typos
* decreased buffer size in some cases
* added more optimal im2row branch in the case of 1x1 convolutions
* tuned fastConv to reduce the number of passes over arrays
2020-08-01 15:05:05 +03:00
Yashas Samaga B L f53f491cd2 Merge pull request #17939 from YashasSamaga:cuda4dnn-fix-eltwise-fusion
* fix eltwise fusion segfault, more eltwise fusions, fix power fusion

* add assertion
2020-08-01 15:03:07 +03:00
kadi soheib 6bed5c181b Corrected Comment as requested by reviewer. 2020-07-31 23:43:38 +03:00
Maksim Shabunin e421233a1d Merge pull request #17301 from YashasSamaga:cuda4dnn-detection-output 2020-07-31 15:21:23 +00:00
Maksim Shabunin f162c08cda Merge pull request #17987 from mshabunin:fix-xcode-carotene 2020-07-31 09:08:10 +00:00
Maksim Shabunin 0d1d452b79 Merge pull request #17983 from Windfisch:Windfisch-patch-jpeg2000 2020-07-31 09:07:35 +00:00
Pavel Rojtberg 3c3e131c38 Merge pull request #17977 from paroj:hervec
* calib3d: calibrateHandEye - allow using Rodrigues vectors for rotation

* calib3d: calibrateHandEye - test rvec representation
2020-07-30 22:59:15 +03:00
Maksim Shabunin a218cf3c61 Merge pull request #17957 from AnnaPetrovicheva:ap/update-logo 2020-07-30 19:56:32 +00:00
Maksim Shabunin 866468cc3e Fix Carotene compilation with XCode 2020-07-30 22:52:29 +03:00
Florian Jung f66fc199a2 Fix build of grfmt_jpeg2000.cpp
libjasper has recently changed `jas_matrix_get` from a macro to an inline function
(389951d071 in https://github.com/jasper-software/jasper), causing the build to fail.
2020-07-30 19:23:52 +02:00
Namgoo Lee 11ac26bfb4 test code 2020-07-30 01:42:44 +09:00
Namgoo Lee 2241bfb0df Use "src" not "*this" for source GpuMat 2020-07-30 01:03:34 +09:00
Vadim Pisarevsky a2f7ef9d21 Merge pull request #17816 from vpisarev:essential_2cameras
* add findEssentialMat for two different cameras

* added smoke test for the newly added variant of findEssentialMatrix

Co-authored-by: tompollok <tom.pollok@gmail.com>
2020-07-29 16:28:01 +03:00
Anatoliy Talamanov c708f506a4 Merge pull request #17493 from TolyaTalamanov:at/python-bindings-gapi
* Implement G-API python bindings

* Fix hdr_parser

* Drop initlization with brackets using regexp

* Handle bracket initilization another way

* Add test for core operations

* Declaration and definition of View constructor now in different files

* Refactor tests

* Remove combine decorator from tests

* Fix comment to review

* Fix test

* Fix comments to review

* Remove GCompilerArgs implementation from python

Co-authored-by: Pinaev <danil.pinaev@intel.com>
2020-07-29 16:18:52 +03:00
Tomoaki Teshima d92af2aa85 * stop showing old generations
* keep it possible to build for old CC
  * make sure old generations don't come up for the choice
  * remove related version check of old one
2020-07-29 17:31:39 +09:00
YashasSamaga ae293f27cf add DetectionOutputOp 2020-07-29 12:28:00 +05:30
Alexander Alekhin afe9993376 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-28 17:25:20 +00:00
Alexander Alekhin e4d573a080 Merge pull request #17916 from SinM9:mish_functor_sin 2020-07-28 17:05:59 +00:00
Anna Petrovicheva f86c8656a3 Updated the OpenCV logo 2020-07-28 18:31:21 +03:00
Maksim Shabunin 6697f0ea86 Merge pull request #17925 from sturkmen72:patch-2 2020-07-28 13:18:16 +00:00
Orest Chura a9f5c19239 Merge pull request #17871 from OrestChura:oc/typed_GArray_GMat
* Added overload for `GArray<GMat>` ProtoParam in `gtyped.hpp`

* Tests+compile_args
 - added tests for GArray<GMat> as an input and an output of GComputationT
 - added possibility to give the compile_args to GComputationT.apply()

* Fix win errors
2020-07-28 14:20:36 +03:00
Orest Chura 53bfdc318a Merge pull request #17896 from OrestChura:oc/fix_kw_videotests
* - fix numeric overflow due to incorrect type casting
 - remove unnecessary default constructor

* Drop the cast
2020-07-28 13:25:56 +03:00
Maksim Shabunin e935f06f16 Merge pull request #17928 from sturkmen72:update_samples 2020-07-27 08:32:25 +00:00
Maksim Shabunin 1e18004bdd Merge pull request #17943 from tomoaki0705:fixPolarToCartRounding 2020-07-27 08:32:03 +00:00
Tomoaki Teshima 19646ad049 let the test pass on Jetson 2020-07-25 23:45:51 +09:00
Suleyman TURKMEN 7e943808b6 Update train_HOG.cpp 2020-07-23 20:23:31 +03:00
Suleyman TURKMEN 88dbee3589 Update samples 2020-07-23 20:09:37 +03:00
Maksim Shabunin 5bfa43f7d5 Merge pull request #17489 from Lapshin:ffmpeg_cap_consider_rotation_metadata_3.4 2020-07-23 08:35:51 +00:00
Alexander Smorkalov 7ed37b3fa5 MP4 autorotation tests and various fixes for Windows
- Added test for automated rotation for  MP4 videos with metadata
- Fix 180 degrees rotation bug
- Moved rotation logic to cv::VideoCapture implementation for FFmpeg and restore binary compatibility with FFmpeg wrapper.
2020-07-23 09:30:18 +03:00
Alexey Lapshin f0271e54d9 Autorotation for mp4 streams with metadata
- Add VideoCapture camera orientation property for mp4 videos with camera orientation meta.
- Add auto rotation for 90, 180, 270 degrees using cv::rotate
2020-07-23 09:27:04 +03:00
Sinitsina 0ac2f0e04c mish_functor_update 2020-07-23 09:02:00 +03:00
Maksim Shabunin ef1690ef45 Merge pull request #17913 from asmorkalov:as/connected_components_ref 2020-07-22 16:06:23 +00:00
Maksim Shabunin 0fa06b1db0 Merge pull request #17863 from nglee:dev_cudaDetachOutput 2020-07-22 08:19:32 +00:00
Alexander Smorkalov abceef74e0 Added reference to Original Wu's articte about SAUF connected components search method. 2020-07-22 10:05:55 +03:00
Giles Payne 4cf76754d3 Add Objective-C/Swift wrappers for opencv_contrib modules 2020-07-21 19:19:08 +09:00
Maksim Shabunin 5444a6b11c Merge pull request #17890 from l-bat:onnx_gather 2020-07-21 09:38:35 +00:00
Maksim Shabunin b698d0a6ee Merge pull request #17894 from ilyachur:feature/ichuraev/remove_copy_with_new_args 2020-07-21 08:19:42 +00:00
Maksim Shabunin 11fb04c2f7 Merge pull request #17888 from ilyachur:feature/ichuraev/1324_2 2020-07-21 08:16:32 +00:00
Ilya Churaev aaf65bb3af Fixed removing is_parameter, is_constant, is_output 2020-07-21 08:45:16 +03:00
Namgoo Lee 9411cd6c07 Use in-place npp function for inplace arguments 2020-07-21 10:27:43 +09:00
Maksim Shabunin 9d38a95292 Merge pull request #17887 from ilyachur:revert-17872-feature/ichuraev/1324 2020-07-20 16:15:49 +00:00
Ilya Churaev 0291dd3ef8 Replaced copy_with_new_args to clone_with_new_inputs 2020-07-20 16:05:01 +03:00
Liubov Batanina a35d4f9029 Support Gather for variable inputs 2020-07-20 14:02:45 +03:00
Ilya Churaev a46ca98c57 Revert "Fixed removing is_parameter, is_constant, is_output" 2020-07-20 07:00:09 +03:00
Alexander Alekhin e65e23b9c0 Merge pull request #17872 from ilyachur:feature/ichuraev/1324 2020-07-19 17:28:05 +00:00
Alexander Alekhin d8b2f11cc8 Merge tag '4.4.0' 2020-07-17 23:08:18 +00:00
Alexander Alekhin c3bb57afea release: OpenCV 4.4.0 2020-07-17 22:43:40 +00:00
Alexander Alekhin 8a480ac3c1 Merge pull request #17877 from alalek:issue_17876 2020-07-17 22:41:57 +00:00
Alexander Alekhin ffe0d50447 core(persistence): fix "use after free" bug
- do not store user-controlled "FileStorage" pointer
- store FileStorage::Impl pointer instead
2020-07-17 21:39:06 +00:00
Alexander Alekhin a199d7adf1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-17 17:00:54 +00:00
Alexander Alekhin 348414dc62 Merge pull request #17873 from dmatveev:dm/fix_vs_infer2 2020-07-17 17:00:06 +00:00
Dmitry Matveev 243ce78508 G-API: Try to fix infer2 problem with VS2017 2020-07-17 18:03:25 +03:00
Ilya Churaev 33db2ac928 Fixed removing is_parameter, is_constant, is_output 2020-07-17 14:45:11 +03:00
Alexander Alekhin 1fabe92ace Merge pull request #17868 from alalek:dnn_openvino_2020.4_master 2020-07-17 10:47:12 +00:00
Vadim Pisarevsky 4564b8a224 Merge pull request #17841 from vpisarev:fixed_fs_dtor
* fixed issue #17412

* Update test_io.cpp
2020-07-17 02:28:50 +00:00
Alexander Alekhin 284d26da05 Merge tag '3.4.11' 2020-07-17 02:06:19 +00:00
Alexander Alekhin 971cc3354b dnn(test): adjust tests for OpenVINO 2020.4 (4.x branch) 2020-07-17 01:42:16 +00:00
Alexander Alekhin e8d4259f9a release: OpenCV 3.4.11 2020-07-17 00:34:46 +00:00
Alexander Alekhin 8086afc60a Merge pull request #17865 from alalek:add_missing_check_17036 2020-07-17 00:28:33 +00:00
Alexander Alekhin 9b7b22ee0e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-16 20:13:27 +00:00
Alexander Alekhin b2ebd37ee2 Merge pull request #17856 from alalek:dnn_openvino_2020.4.0 2020-07-16 20:08:00 +00:00
Alexander Alekhin 83e6813345 imgproc: add missing check into cvtColorTwoPlane() 2020-07-16 20:01:44 +00:00
Orest Chura d17ab271e8 Merge pull request #17668 from OrestChura:oc/giebackend_migration_to_core
GAPI: Migration to IE Core API

* Migration to IE Core API
 - both versions are maintained
 - checked building with all the OpenVINO versions (2019.R1, R2, R3, 2020.4 (newest))

* commit to awake builders

* Addressing comments
 - migrated to Core API in 'gapi_ie_infer_test.cpp'
 - made Core a singleton object
 - dropped redundant steps

* Addressing comments
 - modified Mutex locking

* Update

* Addressing comments
 - remove getInitMutex()
 - reduce amount of #ifdef by abstracting into functions

* return to single IE::Core

* Divide functions readNet and loadNet to avoid warnings on GCC

* Fix deprecated code warnings

* Fix deprecated code warnings on CMake level

* Functions wrapped
 - All the functions depended on IE version wrapped into a cv::gapi::ie::wrap namesapace
 - All this contained to a new "giebackend/gieapi.hpp" header
 - The header shared with G-API infer tests to avoid code duplications

* Addressing comments
 - Renamed `gieapi.hpp` -> `giewrapper.hpp`, `cv::gapi::ie::wrap` -> `cv::gimpl::ie::wrap`
 - Created new `giewrapper.cpp` source file to avoid potential "multiple definition" problems
 - removed unnecessary step SetLayout() in tests

* Enabling two NN infer teest

* Two-NN infer test change for CI
 - deleted additional network
 - inference of two identical NN used instead

* Fix CI fileNotFound

* Disable MYRIAD test not to fail Custom CI runs
2020-07-16 18:33:35 +00:00
Alexander Alekhin 09f24a851e Merge pull request #17764 from alalek:issue_17762 2020-07-16 15:27:21 +00:00
Alexander Alekhin a216b8bf87 Merge pull request #17842 from anton-potapov:gapi_debug_log 2020-07-16 13:02:19 +00:00
Alexander Alekhin 81e027eef7 dnn: fix OpenCL implementation of Slice layer 2020-07-16 04:33:52 +00:00
Alexander Alekhin 1c371d07b5 dnn(test): adjust tests for OpenVINO 2020.4 2020-07-15 23:47:40 +00:00
Alexander Alekhin 55e8549839 dnn: eliminate IE deprecation warning 2020-07-15 23:39:06 +00:00
Alexander Alekhin f8d6c5b330 winpack_dldt: switch defaults to OpenVINO 2020.4 2020-07-15 22:13:19 +00:00
Alexander Alekhin 435b6df989 dnn: use OpenVINO 2020.4 defines
original commit: 2813aa7eb9
2020-07-15 20:13:40 +00:00
Alexander Alekhin bf8136eaa6 Merge pull request #17849 from dkurt:fix_17848 2020-07-15 18:53:46 +00:00
Giles Payne af9ee90091 Merge pull request #17818 from komakai:documentation-improvements
Documentation fixes/improvements

* Documentation fixes/improvements

* Remove HASH_UTILS defines
2020-07-15 18:42:05 +00:00
Pinaev Danil cb2e276bff Merge pull request #17741 from aDanPin:dp/add_dinamic_graph_feature
[G-API] Allow building graphs with a dynamic number of inputs and outputs

* Add dinamic graph feature and tests

* Remove unnecessary file

* Review response

* Add implementation of operator += for GRunArgs
And test for that case

* Tests refactoring

* Add doxygen
Review response

* Fix docs

* A small documentation fix

* Review response

* Add tests for more entities

* Add typed tests

* Another typed tests

* Doc fix

* Documentation fix

* Build fix

* Commit for rebuild

* The last one
2020-07-15 18:37:08 +00:00
Alexander Alekhin cd0f0384ef Merge pull request #17788 from YashasSamaga:cuda4dnn-nice-build 2020-07-15 12:25:23 +00:00
Dmitry Kurtaev cc584760d3 Fix TensorFlow->ONNX imports 2020-07-15 14:36:13 +03:00
Alexander Alekhin 5924770504 Merge pull request #17847 from anton-potapov:gapi_own_mat_ctor_warnings 2020-07-15 10:48:02 +00:00
Anton Potapov 111cdd7a32 GAPI: fix warnings in own::Mat default generated constructors/assign op 2020-07-15 10:49:05 +03:00
Anton Potapov 89a17b4232 GAPI: GAPI_LOG_DEBUG facility 2020-07-15 01:31:25 +03:00
Dmitry Matveev f0c411d8b5 Merge pull request #17502 from dmatveev:dm/infer2
* G-API: Introduce a new gapi::infer2 overload + gaze estimation sample

* G-API/infer2: Introduced static type checking for infer2

- Also added extra tests on the type check routine

* G-API/infer2: Addressed self-review comments in the sample app

- Also fix build on Linux;

* G-API/infer2: Remove incorrect SetLayout(HWC) + dead code

- Also fixed comments in the backend

* G-API/infer2: Continue with self-review

- Fix warnings/compile errors in gaze estimation
- Dropped the use of RTTI (VectorRef::holds()) from the giebackend
- Replaced it with a trait-based enums for GArray<T> and std::vector<T>
- The enums and traits are temporary and need to be unified with
  the S11N when it comes

* G-API/infer2: Final self-review items

- Refactored ROIList test to cover 70% for infer<> and infer2<>;
- Fixed the model data discovery routine to be compatible with new
  OpenVINO;
- Hopefully fixed the final issues (warnings) with the sample.

* G-API/infer2: address review problems

- Fixed typo in comments;
- Fixed public (Doxygen) comment on GArray<GMat> input case for infer2;
- Made model lookup more flexible to allow new & old OMZ dir layouts.

* G-API/infer2: Change the model paths again

* G-API/infer2: Change the lookup path for test data

* G-API/infer2: use randu instead of imread. CI war is over
2020-07-14 11:06:49 +03:00
Alexander Alekhin e5e767abc1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-13 19:54:49 +00:00
Dmitry Budnikov 521aac9665 Merge pull request #17694 from dbudniko:dbudniko/serialization_args2
G-API args serialization

* args serialization

* GRunArgP draft

* UMat added

* bind added

* DmitryM's review addressed. Code clean up required.

* fix android build

* bind test added

* more comments addressed

* try to fix Mac build

* clean up

* header-based generic implementation (GRunArg)

* clang again

* one more attempt for clang

* more clean up

* More Dmitry's comments addressed.

* monostate removed

* Top level functions and some other comments addressed.

* fix warnings

* disable warning
2020-07-13 19:24:46 +00:00
Alexander Alekhin d41b20b268 Merge pull request #17830 from alalek:fix_17815 2020-07-13 18:52:34 +00:00
Alexander Alekhin 36da867caf features2d: v_fma => v_muladd for integers 2020-07-13 17:31:08 +00:00
Alexander Alekhin c5f540e3d7 Merge pull request #17806 from alalek:dnn_ie_num_threads_windows 2020-07-13 17:12:31 +00:00
YashasSamaga 1949056423 improved diagnostics for build issues 2020-07-13 21:09:38 +05:30
pemmanuelviel c90e824342 Merge pull request #17639 from pemmanuelviel:pev--binary-kmeans
Pev binary kmeans

* Ongoing work transposing kmeans clustering method for bitfields: the computeClustering method

Ongoing work transposing kmeans clustering method for bitfields: interface computeBitfieldClustering

Fix genericity of computeNodeStatistics

Ongoing work transposing kmeans clustering method for bitfields: adapt computeNodeStatistics()

Ongoing work transposing kmeans clustering method for bitfields: adapt findNN() method

Ongoing work transposing kmeans clustering method for bitfields: allow kmeans with Hamming distance

Ongoing work transposing kmeans clustering method for bitfields: adapt distances code

Ongoing work transposing kmeans clustering method for bitfields: adapt load/save code

Ongoing work transposing kmeans clustering method for bitfields: adapt kmeans hierarchicalClustring()

PivotType -> CentersType Renaming

Fix type casting for ARM SIMD implementation of Hamming

Fix warnings with Win32 compilation

Fix warnings with Win64 compilation

Fix wrong parenthesis position on rounding

* Ensure proper rounding when CentersType is integral
2020-07-13 12:59:10 +00:00
jasonKercher 749bd80091 Merge pull request #17770 from jasonKercher:3.4_triggered
3.4 Allow first capture to return false

* fix first capture timeout

* fix first capture timeout
2020-07-13 12:29:54 +00:00
Alexander Alekhin 1c0b70bbd2 Merge pull request #17822 from alalek:issue_17792 2020-07-13 11:08:33 +00:00
Alexander Alekhin b75f6c05c0 Merge pull request #17805 from tomoaki0705:fixCUDAHostCompilerIssue 2020-07-12 13:05:14 +00:00
Tomoaki Teshima 269b810601 re-enable automatic CC detection on Jetson
* treat both CMAKE_C_COMPILER and c_compiler_realpath as candidate
2020-07-12 21:22:12 +09:00
Alexander Alekhin e54040d540 core: use lazy on-demand initialization for param_traceEnable 2020-07-12 11:53:46 +00:00
Alexander Alekhin 3d50bde46e Merge pull request #17813 from hannesa2:FixTypo 2020-07-11 19:20:49 +00:00
Alexander Alekhin 0b454486cf Merge pull request #17783 from dmatveev:dm/pmc_script 2020-07-11 19:11:03 +00:00
Alexander Alekhin b96e9a4a4a Merge pull request #17800 from Yosshi999:gsoc_sift-universal-intrinsic 2020-07-11 19:09:21 +00:00
YashasSamaga ead1dcf308 error if cuda4dnn depends are not resolved 2020-07-11 21:37:51 +05:30
Hannes Achleitner 553259ef99 Fix typo 2020-07-11 08:10:15 +02:00
Alexander Alekhin e18df87a15 Merge pull request #17635 from jsxyhelu:3.4 2020-07-10 15:11:53 +00:00
Alexander Alekhin 5cb8619eca dnn(ie): enable KEY_CPU_THREADS_NUM for Windows 2020-07-10 14:29:21 +00:00
jsxyhelu 476094ad5a Use“ moms” replace "contourArea"
double area = moms.m00;
is same as
double area = contourArea(contours[contourIdx]);
Not to mention
"moms" already calculated here,"contourArea" should not apply
2020-07-10 11:05:24 +00:00
Alexander Alekhin ff992183b2 Merge pull request #17791 from YashasSamaga:cuda4dnn-fix-concat-fusion 2020-07-10 10:55:01 +00:00
Alexander Alekhin d2469edd10 Merge pull request #17772 from mshabunin:fix-match-umat-mask 2020-07-10 10:53:56 +00:00
Yosshi999 0df8fb70b4 use bufferarea for allocating buffer 2020-07-09 16:50:20 +00:00
YashasSamaga 37e2afb8f6 fix concat fusion for cuda4dnn 2020-07-09 19:40:44 +05:30
Maksim Shabunin 4dd9a36a3c Added test for checkMasks with UMat train descs 2020-07-09 16:22:19 +03:00
Maksim Shabunin 41678fe3d3 Fixed checkMasks in DescriptorMatcher with train descs in UMats 2020-07-09 16:05:20 +03:00
Yashas Samaga B L d0e6d2438c Merge pull request #17363 from YashasSamaga:cuda4dnn-eltwise-fusion2
cuda4dnn(conv): fuse eltwise with convolutions

* fuse eltwise with convolutions

* manually rebase to avoid bad git merge
2020-07-09 16:02:21 +03:00
Dmitry Matveev a724dc99e8 G-API: Change the default FD model in the privacy-masking-camera 2020-07-09 14:09:59 +03:00
Alexander Alekhin 44d473fba0 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-08 21:03:43 +00:00
Alexander Alekhin 5bc6b6fc26 Merge pull request #17737 from pemmanuelviel:pev--fix-trees-descent 2020-07-08 20:59:29 +00:00
Alexander Alekhin 8931c68b20 Merge pull request #17707 from Yosshi999:gsoc_sift-universal-intrinsic 2020-07-08 20:33:40 +00:00
Alexander Alekhin 988bc804bf Merge pull request #17748 from YashasSamaga:cuda4dnn-data-parallel 2020-07-08 20:20:19 +00:00
Alexander Alekhin f78f908c09 Merge pull request #17674 from alalek:issue_16214 2020-07-08 20:01:35 +00:00
Alexander Alekhin 5487bca4f3 Merge pull request #17777 from alalek:backport_cuda_cmake 2020-07-08 20:00:13 +00:00
Alexander Alekhin 52ac3661b0 Merge pull request #17745 from alalek:cuda_fix_ccbin 2020-07-08 19:59:42 +00:00
Dmitry Matveev 27f1ab5a70 Added a script to measure & report privacy masking camera performance in different configurations 2020-07-08 19:19:37 +03:00
Alexander Alekhin 762a5c8334 imgproc: align GaussianBlur/sepFilter2D OpenCL with CPU version 2020-07-08 15:13:48 +00:00
Alexander Alekhin 2fed41dfa5 imgproc(test): test bitExact cases in OCL/sepFilter2D 2020-07-08 10:14:56 +00:00
Alexander Alekhin 8bf1b9a422 cmake(cuda): repair ccbin, re-implement execute_process() cache
- preventive fix for arch "11.0" (CUDA_ARCH_BIN_OR_PTX_10 bug)
- new var: OPENCV_CUDA_DETECTION_NVCC_FLAGS
- new var: OPENCV_CMAKE_CUDA_DEBUG
2020-07-08 07:34:17 +00:00
Alexander Alekhin e0f9eac521 cmake: backport CUDA scripts 2020-07-08 07:33:54 +00:00
Alexander Alekhin b90a2a8497 Merge pull request #17759 from alalek:build_opencv_winpack_dldt_2020.4.0 2020-07-07 19:28:53 +00:00
Alexander Alekhin 950a916952 Merge pull request #17752 from YashasSamaga:generalize-concat-fusion-3.4 2020-07-07 10:36:02 +00:00
Alexander Alekhin 524a2fffe9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-06 23:05:04 +00:00
Alexander Alekhin 3f13339071 Merge pull request #17728 from sturkmen72:patch-4 2020-07-06 23:01:27 +00:00
Alexander Alekhin eb6678ebef Merge pull request #17699 from alalek:build_core_cuda
* core(cuda): fix build

- MSVS 19.25.28612.0
- CUDA release 11.0, V11.0.167

* cmake(cuda): backport workaround for CUDA 11

* cmake(cuda): call CUDA_BUILD_CLEAN_TARGET() on finalize

* cmake(cuda): use CMAKE_SUPPRESS_REGENERATION with MSVS
2020-07-06 22:58:17 +00:00
Alexander Alekhin 6781ca7d55 Merge pull request #17685 from YashasSamaga:cuda4dnn-cudnn8-support 2020-07-06 22:48:07 +00:00
Alexander Alekhin d62e0a3695 Merge pull request #17743 from alalek:test_17666 2020-07-06 22:36:35 +00:00
Alexander Alekhin dcb7fd8520 Merge pull request #17766 from alalek:backport_17756 2020-07-06 21:50:24 +00:00
Alexander Alekhin d5713c657b dnn(slice): disable buggy OCV/OCL implementation 2020-07-06 21:36:19 +00:00
Alexander Alekhin 99c4b76a6d dnn(test): add YOLOv4-tiny tests 2020-07-06 21:36:19 +00:00
Alexander Alekhin e4887aaa5b Merge pull request #17761 from mshabunin:test-wo-jpg-png 2020-07-06 20:02:15 +00:00
Alexander Alekhin 0970ef57bd Merge pull request #17754 from YashasSamaga:cuda4dnn-slice-concat-copy-reduction 2020-07-06 20:00:52 +00:00
Alexander Alekhin f98c97f796 Merge pull request #17758 from tomoaki0705:fixGapiOpenclTestError 2020-07-06 19:57:54 +00:00
Ilya Churaev d69a7a3bbf Fixed header paths for some nGraph ops
* Added dependency on IE version

backport of commit: 992c908b56
2020-07-06 19:51:57 +00:00
Alexander Alekhin ccf6dd07b3 build: winpack_dldt with dldt 2020.4.0 2020-07-06 14:08:54 +00:00
Maksim Shabunin e8129429e9 imgcodecs: fix test build with disabled JPEG and PNG libs 2020-07-06 14:52:52 +03:00
Tomoaki Teshima 46d3637609 avoid kernel compile error on Arm SBCs 2020-07-06 18:27:19 +09:00
Ilya Churaev 992c908b56 Merge pull request #17756 from ilyachur:feature/ichuraev/fix_ngraph_headers
* Fixed header paths for some nGraph ops

* Added dependency on IE version
2020-07-06 08:11:59 +00:00
Suleyman TURKMEN 2566d13100 Update documentation of imwrite() 2020-07-06 11:02:50 +03:00
YashasSamaga cbdaa93e54 reduce slice, concat to copy; enable more concat fusions 2020-07-05 20:52:35 +05:30
Alexander Alekhin 5a15369d4d Merge pull request #17729 from modeste2015:3.4 2020-07-04 17:17:57 +00:00
Alexander Alekhin deaf1dd458 Merge pull request #17724 from pemmanuelviel:pev--fix-mix-of-types 2020-07-04 17:16:57 +00:00
pemmanuelviel 65f87b114b Merge pull request #17722 from pemmanuelviel:pev--replace-asserts
* Clean: replace C style asserts by CV_Assert and CV_DbgAssert

* Try fixing warning on Windows compilation

* Another way trying to fix warnings on Win

* Fixing warnings with some compilers:
Some compilers warn on systematic exit preventing to execute the code that follows.
This is why assert(0) that exits only in debug was working, but not CV_Assert or CV_Error
that exit both in release and debug, even if with different behavior.
In addition, other compilers complain when return 0 is removed from getKey(),
even if before we have a statement leading to systematic exit.

* Disable "unreachable code" warnings for Win compilers so we can use proper CV_Error
2020-07-04 20:15:44 +03:00
Alexander Alekhin 8f5b453a96 Merge pull request #17719 from pemmanuelviel:pev--fix-computeNodeStatistics-genericity 2020-07-04 17:14:35 +00:00
YashasSamaga b7eec216e9 generalize axis for concat fusion 2020-07-04 18:57:28 +05:30
YashasSamaga 4988e131fd transfer output blobs in background 2020-07-04 12:55:12 +05:30
kadi soheib 17c430da88 Updated comment. 2020-07-04 06:37:59 +03:00
kadi soheib 96a501c08b Adding comment from source code to documentation. 2020-07-04 06:37:58 +03:00
Christoph 657c8d1c65 Merge pull request #17454 from creinders:master
fix instable fisheye undistortPoints

* remove artefacts when (un)distorting fisheye images with large distortion coefficient values

* fix fisheye undistortion when theta is close to zero

* add fisheye image undistort and distort test

* Fixed type conversion warnings

* fixed trailing whitespace
2020-07-03 22:59:19 +00:00
Alexander Alekhin e03891b744 Merge pull request #17701 from pemmanuelviel:pev-lshIndexParams-consistency 2020-07-03 22:53:44 +00:00
Alexander Alekhin dc57707e60 Merge pull request #17744 from alalek:issue_17657 2020-07-03 21:21:27 +00:00
Alexander Alekhin 56b5a7d977 cmake: fix ENABLE_PROFILING 2020-07-03 19:31:41 +00:00
Liubov Batanina 65dbbf712d Merge pull request #17733 from l-bat:tiny_yolov4
* Supported yolov4-tiny

* Added comments
2020-07-03 18:07:08 +00:00
Alexander Alekhin 49497d8e7c Merge pull request #17725 from pemmanuelviel:pev--precompute-divisor 2020-07-03 11:24:11 +00:00
Pierre-Emmanuel Viel 728684840c Fix trees parsing behavior in hierarchical_clustering_index:
Before, when maxCheck was reached in the first descent of a tree, time was still wasted parsing
the next trees till their best leaves whose points were not used at all.
2020-07-03 01:19:10 +02:00
Alexander Alekhin 73f7d091f8 Merge pull request #17721 from pemmanuelviel:pev--fix-hist-intersect-arguments 2020-07-02 11:54:28 +00:00
Ken Shirriff 00e1bc49c8 Merge pull request #17708 from shirriff:patch-1
Clarify component statistics documentation

* Change ConnectedComponentsTypes documentation

Change from "algorithm output formats" to "statistics" because it specifies types of statistics, not formats.

* Documentation: clarify component statistics

Explain that ConnectedComponentTypes selects a statistic.
2020-07-02 13:58:53 +03:00
Heritier Kinke cb3a098b25 forget to look in sub folder of include/openblas 2020-07-02 03:33:07 +02:00
Alexander Alekhin 5a7045181a Merge pull request #17723 from pemmanuelviel:pev--remove-duplicate 2020-07-01 18:14:08 +00:00
Pierre-Emmanuel Viel 6a045fd678 Fix arguments list in loadindex for histogram intersection 2020-07-01 18:59:45 +02:00
Pierre-Emmanuel Viel 327f92cc46 Precompute the divisor to ensure that no kind of compiler would process it on the fly at each call. 2020-07-01 18:52:05 +02:00
Pierre-Emmanuel Viel 482cacd420 Mix of 32 and 64bits vector types prevents vectorisation for distance computation.
Argument "a" is of type ElementType* that is either int* or float*, while b was double*.
Mixing types prevents the possibility to use SSE or AVX instructions.
On implementation without SIMD instructions, this doesn't show any impact on performance.
2020-07-01 18:27:07 +02:00
Pierre-Emmanuel Viel 93a6be836c Remove duplicate line 2020-07-01 18:15:01 +02:00
Pierre-Emmanuel Viel ef7185ce43 Fix genericity of computeNodeStatistics that couldn't compute stats properly on sub-nodes 2020-07-01 12:14:15 +02:00
Alexander Alekhin a5fdcf9881 Merge pull request #17700 from asmorkalov:as/cuda_cmake_compat 2020-06-30 19:55:53 +00:00
YashasSamaga 62a63021c7 add cuDNN 8 support 2020-06-30 21:51:23 +05:30
Pierre-Emmanuel Viel 33fab84473 Type consistency for all xxxIndexParams integer arguments as well as with miniflann's LshIndexParams 2020-06-30 10:33:07 +02:00
Alexander Smorkalov 0ccc839397 Restored compatibility with CMake older than 3.7. 2020-06-30 11:28:36 +03:00
Yosshi999 920c180052 use universal SIMD intrinsics for SIFT 2020-06-30 06:44:12 +00:00
Alexander Alekhin a711e2aa41 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-29 21:19:09 +00:00
Alexander Alekhin a84afb6334 Merge pull request #17640 from pemmanuelviel:pev--fix-lsh-bad-any-cast 2020-06-29 20:53:34 +00:00
Alexander Alekhin ab4065fa1c Merge pull request #17696 from dbudniko:dbudniko/g_api_fix_min_max 2020-06-29 19:54:41 +00:00
Alexander Alekhin ee73b0bd08 Merge pull request #17695 from alalek:issue_17677 2020-06-29 19:15:24 +00:00
Alexander Alekhin e58977a3de Merge pull request #17686 from alalek:cmake_cuda_cxx_flag 2020-06-29 19:14:00 +00:00
Dmitry Budnikov 31bee49371 min max fix for standalone 2020-06-29 20:57:44 +03:00
Alexander Alekhin 48ef6df842 cmake(gapi): fix opencv_world build for winpack 2020-06-29 17:46:39 +00:00
Alexander Alekhin 98ad7d01d5 cmake(cuda): update handling of -std=c++11/14 flags 2020-06-29 01:49:00 +03:00
Pierre-Emmanuel Viel cdac7c7bec Add test checking we don't throw when creating GenericIndex with LshIndexParams() 2020-06-28 19:51:04 +00:00
Pierre-Emmanuel Viel fe09c79f4b Fix the 'cvflann::anyimpl::bad_any_cast' error using Lsh 2020-06-28 19:51:04 +00:00
cyy 206c843f36 Merge pull request #17499 from cyyever:fix_CUDA11
Fix cuda11

* use cudnn_version.h to detect version when it is available

* remove nppi from CUDA11

* use ocv_list_filterout

* dnn(cuda): temporary disable CUDNN 8.0
2020-06-27 20:34:44 +00:00
Alexander Alekhin cabad90d6c Merge pull request #17636 from okamotoR:3.4 2020-06-27 20:17:16 +00:00
Alexander Alekhin 4e6a108bda Merge pull request #17665 from komakai:fix-ios-dynamic-build 2020-06-27 20:12:08 +00:00
Alexander Alekhin 6dba1733f0 Merge pull request #17567 from dev-tronifier:new_branch 2020-06-27 20:08:37 +00:00
Alexander Alekhin c62e63909a Merge pull request #17671 from tomoaki0705:fixCUDANativeDetection 2020-06-26 22:51:34 +00:00
pemmanuelviel daa88c6b9e Merge pull request #17642 from pemmanuelviel:pev--fixes-and-clean
* Clean: make the use of the indices array length consistent

Either we don't want this method to be used in the future for any other node
than the root node, and so we replace indices_length by size_ and remove it as
argument, or we want to be able to use it potentially for other nodes, and
so using size_ instead of indices_length would have lead to a bug.

* Fix: b was not an address

* Fix: transpose the Flann repo commit "Fixes in accum_dist methods" from Adil Ibragimov

Avoids trying to compute log(ratio) with ratio = 0

* Fix: transpose the Flann repo commit "result_set bugfix" from Jack Rae

* Fix Jack Rae commit as the initial i - 1 index was decremented before entering the loop body

* Clean: transpose the Flann repo commit "Updated comments in lsh_index" from Richard McPherson

* Fix: Transpose the Flann repo commit "Fixing unreachable code in lsh_table.h" from hypevr

* Fix warning the same way it was done in flann standalone repo

* Change the return value in case of unsupported type
2020-06-26 22:34:52 +00:00
dev-tronifier 9b727fa1f3 Increased portability of CV_Func 2020-06-26 19:45:58 +00:00
Dmitry Budnikov 7566921364 Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines

* Serialization backend in tests, initial version

* S11N/00: A Great Rename

- "Serialization" is too long and too error-prone to type,
  so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.

* S11N/01: Some basic interface segregation

- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).

The implementation didn't change much, it is a subject to the further
refactoring

* S11N/02: Basic operator reorg, basic tests, vector support

- Reorganized operators on atomic types to follow >>/<< model
  (put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
  (template-based) one;
- Introduced a new test suite where low-level s11n functionality
  is tested (for the basic types).

* S11N/03: Operators reorganization

- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
  complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
  data structures);
- Introduced new operators for cv::gimpl data types. These operators
  (and so, the data structures) are not yet used in the graph
  dump/reconstruction routine, it will be done as a next step.

* S11N/04: The Great Clean-up

- Drop the duplicates of GModel data structures from the
  serialization, serialize the GModel data structures themselve
  instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.

* S11N/05: Internal API Clean-up

- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
  reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library

* S11N/06: Top-level API introduction

- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
  an expession based and a deserialized one. This has led to changes in
  the cv::GComputation::Priv and in its dependent components (even the
  transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
  operations (mainly `outMeta`) which was only available for expression
  based graphs. Now the `outMeta` can be taken from kernels too (and for
  the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
  hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
  protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
  is to be reworked in the next iteration.

* S11N/07: Tests reworked

- Moved the sample pipeline tests w/serialization to
  test the public API (`cv::gapi::serialize`, then
  followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
  backend as no longer necessary.

* S11N/08: Final touches

- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
  internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.

* linux build fix

* fix RcDesc and int uint warnings

* more Linux build fix

* white space and virtual android error fix (attempt)

* more warnings to be fixed

* android warnings fix attempt

* one more attempt for android build fix

* android warnings one more fix

* return back override

* avoid size_t

* static deserialize

* and how do you like this, elon? anonymous namespace  to fix android warning.

* static inline

* trying to fix standalone build

* mat dims fix

* fix mat r/w for standalone

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-26 19:41:29 +00:00
Alexander Alekhin e45d74c8f9 Merge pull request #17638 from pemmanuelviel:pev--avoid-branching-in-loop 2020-06-26 19:22:20 +00:00
Alexander Alekhin 923009b5ff Merge pull request #17663 from alalek:backport_17658 2020-06-26 17:41:53 +00:00
Tomoaki Teshima 4cec9e5ff1 fix native detection on Jetson 2020-06-26 16:36:59 +09:00
Giles Payne 59ba33658a Dynamic build for Objective-C/Swift wrapper 2020-06-26 08:26:05 +09:00
Yosshi999 4064d4c7eb Merge pull request #17618 from Yosshi999:gsoc_sift-better-test
Added/Fixed testcases for SIFT

* merge perf_sift into conventional perf tests

* Fix disabled SIFT scale invariance tests

allows trainIdx duplication in matching scaled keypoints
2020-06-25 11:34:31 +00:00
Ilya Lavrenov e58ce89b10 Conditional compilation for IR v7 support
backported commit 86905754e4
2020-06-25 10:05:14 +00:00
Alexander Alekhin 085bd5f55f Merge pull request #17658 from ilya-lavrenov:get-layer-by-name 2020-06-25 09:42:59 +00:00
Alexander Alekhin 6259ba1bfd Merge pull request #17641 from pemmanuelviel:pev--fix-middleSplit-for-kdtree-single 2020-06-25 09:12:40 +00:00
Ilya Lavrenov 86905754e4 Conditional compilation for IR v7 support 2020-06-25 11:32:10 +03:00
Alexander Alekhin 6044395986 Merge pull request #17584 from AsyaPronina:gapi_state_init_params_via_compile_args 2020-06-25 08:22:20 +00:00
Anastasiya eff259b047 Enable state initialization params via compile_args 2020-06-25 00:43:12 +03:00
Alexander Alekhin cd8262eb79 Merge pull request #17650 from alalek:update_libjpeg-turbo 2020-06-24 10:57:37 +00:00
Alexander Alekhin d2b854674e Merge pull request #17648 from alalek:update_libjpeg 2020-06-24 10:57:07 +00:00
Alexander Alekhin 4f03f70968 Merge pull request #17605 from TolyaTalamanov:at/fix-plaidml-kernels-function 2020-06-24 09:44:51 +00:00
Alexander Alekhin ad930f6216 3rdparty: libjpeg-turbo 2.0.4 => 2.0.5
https://github.com/libjpeg-turbo/libjpeg-turbo/releases/tag/2.0.5
2020-06-24 06:28:16 +00:00
Alexander Alekhin f061a0ab36 3rdparty: libjpeg 9d
http://www.ijg.org/files/jpegsrc.v9d.tar.gz
2020-06-23 20:35:56 +00:00
Alexander Alekhin c81d785ada Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-23 19:15:47 +00:00
Alexander Alekhin 6fb46bb34b Merge pull request #17621 from YashasSamaga:cuda4dnn-mish-half 2020-06-23 18:44:50 +00:00
Alexander Alekhin 2e165053ef Merge pull request #17624 from dkurt:dnn_optimize_mish 2020-06-23 18:43:51 +00:00
Alexander Alekhin 8cc8b0d2b4 Merge pull request #17633 from alalek:backport_17616 2020-06-23 18:29:55 +00:00
Pierre-Emmanuel Viel 06b4292534 Fix: error in the dimension used for computeMinMax
Instead of using the current dimension for which we just got a big span,
we were computing Min and Max for the previous dimension stored in cutfeat
(and using 0 instead of the dimension indice for the very first dimension
with "span > (1-eps)max_span")
2020-06-23 15:47:27 +02:00
Pierre-Emmanuel Viel 29f883feee Optim: test that could be done once has been extracted from the loop 2020-06-23 15:43:38 +02:00
Alexander Alekhin 365a10f58c Merge pull request #17634 from dkurt:dnn_ie_cpu_ext_update_master 2020-06-23 12:51:21 +00:00
okamotoR 0e69cddda2 add if block for indexed color images 2020-06-23 21:36:47 +09:00
Dmitry Kurtaev 3bdd7bfbea Remove deprecated Inference Engine CPU extensions 2020-06-23 14:33:22 +03:00
Ilya Lavrenov ad5e70f94e Conditional compilation for network reader
origibal commit: 63e92cccf2
2020-06-23 14:15:52 +03:00
Alexander Alekhin 7fae2e834c Merge pull request #17622 from dkurt:dnn_ie_cpu_ext_update 2020-06-23 11:01:47 +00:00
Dmitry Kurtaev 8e3f5fb209 Remove deprecated Inference Engine CPU extensions 2020-06-23 10:10:29 +03:00
Pierre-Emmanuel Viel 05fbd1e5bc DNA mode: add the distance computations 2020-06-22 22:53:05 +02:00
Dmitry Kurtaev 1491934d17 Optimize Mish for CPU backend 2020-06-22 23:27:47 +03:00
YashasSamaga 6573b9ace0 use fp32 mish for fp16 mish 2020-06-22 19:09:36 +05:30
Alexander Alekhin ee5ff71d55 Merge pull request #17616 from ilya-lavrenov:network-reader 2020-06-22 12:10:34 +00:00
Alexander Alekhin 6e5f0a2a58 Merge pull request #17576 from philippefoubert:branch_ximea 2020-06-22 11:36:40 +00:00
Alexander Alekhin 721fac5542 Merge pull request #17617 from alalek:fix_logger_initialization 2020-06-22 11:33:35 +00:00
Alexander Alekhin fce486c4f9 Merge pull request #17592 from l-bat:disable_nms_in_yolo_layer 2020-06-22 10:31:33 +00:00
Alexander Alekhin 99bc35a883 core(logger): complete initialization of logger structures
- for using of logging functions from global destructors
2020-06-22 09:27:26 +00:00
Ilya Lavrenov 63e92cccf2 Conditional compilation for network reader 2020-06-22 11:45:56 +03:00
Anatoliy Talamanov a74ed58893 Add implementation in case plaidml isn't found 2020-06-22 00:46:41 +03:00
Alexander Alekhin 1b4955342f Merge pull request #17599 from tomoaki0705:fixCUDAFailSafePath 2020-06-21 17:49:14 +00:00
Tomoaki Teshima 95ac650af6 make the fail safe path actually safe
* use only supported CC in the list
  * workaround of #17526
2020-06-21 07:20:47 +09:00
Alexander Alekhin 2b98aa403e Merge pull request #17593 from tomoaki0705:addAmpereCUDA 2020-06-20 22:01:36 +00:00
Alexander Alekhin 5ed65460d1 Merge pull request #17526 from cyyever:fix_cuda_detection 2020-06-20 21:07:05 +00:00
Philippe FOUBERT 0eb7060205 Fix the detection of the XIMEA library (since its location may be different when the version of the ximea software is updated) 2020-06-20 16:47:18 +02:00
Alexander Alekhin 425c653a14 Merge pull request #17580 from sitic:bibfix 2020-06-19 21:35:07 +00:00
Tomoaki Teshima 52844614c4 add Ampere CC
* Ampere has CC 8.0
  * Arm64 server support has been added in CUDA 11 (only V100 for now)
2020-06-19 20:46:18 +09:00
Liubov Batanina 85c0c8c7ed Disabling dafault NMS in yolo layer 2020-06-19 14:34:13 +03:00
Jan Lebert a8f04359e8 docs: linkfix in bibliography
The [current link](https://arxiv.org/pdf/1808.01752) goes to a
random unrelated paper.
2020-06-19 11:44:35 +02:00
Alexander Alekhin e3d502310f Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-19 07:33:50 +00:00
Alexander Alekhin cb54f4c2ec Merge pull request #17587 from tomoaki0705:fixCUDAOptflowJetson 2020-06-19 07:21:19 +00:00
Tomoaki Teshima 77fa1a20bf fix build on Jetson TX1 and TX2
* enable_if_t is a c++14 feature
2020-06-19 07:56:37 +09:00
Alexander Alekhin a7cdc42140 Merge pull request #17581 from tomoaki0705:fixCudaAsync 2020-06-18 20:54:28 +00:00
Alexander Alekhin a8aa9d5ecb Merge pull request #17578 from Bleach665:fix_win_eigen_build 2020-06-18 20:52:33 +00:00
Alexander Alekhin 52fbfb3ec0 Merge pull request #17577 from philippefoubert:branch_color_yuv_simd 2020-06-18 20:51:52 +00:00
Philippe FOUBERT d25293b721 Fix the build of imgproc using MinGW (variables with the same name as symbols defined in MinGW headers) 2020-06-18 20:13:34 +00:00
Tomoaki Teshima c07af090f5 fix build error on Jetson TX1 and TX2
* enable_if_t and is_base_of is c++14 feature
 * override is c++11 feature
2020-06-18 21:25:15 +09:00
Yuriy Obukh 456e88a8a4 fix VS Windows build with eigen. https://github.com/opencv/opencv/issues/17548 2020-06-18 14:31:11 +03:00
Alex Cohn a7cc1159cd Merge pull request #17573 from alexcohn:fix/android_windows_build
* fixing #17572

https://github.com/opencv/opencv/issues/17572 Build for Android failed: "can't concat str to bytes"

on Windows 10 64bit with python 3.6.6

* similar to changes in platforms/winpack_dldt/build_package.py
2020-06-18 10:40:43 +03:00
Alexander Alekhin 6bd87e8146 Merge pull request #17571 from tomoaki0705:fixAutomaticCC 2020-06-18 07:39:14 +00:00
Alexander Alekhin 42a4c3fba6 Merge pull request #17568 from alalek:cleanup_17527 2020-06-18 07:38:16 +00:00
Tomoaki Teshima 1cba763189 fix build error of automatic CC detection 2020-06-17 22:02:51 +09:00
Alexander Alekhin d01cbe9320 cudacodec(build): fix detection in CMake, cleanup duplicate includes 2020-06-17 09:09:40 +00:00
Yashas Samaga B L 9ba5581d17 Merge pull request #17534 from YashasSamaga:cuda4dnn-remove-unused-funcs
cuda4dnn: reduce CUDA version requirements to at least CUDA 9.2

* remove half2 specializations

* do not remove atomicAdd for half in CUDA 10 and below

* remove fp16.hpp
2020-06-17 09:07:52 +00:00
NesQl b10ab79743 Merge pull request #17468 from liqi-c:sharedlib_build_problem
TEngine installation rules fix for static build

* Modify cmake config error for -DBUILD_SHARED_LIBS=OFF

* Modify for not install tengine include directory

* Update compile error.

* move install command to tengine/CMakeLists.txt

* rm include dir when make install,only build static lib will install libtengine.a
2020-06-17 09:05:04 +00:00
Alexander Alekhin 619462b029 Merge pull request #17564 from l-bat:fix_yolov4 2020-06-17 08:45:56 +00:00
Alexander Alekhin 6fdddd53a1 Merge pull request #17555 from komakai:objc-fix-sift 2020-06-17 07:58:35 +00:00
Liubov Batanina d93b6be3cc Changed StridedSlice to VariadicSplit in Region layer 2020-06-17 10:02:53 +03:00
Alexander Alekhin 9755ab160d Merge pull request #17556 from nglee:dev_optFlowTVL1Async 2020-06-16 20:06:56 +00:00
Alexander Alekhin 88a187a737 Merge pull request #17561 from thatoddmailbox:android-fix-disable-samples 2020-06-16 19:53:51 +00:00
Pinaev Danil 57f5700e18 Merge pull request #16772 from aDanPin:dp/performance_render_tests
Added g-api render performance tests

* Add render performance tests for BGROCV

* Add render NV12 performance tests

* Review response

* Review response

* Review response

* Review response

* Review response

* Review response

* Just a small fix

* Final review response I hope)

* Review response

* Review response

* Review response

* Review response

* Review response

* Review response
2020-06-16 19:48:09 +00:00
Namgoo Lee 2043e06102 cuda optflow tvl1 : async safety
also modify cuda canny to use createTextureObjectPitch2D, etc.
2020-06-17 01:04:22 +09:00
Alex Studer d84b213f59 platforms/android: fix --no_samples_build flag not working 2020-06-16 00:11:26 -04:00
Giles Payne 177fbc7bbb Cleanup unneeded raw pointer handling code 2020-06-16 08:15:27 +09:00
Alexander Alekhin c7dcdc0e88 Merge pull request #17557 from alalek:backport_17554 2020-06-15 19:26:11 +00:00
Alexander Alekhin eb67dc9f50 Merge pull request #17533 from alalek:fix_dumpInputArray_nd_case 2020-06-15 18:38:19 +00:00
Ilya Lavrenov 676b818d6a Removed plugin dispatcher
backport of commit 74113737f3
2020-06-15 18:03:14 +00:00
Alexander Alekhin 56373428dc Merge pull request #17554 from ilya-lavrenov:plugin-dispatcher 2020-06-15 18:02:03 +00:00
Namgoo Lee 411ce04f54 CUDA_OptFlow/OpticalFlowDual_TVL1 Asynchronous test 2020-06-16 01:43:51 +09:00
Giles Payne 13962b8533 Use cv::Ptr instead of raw pointers 2020-06-15 23:20:45 +09:00
Giles Payne 04bee3f9b7 Fix testFitEllipse test 2020-06-15 23:16:22 +09:00
Giles Payne 305a245530 Fix framework_name option in build script 2020-06-15 23:15:05 +09:00
Ilya Lavrenov 74113737f3 Removed plugin dispatcher 2020-06-15 16:02:52 +03:00
Alexander Alekhin c244b456f0 Merge pull request #17540 from YashasSamaga:cuda4dnn-update-mish 2020-06-14 11:08:53 +00:00
Alexander Alekhin d321a34f7c Merge pull request #17527 from tomoaki0705:detectCuvidHeader 2020-06-14 11:08:16 +00:00
Alexander Alekhin fb1a58ac76 Merge pull request #17537 from Murazaki:patch-1 2020-06-13 18:36:34 +00:00
YashasSamaga 87ab4ee567 improve mish performance and accuracy 2020-06-13 16:53:27 +05:30
Alexander Alekhin 0cbaaba4b1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-12 22:20:50 +00:00
Alexander Alekhin 1644af841b Merge pull request #17536 from ilya-lavrenov:remove-error-listener 2020-06-12 22:18:04 +00:00
Mehdi Zakaria Benadel b0def9617f Fix typo
This typo just made me lose my mind on the conan package update. please merge.
2020-06-12 23:52:06 +02:00
Alexander Alekhin c2664d912a Merge pull request #17538 from alalek:dnn_openvino_2020.3.0 2020-06-12 21:24:35 +00:00
Ilya Lavrenov 9697e3ac24 Removed error lisneter usage 2020-06-12 20:29:11 +00:00
Alexander Alekhin d2a9efd039 dnn: use OpenVINO 2020.3 defines 2020-06-12 20:24:08 +00:00
Alexander Alekhin 442999dcdb core: fix handling of ND-arrays in dumpInputArray() helpers 2020-06-12 10:23:32 +00:00
Alexander Alekhin d753ae1489 Merge pull request #17143 from cyyever:detect_mkl_installed_by_nuget 2020-06-12 09:44:42 +00:00
cyy db3e3be8ee improve the mkl search procedure 2020-06-12 06:59:27 +00:00
Alexander Alekhin 0c8da03869 Merge pull request #17341 from hunter-college-ossd-spr-2020:3.4-1 2020-06-12 06:58:14 +00:00
Alexander Alekhin 6fbf7042b5 Merge pull request #17528 from YashasSamaga:cuda4dnn-fix-tests43 2020-06-12 06:55:34 +00:00
Jessica Wong 0417c8c9c7 Added information to OpenCV documentation [MacOS]
Added and Edited specific information to the "Installation in MacOS" OpenCV documentation.
Closes #17340
2020-06-11 23:36:06 -04:00
Tomoaki Teshima d4af89781b fix corner case of libnvcuvid
* detect header automatically and not based on version number
2020-06-11 23:06:18 +09:00
YashasSamaga 265acccd56 allow multiple inputs to resize, fix tests 2020-06-11 19:31:48 +05:30
cyy c6638d62e6 respect CUDA_HOST_COMPILER when detecting CUDA arch 2020-06-11 15:57:08 +08:00
Alexander Alekhin a8c1cdf88e Merge pull request #17511 from mshabunin:fix-kw-issues-34 2020-06-10 12:13:06 +00:00
Maksim Shabunin 7a187e9b5e QRDetectMulti: refactored checkPoints method 2020-06-10 13:48:24 +03:00
Maksim Shabunin 9096b1c768 dnn/NGraph: added nullptr checks 2020-06-10 13:48:24 +03:00
Rasmus 781fbde449 Merge pull request #17368 from themightyoarfish:cv2eigen-doc
* Add documentation about usage of cv2eigen functions in eigen.hpp

* Fixed Doxygen syntax.

Co-authored-by: Alexander Smorkalov <smorkalov.a.m@gmail.com>
2020-06-10 07:53:18 +00:00
Alexander Alekhin 55ca0fcc27 Merge pull request #17492 from cyyever:fix_data_race 2020-06-10 07:01:04 +00:00
Gourav Roy 1b336bb602 Merge pull request #16955 from themechanicalcoder:text_recognition
* add text recognition sample

* fix pylint warning

* made changes according to the c++ example

* fix errors

* add text recognition sample

* update text detection sample
2020-06-10 06:53:18 +00:00
Alexander Alekhin 25f3a11a16 Merge pull request #17509 from mshabunin:fix-kw-issues 2020-06-09 11:11:39 +00:00
Alexander Alekhin b1706bc7e5 Merge pull request #17507 from alalek:update_ffmpeg_4.4 2020-06-09 09:31:16 +00:00
Maksim Shabunin 579d74d35b QRDetectMulti: refactored checkPoints method 2020-06-09 11:10:47 +03:00
Maksim Shabunin 7ce518106b dnn/NGraph: added nullptr checks 2020-06-09 11:10:36 +03:00
Alexander Alekhin 0fb3b8db72 Merge pull request #17504 from alalek:update_ffmpeg_3.4 2020-06-09 07:51:59 +00:00
cyy 171cba4947 use C++11 static variables as memory barrier 2020-06-09 15:49:31 +08:00
Alexander Alekhin fd498501d6 ffmpeg/4.4: update FFmpeg wrapper
- FFmpeg 4.2.3
2020-06-09 10:41:08 +03:00
Alexander Alekhin 51bfe74ce1 Merge pull request #17506 from alalek:update_version_4.4.0-pre 2020-06-09 07:39:10 +00:00
Alexander Alekhin 5f3012fc9a pre: OpenCV 4.4.0 (version++) 2020-06-09 02:27:13 +00:00
Alexander Alekhin b44302382d ffmpeg/3.4: update FFmpeg wrapper
- FFmpeg 3.4.7
2020-06-08 21:03:05 +00:00
Alexander Alekhin 0f3c82e73b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-08 19:50:55 +00:00
Alexander Alekhin 458f1d5ebe Merge pull request #17501 from alalek:update_version_3.4.11-pre 2020-06-08 19:35:34 +00:00
Alexander Alekhin a43e3bebe6 pre: OpenCV 3.4.11 (version++) 2020-06-08 18:46:27 +00:00
Alexander Alekhin f62fe956d1 Merge pull request #17498 from alalek:update_tbb 2020-06-08 18:38:57 +00:00
Giles Payne 02385472b6 Merge pull request #17165 from komakai:objc-binding
Objc binding

* Initial work on Objective-C wrapper

* Objective-C generator script; update manually generated wrappers

* Add Mat tests

* Core Tests

* Imgproc wrapper generation and tests

* Fixes for Imgcodecs wrapper

* Miscellaneous fixes. Swift build support

* Objective-C wrapper build/install

* Add Swift wrappers for videoio/objdetect/feature2d

* Framework build;iOS support

* Fix toArray functions;Use enum types whenever possible

* Use enum types where possible;prepare test build

* Update test

* Add test runner scripts for iOS and macOS

* Add test scripts and samples

* Build fixes

* Fix build (cmake 3.17.x compatibility)

* Fix warnings

* Fix enum name conflicting handling

* Add support for document generation with Jazzy

* Swift/Native fast accessor functions

* Add Objective-C wrapper for calib3d, dnn, ml, photo and video modules

* Remove IntOut/FloatOut/DoubleOut classes

* Fix iOS default test platform value

* Fix samples

* Revert default framework name to opencv2

* Add converter util functions

* Fix failing test

* Fix whitespace

* Add handling for deprecated methods;fix warnings;define __OPENCV_BUILD

* Suppress cmake warnings

* Reduce severity of "jazzy not found" log message

* Fix incorrect #include of compatibility header in ios.h

* Use explicit returns in subscript/get implementation

* Reduce minimum required cmake version to 3.15 for Objective-C/Swift binding
2020-06-08 18:32:53 +00:00
Alexander Alekhin f30b5995b6 Merge pull request #17497 from alalek:fix_ffmpeg_wrapper_build 2020-06-08 18:07:08 +00:00
Alexander Alekhin 852b0226e0 3rdparty: update TBB 2020.1 => 2020.2
https://github.com/oneapi-src/oneTBB/releases/tag/v2020.2
2020-06-08 11:04:33 +00:00
Alexander Alekhin 89a6937c00 videoio: fix plugins build 2020-06-08 09:17:13 +00:00
Alexander Alekhin 08a3eef62a Merge pull request #17485 from sitic:stitching 2020-06-06 19:37:11 +00:00
Alexander Alekhin 434014b05e Merge pull request #17471 from asmorkalov:as/video_capability_check 2020-06-05 19:54:41 +00:00
Maksim Shabunin 29ff1129fb Merge pull request #17431 from mshabunin:support-vtk9
* Added VTK 9 support
2020-06-05 17:55:53 +00:00
Jan Lebert 5906b49bd1 Fix '--help' of stitching_detailed.py sample
Fixes the help for `--features`, previously listed all possible values as default value.

Also adds the default value to the help for two other arguments
2020-06-05 19:37:02 +02:00
Alexander Alekhin b03ed532cf Merge pull request #17474 from komakai:ndk-side-by-side 2020-06-05 10:37:48 +00:00
Alexander Alekhin 7d30e19b3e Merge pull request #17350 from AsyaPronina:gapi_ocv_stateful_kernel
Enable stateful kernels in G-API OCV Backend
2020-06-05 00:51:22 +03:00
AsyaPronina b083c20eb2 Enable stateful kernels in G-API OCV Backend 2020-06-04 22:14:42 +03:00
Alexander Alekhin 7722a2b8a8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-06-04 17:58:34 +00:00
Alexander Alekhin ef3844a177 Merge pull request #17466 from alalek:build_opencv_winpack_dldt_2020.3.0 2020-06-04 17:32:09 +00:00
Alexander Alekhin 476aa443c6 Merge pull request #17432 from tomoaki0705:automaticCC 2020-06-04 17:10:04 +00:00
Fernando Martin cb0f74ab9f Merge pull request #17473 from f3rm4rf3r:fixingFourCCDocBrokenLink
* - Fixing broken URL to mp4ra website

* - Fixing broken URL to mp4ra website (in C videoio API)
2020-06-04 17:07:54 +00:00
Giles Payne 977e5afbac Add handling for Android "NDK (Side by side)" 2020-06-04 21:13:11 +09:00
Alexander Alekhin 08d1c54364 Merge pull request #17469 from l-bat:fix_virtual_try_on 2020-06-04 10:32:30 +00:00
Alexander Alekhin dbbfa003d3 Merge pull request #17455 from mshabunin:check-count-non-zero 2020-06-04 08:47:43 +00:00
Alexander Smorkalov a17d1843fb Skip some GAPI tests if VideoCapture is not capable to playback video. 2020-06-04 09:59:09 +03:00
Liubov Batanina 5ffc5bca7c Fixed virtual try on sample 2020-06-04 09:41:24 +03:00
Alexander Alekhin 11ac2e1475 build: winpack_dldt with dldt 2020.3.0
https://github.com/openvinotoolkit/openvino/releases/tag/2020.3.0
2020-06-04 01:21:16 +00:00
Maksim Shabunin 59608907b8 Added countNonZero test for big arrays and disable IPP for some cases 2020-06-03 18:58:41 +03:00
Alexander Alekhin e454c4891e Merge pull request #17369 from themightyoarfish:doc-essential-matrix-different-cameras 2020-06-03 12:55:55 +00:00
Alexander Alekhin 3ed243abde Merge pull request #17430 from alalek:issue_17257 2020-06-02 12:42:04 +00:00
Alexander Alekhin d60524ecfa Merge pull request #17447 from alalek:dnn_ie_extract_layers 2020-06-02 12:40:06 +00:00
Rasmus Diederichsen 345e071b24 Add instructions for how to use findEssentialMat() when camera matrices are different 2020-06-02 12:19:49 +03:00
Alexander Alekhin be1a121d0d dnn(ie): fix layers extraction 2020-06-01 21:57:39 +00:00
Tomoaki Teshima 156406b56c select the architecture based on nvcc result
* cache the result
  * DRY
  * brush up based on review
2020-06-02 05:07:53 +09:00
Alexander Alekhin f68654a204 Merge pull request #17438 from alalek:fix_eigen_builds 2020-06-01 18:02:07 +00:00
Vadim Pisarevsky 8abb312c20 Merge pull request #17417 from vpisarev:fix_fitellipse
* improved fitEllipse and fitEllipseDirect accuracy in singular or close-to-singular cases (see issue #9923)

* scale points using double precision

* added normalization to fitEllipseAMS as well; fixed Java test case by raising the tolerance (it's unclear what is the correct result in this case).

* improved point perturbation a bit. make the code a little bit more clear

* trying to fix Java fitEllipseTest by slightly raising the tolerance threshold

* synchronized C++ version of Java's fitEllipse test

* removed trailing whitespaces
2020-06-01 18:01:20 +00:00
Alexander Alekhin adcb943f61 Merge pull request #17424 from berak:dnn_sample_human_parsing 2020-06-01 17:58:13 +00:00
Vadim Pisarevsky 5489735258 Merge pull request #17436 from vpisarev:fix_python_io
* fixed #17044
1. fixed Python part of the tutorial about using OpenCV XML-YAML-JSON I/O functionality from C++ and Python.
2. added startWriteStruct() and endWriteStruct() methods to FileStorage
3. modifed FileStorage::write() methods to make them work well inside sequences, not only mappings.

* try to fix the doc builder

* added Python regression test for FileStorage I/O API ([TODO] iterating through long sequences can be very slow)

* fixed yaml testing
2020-06-01 11:33:09 +00:00
Alexander Alekhin 8de176988d Merge pull request #17439 from alalek:fix_dnn_test_required_file 2020-05-31 19:51:56 +00:00
Alexander Alekhin 79c5d07abe dnn(test): file 'dnn/efficientdet-d0.pb' is optional 2020-05-31 16:18:37 +00:00
Alexander Alekhin 74020a084b core: fix builds with eigen helper header 2020-05-31 15:41:42 +00:00
berak 09acd478f1 dnn: add a human parsing cpp sample 2020-05-31 09:50:20 +02:00
Alexander Alekhin e6c9e2fa50 Merge pull request #17420 from nosajthenitram:fix_cascadedetect_convert_bug_for_old_cascade 2020-05-30 17:34:20 +00:00
Meng Wang ab2c59b80e Merge pull request #17403 from wangmengHB:master
Fix Test Case: in latest version, window.cv is a promise instance that makes most test case failed.

* Fix Browser Test Case: In latest version, window.cv is a promise instance

In latest version of opencv.js, window.cv is promise instance.
So that most of the test cases is run failed.
This commit is to fix browser test case.

* Add comment for backward compatible

Add comments for backward compatible
2020-05-30 17:33:17 +00:00
Jason Martin a5209c4882 Fixed cascadedetect convert from old cascade to new 2020-05-30 11:45:24 -05:00
Alexander Alekhin f1dd5e49c5 videoio(ffmpeg): fix handling of AVERROR_EOF
decoder should be properly flushed after that
2020-05-29 19:52:26 +00:00
Alexander Alekhin c6b60e219d Merge pull request #17428 from asmorkalov:as/java_smart_constructors 2020-05-29 18:38:34 +00:00
Alexander Alekhin 740f6628ec Merge pull request #17419 from YourButterfly:fix_divide_zero_in_darknet_3_4 2020-05-29 17:32:48 +00:00
Alexander Smorkalov 821fac187c Generate constructor with smart pointer, if it's expected. 2020-05-29 16:40:19 +03:00
Alexander Alekhin 73fdf75328 Merge pull request #17338 from hunter-college-ossd-spr-2020:contours-toc 2020-05-29 10:40:43 +00:00
YourButterfly f7daa9e4f5 chk divide 0 2020-05-29 09:54:46 +08:00
Alexander Alekhin c3e8a82c9c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-28 23:53:54 +00:00
Liubov Batanina d3aaf2d3a3 Merge pull request #17371 from l-bat:nms_model
* Fix NMS bug in DetectionModel

* Fixed comments

* Refactoring
2020-05-28 22:54:19 +00:00
Alexander Alekhin e58e545584 Merge pull request #17392 from alalek:dnn_test_yolov4 2020-05-28 22:52:21 +00:00
Alexander Alekhin 319db07b6b Merge pull request #17384 from dkurt:efficientdet 2020-05-28 22:48:52 +00:00
Alexander Alekhin 407cc5f1b6 Merge pull request #17416 from vpisarev:fix_fillpoly 2020-05-28 21:37:15 +00:00
Vadim Pisarevsky 80037dc6de fixed fillPoly, the overloaded variant with InputArrayOfArrays parameter (single or multiple polygons) 2020-05-28 21:36:28 +03:00
Dmitry Kurtaev d9bada9867 dnn: EfficientDet 2020-05-28 17:23:42 +03:00
Alexander Alekhin 6b89154afd dnn(test): add YOLOv4 tests 2020-05-28 13:27:40 +00:00
Alexander Alekhin 1f2d4e4839 Merge pull request #17410 from asmorkalov:as/formulae_command_typo 2020-05-28 11:45:19 +00:00
Alexander Smorkalov 4a9904fe62 Command name typo fix for formulas in documentation. 2020-05-28 13:59:31 +03:00
Alexander Alekhin 4b5fdc6bb2 Merge pull request #17406 from mshabunin:fix-msmf-audio-handling 2020-05-27 19:20:39 +00:00
Maksim Shabunin 2d11edd103 videoio/MSMF: fixed audio stream handling 2020-05-27 17:57:18 +03:00
Alexander Alekhin 515a06cedf Merge pull request #17359 from YashasSamaga:cuda4dnn-fix-default-stream-wrappers 2020-05-27 11:28:09 +00:00
Ningxin Hu fef6192bca Merge pull request #17394 from huningxin:fix_segmentation_py
* Fix window title of python segmentation example

* Fix float text position of python segmentation examples
2020-05-27 11:20:07 +03:00
Alexander Alekhin 7d9e1be588 Merge pull request #17388 from alalek:dnn_update_network_dump 2020-05-27 07:55:32 +00:00
Liubov Batanina ba3cf47600 Merge pull request #17386 from l-bat:tf_clamp_subgraph
* Added ClipByValue subgraph

* Return const nodes
2020-05-26 19:01:47 +00:00
Alexander Alekhin 9e09828cc3 Merge pull request #17390 from l-bat:fix_ngraph_multiply 2020-05-26 16:33:12 +00:00
Liubov Batanina b236f10792 Switch ngraph::op::v1::Multiply to v0 2020-05-26 16:59:50 +03:00
Alexander Alekhin f0bef94a03 dnn: update network dump code, include ngraph serialization 2020-05-26 12:49:22 +00:00
Alexander Alekhin 9f177b2bcd Merge pull request #17377 from jtojnar:patch-1 2020-05-26 09:52:13 +00:00
Jan Tojnar 765f333a1d pkg-config: Drop broken include path
The legacy `includedir` was removed in 4.0 (https://github.com/opencv/opencv/pull/12477) but it was not removed from the `.pc` file.

This causes issues when trying to link against OpenCV using pkg-config in CMake.
2020-05-25 22:33:34 +02:00
Egor Pugin 1bec7ca540 Merge pull request #17352 from egorpugin:patch-2
* Fix integer overflow in parseOption().

Previous code does not work for values like 100000MB.

* Fix warning during 32-bit build on inactive code path.

* fix build without C++11
2020-05-25 20:25:18 +00:00
Alexander Alekhin 29bbbaa0a7 Merge pull request #17376 from alalek:dnn_fix_build 2020-05-25 19:59:58 +00:00
shijiayuan 4e97c69792 Merge pull request #17275 from shijiayuan:fixbug
* fix bug for CHECK issue

* remove chack for bpp

* add test for tif file

* add test for tiff file

* change the test name

* use proper bpp value, use clear test names
2020-05-25 18:49:37 +00:00
Alexander Alekhin 88d8a48b09 Merge pull request #17374 from alalek:dnn_fix_build 2020-05-25 18:46:15 +00:00
Alexander Alekhin 73aa5f567b dnn: *_DENORMALS_ZERO_MODE is defined for SSE3 2020-05-25 17:55:36 +00:00
Liubov Batanina d5e8792f55 Merge pull request #17332 from l-bat:fix_nms
Fixed NMSBoxes bug

* Added NMS for each class

* Updated cpp sample

* Fixed errors

* Refactoring

* Added NMS for IE
2020-05-25 12:34:11 +00:00
Alexander Alekhin 6202556fc0 Merge pull request #17367 from anton-potapov:ap/fluid_fix_uninit_members 2020-05-25 11:00:13 +00:00
Anton Potapov be9f3826d7 GAPI: fix uninitialized variables in Fluid 2020-05-25 11:59:28 +03:00
Michal W. Tarnowski 7f453ade73 Merge pull request #17361 from mwtarnowski:fix-documentation-gapi-imgproc-blur
* fix documentation for cv::gapi::blur

* remove dst parameter and move ksize parameter to its correct position
2020-05-24 22:48:44 +00:00
Michal W. Tarnowski 5393185add Merge pull request #17360 from mwtarnowski:fix-documentation-imgproc-blur
* fix documentation for cv::blur

* correct the position of ksize parameter
2020-05-24 22:46:41 +00:00
YashasSamaga b3a261c7ce set stream at the site of creation 2020-05-24 19:01:17 +05:30
Josh Bradley 9fef09fe89 Merge pull request #17320 from jgbradley1:add-eigen-tensor-conversions
* add eigen tensor conversion functions

* add eigen tensor conversion tests

* add support for column major order

* update eigen tensor tests

* fix coding style and add conditional compilation

* fix conditional compilation checks

* remove whitespace

* rearrange functions for easier reading

* reformat function documentation and add tensormap unit test

* cleanup documentation of unit test

* remove condition duplication

* check Eigen major version, not minor version

* restrict to Eigen v3.3.0+

* add documentation note and add type checking to cv2eigen_tensormap()
2020-05-23 18:25:01 +00:00
Alexander Alekhin 6b0fff72d9 Merge pull request #17349 from YashasSamaga:cuda4dnn-general-fixes 2020-05-23 18:18:55 +00:00
Alexander Alekhin 21e28adb87 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-22 19:50:14 +00:00
Alexander Alekhin a9b030591b Merge pull request #17295 from dkurt:dnn_fusion_ftz 2020-05-22 18:49:43 +00:00
YashasSamaga 57ca10636c do not create redundant handles 2020-05-22 19:52:20 +05:30
Alexander Alekhin d4a9c731ff Merge pull request #17345 from alalek:build_fix_mac_warnings 2020-05-22 10:50:41 +00:00
Alexander Alekhin 17d15df6cd Merge pull request #17343 from hunter-college-ossd-spr-2020:mac-install 2020-05-22 08:12:10 +00:00
Alexander Alekhin 98611adeb9 build: fix warnings about TARGET_OS_MACCATALYST 2020-05-21 20:41:47 +00:00
Alexander Alekhin 01a8c9ca8d Merge pull request #17331 from allnes:update_quirc 2020-05-21 20:15:55 +00:00
Boubacar 0940c56a3f add note on cmake brew install 2020-05-21 10:34:17 -04:00
Alexander Alekhin d650b5cc5a Merge pull request #17339 from hunter-college-ossd-spr-2020:pylint-note 2020-05-21 13:53:29 +00:00
Alexander Alekhin e96a58f091 Merge pull request #17191 from anton-potapov:gapi_variant_converting_ctor_assign_op_reworked 2020-05-21 12:59:31 +00:00
Boubacar b624da27bd add pylint install note 2020-05-21 07:55:11 -04:00
Boubacar 5b443199ca group contour articles together 2020-05-21 07:16:54 -04:00
Alexander Alekhin cb82388a84 Merge pull request #17325 from hunter-college-ossd-spr-2020:nav-links 2020-05-20 18:14:27 +00:00
Nesterov Alexander 735c31bb4a Resolve type conflict 2020-05-20 18:05:27 +03:00
Nesterov Alexander b7253e3280 Update version quirc 2020-05-20 17:55:14 +03:00
Anton Potapov e02318d384 GAPI: utils - variant converting ctor and assignment op. reworked
- reworked variant::operator(T&&) and varaint::variant(T&&) to be more
concise and signature accurate with C++17 specification
- restricted cv::detail::OpaqueRef::OpaqueRef(T&&) to not substitute
copy/move ctors
- moved common additions to C++11 version of std <type_traits> to
separte header
2020-05-20 14:34:55 +03:00
Daniel Mallia 94d187e269 Add next and previous navigation links to all tutorials 2020-05-19 18:59:28 -04:00
Liubov Batanina d991c22090 Merge pull request #16575 from l-bat:flownet2
Support FlowNet2 model

* Support DataAugmentation layer

* Fix warnings

* Fix comments

* Support Correlation layer

* TEST

* Support Correlation layer

* Supported Accum and FlowWarp layers

* Supported ChannelNorm layer

* Supported Resample with inputs.size() > 1

* Fixed comments

* Refactoring

* Added tests

* Add resample test

* Added asserts in resize layer

* Updated DataAugmentation layer

* Update convolution layer

* Refactoring

* Fix data augmentation layer

* Fix caffe importer

* Fix resize

* Switch to Mat ptr

* Remove useless resize type

* Used ResizeLayer in Accum

* Split ChannelNormLayer

* Delete duplicate assert

* Add sample

* Fix sample

* Added colormap
2020-05-19 12:29:50 +00:00
Alexander Alekhin 9039284d96 Merge pull request #17317 from Yosshi999:prevent-build-failure-without-flann 2020-05-19 08:30:54 +00:00
Alexander Alekhin 593af7287b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-18 17:50:16 +00:00
Alexander Alekhin 322960f795 Merge pull request #17297 from dkurt:dnn_yolov3_ocl 2020-05-18 17:47:16 +00:00
Dmitry Kurtaev b5035ce991 Increase test threshold for YOLOv3 on OCL FP16 2020-05-18 19:06:15 +03:00
dmallia17 07c56f149f Merge pull request #17313 from hunter-college-ossd-spr-2020:revise-knn-tutorials
* Revise and expand kNN Python tutorials

* Correct NPTEL link
2020-05-18 15:53:17 +00:00
Yosshi999 c0f435349a ignore tests dependent on flann when flann module is absent 2020-05-18 15:30:32 +00:00
Alexander Alekhin 0e1c7eda39 Merge pull request #17092 from alalek:imgproc_ipp_parallel_gaussuanBlur 2020-05-18 11:51:59 +00:00
Alexander Alekhin 2b2bcc9b38 Merge pull request #17304 from chrisballinger:maccatalyst 2020-05-17 20:33:05 +00:00
Alexander Alekhin a3b109eca0 imgproc: enable GaussianBlur IPP parallel processing 2020-05-17 11:40:34 +00:00
Alexander Alekhin a1b09a3734 imgproc(perf): add GaussianBlur cases for SIFT 2020-05-17 10:15:31 +00:00
Chris Ballinger d81ac52ce2 Remove linking against AssetsLibrary framework 2020-05-16 12:47:50 -07:00
Chris Ballinger 220df8252d Add target conditionals for Mac Catalyst 2020-05-16 12:47:50 -07:00
Alexander Alekhin de720ac34a Merge pull request #17294 from alalek:issue_17247 2020-05-16 18:49:22 +00:00
Dmitry Kurtaev 68d59a2913 Flush to zero Convolution denormal weights 2020-05-15 23:44:34 +03:00
Alexander Alekhin 5ecf5f106a Merge pull request #17296 from mshabunin:fix-vulkan-build 2020-05-15 16:51:29 +00:00
Alexander Alekhin 753e417dec Merge pull request #17299 from tweenietomatoes:patch-1 2020-05-15 15:48:46 +00:00
tweenietomatoes 7d1094b7e1 Important single character fix 2020-05-15 14:41:55 +03:00
jumostedu 5b095dfcb6 Merge pull request #15214 from jumostedu:matchtemplmask
* imgproc: templmatch: Add support for mask for all methods

Add support for masked template matching. Fix/scrub old implementation
for masked matching, as it did partly not even really do a meaningful
masking, and only supported limited template matching methods.

Add documentation including formulas for masked matching.

* imgproc: test: Add tests for masked template matching

Test accuracy by comparing to naive implementation for one point.
Test compatibility/correctness by comparing results without mask and
with all ones mask.
All tests are done for all methods, all supported depths, and for 1 and
3 channels.

* imgproc: test: templmatch: Add test for crossCorr

Add a test for the crossCorr function in templmatch.cpp. crossCorr() had
to be added to exported functions to be testable.

This test can maybe help to identify the problem with template matching
on MacOSX.

* fix: Fixed wrong evaluations of the MatExpr on Clang

* fix: removed crossCorr from public interface.

If it should be exported, it should be done as separate PR.

Co-authored-by: Vadim Levin <vadim.levin@xperience.ai>
2020-05-14 22:46:25 +00:00
Maksim Shabunin 7c41b54e3d Fixed build with latest Vulkan headers 2020-05-14 23:20:28 +03:00
Alexander Alekhin 58426c80a3 samples: fix OpenCL events leaks 2020-05-14 17:15:09 +00:00
Ganesh Kathiresan cddd7f10d5 Merge pull request #17224 from ganesh-k13:bugfix/calib3d/17201
* Fixed indexing in prefilter

* Initialised prefilter

* Initialised prefilter with value initialisation

* Added TC to trigger different Mem Allocs in BufferBM

* Optimize cases with only needed conditions
2020-05-14 16:30:01 +00:00
Alexander Alekhin ea3c2307dc Merge pull request #17248 from nroduit:java-addall 2020-05-14 12:17:51 +00:00
Alexander Alekhin 65b3209441 Merge pull request #17055 from vnikoofard:patch-1 2020-05-14 12:17:26 +00:00
Nicolas Roduit 400a781ebf Prefer addall instead of iteration for performance 2020-05-14 11:42:24 +03:00
Alexander Alekhin c8689d9d0a Merge pull request #17288 from dkurt:dnn_tf_resize_down 2020-05-14 07:08:41 +00:00
Alexander Alekhin ea0d1424d8 Merge pull request #17287 from tomoaki0705:fixAkazeTestFailureMali 2020-05-14 06:59:28 +00:00
Alexander Alekhin 365f44b094 Merge pull request #17285 from sauhaardac:patch-1 2020-05-14 06:58:42 +00:00
Alexander Alekhin bcf96d637e Merge pull request #17284 from dkurt:dnn_bn_fusion 2020-05-14 06:57:36 +00:00
Alexander Alekhin 6ced54a892 Merge pull request #17281 from l-bat:ssd_placeholder_shape 2020-05-14 06:55:52 +00:00
Alexander Alekhin 486de65067 Merge pull request #17268 from anton-potapov:deownification_fix 2020-05-14 06:55:08 +00:00
Liubov Batanina c5a2d28367 Determine SSD input shape 2020-05-14 08:16:45 +03:00
Dmitry Kurtaev b4a6aa335d TensorFlow bilinear resize downscale 2020-05-13 23:59:20 +03:00
Tomoaki Teshima 35245cb76e fix test failure on Mali T760 and Mali T628 2020-05-14 05:44:14 +09:00
Sauhaarda Chowdhuri fa349b7a4e Fix #17279 Documentation Error
Update documentation to solve #17279. Simple documentation bug.
2020-05-13 13:14:05 -07:00
Dmitry Kurtaev df305e83fa Fix BatchNorm reinitialization after fusion 2020-05-13 22:15:36 +03:00
Alexander Alekhin b2464e3379 Merge pull request #17270 from l-bat:ngraph_missed_data 2020-05-13 08:27:04 +00:00
Alexander Alekhin 06bff34a6b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-12 19:24:28 +00:00
Alexander Alekhin 6856cc7253 Merge pull request #17228 from mshabunin:mfx-surface-pool-34 2020-05-12 19:00:49 +00:00
Alexander Alekhin 508bd3f55d Merge pull request #17260 from jsxyhelu:add_deepgreen_colormap 2020-05-12 18:58:54 +00:00
Alexander Alekhin 8b51e2df8b Merge pull request #17211 from alalek:sift_dispatch 2020-05-12 18:53:35 +00:00
Alexander Alekhin bd1b252de9 Merge pull request #17196 from alalek:core_matexpr_fix_warning 2020-05-12 18:50:58 +00:00
Alexander Alekhin 77ddfa2fc9 Merge pull request #17215 from spmallick:master 2020-05-12 16:52:27 +00:00
Maksim Shabunin f30931848e CAP_MFX: surface pool with timeout, more parameters 2020-05-12 18:43:04 +03:00
Liubov Batanina b27ae9c63b Switch v1::Multiply to v0::Multiply 2020-05-12 16:05:03 +03:00
Liubov Batanina 79f8b7fd73 Merge pull request #17233 from l-bat:onnx_bn
* Added ONNX BatchNorm subgraph

* Move removing constant inputs to addConstantNodesForInitializers

* Added initializers to ONNXGraphWrapper
2020-05-12 15:33:57 +03:00
jsxyhelu 48e9e651a4 add DeepGreen colormap 2020-05-12 15:24:32 +03:00
Anton Potapov 7386d8523b G-API: "deownification" corrections
- moved "standalone" aliases of cv types to "opencv_includes.hpp" to
keep responsibility principle aplied
- introduced correct aliasing for "descr_of(Mat)" function for
standalone case
 - added missing include in `gapi/own/mat.hpp`
2020-05-12 14:28:32 +03:00
Alexander Alekhin 1bf353b876 Merge pull request #17230 from asmorkalov:as/issue_17171 2020-05-12 10:53:23 +00:00
Alexander Alekhin 23e336ee53 Merge pull request #17244 from hunter-college-ossd-spr-2020:toc-updates 2020-05-12 07:35:14 +00:00
Alexander Alekhin ac54bb193c Merge pull request #17256 from R-penguins:jstutfix 2020-05-12 07:34:00 +00:00
Alexander Alekhin 713577b257 Merge pull request #17258 from YashasSamaga:cuda4dnn-hotfix-slice-pr17231-pr17222 2020-05-11 19:25:50 +00:00
Alexander Alekhin 583f4b9633 Merge pull request #17253 from YashasSamaga:cuda4dnn-region-yolov4 2020-05-11 19:23:55 +00:00
YashasSamaga 45a6386e45 port pr17222 changes to CUDA backend 2020-05-11 11:01:01 +05:30
Rui Hou e9058ea8f5 Easier access to opencv.js in tutorial 2020-05-10 11:20:27 -04:00
YashasSamaga 3c35b563d7 add scale_x_y parameter to region 2020-05-10 16:53:28 +05:30
Alexander Alekhin fd06139c20 Merge pull request #17235 from R-penguins:patch-1 2020-05-10 08:16:34 +00:00
R-penguins b43da8aa5d Update Image Watch Tutorial
Updated the Windows Visual Studio Image Watch tutorial to include download links to the latest versions of Visual Studio Image Watch for newer Visual Studio versions.
2020-05-09 23:24:47 -04:00
Alexander Alekhin 066259b656 Merge pull request #17118 from l-bat/concat_3d
Added NDHWC Concat support for TensorFlow

* Supported TF concat 3d

* Skip myriad

* Fix test
2020-05-09 22:24:06 +03:00
Yashas Samaga B L d981d04c76 Merge pull request #17200 from YashasSamaga:cuda4dnn-general-opt1
cuda4dnn: optimizations for swish, mish, sigmoid, region, resize based ops, transpose, identity-conv fusion

* bunch of optimizations

* more accurate implementation for mish
2020-05-09 17:20:30 +00:00
Alexander Alekhin 666be238d8 Merge pull request #17229 from smirnov-alexey:as/fix_fluid_resize 2020-05-08 18:59:41 +00:00
Alexander Alekhin 64f5471b2a Merge pull request #17208 from hn-88:3.4 2020-05-08 18:31:11 +00:00
Daniel Mallia 4e789635c9 Update tutorials tables of content for several modules 2020-05-08 14:22:30 -04:00
Alexander Smorkalov 7c17695be4 Added Java and C++ regression test for estimateNewCameraMatrixForUndistortRectify. 2020-05-08 13:04:25 +03:00
Smirnov Alexey 3e3d4ad797 Fix fluid resize operating with zero output size 2020-05-07 12:24:57 +03:00
Alexander Alekhin 73bbabcd04 Merge pull request #17223 from hunter-college-ossd-spr-2020:imgproc-toc 2020-05-07 08:44:02 +00:00
Alexander Alekhin 93d79d2e5d Merge pull request #17219 from hunter-college-ossd-spr-2020:mathjax-link 2020-05-07 08:43:16 +00:00
Alexander Alekhin 1889d72889 Merge pull request #17218 from hunter-college-ossd-spr-2020:numpy-links-17212 2020-05-07 08:42:50 +00:00
Satya Mallick 6e5437a582 Adding Official OpenCV Courses link to README.md 2020-05-06 16:32:08 -07:00
Alexander Alekhin 09799402f9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-06 19:53:51 +00:00
Alexander Alekhin 5813d2439c Merge pull request #17222 from dkurt:dnn_flexible_slice 2020-05-06 19:46:34 +00:00
Alexander Alekhin 4f1ba5e69e Merge pull request #16941 from rngtna:examples_dnn_text_decoder 2020-05-06 22:45:05 +03:00
Daniel Mallia c934d9c3cc Update imgproc tutorials table of content Languages fields 2020-05-06 13:07:24 -04:00
Aleksandr Pertovskiy 00b19d6fba Add text recognition example 2020-05-06 15:26:17 +03:00
Dmitry Kurtaev 8b13b85c5e dnn: Slice with variable input shapes 2020-05-05 13:35:17 +03:00
Daniel Mallia 64b0757758 Update Supported formula commands - MathJax link 2020-05-04 23:50:22 -04:00
Daniel Mallia 1622e7cc90 Update NumPy links 2020-05-04 23:20:52 -04:00
Alexander Alekhin 1f9713195b features2d(sift): enable runtime dispatching 2020-05-03 11:59:27 +00:00
hn-88 ea04f9d12e to make OpenCV compile on mingw32
added #define NO_DSHOW_STRSAFE
2020-05-03 11:19:04 +05:30
Alexander Alekhin 74e4cfd1da core(MatExpr): fix warning in case of e.s == (0, 0, 0, 0) 2020-05-01 07:29:57 +00:00
Alexander Alekhin 27ee6501eb Merge pull request #17188 from asmorkalov:as/fisheye_test 2020-04-30 13:55:31 +00:00
Liubov Batanina a5696da9ec Merge pull request #17185 from l-bat:yolo_v4
* Support Yolov4

* Skip Mish on OpenVINO 2020.2

* Revert Mish

* Refactoring
2020-04-30 16:53:44 +03:00
Alexander Alekhin 0b439bcd08 Merge pull request #17190 from alalek:dnn_test_win32_skip_list 2020-04-29 20:53:54 +00:00
Alexander Alekhin b805115c1a dnn(test): update skip tests on Win32 configuration 2020-04-29 20:02:13 +00:00
Alexander Smorkalov c41fb45da3 Restored test disabled during 3.0-alpha preparation. 2020-04-29 17:08:51 +03:00
QIU Xiaochen cdfa58dde0 Merge pull request #17180 from PetWorm:3.4
* fix Scharr nomination
2020-04-29 09:55:59 +00:00
Alexander Alekhin c722625f28 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-28 16:53:19 +00:00
Alexander Alekhin 6630eac813 Merge pull request #17173 from tomoaki0705:fixOclHogDetect 2020-04-28 16:36:14 +00:00
Tomoaki Teshima 63f5f93063 fix test failure on ODROID-N2 2020-04-28 21:46:31 +09:00
Alexander Alekhin 1d30a524fa Merge pull request #17145 from asmorkalov:as/riscv 2020-04-28 10:41:41 +00:00
Vadim Levin 7f90f04df2 Merge pull request #16766 from VadimLevin:dev/vlevin/video_writer_params_constructor
* feature: Extend VideoWriter to accept vector of parameters

 - Add additional constructor and `open` method for `VideoWriter`
   those accept a vector of parameters
 - Move actual implementation of the `VideoWriter::open` to general method
   which accepts vector of parameters
 - Propagate parsed parameters map up to actual video backend construction

* fix: Change VideoWriter constructor description to suppress doc warning

* refactor: Rollback newlines changes

* feature: Changed VideoWriter parameters workflow

* feature: Log unused parameters in VideoWriter open

* doc: Fix VideoWriter `isColor` parameter description

* fix: int to bool VC++ conversion warning

* doc: Remove information about `isColor` flag usage.
2020-04-28 08:38:39 +00:00
Alexander Alekhin 5da4bb7e88 Merge pull request #16983 from dkurt:dnn_tf_prelu 2020-04-28 08:37:46 +00:00
Alexander Alekhin dc1b1f2cd7 Merge pull request #16914 from jackson0223:patch-1 2020-04-28 08:36:51 +00:00
Dmitry Kurtaev 25ec4ce6f1 PReLU from Tensorflow 2020-04-28 00:01:21 +03:00
jackson0223 d30bc0a4c0 Restore face detection train.prototxt from #9516 2020-04-27 23:07:33 +03:00
Alexander Alekhin c05ac8729e features2d: keep history of simd.cpp 2020-04-27 18:19:14 +00:00
Alexander Alekhin 9926a93a78 features2d: copy sift.dispatch.cpp 2020-04-27 18:18:16 +00:00
Alexander Alekhin 7093752cb5 features2d: copy sift.simd.hpp 2020-04-27 18:17:15 +00:00
Alexander Alekhin 0daf055fe6 Merge pull request #17159 from pauljurczak:patch-3 2020-04-27 12:43:32 +00:00
Alexander Alekhin 3f38edfd61 Merge pull request #17161 from alalek:cmake_protobuf_fix 2020-04-27 12:24:37 +00:00
Alexander Alekhin ee201f4df5 Merge pull request #17157 from alalek:issue_17138 2020-04-27 12:23:44 +00:00
Alexander Smorkalov 7228d2a824 Added initial version of cmake toolchain for RISC-V architecture. 2020-04-27 12:42:38 +03:00
Alexander Alekhin 9181ecfc7b cmake: fix protobuf handling 2020-04-27 02:11:19 +00:00
Liubov Batanina 4bf94cb5d1 Fix test 2020-04-26 20:42:11 +03:00
Paul Jurczak 599a3026d1 Added to Camera constructor parameter description 2020-04-26 00:17:39 -06:00
Alexander Alekhin 288fa70ed9 dnn(protobuf): backport AllowUnknownField(), SetRecursionLimit()
- limit recursion in SkipField*() calls
2020-04-25 20:45:43 +00:00
Alexander Alekhin 152e6476d9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-24 19:02:39 +00:00
Alexander Alekhin 8d05dab32c Merge pull request #17119 from alalek:move_sift 2020-04-24 18:15:15 +00:00
Alexander Alekhin 3c14a8c507 Merge pull request #17149 from alalek:core_simd_suppress_coverity 2020-04-24 17:46:54 +00:00
Alexander Alekhin 15b948d109 Merge pull request #17144 from YashasSamaga:cuda4dnn-fix-i17116 2020-04-24 17:40:57 +00:00
Alexander Alekhin ab3b1e9922 Merge pull request #17108 from HowardsPlayPen:patch-1 2020-04-24 17:25:31 +00:00
Alexander Alekhin cd7db168e0 core(SIMD): suppress coverity UNINIT_CTOR on SIMD vectors 2020-04-24 16:36:35 +00:00
HowardsPlayPen cbcdbde29d Update videocapture_basic.cpp
I believe you are using the wrong version of open() on line 28 - adding deviceID + appId together. It's better to use the new version of .open() taking two integers as parameter.
2020-04-24 11:42:45 +03:00
YashasSamaga aff2c7c43c handle redundant slice in SliceOp 2020-04-24 12:54:17 +05:30
Alexander Alekhin 2df978b8e7 Merge pull request #17134 from alalek:dnn_ie_avoid_conversion_to_legacy 2020-04-23 22:39:45 +00:00
Alexander Alekhin 10808ccbb4 Merge pull request #17129 from alalek:dnn_myriad_tests 2020-04-23 19:41:15 +00:00
Alexander Alekhin f756923271 dnn(ie): avoid conversion to legacy CNNNetworkImpl 2020-04-23 19:11:33 +00:00
Maxim Pashchenkov 51a42c0647 Merge pull request #17088 from mpashchenkov:mp/ocv-gapi-kernel-laplacian
G-API: Laplacian and bilateralFilter standard kernels

* Added Laplacian kernel and tests

* Added: Laplacian kernel, Bilateral kernel (CPU, GPU); Performance and accuracy tests for this kernels

* Changed tolerance for GPU test

* boner

* Some changes with alignment; Tests's parameters are the same as for OCV

* Cut tests

* Compressed tests

* Minor changes (rsrt bb)

* Returned types
2020-04-23 17:47:55 +00:00
Alexander Alekhin 189fc43765 Merge pull request #17082 from OrestChura:oc/buildPyramid 2020-04-23 12:07:27 +00:00
Alexander Alekhin a327418767 features2d(sift): move SIFT tests / headers / build fixes 2020-04-23 08:45:22 +00:00
Alexander Alekhin a1641f938e Merge pull request #17133 from alalek:build_fix_gapi_ie 2020-04-22 23:06:14 +00:00
Alexander Alekhin 351fb8c058 gapi: fix build, update IE handling, add OPENCV_GAPI_INF_ENGINE 2020-04-22 21:47:45 +00:00
Alexander Alekhin 83c4378d5d dnn(test): skip failed NGRAPH/MYRIAD tests 2020-04-22 15:00:23 +00:00
Alexander Alekhin 561421f748 Merge pull request #17122 from mshabunin:videoio-win-dbg-plugins 2020-04-22 11:42:33 +00:00
Maksim Shabunin 9415560250 videoio: load debug versions of plug-ins in debug builds 2020-04-22 13:35:06 +03:00
Alexander Alekhin e74075c689 Merge pull request #16887 from ashishkrshrivastava:fasterrcnn 2020-04-22 09:47:45 +00:00
Alexander Alekhin 511d0fe198 Merge pull request #17120 from ganesh-k13:bugfix/documentation/16987 2020-04-22 09:08:02 +00:00
Liubov Batanina 1c1762d3f6 Skip myriad 2020-04-22 09:52:20 +03:00
ashishiva3@gmail.com e0ac0cfbe2 add fused batchNorm Upsample 2020-04-22 08:24:17 +05:30
Alexander Alekhin bfcc136dc7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-21 21:32:51 +00:00
Alexander Alekhin 775d031366 Merge pull request #17123 from ganesh-k13:bugfix/documentation/3.4/16987 2020-04-21 21:03:36 +00:00
Alexander Alekhin 1a17f402a4 Merge pull request #17030 from ashishkrshrivastava:onnximporter 2020-04-21 21:02:41 +00:00
Polina Smolnikova 40973bea31 Merge pull request #16961 from rayonnant14:objdetect_different_return_value_issue
QRDetectMulti : different return value bug fix

* QRDetectMulti : bug fix

* added tests

* changed test image due to large size of previous test image
2020-04-21 20:44:50 +00:00
Maxim Pashchenkov 94e36d8c8d Merge pull request #16995 from mpashchenkov:mp/ocv-gapi-standalone-mat
G-API: Mat's "deownification"

* deowned Mat

* boner

* Removed canDescribe test for own::Mat

* Removed STANDALONE flag for apply() and operator()

* Removed: desc_tests for own::Mat, descr_of for own::Mat.

* Returned: tests, cv::gapi::own::descr_of; fixed alignment; Removed own::Mat's headers

* Removed unused header own/mat.hpp from gbackend.hpp
2020-04-21 20:22:01 +00:00
Ganesh Kathiresan 4ee6852a1e Formula Fixes for master branch
Foumula fix 6

Foumula fix 7
2020-04-21 19:31:52 +05:30
Ganesh Kathiresan 0be2c7018b Formula Fixes for 3.4 branch
Foumula fix 1

Foumula fix 2

Foumula fix 3

Foumula fix 4

Foumula fix 5

Foumula fix 8
2020-04-21 19:23:23 +05:30
Liubov Batanina aa08900ac8 Supported TF concat 3d 2020-04-21 15:15:22 +03:00
OrestChura 05d5c284f6 gapi: buildOpticalFlowPyramid() interface, CPUkernel and CPUtests implementation
- kernel added to a cv::gapi::video namespace
     - tests to check a kernels (based on cv::video tests for cv::buildOpticalFlowPyramid())
     - tests for a combined G-API-pipeline (buildOpticalFlowPyramid() -> calcOpticalFlowPyrLK())
     - tests for internal purposes added
     - custom function for comparison in tests implemented
2020-04-21 14:36:42 +03:00
AshihsKrShrivastava d37180a2c4 modification for upsample node fused from unfused Resize subgraph 2020-04-21 15:03:00 +05:30
Liubov Batanina 8badf7f354 Merge pull request #17112 from l-bat:ie_region
* Support nGraph Region

* Support region since OpenVINO 2020.2

* Skip myriad
2020-04-21 09:26:58 +00:00
Alexander Alekhin 150bd3aee6 Merge pull request #17106 from pauljurczak:patch-3 2020-04-20 18:00:01 +00:00
Alexander Alekhin f19d0ae41d Merge pull request #17109 from alalek:cmake_videoio_plugins_all 2020-04-20 17:24:18 +00:00
Paul Jurczak a748eba42e Added descriptions of randu and randn 2020-04-20 07:13:37 +00:00
Alexander Alekhin 850b1ea2d7 Merge pull request #17110 from alalek:videoio_msmf_fix_warning 2020-04-19 20:41:18 +00:00
Alexander Alekhin 10d2bcc8a2 videoio(msmf): fix build warning
- warning C4800: 'int': forcing value to bool 'true' or 'false'
2020-04-19 19:47:32 +00:00
Alexander Alekhin 7ce1bd5d88 cmake: handle VIDEOIO_PLUGIN_LIST=all 2020-04-19 19:29:07 +00:00
Alexander Alekhin 935420217c Merge pull request #17102 from dkurt:dnn_ie_flexible_inputs 2020-04-19 18:06:09 +00:00
Alexander Alekhin 81d4d4948e Merge pull request #17105 from benji1123:pointPolygonTest_demo 2020-04-19 17:38:23 +00:00
Ben 041da57e87 fix tuple error 2020-04-19 10:36:59 -04:00
Alexander Alekhin acf1be547d Merge pull request #17046 from alalek:core_inputarray_matexpr_cleanup 2020-04-18 21:41:59 +00:00
Dmitry Kurtaev 908bf935f7 Flexible inputs for OpenVINO IR models 2020-04-18 20:00:22 +03:00
Alexander Alekhin e59e978fcd Merge pull request #17096 from spectralio:java-cmake-fix 2020-04-17 21:24:41 +00:00
Alexander Alekhin fbaae7ac37 Merge pull request #17041 from alalek:core_simd_vector_ctors 2020-04-17 21:22:08 +00:00
Alexander Alekhin dcf7eb972e core(SIMD): align behavior of vector constructors
- setzero() calls are dropped due low-level API nature
- initialization is mandatory if necessary (not an output of other calls)
2020-04-17 14:34:34 +00:00
Maksim Shabunin 2840362868 Merge pull request #16769 from mshabunin:fix-ipp-install
* Do not copy standalone IPP libraries to install for static builds

* Restored IPP installation under option
2020-04-17 14:28:42 +00:00
jshiwam d4fc302c7e Merge pull request #16795 from jshiwam:qrsample
Added a sample file for qrcode detection in python

* sample python file for qrcode detection added in samples/python

* input taken using argparse and the indents were removed

* Removed unused variables

* updated the format and removed unused variables

Removed the use of global variables and used parameterised contructor instead

=set multi detection true by default

* added detection from camera

* samples(python): coding style in qrcode.py
2020-04-17 12:16:39 +00:00
spectralio 1cce9db710 fix missing underscore 2020-04-17 13:08:32 +02:00
Alexander Alekhin e92f1eaa3d Merge pull request #17071 from mshabunin:tickmeter-fps 2020-04-17 08:56:29 +00:00
Maksim Shabunin f84cae833a TickMeter: added FPS and AvgTime, improved docs, reformatted 2020-04-16 21:33:29 +03:00
Alexander Alekhin 2cef100303 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-16 18:28:27 +00:00
Alexander Alekhin ed58b5489f [move sift.cpp] sift: avoid inplace calls of GaussianBlur
- should unlock IPP optimizations

original commit: https://github.com/opencv/opencv_contrib/commit/ce7c8f2646ccf3f5e657ab1241e22c0c32cd9d41
2020-04-16 17:58:45 +00:00
Alexander Alekhin ef5fa498d4 [move sift.cpp] sift: perf tests and trace regions
original commit: https://github.com/opencv/opencv_contrib/commit/a15e105db12aa7a0bade47afb791682201e46f60
2020-04-16 17:58:45 +00:00
Alexander Alekhin 78e4fbd2d7 Merge pull request #17091 from tomoaki0705:fixHOGDetectorFailure 2020-04-16 16:34:45 +00:00
Tomoaki Teshima 96075ce0c9 avoid test failure on Arm platform 2020-04-17 00:59:15 +09:00
Alexander Alekhin c007228d0f Merge pull request #17075 from alalek:dnn_updates_from_openvino_2020.2 2020-04-16 12:19:58 +00:00
Alexander Alekhin dca9b4283b Merge pull request #17080 from dkurt:dnn_ngraph_future 2020-04-16 11:19:08 +00:00
Alexander Alekhin dcec3150f0 Merge pull request #17084 from tomoaki0705:fixQRInputCheck 2020-04-16 09:44:08 +00:00
Alexander Alekhin d015db3de8 Merge pull request #17083 from pauljurczak:patch-2 2020-04-16 09:43:44 +00:00
Alexander Alekhin ef7fb905aa Merge pull request #17074 from AlanLi7991:doc/python-svm-doc-formula-miss 2020-04-16 09:43:20 +00:00
Dmitry Kurtaev 5e5385a814 Remove NodeVector for nGraph 2020-04-16 11:13:49 +03:00
Alanli 7aaa918367 doc: formula miss 2020-04-16 09:05:00 +09:00
Tomoaki Teshima c2e484a465 fix wrong condition check 2020-04-16 08:24:14 +09:00
Paul Jurczak f64d807863 Added to description of WCube constructor
`WCube` constructor reorders `min_point`, `max_point` parameters when necessary. I added this info to the description.
2020-04-15 16:06:14 -06:00
Alexander Alekhin 81c2f3d194 Merge pull request #17081 from alalek:backport_17056 2020-04-15 18:33:41 +00:00
Alexander Alekhin 8c77f35fce Merge pull request #17079 from tomoaki0705:fixCUDABgSgmMOG 2020-04-15 18:30:09 +00:00
Alexander Alekhin ff4ce9f7b1 build: winpack_dldt with dldt 2020.2 2020-04-15 17:25:23 +00:00
Alexander Alekhin fecebea2e3 Merge pull request #17056 from alalek:build_opencv_winpack_dldt_2020.2 2020-04-15 17:24:34 +00:00
Tomoaki Teshima f39784c584 fix test failure on Jetson TX2 2020-04-15 23:25:12 +09:00
Alexander Alekhin 98e38b2a41 Merge pull request #17017 from VadimLevin:dev/vlevin/header-parser-explicit-support 2020-04-15 12:53:42 +00:00
Vadim Levin 1d8c73cf6c feature: Added explicit support to header parser
- It is safe to remove `explicit` keyword for constructors with 1
argument, because it is C++ specific keyword and does not affect any of
the generated binding.
2020-04-15 14:25:39 +03:00
Alexander Alekhin ef68cc3d5f dnn: use OpenVINO 2020.2 defines
original commit: 45263d7642
2020-04-15 11:14:43 +00:00
Vadim Levin 18550b4601 test: Added tests for VideoCapture constructors in java 2020-04-15 14:12:31 +03:00
Alexander Alekhin 07a0274507 build: winpack_dldt with dldt 2020.2 2020-04-15 05:19:49 +00:00
Alexander Alekhin 8ff0399432 Merge pull request #17048 from anton-potapov:ap/variant_get_if 2020-04-14 19:06:01 +00:00
Alexander Alekhin c8f1948d58 core: drop EXPR handing code in InputArray 2020-04-14 18:02:19 +00:00
Alexander Alekhin f6de25b6cb Merge pull request #17060 from dkurt:dnn_align_ie_pool 2020-04-14 15:15:44 +00:00
Alexander Alekhin b3514a5708 Merge pull request #17049 from ilya-lavrenov:il/nn-builder 2020-04-14 15:14:35 +00:00
Anton Potapov dd2c7c5140 GAPI: utils - variant::get_if
adding one more missing function to local version of std::variant
2020-04-14 15:12:31 +03:00
Ilya Lavrenov 91b0100287 Fixed compilation when NN builder is not built 2020-04-14 15:05:01 +03:00
Dmitry Kurtaev 870a775d7d Align DLIE and nGraph average pooling layers 2020-04-14 13:54:54 +03:00
Vahid Nikoofard 575a609b80 Update calcBackProject_Demo1.py
To round a ndarray it's necessary to use np.round() instead to Built-in Python round()
2020-04-14 00:23:53 -03:00
Alexander Alekhin ca9756f6a1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-13 20:00:12 +00:00
Alexander Alekhin 675342ecd9 Merge pull request #17025 from tomoaki0705:fixTestFailureCUDABruteForceNonLocalMeans 2020-04-13 18:17:50 +00:00
Alexander Alekhin 245b2fec34 Merge pull request #16925 from dkurt:dnn_ssd.pytorch 2020-04-13 13:12:12 +00:00
Alexander Alekhin 49a75079f2 Merge pull request #17047 from alalek:fix_permissions 2020-04-13 12:34:08 +00:00
Dmitry Kurtaev d3f9ad1145 Enable ONNX SSD from https://github.com/amdegroot/ssd.pytorch 2020-04-13 15:12:27 +03:00
Alexander Alekhin 46615ffc4a Merge pull request #16985 from ashishkrshrivastava:padfusion 2020-04-13 11:26:13 +00:00
Pierre Chatelier f351653589 Merge pull request #13869 from chacha21:LineVirtualIterator
* LineVirtualIterator

Proposal of LineVirtualIterator, an alternative to "LineIterator not attached to any mat".
This is basically the same implementation, replacing the address difference by a single "offset" variable. elemsize becomes irrelevant and considered to be 1. "step" is thus equal to size.width since no stride is expected.

* Update drawing.cpp

fixed warning

* improvement of LineVirtualIterator

instead of being too conservative, the new implementation gets rid of "offset/step" and only keeps a "Point currentPos" up to date.

left_to_right is renamed to forceLeftToRight as suggested (even for the old LineIterator)

assert() replaced by CV_Assert() (even for the old LineIterator)

* fixed implementation

+fixed last commit so that LineVirtualIterator gives at least the same results as LineIterator

+added a new constructor that does not require any Size, so that no clipping is done and iteration occurs from pt1 to pt2. This is done by adding a spatial offset to pt1 and pt2 so that the same implementation is used, the size being in that case the spatial size between pt1 and pt2

* Update imgproc.hpp

fixed warnings

* Update drawing.cpp

fixed whitespace

* Update drawing.cpp

trailing whitespace

* Update imgproc.hpp

+added a new constructor that takes a Rect rather than a Size. It computes the line pt1->pt2 that clips that rect.
Yet again, this is still based on the same implementation, thanks to the Size and the currentPosOffset that can artifically consider the origin of the rect at (0,0)

* revert changes

revert changes on  original LineIterator implementation, that will be superseded by the new LineVirtualIterator anyway

* added test of LineVirtualIterator

* More tests

* refactoring

Use C++11 chained constructors
Improved code style

* improve test

Added offset as random test data.

* fixed order of initialization

* merged LineIterator and VirtualLineIterator

* merged LineIterator & VirtualLineIterator

* merged LineIterator & VirtualLineIterator

* merged LineIterator & VirtualLineIterator

* made LineIterator::operator ++() more efficient

added one perfectly predictable check; in theory, since ptmode is set in the end of the constructor in the header file, the compiler can figure out that it's always true/false and eliminate the check from the inline `LineIterator::operator++()` completely

* optimized Line() function

in the most common case (CV_8UC3) eliminated the check from the loop

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2020-04-13 06:59:31 +00:00
Alexander Alekhin f0ffc52435 fix files permissions 2020-04-13 04:29:55 +00:00
Alexander Alekhin f7d029cfce Merge pull request #17039 from tomoaki0705:fixCudaImgprocFailure 2020-04-12 17:15:49 +00:00
Tomoaki Teshima 1eb63cfc42 fix test failure on Jetson TX1/TX2/Nano 2020-04-12 23:58:53 +09:00
Alexander Alekhin 43ff8f8e8d Merge pull request #17006 from tpoisonooo:patch-1 2020-04-11 17:24:36 +00:00
tpoisonooo b11a3a0820 Update grfmt_pxm.cpp
remove comment in .ppm
2020-04-11 17:41:51 +03:00
AshihsKrShrivastava bef6b6282c ReflecitonPad2d and ZeroPad2d Subgraph fusion added 2020-04-11 07:14:05 +05:30
Alexander Alekhin 9c58a7cb1e Merge pull request #16653 from alalek:core_inputarray_matexpr 2020-04-10 16:57:17 +00:00
Alexander Alekhin 69ac19d82d Merge pull request #17023 from poelmanc:patch-1 2020-04-10 16:32:15 +00:00
Conrad Poelman b77fe9d624 Remove std::binary_function as it's invalid C++
std::binary_function was deprecated with C++11 and removed in C++17. It provided just two typedefs which in this case were unused.
2020-04-10 16:16:52 +03:00
Alexander Alekhin 0556450801 Merge pull request #17000 from rgarnov:async_islands 2020-04-10 12:23:53 +00:00
Xiping Yan 5c7c80dd27 Merge pull request #17028 from xipingyan:patch-1
* Update OpenCVFindVA_INTEL.cmake

When set env VA_INTEL_IOCL_ROOT, "if($ENV{VA_INTEL_IOCL_ROOT})" don't work.
    My modification as follow.
    
    -    if($ENV{VA_INTEL_IOCL_ROOT})
    +    if(DEFINED ENV{VA_INTEL_IOCL_ROOT})
    
    Refer: https://cmake.org/cmake/help/latest/variable/ENV.html

* based on merge comment, update code
2020-04-10 12:23:13 +00:00
Alexander Alekhin d7abb641ca core(test): add InputArray(MatExpr) fetch test 2020-04-10 11:35:42 +00:00
Tomoaki Teshima 4e75f31c55 fix test failure on Jetson Nano/TX1/TX2 2020-04-10 06:15:16 +09:00
Alexander Alekhin 1537a5f253 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-09 19:19:20 +00:00
Ruslan Garnov ce772b346c Fixed standalone build, added cv::gapi::proto::ptr test 2020-04-09 17:19:11 +03:00
Alexander Alekhin e1f14fcac7 Merge pull request #16975 from shimat:Branch_4.3.0 2020-04-09 08:28:20 +00:00
shimat 39d3bbb601 fix error at #include <window_winrt_bridge.hpp> 2020-04-09 09:54:13 +09:00
Dmitry Matveev b1f42a6506 Implement asynchronous execution for islands 2020-04-08 20:48:23 +03:00
Dmitry Matveev cb5921b375 Introduced a newStreamSignal() callback for Island Executables 2020-04-08 20:48:23 +03:00
Alexander Alekhin 016f9ab16e Merge pull request #16788 from OrestChura:oc/optFlowPyrLK
G-API: gapi::calcOpticalFlowPyrLK() Implementation
2020-04-08 20:23:20 +03:00
Alexander Alekhin 499e20da4f Merge pull request #17018 from anton-potapov:ap/fix_control_may_reach_end_of_non_void_function_warning 2020-04-08 16:46:34 +00:00
OrestChura d50c21e571 gapi: Full calcOpticalFlowPyrLK implementation (2 overloads) and tests
- opencv_gapi module is linked with opencv_video module (optional dependency)
     - kernels added to a new cv::gapi::video namespace and a brand new files created to provide gapi_video environment
     - there are 2 different kernels as G-API should provide GMat AND GArray<GMat> implementation: cv::calcOptFlowPyrLK doesn't calculate pyramids if vector<Mat> is given so just the cast GMat -> GArray<GMat> wouldn't represent all the cv:: functionality
     - tests to check both kernels (based on cv::video tests for cv::calcOpticalFlowPyrLK())
     - tests for internal purposes added
     - vectors<T> comparison in tests implemented
     - new (and old too) common test structures refactored to avoid code copypasting
     - "modules/gapi/test/common/gapi_video_tests_common.hpp" created to share some code snippets between perf and acc tests and avoid code copypasting
2020-04-08 18:11:55 +03:00
Alexander Alekhin 4d35a46c48 Merge pull request #17010 from alalek:issue_16896 2020-04-08 14:50:00 +00:00
Anton Potapov 676d1dfd5b GAPI: Fix [-Wreturn-type] warning on standalone mac build
- added [[noreturn]] to standalone version of  GAPI_Assert
2020-04-08 17:13:33 +03:00
Alexander Alekhin 2c9d149ac2 Merge pull request #16993 from asmorkalov:as/faq_wiki 2020-04-08 13:56:57 +00:00
Alexander Alekhin 06bf845783 Merge pull request #16979 from dkurt:dnn_fused_resize_conv 2020-04-08 13:29:51 +00:00
Alexander Alekhin acede976e4 Merge pull request #17009 from mshabunin:msmf-plugin 2020-04-08 13:28:26 +00:00
Maksim Shabunin 90e7c29c46 videoio: set plugin output dir on windows to bin 2020-04-08 15:22:50 +03:00
Maksim Shabunin ca6a11e4d2 videoio: added plug-in support to MSMF backend 2020-04-08 15:22:50 +03:00
Alexander Smorkalov f496a37340 Migrated FAQ page to Github Wiki 2020-04-08 13:55:44 +03:00
Alexander Alekhin b8579f12be Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-08 10:19:09 +00:00
Alexander Alekhin b745e1c43a Merge pull request #17014 from dkurt:dnn_onnx_elu 2020-04-08 10:18:33 +00:00
Dmitry Kurtaev 21ed892489 Fix Elu import from ONNX 2020-04-08 12:09:45 +03:00
Alexander Alekhin 5504d94e36 cmake: update generation of 'uninstall' target
Details: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
2020-04-07 22:03:12 +00:00
GFleishman 31ec9b2aa7 Merge pull request #16614 from GFleishman:estimateTranslation3D
added estimateTranslation3D to calib3d/ptsetreg

* added estimateTranslation3D; follows API and implementation structure for estimateAffine3D, but only allows for translation

* void variables in null function to suppress compiler warnings

* added test for estimateTranslation3D

* changed to Matx13d datatype for translation vector in ptsetreg and test; used short license in test

* removed iostream include

* calib3d: code cleanup
2020-04-07 19:58:25 +00:00
Alexander Alekhin 0c2a43923c Merge pull request #17007 from mshabunin:fix-openjpeg-vs 2020-04-07 19:55:37 +00:00
Alexander Alekhin 63320aba6c Merge pull request #16999 from rgarnov:exports_for_gisland_executable 2020-04-07 19:55:01 +00:00
Orest Chura 2fe9c87433 Merge pull request #16717 from OrestChura:oc/goodFeatures
- cv::gapi::goodFeaturesToTrack() kernel is implemented
- tests (for exact check with cv::goodFeaturesToTrack() and for internal cases) are implemented
- a custom comparison function for vectors and a custom test fixture implemented
  - some posiible issues as wrong/inexact sorting of two compared vectors are
 not taken into account
- initializations of an input Mat using a picture from opencv_extra implemented (function from gapi_streaming_test used)
2020-04-07 15:53:24 +00:00
Alexander Alekhin adf54d41d5 Merge pull request #16905 from dkurt:dnn_tf2_keras 2020-04-07 14:59:42 +00:00
Alexander Alekhin ab4dbff150 Merge pull request #15907 from rgarnov:rg/unique_ptr_for_priv_in_fluid 2020-04-07 14:51:14 +00:00
mehlukas 75bd9f86b2 Merge pull request #16889 from mehlukas:3.4-consolidateImshow
* consolidate tutorials on image read/display/write

* fix unsused variables

* apply requested changes

* apply requested changes

* fix mistake
2020-04-07 14:14:51 +00:00
Liubov Batanina 734771418e Merge pull request #16840 from l-bat:matmul_inputs
* Supported FullyConnected layer with two inputs

* Skipped test

* Fix conditions

* Added OpenCL support

* Supported ReduceMean3D

* Supported Expand layer

* Fix warning

* Added Normalize subgraph

* refactoring

* Used addLayer

* Fix check

* Used addLayer

* Skip failed test

* Added normalize1 subgraph

* Fix comments
2020-04-07 14:12:18 +00:00
Maksim Shabunin 01a85736e6 OpenJPEG: fixed compilation and warnings with VS 2020-04-07 16:03:17 +03:00
Alexander Alekhin 51a8885566 Merge pull request #16984 from CSharperMantle:argparse-patch-1 2020-04-07 12:54:27 +00:00
Alexander Alekhin 7d5a8053d7 Merge pull request #16640 from malfet:add-16-bit-otsu 2020-04-07 11:01:53 +00:00
Alexander Alekhin 60c382d8f1 Merge pull request #17005 from tomoaki0705:fixHoughKernelLocal 2020-04-07 10:05:44 +00:00
Tomoaki Teshima 3371e679ce fix OpenCL spec violation 2020-04-07 14:34:55 +09:00
Nikita Shulga b8cf5d8d5f Enable Otsu thresholding for CV_16UC1 images 2020-04-06 21:19:07 -07:00
Dmitry Matveev 43df944eb4 Added GAPI_EXPORTS to GIslandExecutable since now it needs to be exported 2020-04-06 23:42:52 +03:00
Alexander Alekhin ce5626db45 Merge pull request #16878 from dkurt:fix_16877 2020-04-06 18:14:35 +00:00
Alexander Alekhin 763a1d7392 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-04-06 15:57:43 +00:00
Alexander Alekhin 1377b9b736 Merge pull request #16970 from l-bat:fix_enet 2020-04-06 15:57:08 +00:00
Alexander Alekhin 5db3092a1f Merge pull request #16952 from anton-potapov:kw_fixes 2020-04-06 15:55:33 +00:00
Ruslan Garnov be1615b1c3 Merge pull request #16964 from rgarnov:rg/opaque_for_streaming_exec
* Added GOpaque support to GStreamingExecutor

* Added inter-island GOpaque support to GExecutor
2020-04-06 15:53:54 +00:00
Alexander Alekhin 936428cb3b core(MatExpr) fetch result before InputArray wrap
- avoid multiple expression evaluations
- avoid issues with reduced support of InputArray::EXPR
2020-04-06 15:28:32 +00:00
Maxim Pashchenkov ca9fd66744 Merge pull request #16886 from mpashchenkov:mp/ocv-gapi-add-disable
G-API: DISABLED_ in tests instead #if 0

* Removed if 0, replaced with DISABLED_

* boner

* Added tests for fluid

* -1 instead 0.0

* Added GMatDesc's tests for own::Mat

* IMGPROC_FLUID CORE_FLUID

* Added use_only, disabled tests without kernels
2020-04-06 15:21:08 +00:00
Alexander Alekhin bdc95d2c66 Merge pull request #16911 from anton-potapov:ap/variant_move_issue 2020-04-06 15:19:32 +00:00
Alexander Alekhin c305455cb2 Merge pull request #16967 from benji1123:patch-1 2020-04-06 15:17:23 +00:00
Adam Fowles 8334932a26 Merge pull request #16992 from afowles:fix-forEach-segfault
* Fixed divide by zero error in forEach

* Dedicated assertion for !empty
2020-04-06 14:49:02 +00:00
Alexander Alekhin a10385543b Merge pull request #16963 from rgarnov:rg/gframe 2020-04-06 14:35:52 +00:00
Alexander Alekhin 99d29c9d39 Merge pull request #16982 from tomoaki0705:houghLinesOCL 2020-04-06 14:35:14 +00:00
Liubov Batanina a448d3a6aa Fix ENet test with OpenVINO 2020.2 2020-04-06 17:29:43 +03:00
Alexander Alekhin e80adc0bc6 Merge pull request #16965 from rgarnov:in_out_island_interface 2020-04-06 14:06:40 +00:00
Ben Li 1a6b4d6ce6 typo fix 2020-04-06 14:56:31 +03:00
Alexander Alekhin a15417fe74 Merge pull request #16980 from albert-github:feature/bug_doxyfile 2020-04-06 11:37:18 +00:00
Dmitry Matveev 1b5730a799 Introduce a new abstraction layer over island input/output data
- Port GExecutor to this new interface
2020-04-06 12:24:19 +03:00
Bao "Mantle" Rong 3dcb775d16 switch to argparse 2020-04-05 11:57:04 +08:00
albert-github 2d387356de Incorrect PREDEFINED setting.
The PREDEFINED setting for  had a space between the define name and the equal sign and this is not allowed, it results in the warning:
```
error: Illegal PREDEFINED format '=', no define name specified
```
according to the documentation explicitly states that no space is allowed:
> The PREDEFINED tag can be used to specify one or more macro names that are defined before the preprocessor is started (similar to the -D option of e.g. gcc). The argument of the tag is a list of macros of the form: name or name=definition (no spaces). If the definition and the "=" are omitted, "=1" is assumed. To prevent a macro definition from being undefined via #undef or recursively expanded use the := operator instead of the = operator.
2020-04-04 16:50:15 +00:00
Tomoaki Teshima 07c3aae315 let the test pass on Mali G52 (ODROID-N2) 2020-04-05 01:39:47 +09:00
Dmitry Kurtaev b36eba7fab Support FusedResizeAndPadConv2D from TensorFlow 2020-04-04 16:02:17 +03:00
Dmitry Kurtaev 8574a757f9 Case sensitive dnn layers types 2020-04-04 15:03:56 +03:00
Alexander Alekhin 01dcfb0825 Merge tag '4.3.0' 2020-04-03 11:50:53 +00:00
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
Ruslan Garnov c8776e6ebd Added GFrame 2020-04-03 01:21:51 +03: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
Anton Potapov 3ffed0bf6e GAPI - KW fixes
- remove unreachable code in GIsland::producer()
2020-04-02 12:05:34 +03: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
Anton Potapov faceb05775 G-API utils - make variant converting constructor and assignment
operator properly forward it's argument
2020-03-27 14:30:16 +03: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
Dmitry Kurtaev 7e4b2057f2 Import TF2.0 network from Keras 2020-03-25 15:34:28 +03: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
Ruslan Garnov 65ccafd494 Changed shared_ptr to unique_ptr for Priv storage in fluid::View 2020-01-21 18:03:03 +03:00
Ruslan Garnov 6c93e42d94 Changed sharev_ptr for Priv to unique_ptr for fluid::Buffer 2020-01-21 13:48:46 +03:00
ab-dragon 2947877871 [move sift.cpp] Merge pull request opencv/opencv_contrib#2301 from ab-dragon:conditionally_compute_dog_pyramid
Build DoG Pyramid if useProvideKeypoints is false

The buildDoGPyramid operation need not be performed unconditionally. In cases where it is not needed, both memory and speed performance can be improved

original commit: https://github.com/opencv/opencv_contrib/commit/e45887e1c097db6e5f75dc70d7723203bcafa5f1
2019-11-01 21:28:18 +03:00
Alexander Alekhin fadb90c579 [move sift.cpp] xfeatures2d: use updated TLS API
original commit: https://github.com/opencv/opencv_contrib/commit/3e4fb8f415ba68c56ba2cded1ab10a75c46d342e
2019-10-20 14:17:05 +00:00
Alexander Alekhin dfb9832a25 cmake(protobuf): ensure using of own headers 2019-04-15 22:28:33 +00:00
Alexander Alekhin fd46684bf8 [move sift.cpp] opencv: use cv::AutoBuffer<>::data()
original commit: https://github.com/opencv/opencv_contrib/commit/fc69aa57bc021422d825a4331f7ddf7d9f7534e7
2018-06-13 19:11:18 +00:00
Alexander Alekhin 9badb0d903 [move sift.cpp] xfeatures2d: apply CV_OVERRIDE/CV_FINAL
original commit: https://github.com/opencv/opencv_contrib/commit/ec65e5b29c1c4928aee3d56a44bb399d4af6b61a
2018-03-28 16:50:00 +03:00
Vitaly Tuzov c5f06814bc [move sift.cpp] Updated internal calls to linear resize to use bit-exact version
original commit: https://github.com/opencv/opencv_contrib/commit/8c394a4f2e02994f21c3cf88706ad62d65b53431
2017-12-14 13:00:09 +03:00
woody.chow 69d43e2997 [move sift.cpp] Remove unnecessary _mm256_round_ps
original commit: https://github.com/opencv/opencv_contrib/commit/b5340f6428b6d48445947b16ef2df04552451330
2017-09-26 10:12:30 +09:00
Woody Chow 0f0dea79fc [move sift.cpp] Use TLS instead of mutex in SIFT
original commit: https://github.com/opencv/opencv_contrib/commit/ab43a3b2d99c490be8635987923e7571fd95a0c9
2017-05-31 15:08:32 +09:00
Woody Chow b6d636214e [move sift.cpp] Multithreading findScaleSpaceExtremaComputer. Sort the keypoints afterwards to make the output stable
original commit: https://github.com/opencv/opencv_contrib/commit/6be2945abb0dcff2e038b5f23c7c7716da69ede9
2017-05-31 10:02:09 +09:00
Woody Chow 4b64955a12 [move sift.cpp] Parallelize calcDescriptors and buildDoGPyramid. Simplify 2 lines of AVX2 instructions
original commit: https://github.com/opencv/opencv_contrib/commit/443f68cb71128d5ae27e8771a91f7641f9450685
2017-03-24 16:31:18 +09:00
Woody Chow 546239a3a8 [move sift.cpp] Optimize SIFT with AVX2
original commit: https://github.com/opencv/opencv_contrib/commit/c5e55dfde96307fef12fc55f63d6a600fd784582
2017-03-08 10:08:50 +09:00
Suleyman TURKMEN 8be0a3452d [move sift.cpp] Update sift.cpp
original commit: https://github.com/opencv/opencv_contrib/commit/cb7b59f203bf06586d6176ac812e0ee382cedcf1
2016-12-23 13:21:30 +03:00
Martin Nowak 99d914ea3b [move sift.cpp] fix overflow issue when computing diagonal
- with big images the int multiplication can overflow

original commit: https://github.com/opencv/opencv_contrib/commit/d4df727d380887fdd880fdb5430cf4680a4ad19b
2016-06-11 17:51:46 +02:00
Maksim Shabunin 24284d3d17 [move sift.cpp] Fixed HAL headers location
original commit: https://github.com/opencv/opencv_contrib/commit/f529a1df2b17bcada1179ddcaf1352e3a5ba97b8
2015-12-15 18:41:26 +03:00
Vadim Pisarevsky 9fc872b70b [move sift.cpp] fixed contrib code to match the HAL
original commit: https://github.com/opencv/opencv_contrib/commit/cdddcc8237627f667d66daffb3fcb3af39a3e673
2015-04-16 22:52:05 +03:00
Vadim Pisarevsky e3654d5416 [move sift.cpp] refactored xfeatures2d in the same style as features2d
original commit: https://github.com/opencv/opencv_contrib/commit/0cfd795303c414aada6d10701e0de4995841210c
2014-10-16 16:33:21 +04:00
Alexander Alekhin d92bee821d Merge upstream branch 2020-04-21 06:20:05 +00:00
Alexander Alekhin df10411e05 features2d(sift): patent expiration note 2020-04-21 06:19:16 +00:00
Alexander Alekhin 44e9fb306d features2d(sift): code from nonfree module 2020-04-21 04:14:18 +00:00
2282 changed files with 233624 additions and 28235 deletions
+11 -4
View File
@@ -1,3 +1,10 @@
<!--
If you have a question rather than reporting a bug please go to https://forum.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).
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 => 4.2
@@ -26,17 +33,17 @@
- [ ] I report the issue, it's not a question
<!--
OpenCV team works with answers.opencv.org, Stack Overflow and other communities
OpenCV team works with forum.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
forum.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 forum: https://forum.opencv.org
* OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
* Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
-->
@@ -54,7 +61,7 @@
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.
* Attach the image as archive 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
+1 -1
View File
@@ -2,7 +2,7 @@
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [ ] I agree to contribute to the project under OpenCV (BSD) License.
- [ ] I agree to contribute to the project under Apache 2 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
+47
View File
@@ -0,0 +1,47 @@
name: arm64 build checks
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install dependency packages
run: |
sudo sed -i -E 's|^deb ([^ ]+) (.*)$|deb [arch=amd64] \1 \2\ndeb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ \2|' /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
crossbuild-essential-arm64 \
git \
cmake \
libpython-dev:arm64 \
libpython3-dev:arm64 \
python-numpy \
python3-numpy
- name: Fetch opencv_contrib
run: |
git clone --depth 1 https://github.com/opencv/opencv_contrib.git ../opencv_contrib
- name: Configure
run: |
mkdir build
cd build
cmake -DPYTHON2_INCLUDE_PATH=/usr/include/python2.7/ \
-DPYTHON2_LIBRARIES=/usr/lib/aarch64-linux-gnu/libpython2.7.so \
-DPYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include \
-DPYTHON3_INCLUDE_PATH=/usr/include/python3.6m/ \
-DPYTHON3_LIBRARIES=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
-DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \
-DCMAKE_TOOLCHAIN_FILE=../platforms/linux/aarch64-gnu.toolchain.cmake \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
../
- name: Build
run: |
cd build
make -j$(nproc --all)
+1
View File
@@ -24,3 +24,4 @@ bin/
build
node_modules
CMakeSettings.json
xcuserdata/
+3 -2
View File
@@ -27,7 +27,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
endif()
add_library(carotene_objs OBJECT
add_library(carotene_objs OBJECT EXCLUDE_FROM_ALL
${carotene_headers}
${carotene_sources}
)
@@ -40,4 +40,5 @@ if(WITH_NEON)
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
endif()
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
# we add dummy file to fix XCode build
add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
+2 -1
View File
@@ -82,7 +82,8 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
# 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()
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
# we add dummy file to fix XCode build
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs> "dummy.cpp")
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
if(NOT BUILD_SHARED_LIBS)
+2
View File
@@ -0,0 +1,2 @@
// This file is needed for compilation on some platforms e.g. with XCode generator
// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457
+2
View File
@@ -0,0 +1,2 @@
// This file is needed for compilation on some platforms e.g. with XCode generator
// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457
+1 -1
View File
@@ -758,7 +758,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
}
else if (channels == 3)
{
if ((wr == 2.0f) && (wr == 2.0f))
if ((wr == 2.0f) && (hr == 2.0f))
{
#ifndef __ANDROID__
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
+2 -2
View File
@@ -14,7 +14,7 @@ if(NOT DEFINED CPUFEATURES_SOURCES)
endif()
include_directories(${CPUFEATURES_INCLUDE_DIRS})
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${CPUFEATURES_SOURCES})
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
PROPERTIES OUTPUT_NAME cpufeatures
@@ -29,7 +29,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)
+6 -6
View File
@@ -1,9 +1,9 @@
# 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")
# Binaries branch name: ffmpeg/master_20210608
# Binaries were created for OpenCV: eaa9228a4fdfb9c2465aea65a50ce2d16b55dce0
ocv_update(FFMPEG_BINARIES_COMMIT "213fcd5d4897319a83207406036c4a5957fba010")
ocv_update(FFMPEG_FILE_HASH_BIN32 "bab661341c30862fa88627130219c0a5")
ocv_update(FFMPEG_FILE_HASH_BIN64 "ac99f9767a83103c31709628af685924")
ocv_update(FFMPEG_FILE_HASH_CMAKE "8862c87496e2e8c375965e1277dee1c7")
function(download_win_ffmpeg script_var)
set(${script_var} "" PARENT_SCOPE)
@@ -0,0 +1,160 @@
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed 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) 2013-2019 Intel Corporation All Rights Reserved.
THESE MATERIALS ARE 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 INTEL OR ITS
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 THESE
MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
File Name: cl_va_api_media_sharing_intel.h
Abstract:
Notes:
\*****************************************************************************/
#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
#include <CL/cl.h>
#include <CL/cl_platform.h>
#include <va/va.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************
* cl_intel_va_api_media_sharing extension *
*******************************************/
#define cl_intel_va_api_media_sharing 1
/* error codes */
#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
/* cl_va_api_device_source_intel */
#define CL_VA_API_DISPLAY_INTEL 0x4094
/* cl_va_api_device_set_intel */
#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
/* cl_context_info */
#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
/* cl_mem_info */
#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
/* cl_image_info */
#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
typedef cl_uint cl_va_api_device_source_intel;
typedef cl_uint cl_va_api_device_set_intel;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
cl_platform_id platform,
cl_va_api_device_source_intel media_adapter_type,
void* media_adapter,
cl_va_api_device_set_intel media_adapter_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
cl_platform_id platform,
cl_va_api_device_source_intel media_adapter_type,
void* media_adapter,
cl_va_api_device_set_intel media_adapter_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromVA_APIMediaSurfaceINTEL(
cl_context context,
cl_mem_flags flags,
VASurfaceID* surface,
cl_uint plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
cl_context context,
cl_mem_flags flags,
VASurfaceID* surface,
cl_uint plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireVA_APIMediaSurfacesINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseVA_APIMediaSurfacesINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
+2 -2
View File
@@ -17,7 +17,7 @@ file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IP
# Define the library target:
# ----------------------------------------------------------------------------------
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
add_library(${IPP_IW_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
if(UNIX)
if(CV_GCC OR CV_CLANG OR CV_ICC)
@@ -41,5 +41,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${IPP_IW_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
+2 -2
View File
@@ -37,7 +37,7 @@ set(ITT_SRCS
src/ittnotify/jitprofiling.c
)
add_library(${ITT_LIBRARY} STATIC ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
if(NOT WIN32)
if(HAVE_DL_LIBRARY)
@@ -60,7 +60,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
+2 -2
View File
@@ -17,7 +17,7 @@ file(GLOB lib_ext_hdrs jasper/*.h)
# Define the library target:
# ----------------------------------------------------------------------------------
add_library(${JASPER_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
add_library(${JASPER_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
if(WIN32 AND NOT MINGW)
add_definitions(-DJAS_WIN_MSVC_BUILD)
@@ -46,7 +46,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(jasper LICENSE README copyright)
+7 -6
View File
@@ -3,10 +3,10 @@ project(${JPEG_LIBRARY} C)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_REVISION 4)
set(VERSION_MINOR 1)
set(VERSION_REVISION 0)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
set(LIBJPEG_TURBO_VERSION_NUMBER 2000004)
set(LIBJPEG_TURBO_VERSION_NUMBER 2001000)
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -46,7 +46,6 @@ if(UNIX)
ocv_update(HAVE_UNSIGNED_SHORT 1)
# undef INCOMPLETE_TYPES_BROKEN
ocv_update(RIGHT_SHIFT_IS_UNSIGNED 0)
ocv_update(__CHAR_UNSIGNED__ 0)
endif()
@@ -65,6 +64,8 @@ set(JPEG_LIB_VERSION 62)
# OpenCV
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
set(THREAD_LOCAL "") # WITH_TURBOJPEG is not used
if(MSVC)
add_definitions(-W3 -wd4996 -wd4018)
endif()
@@ -104,7 +105,7 @@ set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
ocv_list_add_prefix(JPEG_SOURCES src/)
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} ${SIMD_OBJS})
set_target_properties(${JPEG_LIBRARY}
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
@@ -119,7 +120,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg)
+1 -1
View File
@@ -91,7 +91,7 @@ best of our understanding.
The Modified (3-clause) BSD License
===================================
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
Copyright (C)2009-2021 D. R. Commander. All Rights Reserved.<br>
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
+9 -28
View File
@@ -128,7 +128,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-2020, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@@ -159,19 +159,6 @@ commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs". This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.
We are required to state that
"The Graphics Interchange Format(c) is the Copyright property of
CompuServe Incorporated. GIF(sm) is a Service Mark property of
CompuServe Incorporated."
REFERENCES
==========
@@ -223,12 +210,12 @@ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
A PDF file of the older JFIF 1.02 specification is available at
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
(Compression tag 7). Copies of this Note can be obtained from
The TIFF 6.0 file format specification can be obtained from
http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
#2 (Compression tag 7). Copies of this Note can be obtained from
http://www.ijg.org/files/. It is expected that the next revision
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
@@ -243,14 +230,8 @@ The most recent released version can always be found there in
directory "files".
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
and other news.answers archive sites, including the official news.answers
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
with body
send usenet/news.answers/jpeg-faq/part1
send usenet/news.answers/jpeg-faq/part2
general information about JPEG. It is available at
http://www.faqs.org/faqs/jpeg-faq.
FILE FORMAT COMPATIBILITY
+12 -11
View File
@@ -2,8 +2,8 @@ Background
==========
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
baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and
MIPS systems, as well as progressive JPEG compression on x86, x86-64, and Arm
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
@@ -179,8 +179,8 @@ supported and which aren't.
NOTE: As of this writing, extensive research has been conducted into the
usefulness of DCT scaling as a means of data reduction and SmartScale as a
means of quality improvement. The reader is invited to peruse the research at
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
means of quality improvement. Readers are invited to peruse the research at
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
@@ -287,12 +287,13 @@ following reasons:
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
however, that this algorithm basically brings the accuracy of the floating
point IDCT in line with the accuracy of the slow integer IDCT. The floating
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
produce significantly more accuracy than the slow integer algorithms (to put
numbers on this, the typical difference in PNSR between the two algorithms
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
range of the quality scale is typically more like a 1.0 dB difference.)
point IDCT in line with the accuracy of the accurate integer IDCT. The
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
not produce significantly more accuracy than the accurate integer algorithms
(to put numbers on this, the typical difference in PNSR between the two
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
the upper range of the quality scale is typically more like a 1.0 dB
difference.)
- If the floating point algorithms in libjpeg-turbo are not implemented using
SIMD instructions on a particular platform, then the accuracy of the
@@ -340,7 +341,7 @@ The algorithm used by the SIMD-accelerated quantization function cannot produce
correct results whenever the fast integer forward DCT is used along with a JPEG
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
It is therefore strongly advised that you use the accurate integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher.
-5
View File
@@ -61,11 +61,6 @@
unsigned. */
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
#cmakedefine __CHAR_UNSIGNED__ 1
#endif
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
-1
View File
@@ -18,7 +18,6 @@
#define HAVE_UNSIGNED_SHORT
#undef INCOMPLETE_TYPES_BROKEN
#undef RIGHT_SHIFT_IS_UNSIGNED
#undef __CHAR_UNSIGNED__
/* Define "boolean" as unsigned char, not int, per Windows custom */
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+3
View File
@@ -15,6 +15,9 @@
#endif
#endif
/* How to obtain thread-local storage */
#define THREAD_LOCAL @THREAD_LOCAL@
/* Define to the full name of this package. */
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
+9 -9
View File
@@ -48,9 +48,9 @@ rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
r = inptr[RGB_RED];
g = inptr[RGB_GREEN];
b = inptr[RGB_BLUE];
inptr += RGB_PIXELSIZE;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
@@ -100,9 +100,9 @@ rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
outptr = output_buf[0][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
r = inptr[RGB_RED];
g = inptr[RGB_GREEN];
b = inptr[RGB_BLUE];
inptr += RGB_PIXELSIZE;
/* Y */
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
@@ -135,9 +135,9 @@ rgb_rgb_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);
outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);
outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);
outptr0[col] = inptr[RGB_RED];
outptr1[col] = inptr[RGB_GREEN];
outptr2[col] = inptr[RGB_BLUE];
inptr += RGB_PIXELSIZE;
}
}
+6 -6
View File
@@ -392,11 +392,11 @@ cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
outptr3 = output_buf[3][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
r = MAXJSAMPLE - inptr[0];
g = MAXJSAMPLE - inptr[1];
b = MAXJSAMPLE - inptr[2];
/* K passes through as-is */
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
outptr3[col] = inptr[3];
inptr += 4;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
@@ -438,7 +438,7 @@ grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
outptr = output_buf[0][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
outptr[col] = inptr[0];
inptr += instride;
}
}
@@ -497,7 +497,7 @@ null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
inptr = *input_buf;
outptr = output_buf[ci][output_row];
for (col = 0; col < num_cols; col++) {
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
outptr[col] = inptr[ci];
inptr += nc;
}
}
+18 -19
View File
@@ -381,19 +381,19 @@ convsamp(JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)
elemptr = sample_data[elemr] + start_col;
#if DCTSIZE == 8 /* unroll the inner loop */
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
#else
{
register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--)
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = (*elemptr++) - CENTERJSAMPLE;
}
#endif
}
@@ -533,20 +533,19 @@ convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
for (elemr = 0; elemr < DCTSIZE; elemr++) {
elemptr = sample_data[elemr] + start_col;
#if DCTSIZE == 8 /* unroll the inner loop */
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
#else
{
register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--)
*workspaceptr++ = (FAST_FLOAT)
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)((*elemptr++) - CENTERJSAMPLE);
}
#endif
}
+222 -182
View File
@@ -4,8 +4,10 @@
* 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-2019, D. R. Commander.
* Copyright (C) 2009-2011, 2014-2016, 2018-2021, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
* Copyright (C) 2018, Matthias Räncker.
* Copyright (C) 2020, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -34,23 +36,27 @@
* memory footprint by 64k, which is important for some mobile applications
* that create many isolated instances of libjpeg-turbo (web browsers, for
* instance.) This may improve performance on some mobile platforms as well.
* This feature is enabled by default only on ARM processors, because some x86
* This feature is enabled by default only on Arm processors, because some x86
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
* shown to have a significant performance impact even on the x86 chips that
* have a fast implementation of it. When building for ARMv6, you can
* have a fast implementation of it. When building for Armv6, you can
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
* flags (this defines __thumb__).
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \
defined(_M_ARM64)
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif
#ifdef USE_CLZ_INTRINSIC
#if defined(_MSC_VER) && !defined(__clang__)
#define JPEG_NBITS_NONZERO(x) (32 - _CountLeadingZeros(x))
#else
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
#endif
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
#else
#include "jpeg_nbits_table.h"
@@ -65,32 +71,43 @@
* but must not be updated permanently until we complete the MCU.
*/
#if defined(__x86_64__) && defined(__ILP32__)
typedef unsigned long long bit_buf_type;
#else
typedef size_t bit_buf_type;
#endif
/* NOTE: The more optimal Huffman encoding algorithm is only used by the
* intrinsics implementation of the Arm Neon SIMD extensions, which is why we
* retain the old Huffman encoder behavior when using the GAS implementation.
*/
#if defined(WITH_SIMD) && !(defined(__arm__) || defined(__aarch64__) || \
defined(_M_ARM) || defined(_M_ARM64))
typedef unsigned long long simd_bit_buf_type;
#else
typedef bit_buf_type simd_bit_buf_type;
#endif
#if (defined(SIZEOF_SIZE_T) && SIZEOF_SIZE_T == 8) || defined(_WIN64) || \
(defined(__x86_64__) && defined(__ILP32__))
#define BIT_BUF_SIZE 64
#elif (defined(SIZEOF_SIZE_T) && SIZEOF_SIZE_T == 4) || defined(_WIN32)
#define BIT_BUF_SIZE 32
#else
#error Cannot determine word size
#endif
#define SIMD_BIT_BUF_SIZE (sizeof(simd_bit_buf_type) * 8)
typedef struct {
size_t put_buffer; /* current bit-accumulation buffer */
int put_bits; /* # of bits now in it */
union {
bit_buf_type c;
simd_bit_buf_type simd;
} put_buffer; /* current bit accumulation buffer */
int free_bits; /* # of bits available in it */
/* (Neon GAS: # of bits now in it) */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
} savable_state;
/* This macro is to work around compilers with missing or broken
* structure assignment. You'll need to fix this code if you have
* such a compiler and you change MAX_COMPS_IN_SCAN.
*/
#ifndef NO_STRUCT_ASSIGN
#define ASSIGN_STATE(dest, src) ((dest) = (src))
#else
#if MAX_COMPS_IN_SCAN == 4
#define ASSIGN_STATE(dest, src) \
((dest).put_buffer = (src).put_buffer, \
(dest).put_bits = (src).put_bits, \
(dest).last_dc_val[0] = (src).last_dc_val[0], \
(dest).last_dc_val[1] = (src).last_dc_val[1], \
(dest).last_dc_val[2] = (src).last_dc_val[2], \
(dest).last_dc_val[3] = (src).last_dc_val[3])
#endif
#endif
typedef struct {
struct jpeg_entropy_encoder pub; /* public fields */
@@ -123,6 +140,7 @@ typedef struct {
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
savable_state cur; /* Current bit buffer & DC state */
j_compress_ptr cinfo; /* dump_buffer needs access to this */
int simd;
} working_state;
@@ -201,8 +219,17 @@ start_pass_huff(j_compress_ptr cinfo, boolean gather_statistics)
}
/* Initialize bit buffer to empty */
entropy->saved.put_buffer = 0;
entropy->saved.put_bits = 0;
if (entropy->simd) {
entropy->saved.put_buffer.simd = 0;
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
entropy->saved.free_bits = 0;
#else
entropy->saved.free_bits = SIMD_BIT_BUF_SIZE;
#endif
} else {
entropy->saved.put_buffer.c = 0;
entropy->saved.free_bits = BIT_BUF_SIZE;
}
/* Initialize restart stuff */
entropy->restarts_to_go = cinfo->restart_interval;
@@ -287,6 +314,7 @@ jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC, int tblno,
* this lets us detect duplicate VAL entries here, and later
* allows emit_bits to detect any attempt to emit such symbols.
*/
MEMZERO(dtbl->ehufco, sizeof(dtbl->ehufco));
MEMZERO(dtbl->ehufsi, sizeof(dtbl->ehufsi));
/* This is also a convenient place to check for out-of-range
@@ -334,94 +362,94 @@ dump_buffer(working_state *state)
/* Outputting bits to the file */
/* These macros perform the same task as the emit_bits() function in the
* original libjpeg code. In addition to reducing overhead by explicitly
* inlining the code, additional performance is achieved by taking into
* account the size of the bit buffer and waiting until it is almost full
* before emptying it. This mostly benefits 64-bit platforms, since 6
* bytes can be stored in a 64-bit bit buffer before it has to be emptied.
/* Output byte b and, speculatively, an additional 0 byte. 0xFF must be
* encoded as 0xFF 0x00, so the output buffer pointer is advanced by 2 if the
* byte is 0xFF. Otherwise, the output buffer pointer is advanced by 1, and
* the speculative 0 byte will be overwritten by the next byte.
*/
#define EMIT_BYTE() { \
JOCTET c; \
put_bits -= 8; \
c = (JOCTET)GETJOCTET(put_buffer >> put_bits); \
*buffer++ = c; \
if (c == 0xFF) /* need to stuff a zero byte? */ \
*buffer++ = 0; \
#define EMIT_BYTE(b) { \
buffer[0] = (JOCTET)(b); \
buffer[1] = 0; \
buffer -= -2 + ((JOCTET)(b) < 0xFF); \
}
#define PUT_BITS(code, size) { \
put_bits += size; \
put_buffer = (put_buffer << size) | code; \
}
/* Output the entire bit buffer. If there are no 0xFF bytes in it, then write
* directly to the output buffer. Otherwise, use the EMIT_BYTE() macro to
* encode 0xFF as 0xFF 0x00.
*/
#if BIT_BUF_SIZE == 64
#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
#define CHECKBUF15() { \
if (put_bits > 15) { \
EMIT_BYTE() \
EMIT_BYTE() \
#define FLUSH() { \
if (put_buffer & 0x8080808080808080 & ~(put_buffer + 0x0101010101010101)) { \
EMIT_BYTE(put_buffer >> 56) \
EMIT_BYTE(put_buffer >> 48) \
EMIT_BYTE(put_buffer >> 40) \
EMIT_BYTE(put_buffer >> 32) \
EMIT_BYTE(put_buffer >> 24) \
EMIT_BYTE(put_buffer >> 16) \
EMIT_BYTE(put_buffer >> 8) \
EMIT_BYTE(put_buffer ) \
} else { \
buffer[0] = (JOCTET)(put_buffer >> 56); \
buffer[1] = (JOCTET)(put_buffer >> 48); \
buffer[2] = (JOCTET)(put_buffer >> 40); \
buffer[3] = (JOCTET)(put_buffer >> 32); \
buffer[4] = (JOCTET)(put_buffer >> 24); \
buffer[5] = (JOCTET)(put_buffer >> 16); \
buffer[6] = (JOCTET)(put_buffer >> 8); \
buffer[7] = (JOCTET)(put_buffer); \
buffer += 8; \
} \
}
#endif
#define CHECKBUF31() { \
if (put_bits > 31) { \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
} \
}
#define CHECKBUF47() { \
if (put_bits > 47) { \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
EMIT_BYTE() \
} \
}
#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T)
#error Cannot determine word size
#endif
#if SIZEOF_SIZE_T == 8 || defined(_WIN64)
#define EMIT_BITS(code, size) { \
CHECKBUF47() \
PUT_BITS(code, size) \
}
#define EMIT_CODE(code, size) { \
temp2 &= (((JLONG)1) << nbits) - 1; \
CHECKBUF31() \
PUT_BITS(code, size) \
PUT_BITS(temp2, nbits) \
}
#else
#define EMIT_BITS(code, size) { \
PUT_BITS(code, size) \
CHECKBUF15() \
}
#define EMIT_CODE(code, size) { \
temp2 &= (((JLONG)1) << nbits) - 1; \
PUT_BITS(code, size) \
CHECKBUF15() \
PUT_BITS(temp2, nbits) \
CHECKBUF15() \
#define FLUSH() { \
if (put_buffer & 0x80808080 & ~(put_buffer + 0x01010101)) { \
EMIT_BYTE(put_buffer >> 24) \
EMIT_BYTE(put_buffer >> 16) \
EMIT_BYTE(put_buffer >> 8) \
EMIT_BYTE(put_buffer ) \
} else { \
buffer[0] = (JOCTET)(put_buffer >> 24); \
buffer[1] = (JOCTET)(put_buffer >> 16); \
buffer[2] = (JOCTET)(put_buffer >> 8); \
buffer[3] = (JOCTET)(put_buffer); \
buffer += 4; \
} \
}
#endif
/* Fill the bit buffer to capacity with the leading bits from code, then output
* the bit buffer and put the remaining bits from code into the bit buffer.
*/
#define PUT_AND_FLUSH(code, size) { \
put_buffer = (put_buffer << (size + free_bits)) | (code >> -free_bits); \
FLUSH() \
free_bits += BIT_BUF_SIZE; \
put_buffer = code; \
}
/* Insert code into the bit buffer and output the bit buffer if needed.
* NOTE: We can't flush with free_bits == 0, since the left shift in
* PUT_AND_FLUSH() would have undefined behavior.
*/
#define PUT_BITS(code, size) { \
free_bits -= size; \
if (free_bits < 0) \
PUT_AND_FLUSH(code, size) \
else \
put_buffer = (put_buffer << size) | code; \
}
#define PUT_CODE(code, size) { \
temp &= (((JLONG)1) << nbits) - 1; \
temp |= code << nbits; \
nbits += size; \
PUT_BITS(temp, nbits) \
}
/* Although it is exceedingly rare, it is possible for a Huffman-encoded
* coefficient block to be larger than the 128-byte unencoded block. For each
@@ -444,6 +472,7 @@ dump_buffer(working_state *state)
#define STORE_BUFFER() { \
if (localbuf) { \
size_t bytes, bytestocopy; \
bytes = buffer - _buffer; \
buffer = _buffer; \
while (bytes > 0) { \
@@ -466,20 +495,46 @@ dump_buffer(working_state *state)
LOCAL(boolean)
flush_bits(working_state *state)
{
JOCTET _buffer[BUFSIZE], *buffer;
size_t put_buffer; int put_bits;
size_t bytes, bytestocopy; int localbuf = 0;
JOCTET _buffer[BUFSIZE], *buffer, temp;
simd_bit_buf_type put_buffer; int put_bits;
int localbuf = 0;
if (state->simd) {
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
put_bits = state->cur.free_bits;
#else
put_bits = SIMD_BIT_BUF_SIZE - state->cur.free_bits;
#endif
put_buffer = state->cur.put_buffer.simd;
} else {
put_bits = BIT_BUF_SIZE - state->cur.free_bits;
put_buffer = state->cur.put_buffer.c;
}
put_buffer = state->cur.put_buffer;
put_bits = state->cur.put_bits;
LOAD_BUFFER()
/* fill any partial byte with ones */
PUT_BITS(0x7F, 7)
while (put_bits >= 8) EMIT_BYTE()
while (put_bits >= 8) {
put_bits -= 8;
temp = (JOCTET)(put_buffer >> put_bits);
EMIT_BYTE(temp)
}
if (put_bits) {
/* fill partial byte with ones */
temp = (JOCTET)((put_buffer << (8 - put_bits)) | (0xFF >> put_bits));
EMIT_BYTE(temp)
}
state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
state->cur.put_bits = 0;
if (state->simd) { /* and reset bit buffer to empty */
state->cur.put_buffer.simd = 0;
#if defined(__aarch64__) && !defined(NEON_INTRINSICS)
state->cur.free_bits = 0;
#else
state->cur.free_bits = SIMD_BIT_BUF_SIZE;
#endif
} else {
state->cur.put_buffer.c = 0;
state->cur.free_bits = BIT_BUF_SIZE;
}
STORE_BUFFER()
return TRUE;
@@ -493,7 +548,7 @@ encode_one_block_simd(working_state *state, JCOEFPTR block, int last_dc_val,
c_derived_tbl *dctbl, c_derived_tbl *actbl)
{
JOCTET _buffer[BUFSIZE], *buffer;
size_t bytes, bytestocopy; int localbuf = 0;
int localbuf = 0;
LOAD_BUFFER()
@@ -509,53 +564,41 @@ LOCAL(boolean)
encode_one_block(working_state *state, JCOEFPTR block, int last_dc_val,
c_derived_tbl *dctbl, c_derived_tbl *actbl)
{
int temp, temp2, temp3;
int nbits;
int r, code, size;
int temp, nbits, free_bits;
bit_buf_type put_buffer;
JOCTET _buffer[BUFSIZE], *buffer;
size_t put_buffer; int put_bits;
int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];
size_t bytes, bytestocopy; int localbuf = 0;
int localbuf = 0;
put_buffer = state->cur.put_buffer;
put_bits = state->cur.put_bits;
free_bits = state->cur.free_bits;
put_buffer = state->cur.put_buffer.c;
LOAD_BUFFER()
/* Encode the DC coefficient difference per section F.1.2.1 */
temp = temp2 = block[0] - last_dc_val;
temp = block[0] - last_dc_val;
/* This is a well-known technique for obtaining the absolute value without a
* branch. It is derived from an assembly language technique presented in
* "How to Optimize for the Pentium Processors", Copyright (c) 1996, 1997 by
* Agner Fog.
* Agner Fog. This code assumes we are on a two's complement machine.
*/
temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);
temp ^= temp3;
temp -= temp3;
/* For a negative input, want temp2 = bitwise complement of abs(input) */
/* This code assumes we are on a two's complement machine */
temp2 += temp3;
nbits = temp >> (CHAR_BIT * sizeof(int) - 1);
temp += nbits;
nbits ^= temp;
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = JPEG_NBITS(temp);
nbits = JPEG_NBITS(nbits);
/* Emit the Huffman-coded symbol for the number of bits */
code = dctbl->ehufco[nbits];
size = dctbl->ehufsi[nbits];
EMIT_BITS(code, size)
/* Mask off any extra bits in code */
temp2 &= (((JLONG)1) << nbits) - 1;
/* Emit that number of bits of the value, if positive, */
/* or the complement of its magnitude, if negative. */
EMIT_BITS(temp2, nbits)
/* Emit the Huffman-coded symbol for the number of bits.
* Emit that number of bits of the value, if positive,
* or the complement of its magnitude, if negative.
*/
PUT_CODE(dctbl->ehufco[nbits], dctbl->ehufsi[nbits])
/* Encode the AC coefficients per section F.1.2.2 */
r = 0; /* r = run length of zeros */
{
int r = 0; /* r = run length of zeros */
/* Manually unroll the k loop to eliminate the counter variable. This
* improves performance greatly on systems with a limited number of
@@ -563,51 +606,46 @@ encode_one_block(working_state *state, JCOEFPTR block, int last_dc_val,
*/
#define kloop(jpeg_natural_order_of_k) { \
if ((temp = block[jpeg_natural_order_of_k]) == 0) { \
r++; \
r += 16; \
} else { \
temp2 = temp; \
/* Branch-less absolute value, bitwise complement, etc., same as above */ \
temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); \
temp ^= temp3; \
temp -= temp3; \
temp2 += temp3; \
nbits = JPEG_NBITS_NONZERO(temp); \
nbits = temp >> (CHAR_BIT * sizeof(int) - 1); \
temp += nbits; \
nbits ^= temp; \
nbits = JPEG_NBITS_NONZERO(nbits); \
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
while (r > 15) { \
EMIT_BITS(code_0xf0, size_0xf0) \
r -= 16; \
while (r >= 16 * 16) { \
r -= 16 * 16; \
PUT_BITS(actbl->ehufco[0xf0], actbl->ehufsi[0xf0]) \
} \
/* Emit Huffman symbol for run length / number of bits */ \
temp3 = (r << 4) + nbits; \
code = actbl->ehufco[temp3]; \
size = actbl->ehufsi[temp3]; \
EMIT_CODE(code, size) \
r += nbits; \
PUT_CODE(actbl->ehufco[r], actbl->ehufsi[r]) \
r = 0; \
} \
}
/* One iteration for each value in jpeg_natural_order[] */
kloop(1); kloop(8); kloop(16); kloop(9); kloop(2); kloop(3);
kloop(10); kloop(17); kloop(24); kloop(32); kloop(25); kloop(18);
kloop(11); kloop(4); kloop(5); kloop(12); kloop(19); kloop(26);
kloop(33); kloop(40); kloop(48); kloop(41); kloop(34); kloop(27);
kloop(20); kloop(13); kloop(6); kloop(7); kloop(14); kloop(21);
kloop(28); kloop(35); kloop(42); kloop(49); kloop(56); kloop(57);
kloop(50); kloop(43); kloop(36); kloop(29); kloop(22); kloop(15);
kloop(23); kloop(30); kloop(37); kloop(44); kloop(51); kloop(58);
kloop(59); kloop(52); kloop(45); kloop(38); kloop(31); kloop(39);
kloop(46); kloop(53); kloop(60); kloop(61); kloop(54); kloop(47);
kloop(55); kloop(62); kloop(63);
/* One iteration for each value in jpeg_natural_order[] */
kloop(1); kloop(8); kloop(16); kloop(9); kloop(2); kloop(3);
kloop(10); kloop(17); kloop(24); kloop(32); kloop(25); kloop(18);
kloop(11); kloop(4); kloop(5); kloop(12); kloop(19); kloop(26);
kloop(33); kloop(40); kloop(48); kloop(41); kloop(34); kloop(27);
kloop(20); kloop(13); kloop(6); kloop(7); kloop(14); kloop(21);
kloop(28); kloop(35); kloop(42); kloop(49); kloop(56); kloop(57);
kloop(50); kloop(43); kloop(36); kloop(29); kloop(22); kloop(15);
kloop(23); kloop(30); kloop(37); kloop(44); kloop(51); kloop(58);
kloop(59); kloop(52); kloop(45); kloop(38); kloop(31); kloop(39);
kloop(46); kloop(53); kloop(60); kloop(61); kloop(54); kloop(47);
kloop(55); kloop(62); kloop(63);
/* If the last coef(s) were zero, emit an end-of-block code */
if (r > 0) {
code = actbl->ehufco[0];
size = actbl->ehufsi[0];
EMIT_BITS(code, size)
/* If the last coef(s) were zero, emit an end-of-block code */
if (r > 0) {
PUT_BITS(actbl->ehufco[0], actbl->ehufsi[0])
}
}
state->cur.put_buffer = put_buffer;
state->cur.put_bits = put_bits;
state->cur.put_buffer.c = put_buffer;
state->cur.free_bits = free_bits;
STORE_BUFFER()
return TRUE;
@@ -654,8 +692,9 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
/* Load up working state */
state.next_output_byte = cinfo->dest->next_output_byte;
state.free_in_buffer = cinfo->dest->free_in_buffer;
ASSIGN_STATE(state.cur, entropy->saved);
state.cur = entropy->saved;
state.cinfo = cinfo;
state.simd = entropy->simd;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
@@ -694,7 +733,7 @@ encode_mcu_huff(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
/* Completed MCU, so update state */
cinfo->dest->next_output_byte = state.next_output_byte;
cinfo->dest->free_in_buffer = state.free_in_buffer;
ASSIGN_STATE(entropy->saved, state.cur);
entropy->saved = state.cur;
/* Update restart-interval state too */
if (cinfo->restart_interval) {
@@ -723,8 +762,9 @@ finish_pass_huff(j_compress_ptr cinfo)
/* Load up working state ... flush_bits needs it */
state.next_output_byte = cinfo->dest->next_output_byte;
state.free_in_buffer = cinfo->dest->free_in_buffer;
ASSIGN_STATE(state.cur, entropy->saved);
state.cur = entropy->saved;
state.cinfo = cinfo;
state.simd = entropy->simd;
/* Flush out the last data */
if (!flush_bits(&state))
@@ -733,7 +773,7 @@ finish_pass_huff(j_compress_ptr cinfo)
/* Update state */
cinfo->dest->next_output_byte = state.next_output_byte;
cinfo->dest->free_in_buffer = state.free_in_buffer;
ASSIGN_STATE(entropy->saved, state.cur);
entropy->saved = state.cur;
}
+4 -1
View File
@@ -1,8 +1,10 @@
/*
* jcinit.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -19,6 +21,7 @@
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jpegcomp.h"
/*
+18 -11
View File
@@ -4,8 +4,9 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2011, 2015, 2018, D. R. Commander.
* Copyright (C) 2011, 2015, 2018, 2021, D. R. Commander.
* Copyright (C) 2016, 2018, Matthieu Darbois.
* Copyright (C) 2020, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -43,23 +44,27 @@
* memory footprint by 64k, which is important for some mobile applications
* that create many isolated instances of libjpeg-turbo (web browsers, for
* instance.) This may improve performance on some mobile platforms as well.
* This feature is enabled by default only on ARM processors, because some x86
* This feature is enabled by default only on Arm processors, because some x86
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
* shown to have a significant performance impact even on the x86 chips that
* have a fast implementation of it. When building for ARMv6, you can
* have a fast implementation of it. When building for Armv6, you can
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
* flags (this defines __thumb__).
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \
defined(_M_ARM64)
#if !defined(__thumb__) || defined(__thumb2__)
#define USE_CLZ_INTRINSIC
#endif
#endif
#ifdef USE_CLZ_INTRINSIC
#if defined(_MSC_VER) && !defined(__clang__)
#define JPEG_NBITS_NONZERO(x) (32 - _CountLeadingZeros(x))
#else
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
#endif
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
#else
#include "jpeg_nbits_table.h"
@@ -169,24 +174,26 @@ INLINE
METHODDEF(int)
count_zeroes(size_t *x)
{
int result;
#if defined(HAVE_BUILTIN_CTZL)
int result;
result = __builtin_ctzl(*x);
*x >>= result;
#elif defined(HAVE_BITSCANFORWARD64)
unsigned long result;
_BitScanForward64(&result, *x);
*x >>= result;
#elif defined(HAVE_BITSCANFORWARD)
unsigned long result;
_BitScanForward(&result, *x);
*x >>= result;
#else
result = 0;
int result = 0;
while ((*x & 1) == 0) {
++result;
*x >>= 1;
}
#endif
return result;
return (int)result;
}
@@ -860,7 +867,7 @@ encode_mcu_AC_refine_prepare(const JCOEF *block,
#define ENCODE_COEFS_AC_REFINE(label) { \
while (zerobits) { \
int idx = count_zeroes(&zerobits); \
idx = count_zeroes(&zerobits); \
r += idx; \
cabsvalue += idx; \
signbits >>= idx; \
@@ -917,7 +924,7 @@ METHODDEF(boolean)
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
register int temp, r;
register int temp, r, idx;
char *BR_buffer;
unsigned int BR;
int Sl = cinfo->Se - cinfo->Ss + 1;
@@ -968,7 +975,7 @@ encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
if (zerobits) {
int diff = ((absvalues + DCTSIZE2 / 2) - cabsvalue);
int idx = count_zeroes(&zerobits);
idx = count_zeroes(&zerobits);
signbits >>= idx;
idx += diff;
r += idx;
+23 -40
View File
@@ -6,7 +6,7 @@
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015, D. R. Commander.
* Copyright (C) 2015, 2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -103,7 +103,7 @@ expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
if (numcols > 0) {
for (row = 0; row < num_rows; row++) {
ptr = image_data[row] + input_cols;
pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
pixval = ptr[-1];
for (count = numcols; count > 0; count--)
*ptr++ = pixval;
}
@@ -174,7 +174,7 @@ int_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
for (v = 0; v < v_expand; v++) {
inptr = input_data[inrow + v] + outcol_h;
for (h = 0; h < h_expand; h++) {
outvalue += (JLONG)GETJSAMPLE(*inptr++);
outvalue += (JLONG)(*inptr++);
}
}
*outptr++ = (JSAMPLE)((outvalue + numpix2) / numpix);
@@ -237,8 +237,7 @@ h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
inptr = input_data[outrow];
bias = 0; /* bias = 0,1,0,1,... for successive samples */
for (outcol = 0; outcol < output_cols; outcol++) {
*outptr++ =
(JSAMPLE)((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + bias) >> 1);
*outptr++ = (JSAMPLE)((inptr[0] + inptr[1] + bias) >> 1);
bias ^= 1; /* 0=>1, 1=>0 */
inptr += 2;
}
@@ -277,8 +276,7 @@ h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
bias = 1; /* bias = 1,2,1,2,... for successive samples */
for (outcol = 0; outcol < output_cols; outcol++) {
*outptr++ =
(JSAMPLE)((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + bias) >> 2);
(JSAMPLE)((inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1] + bias) >> 2);
bias ^= 3; /* 1=>2, 2=>1 */
inptr0 += 2; inptr1 += 2;
}
@@ -337,33 +335,25 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
below_ptr = input_data[inrow + 2];
/* Special case for first column: pretend column -1 is same as column 0 */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
inptr0[0] + inptr0[2] + inptr1[0] + inptr1[2];
neighsum += neighsum;
neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
neighsum += above_ptr[0] + above_ptr[2] + below_ptr[0] + below_ptr[2];
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
for (colctr = output_cols - 2; colctr > 0; colctr--) {
/* sum of pixels directly mapped to this output element */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
/* sum of edge-neighbor pixels */
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
inptr0[-1] + inptr0[2] + inptr1[-1] + inptr1[2];
/* The edge-neighbors count twice as much as corner-neighbors */
neighsum += neighsum;
/* Add in the corner-neighbors */
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
neighsum += above_ptr[-1] + above_ptr[2] + below_ptr[-1] + below_ptr[2];
/* form final output scaled up by 2^16 */
membersum = membersum * memberscale + neighsum * neighscale;
/* round, descale and output it */
@@ -372,15 +362,11 @@ h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
}
/* Special case for last column */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
membersum = inptr0[0] + inptr0[1] + inptr1[0] + inptr1[1];
neighsum = above_ptr[0] + above_ptr[1] + below_ptr[0] + below_ptr[1] +
inptr0[-1] + inptr0[1] + inptr1[-1] + inptr1[1];
neighsum += neighsum;
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
neighsum += above_ptr[-1] + above_ptr[1] + below_ptr[-1] + below_ptr[1];
membersum = membersum * memberscale + neighsum * neighscale;
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
@@ -429,21 +415,18 @@ fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
below_ptr = input_data[outrow + 1];
/* Special case for first column */
colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
GETJSAMPLE(*inptr);
membersum = GETJSAMPLE(*inptr++);
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
colsum = (*above_ptr++) + (*below_ptr++) + inptr[0];
membersum = *inptr++;
nextcolsum = above_ptr[0] + below_ptr[0] + inptr[0];
neighsum = colsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
lastcolsum = colsum; colsum = nextcolsum;
for (colctr = output_cols - 2; colctr > 0; colctr--) {
membersum = GETJSAMPLE(*inptr++);
membersum = *inptr++;
above_ptr++; below_ptr++;
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
nextcolsum = above_ptr[0] + below_ptr[0] + inptr[0];
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
@@ -451,7 +434,7 @@ fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
}
/* Special case for last column */
membersum = GETJSAMPLE(*inptr);
membersum = *inptr;
neighsum = lastcolsum + (colsum - membersum) + colsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
+3 -2
View File
@@ -4,8 +4,8 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2009 by Guido Vollbeding.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -17,6 +17,7 @@
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jpegcomp.h"
/* Forward declarations */
+44 -9
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, 2015-2018, D. R. Commander.
* Copyright (C) 2010, 2015-2020, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -21,6 +21,8 @@
#include "jinclude.h"
#include "jdmainct.h"
#include "jdcoefct.h"
#include "jdmaster.h"
#include "jdmerge.h"
#include "jdsample.h"
#include "jmemsys.h"
@@ -316,6 +318,10 @@ LOCAL(void)
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{
JDIMENSION n;
my_master_ptr master = (my_master_ptr)cinfo->master;
JSAMPLE dummy_sample[1] = { 0 };
JSAMPROW dummy_row = dummy_sample;
JSAMPARRAY scanlines = NULL;
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows) = NULL;
@@ -325,6 +331,10 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
color_convert = cinfo->cconvert->color_convert;
cinfo->cconvert->color_convert = noop_convert;
/* This just prevents UBSan from complaining about adding 0 to a NULL
* pointer. The pointer isn't actually used.
*/
scanlines = &dummy_row;
}
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
@@ -332,8 +342,13 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->cquantize->color_quantize = noop_quantize;
}
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
scanlines = &upsample->spare_row;
}
for (n = 0; n < num_lines; n++)
jpeg_read_scanlines(cinfo, NULL, 1);
jpeg_read_scanlines(cinfo, scanlines, 1);
if (color_convert)
cinfo->cconvert->color_convert = color_convert;
@@ -353,6 +368,12 @@ increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
{
JDIMENSION rows_left;
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
my_master_ptr master = (my_master_ptr)cinfo->master;
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
read_and_discard_scanlines(cinfo, rows);
return;
}
/* Increment the counter to the next row group after the skipped rows. */
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
@@ -382,21 +403,27 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
my_master_ptr master = (my_master_ptr)cinfo->master;
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
JDIMENSION i, x;
int y;
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
JDIMENSION lines_to_skip, lines_to_read;
/* Two-pass color quantization is not supported. */
if (cinfo->quantize_colors && cinfo->two_pass_quantize)
ERREXIT(cinfo, JERR_NOTIMPL);
if (cinfo->global_state != DSTATE_SCANNING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Do not skip past the bottom of the image. */
if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
num_lines = cinfo->output_height - cinfo->output_scanline;
cinfo->output_scanline = cinfo->output_height;
(*cinfo->inputctl->finish_input_pass) (cinfo);
cinfo->inputctl->eoi_reached = TRUE;
return cinfo->output_height - cinfo->output_scanline;
return num_lines;
}
if (num_lines == 0)
@@ -445,8 +472,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
main_ptr->buffer_full = FALSE;
main_ptr->rowgroup_ctr = 0;
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
if (!master->using_merged_upsample) {
upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
}
}
/* Skipping is much simpler when context rows are not required. */
@@ -458,8 +487,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->output_scanline += lines_left_in_iMCU_row;
main_ptr->buffer_full = FALSE;
main_ptr->rowgroup_ctr = 0;
upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
if (!master->using_merged_upsample) {
upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
}
}
}
@@ -494,7 +525,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
}
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
if (!master->using_merged_upsample)
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
return num_lines;
}
@@ -506,6 +538,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
* decoded coefficients. This is ~5% faster for large subsets, but
* it's tough to tell a difference for smaller images.
*/
if (!cinfo->entropy->insufficient_data)
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
(*cinfo->entropy->decode_mcu) (cinfo, NULL);
}
}
@@ -535,7 +569,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
* output_scanline.
*/
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
if (!master->using_merged_upsample)
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
/* Always skip the requested number of lines. */
return num_lines;
+12 -3
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Developed 1997-2015 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2018, D. R. Commander.
* Copyright (C) 2015-2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -80,7 +80,7 @@ get_byte(j_decompress_ptr cinfo)
if (!(*src->fill_input_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
src->bytes_in_buffer--;
return GETJOCTET(*src->next_input_byte++);
return *src->next_input_byte++;
}
@@ -665,8 +665,16 @@ bad:
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
int *coef_bit_ptr = &cinfo->coef_bits[cindex][0];
int *prev_coef_bit_ptr =
&cinfo->coef_bits[cindex + cinfo->num_components][0];
if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
for (coefi = MIN(cinfo->Ss, 1); coefi <= MAX(cinfo->Se, 9); coefi++) {
if (cinfo->input_scan_number > 1)
prev_coef_bit_ptr[coefi] = coef_bit_ptr[coefi];
else
prev_coef_bit_ptr[coefi] = 0;
}
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
if (cinfo->Ah != expected)
@@ -727,6 +735,7 @@ bad:
entropy->c = 0;
entropy->a = 0;
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
entropy->pub.insufficient_data = FALSE;
/* Initialize restart counter */
entropy->restarts_to_go = cinfo->restart_interval;
@@ -763,7 +772,7 @@ jinit_arith_decoder(j_decompress_ptr cinfo)
int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2])
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 *
cinfo->num_components * 2 * DCTSIZE2 *
sizeof(int));
coef_bit_ptr = &cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
+1 -2
View File
@@ -143,8 +143,7 @@ empty_mem_output_buffer(j_compress_ptr cinfo)
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
if (dest->newbuffer != NULL)
free(dest->newbuffer);
free(dest->newbuffer);
dest->newbuffer = nextbuffer;
+238 -52
View File
@@ -5,8 +5,8 @@
* Copyright (C) 1994-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2010, 2015-2016, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2010, 2015-2016, 2019-2020, D. R. Commander.
* Copyright (C) 2015, 2020, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -102,6 +102,8 @@ decompress_onepass(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
jzero_far((void *)coef->MCU_buffer[0],
(size_t)(cinfo->blocks_in_MCU * sizeof(JBLOCK)));
if (!cinfo->entropy->insufficient_data)
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
@@ -227,6 +229,8 @@ consume_data(j_decompress_ptr cinfo)
}
}
}
if (!cinfo->entropy->insufficient_data)
cinfo->master->last_good_iMCU_row = cinfo->input_iMCU_row;
/* Try to fetch the MCU. */
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
@@ -326,19 +330,22 @@ decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
#ifdef BLOCK_SMOOTHING_SUPPORTED
/*
* This code applies interblock smoothing as described by section K.8
* of the JPEG standard: the first 5 AC coefficients are estimated from
* the DC values of a DCT block and its 8 neighboring blocks.
* This code applies interblock smoothing; the first 9 AC coefficients are
* estimated from the DC values of a DCT block and its 24 neighboring blocks.
* We apply smoothing only for progressive JPEG decoding, and only if
* the coefficients it can estimate are not yet known to full precision.
*/
/* Natural-order array positions of the first 5 zigzag-order coefficients */
/* Natural-order array positions of the first 9 zigzag-order coefficients */
#define Q01_POS 1
#define Q10_POS 8
#define Q20_POS 16
#define Q11_POS 9
#define Q02_POS 2
#define Q03_POS 3
#define Q12_POS 10
#define Q21_POS 17
#define Q30_POS 24
/*
* Determine whether block smoothing is applicable and safe.
@@ -356,8 +363,8 @@ smoothing_ok(j_decompress_ptr cinfo)
int ci, coefi;
jpeg_component_info *compptr;
JQUANT_TBL *qtable;
int *coef_bits;
int *coef_bits_latch;
int *coef_bits, *prev_coef_bits;
int *coef_bits_latch, *prev_coef_bits_latch;
if (!cinfo->progressive_mode || cinfo->coef_bits == NULL)
return FALSE;
@@ -366,34 +373,47 @@ smoothing_ok(j_decompress_ptr cinfo)
if (coef->coef_bits_latch == NULL)
coef->coef_bits_latch = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
cinfo->num_components *
cinfo->num_components * 2 *
(SAVED_COEFS * sizeof(int)));
coef_bits_latch = coef->coef_bits_latch;
prev_coef_bits_latch =
&coef->coef_bits_latch[cinfo->num_components * SAVED_COEFS];
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* All components' quantization values must already be latched. */
if ((qtable = compptr->quant_table) == NULL)
return FALSE;
/* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
/* Verify DC & first 9 AC quantizers are nonzero to avoid zero-divide. */
if (qtable->quantval[0] == 0 ||
qtable->quantval[Q01_POS] == 0 ||
qtable->quantval[Q10_POS] == 0 ||
qtable->quantval[Q20_POS] == 0 ||
qtable->quantval[Q11_POS] == 0 ||
qtable->quantval[Q02_POS] == 0)
qtable->quantval[Q02_POS] == 0 ||
qtable->quantval[Q03_POS] == 0 ||
qtable->quantval[Q12_POS] == 0 ||
qtable->quantval[Q21_POS] == 0 ||
qtable->quantval[Q30_POS] == 0)
return FALSE;
/* DC values must be at least partly known for all components. */
coef_bits = cinfo->coef_bits[ci];
prev_coef_bits = cinfo->coef_bits[ci + cinfo->num_components];
if (coef_bits[0] < 0)
return FALSE;
coef_bits_latch[0] = coef_bits[0];
/* Block smoothing is helpful if some AC coefficients remain inaccurate. */
for (coefi = 1; coefi <= 5; coefi++) {
for (coefi = 1; coefi < SAVED_COEFS; coefi++) {
if (cinfo->input_scan_number > 1)
prev_coef_bits_latch[coefi] = prev_coef_bits[coefi];
else
prev_coef_bits_latch[coefi] = -1;
coef_bits_latch[coefi] = coef_bits[coefi];
if (coef_bits[coefi] != 0)
smoothing_useful = TRUE;
}
coef_bits_latch += SAVED_COEFS;
prev_coef_bits_latch += SAVED_COEFS;
}
return smoothing_useful;
@@ -412,17 +432,20 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
JDIMENSION block_num, last_block_column;
int ci, block_row, block_rows, access_rows;
JBLOCKARRAY buffer;
JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
JBLOCKROW buffer_ptr, prev_prev_block_row, prev_block_row;
JBLOCKROW next_block_row, next_next_block_row;
JSAMPARRAY output_ptr;
JDIMENSION output_col;
jpeg_component_info *compptr;
inverse_DCT_method_ptr inverse_DCT;
boolean first_row, last_row;
boolean change_dc;
JCOEF *workspace;
int *coef_bits;
JQUANT_TBL *quanttbl;
JLONG Q00, Q01, Q02, Q10, Q11, Q20, num;
int DC1, DC2, DC3, DC4, DC5, DC6, DC7, DC8, DC9;
JLONG Q00, Q01, Q02, Q03 = 0, Q10, Q11, Q12 = 0, Q20, Q21 = 0, Q30 = 0, num;
int DC01, DC02, DC03, DC04, DC05, DC06, DC07, DC08, DC09, DC10, DC11, DC12,
DC13, DC14, DC15, DC16, DC17, DC18, DC19, DC20, DC21, DC22, DC23, DC24,
DC25;
int Al, pred;
/* Keep a local variable to avoid looking it up more than once */
@@ -434,10 +457,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
if (cinfo->input_scan_number == cinfo->output_scan_number) {
/* If input is working on current scan, we ordinarily want it to
* have completed the current row. But if input scan is DC,
* we want it to keep one row ahead so that next block row's DC
* we want it to keep two rows ahead so that next two block rows' DC
* values are up to date.
*/
JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
JDIMENSION delta = (cinfo->Ss == 0) ? 2 : 0;
if (cinfo->input_iMCU_row > cinfo->output_iMCU_row + delta)
break;
}
@@ -452,34 +475,53 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
if (!compptr->component_needed)
continue;
/* Count non-dummy DCT block rows in this iMCU row. */
if (cinfo->output_iMCU_row < last_iMCU_row) {
if (cinfo->output_iMCU_row < last_iMCU_row - 1) {
block_rows = compptr->v_samp_factor;
access_rows = block_rows * 3; /* this and next two iMCU rows */
} else if (cinfo->output_iMCU_row < last_iMCU_row) {
block_rows = compptr->v_samp_factor;
access_rows = block_rows * 2; /* this and next iMCU row */
last_row = FALSE;
} else {
/* NB: can't use last_row_height here; it is input-side-dependent! */
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
if (block_rows == 0) block_rows = compptr->v_samp_factor;
access_rows = block_rows; /* this iMCU row only */
last_row = TRUE;
}
/* Align the virtual buffer for this component. */
if (cinfo->output_iMCU_row > 0) {
access_rows += compptr->v_samp_factor; /* prior iMCU row too */
if (cinfo->output_iMCU_row > 1) {
access_rows += 2 * compptr->v_samp_factor; /* prior two iMCU rows too */
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[ci],
(cinfo->output_iMCU_row - 2) * compptr->v_samp_factor,
(JDIMENSION)access_rows, FALSE);
buffer += 2 * compptr->v_samp_factor; /* point to current iMCU row */
} else if (cinfo->output_iMCU_row > 0) {
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[ci],
(cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
(JDIMENSION)access_rows, FALSE);
buffer += compptr->v_samp_factor; /* point to current iMCU row */
first_row = FALSE;
} else {
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[ci],
(JDIMENSION)0, (JDIMENSION)access_rows, FALSE);
first_row = TRUE;
}
/* Fetch component-dependent info */
coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
/* Fetch component-dependent info.
* If the current scan is incomplete, then we use the component-dependent
* info from the previous scan.
*/
if (cinfo->output_iMCU_row > cinfo->master->last_good_iMCU_row)
coef_bits =
coef->coef_bits_latch + ((ci + cinfo->num_components) * SAVED_COEFS);
else
coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
/* We only do DC interpolation if no AC coefficient data is available. */
change_dc =
coef_bits[1] == -1 && coef_bits[2] == -1 && coef_bits[3] == -1 &&
coef_bits[4] == -1 && coef_bits[5] == -1 && coef_bits[6] == -1 &&
coef_bits[7] == -1 && coef_bits[8] == -1 && coef_bits[9] == -1;
quanttbl = compptr->quant_table;
Q00 = quanttbl->quantval[0];
Q01 = quanttbl->quantval[Q01_POS];
@@ -487,25 +529,51 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
Q20 = quanttbl->quantval[Q20_POS];
Q11 = quanttbl->quantval[Q11_POS];
Q02 = quanttbl->quantval[Q02_POS];
if (change_dc) {
Q03 = quanttbl->quantval[Q03_POS];
Q12 = quanttbl->quantval[Q12_POS];
Q21 = quanttbl->quantval[Q21_POS];
Q30 = quanttbl->quantval[Q30_POS];
}
inverse_DCT = cinfo->idct->inverse_DCT[ci];
output_ptr = output_buf[ci];
/* Loop over all DCT blocks to be processed. */
for (block_row = 0; block_row < block_rows; block_row++) {
buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
if (first_row && block_row == 0)
if (block_row > 0 || cinfo->output_iMCU_row > 0)
prev_block_row =
buffer[block_row - 1] + cinfo->master->first_MCU_col[ci];
else
prev_block_row = buffer_ptr;
if (block_row > 1 || cinfo->output_iMCU_row > 1)
prev_prev_block_row =
buffer[block_row - 2] + cinfo->master->first_MCU_col[ci];
else
prev_prev_block_row = prev_block_row;
if (block_row < block_rows - 1 || cinfo->output_iMCU_row < last_iMCU_row)
next_block_row =
buffer[block_row + 1] + cinfo->master->first_MCU_col[ci];
else
prev_block_row = buffer[block_row - 1];
if (last_row && block_row == block_rows - 1)
next_block_row = buffer_ptr;
if (block_row < block_rows - 2 ||
cinfo->output_iMCU_row < last_iMCU_row - 1)
next_next_block_row =
buffer[block_row + 2] + cinfo->master->first_MCU_col[ci];
else
next_block_row = buffer[block_row + 1];
next_next_block_row = next_block_row;
/* We fetch the surrounding DC values using a sliding-register approach.
* Initialize all nine here so as to do the right thing on narrow pics.
* Initialize all 25 here so as to do the right thing on narrow pics.
*/
DC1 = DC2 = DC3 = (int)prev_block_row[0][0];
DC4 = DC5 = DC6 = (int)buffer_ptr[0][0];
DC7 = DC8 = DC9 = (int)next_block_row[0][0];
DC01 = DC02 = DC03 = DC04 = DC05 = (int)prev_prev_block_row[0][0];
DC06 = DC07 = DC08 = DC09 = DC10 = (int)prev_block_row[0][0];
DC11 = DC12 = DC13 = DC14 = DC15 = (int)buffer_ptr[0][0];
DC16 = DC17 = DC18 = DC19 = DC20 = (int)next_block_row[0][0];
DC21 = DC22 = DC23 = DC24 = DC25 = (int)next_next_block_row[0][0];
output_col = 0;
last_block_column = compptr->width_in_blocks - 1;
for (block_num = cinfo->master->first_MCU_col[ci];
@@ -513,18 +581,39 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
/* Fetch current DCT block into workspace so we can modify it. */
jcopy_block_row(buffer_ptr, (JBLOCKROW)workspace, (JDIMENSION)1);
/* Update DC values */
if (block_num < last_block_column) {
DC3 = (int)prev_block_row[1][0];
DC6 = (int)buffer_ptr[1][0];
DC9 = (int)next_block_row[1][0];
if (block_num == cinfo->master->first_MCU_col[ci] &&
block_num < last_block_column) {
DC04 = (int)prev_prev_block_row[1][0];
DC09 = (int)prev_block_row[1][0];
DC14 = (int)buffer_ptr[1][0];
DC19 = (int)next_block_row[1][0];
DC24 = (int)next_next_block_row[1][0];
}
/* Compute coefficient estimates per K.8.
* An estimate is applied only if coefficient is still zero,
* and is not known to be fully accurate.
if (block_num + 1 < last_block_column) {
DC05 = (int)prev_prev_block_row[2][0];
DC10 = (int)prev_block_row[2][0];
DC15 = (int)buffer_ptr[2][0];
DC20 = (int)next_block_row[2][0];
DC25 = (int)next_next_block_row[2][0];
}
/* If DC interpolation is enabled, compute coefficient estimates using
* a Gaussian-like kernel, keeping the averages of the DC values.
*
* If DC interpolation is disabled, compute coefficient estimates using
* an algorithm similar to the one described in Section K.8 of the JPEG
* standard, except applied to a 5x5 window rather than a 3x3 window.
*
* An estimate is applied only if the coefficient is still zero and is
* not known to be fully accurate.
*/
/* AC01 */
if ((Al = coef_bits[1]) != 0 && workspace[1] == 0) {
num = 36 * Q00 * (DC4 - DC6);
num = Q00 * (change_dc ?
(-DC01 - DC02 + DC04 + DC05 - 3 * DC06 + 13 * DC07 -
13 * DC09 + 3 * DC10 - 3 * DC11 + 38 * DC12 - 38 * DC14 +
3 * DC15 - 3 * DC16 + 13 * DC17 - 13 * DC19 + 3 * DC20 -
DC21 - DC22 + DC24 + DC25) :
(-7 * DC11 + 50 * DC12 - 50 * DC14 + 7 * DC15));
if (num >= 0) {
pred = (int)(((Q01 << 7) + num) / (Q01 << 8));
if (Al > 0 && pred >= (1 << Al))
@@ -539,7 +628,12 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
/* AC10 */
if ((Al = coef_bits[2]) != 0 && workspace[8] == 0) {
num = 36 * Q00 * (DC2 - DC8);
num = Q00 * (change_dc ?
(-DC01 - 3 * DC02 - 3 * DC03 - 3 * DC04 - DC05 - DC06 +
13 * DC07 + 38 * DC08 + 13 * DC09 - DC10 + DC16 -
13 * DC17 - 38 * DC18 - 13 * DC19 + DC20 + DC21 +
3 * DC22 + 3 * DC23 + 3 * DC24 + DC25) :
(-7 * DC03 + 50 * DC08 - 50 * DC18 + 7 * DC23));
if (num >= 0) {
pred = (int)(((Q10 << 7) + num) / (Q10 << 8));
if (Al > 0 && pred >= (1 << Al))
@@ -554,7 +648,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
/* AC20 */
if ((Al = coef_bits[3]) != 0 && workspace[16] == 0) {
num = 9 * Q00 * (DC2 + DC8 - 2 * DC5);
num = Q00 * (change_dc ?
(DC03 + 2 * DC07 + 7 * DC08 + 2 * DC09 - 5 * DC12 - 14 * DC13 -
5 * DC14 + 2 * DC17 + 7 * DC18 + 2 * DC19 + DC23) :
(-DC03 + 13 * DC08 - 24 * DC13 + 13 * DC18 - DC23));
if (num >= 0) {
pred = (int)(((Q20 << 7) + num) / (Q20 << 8));
if (Al > 0 && pred >= (1 << Al))
@@ -569,7 +666,11 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
/* AC11 */
if ((Al = coef_bits[4]) != 0 && workspace[9] == 0) {
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
num = Q00 * (change_dc ?
(-DC01 + DC05 + 9 * DC07 - 9 * DC09 - 9 * DC17 +
9 * DC19 + DC21 - DC25) :
(DC10 + DC16 - 10 * DC17 + 10 * DC19 - DC02 - DC20 + DC22 -
DC24 + DC04 - DC06 + 10 * DC07 - 10 * DC09));
if (num >= 0) {
pred = (int)(((Q11 << 7) + num) / (Q11 << 8));
if (Al > 0 && pred >= (1 << Al))
@@ -584,7 +685,10 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
/* AC02 */
if ((Al = coef_bits[5]) != 0 && workspace[2] == 0) {
num = 9 * Q00 * (DC4 + DC6 - 2 * DC5);
num = Q00 * (change_dc ?
(2 * DC07 - 5 * DC08 + 2 * DC09 + DC11 + 7 * DC12 - 14 * DC13 +
7 * DC14 + DC15 + 2 * DC17 - 5 * DC18 + 2 * DC19) :
(-DC11 + 13 * DC12 - 24 * DC13 + 13 * DC14 - DC15));
if (num >= 0) {
pred = (int)(((Q02 << 7) + num) / (Q02 << 8));
if (Al > 0 && pred >= (1 << Al))
@@ -597,14 +701,96 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
workspace[2] = (JCOEF)pred;
}
if (change_dc) {
/* AC03 */
if ((Al = coef_bits[6]) != 0 && workspace[3] == 0) {
num = Q00 * (DC07 - DC09 + 2 * DC12 - 2 * DC14 + DC17 - DC19);
if (num >= 0) {
pred = (int)(((Q03 << 7) + num) / (Q03 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q03 << 7) - num) / (Q03 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[3] = (JCOEF)pred;
}
/* AC12 */
if ((Al = coef_bits[7]) != 0 && workspace[10] == 0) {
num = Q00 * (DC07 - 3 * DC08 + DC09 - DC17 + 3 * DC18 - DC19);
if (num >= 0) {
pred = (int)(((Q12 << 7) + num) / (Q12 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q12 << 7) - num) / (Q12 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[10] = (JCOEF)pred;
}
/* AC21 */
if ((Al = coef_bits[8]) != 0 && workspace[17] == 0) {
num = Q00 * (DC07 - DC09 - 3 * DC12 + 3 * DC14 + DC17 - DC19);
if (num >= 0) {
pred = (int)(((Q21 << 7) + num) / (Q21 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q21 << 7) - num) / (Q21 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[17] = (JCOEF)pred;
}
/* AC30 */
if ((Al = coef_bits[9]) != 0 && workspace[24] == 0) {
num = Q00 * (DC07 + 2 * DC08 + DC09 - DC17 - 2 * DC18 - DC19);
if (num >= 0) {
pred = (int)(((Q30 << 7) + num) / (Q30 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q30 << 7) - num) / (Q30 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[24] = (JCOEF)pred;
}
/* coef_bits[0] is non-negative. Otherwise this function would not
* be called.
*/
num = Q00 *
(-2 * DC01 - 6 * DC02 - 8 * DC03 - 6 * DC04 - 2 * DC05 -
6 * DC06 + 6 * DC07 + 42 * DC08 + 6 * DC09 - 6 * DC10 -
8 * DC11 + 42 * DC12 + 152 * DC13 + 42 * DC14 - 8 * DC15 -
6 * DC16 + 6 * DC17 + 42 * DC18 + 6 * DC19 - 6 * DC20 -
2 * DC21 - 6 * DC22 - 8 * DC23 - 6 * DC24 - 2 * DC25);
if (num >= 0) {
pred = (int)(((Q00 << 7) + num) / (Q00 << 8));
} else {
pred = (int)(((Q00 << 7) - num) / (Q00 << 8));
pred = -pred;
}
workspace[0] = (JCOEF)pred;
} /* change_dc */
/* OK, do the IDCT */
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)workspace, output_ptr,
output_col);
/* Advance for next column */
DC1 = DC2; DC2 = DC3;
DC4 = DC5; DC5 = DC6;
DC7 = DC8; DC8 = DC9;
buffer_ptr++, prev_block_row++, next_block_row++;
DC01 = DC02; DC02 = DC03; DC03 = DC04; DC04 = DC05;
DC06 = DC07; DC07 = DC08; DC08 = DC09; DC09 = DC10;
DC11 = DC12; DC12 = DC13; DC13 = DC14; DC14 = DC15;
DC16 = DC17; DC17 = DC18; DC18 = DC19; DC19 = DC20;
DC21 = DC22; DC22 = DC23; DC23 = DC24; DC24 = DC25;
buffer_ptr++, prev_block_row++, next_block_row++,
prev_prev_block_row++, next_next_block_row++;
output_col += compptr->_DCT_scaled_size;
}
output_ptr += compptr->_DCT_scaled_size;
@@ -653,7 +839,7 @@ jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
#ifdef BLOCK_SMOOTHING_SUPPORTED
/* If block smoothing could be used, need a bigger window */
if (cinfo->progressive_mode)
access_rows *= 3;
access_rows *= 5;
#endif
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
+2 -1
View File
@@ -5,6 +5,7 @@
* Copyright (C) 1994-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2020, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*/
@@ -51,7 +52,7 @@ typedef struct {
#ifdef BLOCK_SMOOTHING_SUPPORTED
/* When doing block smoothing, we latch coefficient Al values here */
int *coef_bits_latch;
#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
#define SAVED_COEFS 10 /* we save coef_bits[0..9] */
#endif
} my_coef_controller;
+48 -48
View File
@@ -45,9 +45,9 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[y + Crrtab[cr]];
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
@@ -58,18 +58,18 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[y + Crrtab[cr]];
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
b = range_limit[y + Cbbtab[cb]];
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[y + Crrtab[cr]];
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
@@ -80,9 +80,9 @@ ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr += 4;
}
if (num_cols & 1) {
y = GETJSAMPLE(*inptr0);
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
y = *inptr0;
cb = *inptr1;
cr = *inptr2;
r = range_limit[y + Crrtab[cr]];
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
@@ -125,9 +125,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
g = range_limit[DITHER_565_G(y +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
@@ -139,9 +139,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
g = range_limit[DITHER_565_G(y +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
@@ -150,9 +150,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
d0 = DITHER_ROTATE(d0);
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
y = *inptr0++;
cb = *inptr1++;
cr = *inptr2++;
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
g = range_limit[DITHER_565_G(y +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
@@ -165,9 +165,9 @@ ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr += 4;
}
if (num_cols & 1) {
y = GETJSAMPLE(*inptr0);
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
y = *inptr0;
cb = *inptr1;
cr = *inptr2;
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
g = range_limit[DITHER_565_G(y +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
@@ -202,32 +202,32 @@ rgb_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
r = GETJSAMPLE(*inptr0++);
g = GETJSAMPLE(*inptr1++);
b = GETJSAMPLE(*inptr2++);
r = *inptr0++;
g = *inptr1++;
b = *inptr2++;
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
r = GETJSAMPLE(*inptr0++);
g = GETJSAMPLE(*inptr1++);
b = GETJSAMPLE(*inptr2++);
r = *inptr0++;
g = *inptr1++;
b = *inptr2++;
rgb = PACK_SHORT_565(r, g, b);
r = GETJSAMPLE(*inptr0++);
g = GETJSAMPLE(*inptr1++);
b = GETJSAMPLE(*inptr2++);
r = *inptr0++;
g = *inptr1++;
b = *inptr2++;
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
outptr += 4;
}
if (num_cols & 1) {
r = GETJSAMPLE(*inptr0);
g = GETJSAMPLE(*inptr1);
b = GETJSAMPLE(*inptr2);
r = *inptr0;
g = *inptr1;
b = *inptr2;
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
}
@@ -259,24 +259,24 @@ rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
r = range_limit[DITHER_565_R(*inptr0++, d0)];
g = range_limit[DITHER_565_G(*inptr1++, d0)];
b = range_limit[DITHER_565_B(*inptr2++, d0)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
r = range_limit[DITHER_565_R(*inptr0++, d0)];
g = range_limit[DITHER_565_G(*inptr1++, d0)];
b = range_limit[DITHER_565_B(*inptr2++, d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_SHORT_565(r, g, b);
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
r = range_limit[DITHER_565_R(*inptr0++, d0)];
g = range_limit[DITHER_565_G(*inptr1++, d0)];
b = range_limit[DITHER_565_B(*inptr2++, d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
@@ -284,9 +284,9 @@ rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr += 4;
}
if (num_cols & 1) {
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0), d0)];
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1), d0)];
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2), d0)];
r = range_limit[DITHER_565_R(*inptr0, d0)];
g = range_limit[DITHER_565_G(*inptr1, d0)];
b = range_limit[DITHER_565_B(*inptr2, d0)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
}
+3 -5
View File
@@ -53,9 +53,9 @@ ycc_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
y = GETJSAMPLE(inptr0[col]);
cb = GETJSAMPLE(inptr1[col]);
cr = GETJSAMPLE(inptr2[col]);
y = inptr0[col];
cb = inptr1[col];
cr = inptr2[col];
/* Range-limiting is essential due to noise introduced by DCT losses. */
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
outptr[RGB_GREEN] = range_limit[y +
@@ -93,7 +93,6 @@ gray_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
inptr = input_buf[0][input_row++];
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
/* We can dispense with GETJSAMPLE() here */
outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
/* alpha channel value */
@@ -128,7 +127,6 @@ rgb_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
/* We can dispense with GETJSAMPLE() here */
outptr[RGB_RED] = inptr0[col];
outptr[RGB_GREEN] = inptr1[col];
outptr[RGB_BLUE] = inptr2[col];
+11 -12
View File
@@ -341,9 +341,9 @@ rgb_gray_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr0[col]);
g = GETJSAMPLE(inptr1[col]);
b = GETJSAMPLE(inptr2[col]);
r = inptr0[col];
g = inptr1[col];
b = inptr2[col];
/* Y */
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
ctab[b + B_Y_OFF]) >> SCALEBITS);
@@ -550,9 +550,9 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
y = GETJSAMPLE(inptr0[col]);
cb = GETJSAMPLE(inptr1[col]);
cr = GETJSAMPLE(inptr2[col]);
y = inptr0[col];
cb = inptr1[col];
cr = inptr2[col];
/* Range-limiting is essential due to noise introduced by DCT losses. */
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
@@ -560,7 +560,7 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
SCALEBITS)))];
outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
/* K passes through unchanged */
outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
outptr[3] = inptr3[col];
outptr += 4;
}
}
@@ -571,11 +571,10 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
* RGB565 conversion
*/
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
(((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
(((g) << 11) & 0xE000) | \
(((b) << 5) & 0x1F00))
#define PACK_SHORT_565_LE(r, g, b) \
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) \
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
+27 -33
View File
@@ -5,6 +5,7 @@
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
* Copyright (C) 2018, Matthias Räncker.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -39,24 +40,6 @@ typedef struct {
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
} savable_state;
/* This macro is to work around compilers with missing or broken
* structure assignment. You'll need to fix this code if you have
* such a compiler and you change MAX_COMPS_IN_SCAN.
*/
#ifndef NO_STRUCT_ASSIGN
#define ASSIGN_STATE(dest, src) ((dest) = (src))
#else
#if MAX_COMPS_IN_SCAN == 4
#define ASSIGN_STATE(dest, src) \
((dest).last_dc_val[0] = (src).last_dc_val[0], \
(dest).last_dc_val[1] = (src).last_dc_val[1], \
(dest).last_dc_val[2] = (src).last_dc_val[2], \
(dest).last_dc_val[3] = (src).last_dc_val[3])
#endif
#endif
typedef struct {
struct jpeg_entropy_decoder pub; /* public fields */
@@ -325,7 +308,7 @@ jpeg_fill_bit_buffer(bitread_working_state *state,
bytes_in_buffer = cinfo->src->bytes_in_buffer;
}
bytes_in_buffer--;
c = GETJOCTET(*next_input_byte++);
c = *next_input_byte++;
/* If it's 0xFF, check and discard stuffed zero byte */
if (c == 0xFF) {
@@ -342,7 +325,7 @@ jpeg_fill_bit_buffer(bitread_working_state *state,
bytes_in_buffer = cinfo->src->bytes_in_buffer;
}
bytes_in_buffer--;
c = GETJOCTET(*next_input_byte++);
c = *next_input_byte++;
} while (c == 0xFF);
if (c == 0) {
@@ -405,8 +388,8 @@ no_more_bytes:
#define GET_BYTE { \
register int c0, c1; \
c0 = GETJOCTET(*buffer++); \
c1 = GETJOCTET(*buffer); \
c0 = *buffer++; \
c1 = *buffer; \
/* Pre-execute most common case */ \
get_buffer = (get_buffer << 8) | c0; \
bits_left += 8; \
@@ -423,7 +406,7 @@ no_more_bytes:
} \
}
#if SIZEOF_SIZE_T == 8 || defined(_WIN64)
#if SIZEOF_SIZE_T == 8 || defined(_WIN64) || (defined(__x86_64__) && defined(__ILP32__))
/* Pre-fetch 48 bytes, because the holding register is 64-bit */
#define FILL_BIT_BUFFER_FAST \
@@ -557,6 +540,12 @@ process_restart(j_decompress_ptr cinfo)
}
#if defined(__has_feature)
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("signed-integer-overflow"),
no_sanitize("unsigned-integer-overflow")))
#endif
#endif
LOCAL(boolean)
decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
@@ -568,7 +557,7 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Load up working state */
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(state, entropy->saved);
state = entropy->saved;
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
@@ -589,11 +578,15 @@ 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];
/* This is really just
* s += state.last_dc_val[ci];
* It is written this way in order to shut up UBSan.
/* Certain malformed JPEG images produce repeated DC coefficient
* differences of 2047 or -2047, which causes state.last_dc_val[ci] to
* grow until it overflows or underflows a 32-bit signed integer. This
* behavior is, to the best of our understanding, innocuous, and it is
* unclear how to work around it without potentially affecting
* performance. Thus, we (hopefully temporarily) suppress UBSan integer
* overflow errors for this function.
*/
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
s += state.last_dc_val[ci];
state.last_dc_val[ci] = s;
if (block) {
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
@@ -653,7 +646,7 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
entropy->saved = state;
return TRUE;
}
@@ -671,7 +664,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Load up working state */
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
buffer = (JOCTET *)br_state.next_input_byte;
ASSIGN_STATE(state, entropy->saved);
state = entropy->saved;
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
@@ -688,7 +681,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
int ci = cinfo->MCU_membership[blkn];
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
s += state.last_dc_val[ci];
state.last_dc_val[ci] = s;
if (block)
(*block)[0] = (JCOEF)s;
@@ -740,7 +733,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
br_state.next_input_byte = buffer;
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
entropy->saved = state;
return TRUE;
}
@@ -795,7 +788,8 @@ use_slow:
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
+11 -2
View File
@@ -4,7 +4,8 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2010-2011, 2015-2016, D. R. Commander.
* Copyright (C) 2010-2011, 2015-2016, 2021, D. R. Commander.
* Copyright (C) 2018, Matthias Räncker.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -78,6 +79,11 @@ EXTERN(void) jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC,
typedef size_t bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
#elif defined(__x86_64__) && defined(__ILP32__)
typedef unsigned long long bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 64 /* size of buffer in bits */
#else
typedef unsigned long bit_buf_type; /* type of bit-extraction buffer */
@@ -228,7 +234,10 @@ slowlabel: \
s |= GET_BITS(1); \
nb++; \
} \
s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
if (nb > 16) \
s = 0; \
else \
s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
}
/* Out-of-line case for Huffman code fetching */
+16 -16
View File
@@ -38,18 +38,18 @@ marker_is_icc(jpeg_saved_marker_ptr marker)
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;
marker->data[0] == 0x49 &&
marker->data[1] == 0x43 &&
marker->data[2] == 0x43 &&
marker->data[3] == 0x5F &&
marker->data[4] == 0x50 &&
marker->data[5] == 0x52 &&
marker->data[6] == 0x4F &&
marker->data[7] == 0x46 &&
marker->data[8] == 0x49 &&
marker->data[9] == 0x4C &&
marker->data[10] == 0x45 &&
marker->data[11] == 0x0;
}
@@ -102,12 +102,12 @@ jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr,
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])) {
num_markers = marker->data[13];
else if (num_markers != marker->data[13]) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* inconsistent num_markers fields */
return FALSE;
}
seq_no = GETJOCTET(marker->data[12]);
seq_no = marker->data[12];
if (seq_no <= 0 || seq_no > num_markers) {
WARNMS(cinfo, JWRN_BOGUS_ICC); /* bogus sequence number */
return FALSE;
@@ -154,7 +154,7 @@ jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr,
JOCTET FAR *src_ptr;
JOCTET *dst_ptr;
unsigned int length;
seq_no = GETJOCTET(marker->data[12]);
seq_no = marker->data[12];
dst_ptr = icc_data + data_offset[seq_no];
src_ptr = marker->data + ICC_OVERHEAD_LEN;
length = data_length[seq_no];
+32 -35
View File
@@ -151,7 +151,7 @@ typedef my_marker_reader *my_marker_ptr;
#define INPUT_BYTE(cinfo, V, action) \
MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
bytes_in_buffer--; \
V = GETJOCTET(*next_input_byte++); )
V = *next_input_byte++; )
/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
* V should be declared unsigned int or perhaps JLONG.
@@ -159,10 +159,10 @@ typedef my_marker_reader *my_marker_ptr;
#define INPUT_2BYTES(cinfo, V, action) \
MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
bytes_in_buffer--; \
V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
V = ((unsigned int)(*next_input_byte++)) << 8; \
MAKE_BYTE_AVAIL(cinfo, action); \
bytes_in_buffer--; \
V += GETJOCTET(*next_input_byte++); )
V += *next_input_byte++; )
/*
@@ -608,18 +608,18 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
JLONG totallen = (JLONG)datalen + remaining;
if (datalen >= APP0_DATA_LEN &&
GETJOCTET(data[0]) == 0x4A &&
GETJOCTET(data[1]) == 0x46 &&
GETJOCTET(data[2]) == 0x49 &&
GETJOCTET(data[3]) == 0x46 &&
GETJOCTET(data[4]) == 0) {
data[0] == 0x4A &&
data[1] == 0x46 &&
data[2] == 0x49 &&
data[3] == 0x46 &&
data[4] == 0) {
/* Found JFIF APP0 marker: save info */
cinfo->saw_JFIF_marker = TRUE;
cinfo->JFIF_major_version = GETJOCTET(data[5]);
cinfo->JFIF_minor_version = GETJOCTET(data[6]);
cinfo->density_unit = GETJOCTET(data[7]);
cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
cinfo->JFIF_major_version = data[5];
cinfo->JFIF_minor_version = data[6];
cinfo->density_unit = data[7];
cinfo->X_density = (data[8] << 8) + data[9];
cinfo->Y_density = (data[10] << 8) + data[11];
/* Check version.
* Major version must be 1, anything else signals an incompatible change.
* (We used to treat this as an error, but now it's a nonfatal warning,
@@ -634,24 +634,22 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
/* Validate thumbnail dimensions and issue appropriate messages */
if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
GETJOCTET(data[12]), GETJOCTET(data[13]));
if (data[12] | data[13])
TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, data[12], data[13]);
totallen -= APP0_DATA_LEN;
if (totallen !=
((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG)3))
if (totallen != ((JLONG)data[12] * (JLONG)data[13] * (JLONG)3))
TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int)totallen);
} else if (datalen >= 6 &&
GETJOCTET(data[0]) == 0x4A &&
GETJOCTET(data[1]) == 0x46 &&
GETJOCTET(data[2]) == 0x58 &&
GETJOCTET(data[3]) == 0x58 &&
GETJOCTET(data[4]) == 0) {
data[0] == 0x4A &&
data[1] == 0x46 &&
data[2] == 0x58 &&
data[3] == 0x58 &&
data[4] == 0) {
/* Found JFIF "JFXX" extension APP0 marker */
/* The library doesn't actually do anything with these,
* but we try to produce a helpful trace message.
*/
switch (GETJOCTET(data[5])) {
switch (data[5]) {
case 0x10:
TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int)totallen);
break;
@@ -662,8 +660,7 @@ examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int)totallen);
break;
default:
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
GETJOCTET(data[5]), (int)totallen);
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, data[5], (int)totallen);
break;
}
} else {
@@ -684,16 +681,16 @@ examine_app14(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
unsigned int version, flags0, flags1, transform;
if (datalen >= APP14_DATA_LEN &&
GETJOCTET(data[0]) == 0x41 &&
GETJOCTET(data[1]) == 0x64 &&
GETJOCTET(data[2]) == 0x6F &&
GETJOCTET(data[3]) == 0x62 &&
GETJOCTET(data[4]) == 0x65) {
data[0] == 0x41 &&
data[1] == 0x64 &&
data[2] == 0x6F &&
data[3] == 0x62 &&
data[4] == 0x65) {
/* Found Adobe APP14 marker */
version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
transform = GETJOCTET(data[11]);
version = (data[5] << 8) + data[6];
flags0 = (data[7] << 8) + data[8];
flags1 = (data[9] << 8) + data[10];
transform = data[11];
TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
cinfo->saw_Adobe_marker = TRUE;
cinfo->Adobe_transform = (UINT8)transform;
+2 -13
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2016, D. R. Commander.
* Copyright (C) 2009-2011, 2016, 2019, D. R. Commander.
* Copyright (C) 2013, Linaro Limited.
* Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
@@ -22,7 +22,6 @@
#include "jpeglib.h"
#include "jpegcomp.h"
#include "jdmaster.h"
#include "jsimd.h"
/*
@@ -70,17 +69,6 @@ use_merged_upsample(j_decompress_ptr cinfo)
cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)
return FALSE;
#ifdef WITH_SIMD
/* If YCbCr-to-RGB color conversion is SIMD-accelerated but merged upsampling
isn't, then disabling merged upsampling is likely to be faster when
decompressing YCbCr JPEG images. */
if (!jsimd_can_h2v2_merged_upsample() && !jsimd_can_h2v1_merged_upsample() &&
jsimd_can_ycc_rgb() && cinfo->jpeg_color_space == JCS_YCbCr &&
(cinfo->out_color_space == JCS_RGB ||
(cinfo->out_color_space >= JCS_EXT_RGB &&
cinfo->out_color_space <= JCS_EXT_ARGB)))
return FALSE;
#endif
/* ??? also need to test for upsample-time rescaling, when & if supported */
return TRUE; /* by golly, it'll work... */
#else
@@ -580,6 +568,7 @@ master_selection(j_decompress_ptr cinfo)
*/
cinfo->master->first_iMCU_col = 0;
cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1;
cinfo->master->last_good_iMCU_row = 0;
#ifdef D_MULTISCAN_FILES_SUPPORTED
/* If jpeg_start_decompress will read the whole file, initialize
+13 -42
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
* Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
* Copyright (C) 2013, Linaro Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -40,41 +40,13 @@
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdmerge.h"
#include "jsimd.h"
#include "jconfigint.h"
#ifdef UPSAMPLE_MERGING_SUPPORTED
/* Private subobject */
typedef struct {
struct jpeg_upsampler pub; /* public fields */
/* Pointer to routine to do actual upsampling/conversion of one row group */
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
/* Private state for YCC->RGB conversion */
int *Cr_r_tab; /* => table for Cr to R conversion */
int *Cb_b_tab; /* => table for Cb to B conversion */
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
/* For 2:1 vertical sampling, we produce two output rows at a time.
* We need a "spare" row buffer to hold the second output row if the
* application provides just a one-row buffer; we also use the spare
* to discard the dummy last row if the image height is odd.
*/
JSAMPROW spare_row;
boolean spare_full; /* T if spare buffer is occupied */
JDIMENSION out_row_width; /* samples per output row */
JDIMENSION rows_to_go; /* counts rows remaining in image */
} my_upsampler;
typedef my_upsampler *my_upsample_ptr;
#define SCALEBITS 16 /* speediest right-shift on some machines */
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
@@ -189,7 +161,7 @@ typedef my_upsampler *my_upsample_ptr;
LOCAL(void)
build_ycc_rgb_table(j_decompress_ptr cinfo)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
int i;
JLONG x;
SHIFT_TEMPS
@@ -232,7 +204,7 @@ build_ycc_rgb_table(j_decompress_ptr cinfo)
METHODDEF(void)
start_pass_merged_upsample(j_decompress_ptr cinfo)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
/* Mark the spare buffer empty */
upsample->spare_full = FALSE;
@@ -254,7 +226,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
/* 2:1 vertical sampling case: may need a spare row. */
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
JSAMPROW work_ptrs[2];
JDIMENSION num_rows; /* number of rows returned to caller */
@@ -305,7 +277,7 @@ merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
/* 1:1 vertical sampling case: much easier, never need a spare row. */
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
/* Just do the upsampling. */
(*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
@@ -420,11 +392,10 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
* RGB565 conversion
*/
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
(((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
(((g) << 11) & 0xE000) | \
(((b) << 5) & 0x1F00))
#define PACK_SHORT_565_LE(r, g, b) \
((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) \
(((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
@@ -566,11 +537,11 @@ h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
GLOBAL(void)
jinit_merged_upsampler(j_decompress_ptr cinfo)
{
my_upsample_ptr upsample;
my_merged_upsample_ptr upsample;
upsample = (my_upsample_ptr)
upsample = (my_merged_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_upsampler));
sizeof(my_merged_upsampler));
cinfo->upsample = (struct jpeg_upsampler *)upsample;
upsample->pub.start_pass = start_pass_merged_upsample;
upsample->pub.need_context_rows = FALSE;
+47
View File
@@ -0,0 +1,47 @@
/*
* jdmerge.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*/
#define JPEG_INTERNALS
#include "jpeglib.h"
#ifdef UPSAMPLE_MERGING_SUPPORTED
/* Private subobject */
typedef struct {
struct jpeg_upsampler pub; /* public fields */
/* Pointer to routine to do actual upsampling/conversion of one row group */
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
/* Private state for YCC->RGB conversion */
int *Cr_r_tab; /* => table for Cr to R conversion */
int *Cb_b_tab; /* => table for Cb to B conversion */
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
/* For 2:1 vertical sampling, we produce two output rows at a time.
* We need a "spare" row buffer to hold the second output row if the
* application provides just a one-row buffer; we also use the spare
* to discard the dummy last row if the image height is odd.
*/
JSAMPROW spare_row;
boolean spare_full; /* T if spare buffer is occupied */
JDIMENSION out_row_width; /* samples per output row */
JDIMENSION rows_to_go; /* counts rows remaining in image */
} my_merged_upsampler;
typedef my_merged_upsampler *my_merged_upsample_ptr;
#endif /* UPSAMPLE_MERGING_SUPPORTED */
+39 -39
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2013, Linaro Limited.
* Copyright (C) 2014-2015, 2018, D. R. Commander.
* Copyright (C) 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -19,7 +19,7 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr;
@@ -43,20 +43,20 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Loop for each pair of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 2 Y values and emit 2 pixels */
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
@@ -68,12 +68,12 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr0);
y = *inptr0;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
@@ -90,7 +90,7 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr;
@@ -115,21 +115,21 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
/* Loop for each pair of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 2 Y values and emit 2 pixels */
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
@@ -142,12 +142,12 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr0);
y = *inptr0;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
@@ -163,7 +163,7 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr0, outptr1;
@@ -189,20 +189,20 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Loop for each group of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
@@ -211,13 +211,13 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
WRITE_TWO_PIXELS(outptr0, rgb);
outptr0 += 4;
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
@@ -229,20 +229,20 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr00);
y = *inptr00;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr0 = (INT16)rgb;
y = GETJSAMPLE(*inptr01);
y = *inptr01;
r = range_limit[y + cred];
g = range_limit[y + cgreen];
b = range_limit[y + cblue];
@@ -259,7 +259,7 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr0, outptr1;
@@ -287,21 +287,21 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
/* Loop for each group of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
@@ -311,14 +311,14 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
WRITE_TWO_PIXELS(outptr0, rgb);
outptr0 += 4;
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
r = range_limit[DITHER_565_R(y + cred, d1)];
g = range_limit[DITHER_565_G(y + cgreen, d1)];
b = range_limit[DITHER_565_B(y + cblue, d1)];
d1 = DITHER_ROTATE(d1);
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
r = range_limit[DITHER_565_R(y + cred, d1)];
g = range_limit[DITHER_565_G(y + cgreen, d1)];
b = range_limit[DITHER_565_B(y + cblue, d1)];
@@ -331,20 +331,20 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr00);
y = *inptr00;
r = range_limit[DITHER_565_R(y + cred, d0)];
g = range_limit[DITHER_565_G(y + cgreen, d0)];
b = range_limit[DITHER_565_B(y + cblue, d0)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr0 = (INT16)rgb;
y = GETJSAMPLE(*inptr01);
y = *inptr01;
r = range_limit[DITHER_565_R(y + cred, d1)];
g = range_limit[DITHER_565_G(y + cgreen, d1)];
b = range_limit[DITHER_565_B(y + cblue, d1)];
+20 -20
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2011, 2015, D. R. Commander.
* Copyright (C) 2011, 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -25,7 +25,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr;
@@ -46,13 +46,13 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Loop for each pair of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 2 Y values and emit 2 pixels */
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
@@ -60,7 +60,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr0++);
y = *inptr0++;
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
@@ -71,12 +71,12 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
}
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr0);
y = *inptr0;
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
@@ -97,7 +97,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
register JSAMPROW outptr0, outptr1;
@@ -120,13 +120,13 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Loop for each group of output pixels */
for (col = cinfo->output_width >> 1; col > 0; col--) {
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cb = *inptr1++;
cr = *inptr2++;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
@@ -134,7 +134,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr0[RGB_ALPHA] = 0xFF;
#endif
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr00++);
y = *inptr00++;
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
@@ -142,7 +142,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr0[RGB_ALPHA] = 0xFF;
#endif
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
@@ -150,7 +150,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
outptr1[RGB_ALPHA] = 0xFF;
#endif
outptr1 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
y = *inptr01++;
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
@@ -161,19 +161,19 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
}
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
cb = *inptr1;
cr = *inptr2;
cred = Crrtab[cr];
cgreen = (int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr00);
y = *inptr00;
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr0[RGB_ALPHA] = 0xFF;
#endif
y = GETJSAMPLE(*inptr01);
y = *inptr01;
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
+20 -28
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, 2018, D. R. Commander.
* Copyright (C) 2015-2016, 2018-2021, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -41,25 +41,6 @@ typedef struct {
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
} savable_state;
/* This macro is to work around compilers with missing or broken
* structure assignment. You'll need to fix this code if you have
* such a compiler and you change MAX_COMPS_IN_SCAN.
*/
#ifndef NO_STRUCT_ASSIGN
#define ASSIGN_STATE(dest, src) ((dest) = (src))
#else
#if MAX_COMPS_IN_SCAN == 4
#define ASSIGN_STATE(dest, src) \
((dest).EOBRUN = (src).EOBRUN, \
(dest).last_dc_val[0] = (src).last_dc_val[0], \
(dest).last_dc_val[1] = (src).last_dc_val[1], \
(dest).last_dc_val[2] = (src).last_dc_val[2], \
(dest).last_dc_val[3] = (src).last_dc_val[3])
#endif
#endif
typedef struct {
struct jpeg_entropy_decoder pub; /* public fields */
@@ -102,7 +83,7 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo)
boolean is_DC_band, bad;
int ci, coefi, tbl;
d_derived_tbl **pdtbl;
int *coef_bit_ptr;
int *coef_bit_ptr, *prev_coef_bit_ptr;
jpeg_component_info *compptr;
is_DC_band = (cinfo->Ss == 0);
@@ -143,8 +124,15 @@ start_pass_phuff_decoder(j_decompress_ptr cinfo)
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
int cindex = cinfo->cur_comp_info[ci]->component_index;
coef_bit_ptr = &cinfo->coef_bits[cindex][0];
prev_coef_bit_ptr = &cinfo->coef_bits[cindex + cinfo->num_components][0];
if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
for (coefi = MIN(cinfo->Ss, 1); coefi <= MAX(cinfo->Se, 9); coefi++) {
if (cinfo->input_scan_number > 1)
prev_coef_bit_ptr[coefi] = coef_bit_ptr[coefi];
else
prev_coef_bit_ptr[coefi] = 0;
}
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
if (cinfo->Ah != expected)
@@ -323,7 +311,7 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Load up working state */
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(state, entropy->saved);
state = entropy->saved;
/* Outer loop handles each block in the MCU */
@@ -356,11 +344,12 @@ decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
entropy->saved = state;
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -444,7 +433,8 @@ decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -495,7 +485,8 @@ decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -638,7 +629,8 @@ decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
@@ -676,7 +668,7 @@ jinit_phuff_decoder(j_decompress_ptr cinfo)
/* Create progression status table */
cinfo->coef_bits = (int (*)[DCTSIZE2])
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 *
cinfo->num_components * 2 * DCTSIZE2 *
sizeof(int));
coef_bit_ptr = &cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
+22 -16
View File
@@ -8,7 +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.
* Copyright (C) 2019-2020, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -177,7 +177,7 @@ int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
outptr = output_data[outrow];
outend = outptr + cinfo->output_width;
while (outptr < outend) {
invalue = *inptr++; /* don't need GETJSAMPLE() here */
invalue = *inptr++;
for (h = h_expand; h > 0; h--) {
*outptr++ = invalue;
}
@@ -213,7 +213,7 @@ h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
outptr = output_data[inrow];
outend = outptr + cinfo->output_width;
while (outptr < outend) {
invalue = *inptr++; /* don't need GETJSAMPLE() here */
invalue = *inptr++;
*outptr++ = invalue;
*outptr++ = invalue;
}
@@ -242,7 +242,7 @@ h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
outptr = output_data[outrow];
outend = outptr + cinfo->output_width;
while (outptr < outend) {
invalue = *inptr++; /* don't need GETJSAMPLE() here */
invalue = *inptr++;
*outptr++ = invalue;
*outptr++ = invalue;
}
@@ -283,20 +283,20 @@ h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
inptr = input_data[inrow];
outptr = output_data[inrow];
/* Special case for first column */
invalue = GETJSAMPLE(*inptr++);
invalue = *inptr++;
*outptr++ = (JSAMPLE)invalue;
*outptr++ = (JSAMPLE)((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
*outptr++ = (JSAMPLE)((invalue * 3 + inptr[0] + 2) >> 2);
for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
/* General case: 3/4 * nearer pixel + 1/4 * further pixel */
invalue = GETJSAMPLE(*inptr++) * 3;
*outptr++ = (JSAMPLE)((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
*outptr++ = (JSAMPLE)((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
invalue = (*inptr++) * 3;
*outptr++ = (JSAMPLE)((invalue + inptr[-2] + 1) >> 2);
*outptr++ = (JSAMPLE)((invalue + inptr[0] + 2) >> 2);
}
/* Special case for last column */
invalue = GETJSAMPLE(*inptr);
*outptr++ = (JSAMPLE)((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
invalue = *inptr;
*outptr++ = (JSAMPLE)((invalue * 3 + inptr[-1] + 1) >> 2);
*outptr++ = (JSAMPLE)invalue;
}
}
@@ -338,7 +338,7 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
outptr = output_data[outrow++];
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
thiscolsum = (*inptr0++) * 3 + (*inptr1++);
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
}
}
@@ -381,8 +381,8 @@ h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
outptr = output_data[outrow++];
/* Special case for first column */
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
thiscolsum = (*inptr0++) * 3 + (*inptr1++);
nextcolsum = (*inptr0++) * 3 + (*inptr1++);
*outptr++ = (JSAMPLE)((thiscolsum * 4 + 8) >> 4);
*outptr++ = (JSAMPLE)((thiscolsum * 3 + nextcolsum + 7) >> 4);
lastcolsum = thiscolsum; thiscolsum = nextcolsum;
@@ -390,7 +390,7 @@ h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
/* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
/* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
nextcolsum = (*inptr0++) * 3 + (*inptr1++);
*outptr++ = (JSAMPLE)((thiscolsum * 3 + lastcolsum + 8) >> 4);
*outptr++ = (JSAMPLE)((thiscolsum * 3 + nextcolsum + 7) >> 4);
lastcolsum = thiscolsum; thiscolsum = nextcolsum;
@@ -477,7 +477,13 @@ jinit_upsampler(j_decompress_ptr cinfo)
} else if (h_in_group == h_out_group &&
v_in_group * 2 == v_out_group && do_fancy) {
/* Non-fancy upsampling is handled by the generic method */
upsample->methods[ci] = h1v2_fancy_upsample;
#if defined(__arm__) || defined(__aarch64__) || \
defined(_M_ARM) || defined(_M_ARM64)
if (jsimd_can_h1v2_fancy_upsample())
upsample->methods[ci] = jsimd_h1v2_fancy_upsample;
else
#endif
upsample->methods[ci] = h1v2_fancy_upsample;
upsample->pub.need_context_rows = TRUE;
} else if (h_in_group * 2 == h_out_group &&
v_in_group * 2 == v_out_group) {
+3 -2
View File
@@ -3,8 +3,8 @@
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1997, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -16,6 +16,7 @@
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jpegcomp.h"
/* Forward declarations */
+13
View File
@@ -207,6 +207,10 @@ JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
#ifdef JMAKE_ENUM_LIST
@@ -252,6 +256,15 @@ JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXITS(cinfo, code, str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+2 -2
View File
@@ -4,11 +4,11 @@
* 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.
* Copyright (C) 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains a slow-but-accurate integer implementation of the
* This file contains a slower but more accurate integer implementation of the
* forward DCT (Discrete Cosine Transform).
*
* A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+6 -6
View File
@@ -3,13 +3,13 @@
*
* 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.
* Modification developed 2002-2018 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.
* Copyright (C) 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains a slow-but-accurate integer implementation of the
* This file contains a slower but more accurate integer implementation of the
* inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
* must also perform dequantization of the input coefficients.
*
@@ -417,7 +417,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).
@@ -1258,7 +1258,7 @@ jpeg_idct_10x10(j_decompress_ptr cinfo, jpeg_component_info *compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a 11x11 output block.
* producing an 11x11 output block.
*
* Optimized algorithm with 24 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/22).
@@ -2398,7 +2398,7 @@ jpeg_idct_16x16(j_decompress_ptr cinfo, jpeg_component_info *compptr,
tmp0 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
tmp0 = LEFT_SHIFT(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] */
+4 -39
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, D. R. Commander.
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -43,25 +43,11 @@
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
*/
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#else /* not HAVE_UNSIGNED_CHAR */
typedef char JSAMPLE;
#ifdef __CHAR_UNSIGNED__
#define GETJSAMPLE(value) ((int)(value))
#else
#define GETJSAMPLE(value) ((int)(value) & 0xFF)
#endif /* __CHAR_UNSIGNED__ */
#endif /* HAVE_UNSIGNED_CHAR */
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
@@ -97,22 +83,9 @@ typedef short JCOEF;
* managers, this is also the data type passed to fread/fwrite.
*/
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
#else /* not HAVE_UNSIGNED_CHAR */
typedef char JOCTET;
#ifdef __CHAR_UNSIGNED__
#define GETJOCTET(value) (value)
#else
#define GETJOCTET(value) ((value) & 0xFF)
#endif /* __CHAR_UNSIGNED__ */
#endif /* HAVE_UNSIGNED_CHAR */
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
@@ -123,15 +96,7 @@ typedef char JOCTET;
/* UINT8 must hold at least the values 0..255. */
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */
#ifdef __CHAR_UNSIGNED__
typedef char UINT8;
#else /* not __CHAR_UNSIGNED__ */
typedef short UINT8;
#endif /* __CHAR_UNSIGNED__ */
#endif /* HAVE_UNSIGNED_CHAR */
/* UINT16 must hold at least the values 0..65535. */
@@ -273,9 +238,9 @@ typedef int boolean;
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */
+2 -1
View File
@@ -1,7 +1,7 @@
/*
* jpegcomp.h
*
* Copyright (C) 2010, D. R. Commander.
* Copyright (C) 2010, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -19,6 +19,7 @@
#define _min_DCT_v_scaled_size min_DCT_v_scaled_size
#define _jpeg_width jpeg_width
#define _jpeg_height jpeg_height
#define JERR_ARITH_NOTIMPL JERR_NOT_COMPILED
#else
#define _DCT_scaled_size DCT_scaled_size
#define _DCT_h_scaled_size DCT_scaled_size
+4 -1
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, D. R. Commander.
* Copyright (C) 2015-2016, 2019, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -158,6 +158,9 @@ struct jpeg_decomp_master {
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
/* Last iMCU row that was successfully decoded */
JDIMENSION last_good_iMCU_row;
};
/* Input control module */
+4 -4
View File
@@ -5,7 +5,7 @@
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, D. R. Commander.
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -244,9 +244,9 @@ typedef enum {
/* DCT/IDCT algorithm options. */
typedef enum {
JDCT_ISLOW, /* slow but accurate integer algorithm */
JDCT_IFAST, /* faster, less accurate integer method */
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
JDCT_ISLOW, /* accurate integer method */
JDCT_IFAST, /* less accurate integer method [legacy feature] */
JDCT_FLOAT /* floating-point method [legacy feature] */
} J_DCT_METHOD;
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
+12 -15
View File
@@ -479,7 +479,7 @@ color_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
for (col = width; col > 0; col--) {
pixcode = 0;
for (ci = 0; ci < nc; ci++) {
pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
pixcode += colorindex[ci][*ptrin++];
}
*ptrout++ = (JSAMPLE)pixcode;
}
@@ -506,9 +506,9 @@ color_quantize3(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
ptrin = input_buf[row];
ptrout = output_buf[row];
for (col = width; col > 0; col--) {
pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
pixcode = colorindex0[*ptrin++];
pixcode += colorindex1[*ptrin++];
pixcode += colorindex2[*ptrin++];
*ptrout++ = (JSAMPLE)pixcode;
}
}
@@ -552,7 +552,7 @@ quantize_ord_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
* required amount of padding.
*/
*output_ptr +=
colorindex_ci[GETJSAMPLE(*input_ptr) + dither[col_index]];
colorindex_ci[*input_ptr + dither[col_index]];
input_ptr += nc;
output_ptr++;
col_index = (col_index + 1) & ODITHER_MASK;
@@ -595,12 +595,9 @@ quantize3_ord_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
col_index = 0;
for (col = width; col > 0; col--) {
pixcode =
GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + dither0[col_index]]);
pixcode +=
GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + dither1[col_index]]);
pixcode +=
GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + dither2[col_index]]);
pixcode = colorindex0[(*input_ptr++) + dither0[col_index]];
pixcode += colorindex1[(*input_ptr++) + dither1[col_index]];
pixcode += colorindex2[(*input_ptr++) + dither2[col_index]];
*output_ptr++ = (JSAMPLE)pixcode;
col_index = (col_index + 1) & ODITHER_MASK;
}
@@ -677,15 +674,15 @@ quantize_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
* The maximum error is +- MAXJSAMPLE; this sets the required size
* of the range_limit array.
*/
cur += GETJSAMPLE(*input_ptr);
cur = GETJSAMPLE(range_limit[cur]);
cur += *input_ptr;
cur = range_limit[cur];
/* Select output value, accumulate into output code for this pixel */
pixcode = GETJSAMPLE(colorindex_ci[cur]);
pixcode = colorindex_ci[cur];
*output_ptr += (JSAMPLE)pixcode;
/* Compute actual representation error at this pixel */
/* Note: we can do this even though we don't have the final */
/* pixel code, because the colormap is orthogonal. */
cur -= GETJSAMPLE(colormap_ci[pixcode]);
cur -= colormap_ci[pixcode];
/* Compute error fractions to be propagated to adjacent pixels.
* Add these into the running sums, and simultaneously shift the
* next-line error sums left by 1 column.
+26 -26
View File
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2014-2015, D. R. Commander.
* Copyright (C) 2009, 2014-2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -215,9 +215,9 @@ prescan_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
ptr = input_buf[row];
for (col = width; col > 0; col--) {
/* get pixel value and index into the histogram */
histp = &histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
[GETJSAMPLE(ptr[1]) >> C1_SHIFT]
[GETJSAMPLE(ptr[2]) >> C2_SHIFT];
histp = &histogram[ptr[0] >> C0_SHIFT]
[ptr[1] >> C1_SHIFT]
[ptr[2] >> C2_SHIFT];
/* increment, check for overflow and undo increment if so. */
if (++(*histp) <= 0)
(*histp)--;
@@ -665,7 +665,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
for (i = 0; i < numcolors; i++) {
/* We compute the squared-c0-distance term, then add in the other two. */
x = GETJSAMPLE(cinfo->colormap[0][i]);
x = cinfo->colormap[0][i];
if (x < minc0) {
tdist = (x - minc0) * C0_SCALE;
min_dist = tdist * tdist;
@@ -688,7 +688,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
}
}
x = GETJSAMPLE(cinfo->colormap[1][i]);
x = cinfo->colormap[1][i];
if (x < minc1) {
tdist = (x - minc1) * C1_SCALE;
min_dist += tdist * tdist;
@@ -710,7 +710,7 @@ find_nearby_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
}
}
x = GETJSAMPLE(cinfo->colormap[2][i]);
x = cinfo->colormap[2][i];
if (x < minc2) {
tdist = (x - minc2) * C2_SCALE;
min_dist += tdist * tdist;
@@ -788,13 +788,13 @@ find_best_colors(j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)
for (i = 0; i < numcolors; i++) {
icolor = GETJSAMPLE(colorlist[i]);
icolor = colorlist[i];
/* Compute (square of) distance from minc0/c1/c2 to this color */
inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
inc0 = (minc0 - cinfo->colormap[0][icolor]) * C0_SCALE;
dist0 = inc0 * inc0;
inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
inc1 = (minc1 - cinfo->colormap[1][icolor]) * C1_SCALE;
dist0 += inc1 * inc1;
inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
inc2 = (minc2 - cinfo->colormap[2][icolor]) * C2_SCALE;
dist0 += inc2 * inc2;
/* Form the initial difference increments */
inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
@@ -879,7 +879,7 @@ fill_inverse_cmap(j_decompress_ptr cinfo, int c0, int c1, int c2)
for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
cachep = &histogram[c0 + ic0][c1 + ic1][c2];
for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
*cachep++ = (histcell)(GETJSAMPLE(*cptr++) + 1);
*cachep++ = (histcell)((*cptr++) + 1);
}
}
}
@@ -909,9 +909,9 @@ pass2_no_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
outptr = output_buf[row];
for (col = width; col > 0; col--) {
/* get pixel value and index into the cache */
c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
c0 = (*inptr++) >> C0_SHIFT;
c1 = (*inptr++) >> C1_SHIFT;
c2 = (*inptr++) >> C2_SHIFT;
cachep = &histogram[c0][c1][c2];
/* If we have not seen this color before, find nearest colormap entry */
/* and update the cache */
@@ -996,12 +996,12 @@ pass2_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
* The maximum error is +- MAXJSAMPLE (or less with error limiting);
* this sets the required size of the range_limit array.
*/
cur0 += GETJSAMPLE(inptr[0]);
cur1 += GETJSAMPLE(inptr[1]);
cur2 += GETJSAMPLE(inptr[2]);
cur0 = GETJSAMPLE(range_limit[cur0]);
cur1 = GETJSAMPLE(range_limit[cur1]);
cur2 = GETJSAMPLE(range_limit[cur2]);
cur0 += inptr[0];
cur1 += inptr[1];
cur2 += inptr[2];
cur0 = range_limit[cur0];
cur1 = range_limit[cur1];
cur2 = range_limit[cur2];
/* Index into the cache with adjusted pixel value */
cachep =
&histogram[cur0 >> C0_SHIFT][cur1 >> C1_SHIFT][cur2 >> C2_SHIFT];
@@ -1015,9 +1015,9 @@ pass2_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
register int pixcode = *cachep - 1;
*outptr = (JSAMPLE)pixcode;
/* Compute representation error for this pixel */
cur0 -= GETJSAMPLE(colormap0[pixcode]);
cur1 -= GETJSAMPLE(colormap1[pixcode]);
cur2 -= GETJSAMPLE(colormap2[pixcode]);
cur0 -= colormap0[pixcode];
cur1 -= colormap1[pixcode];
cur2 -= colormap2[pixcode];
}
/* Compute error fractions to be propagated to adjacent pixels.
* Add these into the running sums, and simultaneously shift the
@@ -1145,7 +1145,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan)
int i;
/* Only F-S dithering or no dithering is supported. */
/* If user asks for ordered dither, give him F-S. */
/* If user asks for ordered dither, give them F-S. */
if (cinfo->dither_mode != JDITHER_NONE)
cinfo->dither_mode = JDITHER_FS;
@@ -1263,7 +1263,7 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo)
cquantize->sv_colormap = NULL;
/* Only F-S dithering or no dithering is supported. */
/* If user asks for ordered dither, give him F-S. */
/* If user asks for ordered dither, give them F-S. */
if (cinfo->dither_mode != JDITHER_NONE)
cinfo->dither_mode = JDITHER_FS;
+6
View File
@@ -4,6 +4,7 @@
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, 2014, D. R. Commander.
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
* Copyright (C) 2020, Arm Limited.
*
* Based on the x86 SIMD extension for IJG JPEG library,
* Copyright (C) 1999-2006, MIYASAKA Masaru.
@@ -75,6 +76,7 @@ EXTERN(void) jsimd_int_upsample(j_decompress_ptr cinfo,
EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
EXTERN(int) jsimd_can_h1v2_fancy_upsample(void);
EXTERN(void) jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo,
jpeg_component_info *compptr,
@@ -84,6 +86,10 @@ EXTERN(void) jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JSAMPARRAY input_data,
JSAMPARRAY *output_data_ptr);
EXTERN(void) jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JSAMPARRAY input_data,
JSAMPARRAY *output_data_ptr);
EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
+13
View File
@@ -4,6 +4,7 @@
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009-2011, 2014, D. R. Commander.
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
* Copyright (C) 2020, Arm Limited.
*
* Based on the x86 SIMD extension for IJG JPEG library,
* Copyright (C) 1999-2006, MIYASAKA Masaru.
@@ -169,6 +170,12 @@ jsimd_can_h2v1_fancy_upsample(void)
return 0;
}
GLOBAL(int)
jsimd_can_h1v2_fancy_upsample(void)
{
return 0;
}
GLOBAL(void)
jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
@@ -181,6 +188,12 @@ jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
{
}
GLOBAL(void)
jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
{
}
GLOBAL(int)
jsimd_can_h2v2_merged_upsample(void)
{
+12 -10
View File
@@ -2,9 +2,9 @@
* jversion.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, 2012-2019, D. R. Commander.
* Copyright (C) 2010, 2012-2021, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -30,23 +30,25 @@
* NOTE: It is our convention to place the authors in the following order:
* - libjpeg-turbo authors (2009-) in descending order of the date of their
* most recent contribution to the project, then in ascending order of the
* date of their first contribution to the project
* date of their first contribution to the project, then in alphabetical
* order
* - Upstream authors in descending order of the date of the first inclusion of
* their code
*/
#define JCOPYRIGHT \
"Copyright (C) 2009-2019 D. R. Commander\n" \
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
"Copyright (C) 2009-2021 D. R. Commander\n" \
"Copyright (C) 2015, 2020 Google, Inc.\n" \
"Copyright (C) 2019-2020 Arm Limited\n" \
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
"Copyright (C) 2015 Intel Corporation\n" \
"Copyright (C) 2015 Google, Inc.\n" \
"Copyright (C) 2013-2014 Linaro Limited\n" \
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
"Copyright (C) 2013 Linaro Limited\n" \
"Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
"Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT_SHORT \
"Copyright (C) 1991-2019 The libjpeg-turbo Project and many others"
"Copyright (C) 1991-2021 The libjpeg-turbo Project and many others"
+2 -2
View File
@@ -19,7 +19,7 @@ endif()
# Define the library target:
# ----------------------------------------------------------------------------------
add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
if(CV_GCC OR CV_CLANG)
set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
@@ -42,7 +42,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(libjpeg README)
+6 -13
View File
@@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software
==========================================
README for release 9c of 14-Jan-2018
README for release 9d of 12-Jan-2020
====================================
This distribution contains the ninth public release of the Independent JPEG
@@ -10,8 +10,8 @@ to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
and other members of the Independent JPEG Group.
John Korejwa, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
Ge' Weijers, and other members of the Independent JPEG Group.
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
(previously known as JPEG, together with ITU-T SG16).
@@ -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-2018, Thomas G. Lane, Guido Vollbeding.
This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@@ -152,13 +152,6 @@ The same holds for its supporting scripts (config.guess, config.sub,
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
but is also freely distributable.
The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs". This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.
REFERENCES
==========
@@ -246,8 +239,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.v9c.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9d.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
+49
View File
@@ -1,6 +1,55 @@
CHANGE LOG for Independent JPEG Group's JPEG software
Version 9d 12-Jan-2020
-----------------------
Optimize the optimal Huffman code table generation to produce
slightly smaller files. Thank to John Korejwa for suggestion.
Note: Requires rebuild of testimgp.jpg.
Decoding Huffman: Use default tables if tables are not defined.
Thank to Simone Azzalin for report (Motion JPEG),
and to Martin Strunz for hint.
Add sanity check in optimal Huffman code table generation.
Thank to Adam Farley for suggestion.
rdtarga.c: use read_byte(), with EOF check, instead of getc()
in read_*_pixel().
Thank to Chijin Zhou for cjpeg potential vulnerability report.
jmemnobs.c: respect the max_memory_to_use setting in
jpeg_mem_available() computation. Thank to Sheng Shu and
Dongdong She for djpeg potential vulnerability report.
jdarith.c, jdhuff.c: avoid left shift of negative value
compiler warning in decode_mcu_AC_refine().
Thank to Indu Bhagat for suggestion.
Add x64 (64-bit) platform support, avoid compiler warnings.
Thank to Jonathan Potter, Feiyun Wang, and Sheng Shu for suggestion.
Adjust libjpeg version specification for pkg-config file.
Thank to Chen Chen for suggestion.
Restore GIF read and write support from libjpeg version 6a.
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
Improve consistency in raw (downsampled) image data processing mode.
Thank to Zhongyuan Zhou for hint.
Avoid out of bounds array read (AC derived table pointers)
in start pass in jdhuff.c. Thank to Peng Li for report.
Improve code sanity (jdhuff.c).
Thank to Reza Mirzazade farkhani for reports.
Add jpegtran -drop option; add options to the crop extension and wipe
to fill the extra area with content from the source image region,
instead of gray out.
Version 9c 14-Jan-2018
-----------------------
+9 -8
View File
@@ -1,7 +1,7 @@
/*
* jcarith.c
*
* Developed 1997-2013 by Guido Vollbeding.
* Developed 1997-2019 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.
*
@@ -181,11 +181,11 @@ finish_pass (j_compress_ptr cinfo)
if (e->zc) /* output final pending zero bytes */
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte((e->c >> 19) & 0xFF, cinfo);
emit_byte((int) ((e->c >> 19) & 0xFF), cinfo);
if (((e->c >> 19) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo);
if (e->c & 0x7F800L) {
emit_byte((e->c >> 11) & 0xFF, cinfo);
emit_byte((int) ((e->c >> 11) & 0xFF), cinfo);
if (((e->c >> 11) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo);
}
@@ -280,7 +280,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
/* Note: The 3 spacer bits in the C register guarantee
* that the new buffer byte can't be 0xFF here
* (see page 160 in the P&M JPEG book). */
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
/* New output byte, might overflow later */
e->buffer = (int) (temp & 0xFF);
} else if (temp == 0xFF) {
++e->sc; /* stack 0xFF byte (which might overflow later) */
} else {
@@ -302,7 +303,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
emit_byte(0x00, cinfo);
} while (--e->sc);
}
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
/* New output byte (can still overflow) */
e->buffer = (int) (temp & 0xFF);
}
e->c &= 0x7FFFFL;
e->ct += 8;
@@ -926,9 +928,8 @@ jinit_arith_encoder (j_compress_ptr cinfo)
arith_entropy_ptr entropy;
int i;
entropy = (arith_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(arith_entropy_encoder));
entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_encoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass;
+47 -50
View File
@@ -2,7 +2,7 @@
* jccolor.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2011-2013 by Guido Vollbeding.
* Modified 2011-2019 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.
*
@@ -105,14 +105,14 @@ rgb_ycc_start (j_compress_ptr cinfo)
/* Allocate and fill in the conversion tables. */
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(TABLE_SIZE * SIZEOF(INT32)));
TABLE_SIZE * SIZEOF(INT32));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;
rgb_ycc_tab[i+G_Y_OFF] = FIX(0.587) * i;
rgb_ycc_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF;
rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.168735892)) * i;
rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.331264108)) * i;
rgb_ycc_tab[i+R_CB_OFF] = (- FIX(0.168735892)) * i;
rgb_ycc_tab[i+G_CB_OFF] = (- FIX(0.331264108)) * i;
/* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
* This ensures that the maximum output will round to MAXJSAMPLE
* not MAXJSAMPLE+1, and thus that we don't have to range-limit.
@@ -121,8 +121,8 @@ rgb_ycc_start (j_compress_ptr cinfo)
/* B=>Cb and R=>Cr tables are the same
rgb_ycc_tab[i+R_CR_OFF] = FIX(0.5) * i + CBCR_OFFSET + ONE_HALF-1;
*/
rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.418687589)) * i;
rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.081312411)) * i;
rgb_ycc_tab[i+G_CR_OFF] = (- FIX(0.418687589)) * i;
rgb_ycc_tab[i+B_CR_OFF] = (- FIX(0.081312411)) * i;
}
}
@@ -131,12 +131,12 @@ rgb_ycc_start (j_compress_ptr cinfo)
* Convert some rows of samples to the JPEG colorspace.
*
* Note that we change from the application's interleaved-pixel format
* to our internal noninterleaved, one-plane-per-component format.
* The input buffer is therefore three times as wide as the output buffer.
* to our internal noninterleaved, one-plane-per-component format. The
* input buffer is therefore three times as wide as the output buffer.
*
* A starting row offset is provided only for the output buffer. The caller
* can easily adjust the passed input_buf value to accommodate any row
* offset required on that side.
* A starting row offset is provided only for the output buffer. The
* caller can easily adjust the passed input_buf value to accommodate
* any row offset required on that side.
*/
METHODDEF(void)
@@ -145,8 +145,8 @@ rgb_ycc_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
@@ -162,6 +162,7 @@ rgb_ycc_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't
@@ -179,7 +180,6 @@ rgb_ycc_convert (j_compress_ptr cinfo,
outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -201,8 +201,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
@@ -215,11 +215,11 @@ rgb_gray_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* Y */
outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -228,8 +228,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles Adobe-style CMYK->YCCK conversion,
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
* conversion as above, while passing K (black) unchanged.
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the
* same conversion as above, while passing K (black) unchanged.
* We assume rgb_ycc_start has been called.
*/
@@ -239,8 +239,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
register JDIMENSION col;
@@ -259,6 +259,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
/* K passes through as-is */
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
inptr += 4;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't
@@ -276,7 +277,6 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
inptr += 4;
}
}
}
@@ -312,13 +312,13 @@ rgb_rgb1_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
* (modulo) operator is equivalent to the bitmask operator AND.
*/
outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);
outptr1[col] = (JSAMPLE) g;
outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -335,17 +335,17 @@ grayscale_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
int instride = cinfo->input_components;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
register JDIMENSION count;
register int instride = cinfo->input_components;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr = output_buf[0][output_row++];
for (col = 0; col < num_cols; col++) {
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
for (count = num_cols; count > 0; count--) {
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
inptr += instride;
}
}
@@ -396,21 +396,21 @@ null_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
int ci;
register int nc = cinfo->num_components;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
register JDIMENSION count;
register int num_comps = cinfo->num_components;
JDIMENSION num_cols = cinfo->image_width;
int ci;
while (--num_rows >= 0) {
/* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < nc; ci++) {
for (ci = 0; ci < num_comps; ci++) {
inptr = input_buf[0] + ci;
outptr = output_buf[ci][output_row];
for (col = 0; col < num_cols; col++) {
for (count = num_cols; count > 0; count--) {
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
inptr += nc;
inptr += num_comps;
}
}
input_buf++;
@@ -439,9 +439,8 @@ jinit_color_converter (j_compress_ptr cinfo)
{
my_cconvert_ptr cconvert;
cconvert = (my_cconvert_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_color_converter));
cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_converter));
cinfo->cconvert = &cconvert->pub;
/* set start_pass to null method until we find out differently */
cconvert->pub.start_pass = null_method;
@@ -455,9 +454,11 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_RGB:
case JCS_BG_RGB:
#if RGB_PIXELSIZE != 3
if (cinfo->input_components != RGB_PIXELSIZE)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
#endif /* else share code with YCbCr */
case JCS_YCbCr:
case JCS_BG_YCC:
@@ -474,7 +475,6 @@ jinit_color_converter (j_compress_ptr cinfo)
default: /* JCS_UNKNOWN can be anything */
if (cinfo->input_components < 1)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
}
/* Support color transform only for RGB colorspaces */
@@ -507,19 +507,18 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_BG_RGB:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == cinfo->jpeg_color_space) {
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb_rgb1_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
} else
if (cinfo->in_color_space != cinfo->jpeg_color_space)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb_rgb1_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
break;
case JCS_YCbCr:
@@ -572,10 +571,9 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_CMYK:
if (cinfo->num_components != 4)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_CMYK)
cconvert->pub.color_convert = null_convert;
else
if (cinfo->in_color_space != JCS_CMYK)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cconvert->pub.color_convert = null_convert;
break;
case JCS_YCCK:
@@ -599,6 +597,5 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->num_components != cinfo->input_components)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cconvert->pub.color_convert = null_convert;
break;
}
}
+109 -42
View File
@@ -2,7 +2,7 @@
* jchuff.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2006-2013 by Guido Vollbeding.
* Modified 2006-2019 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.
*
@@ -178,13 +178,12 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
htbl =
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
/* Allocate a workspace if we haven't already done so. */
if (*pdtbl == NULL)
*pdtbl = (c_derived_tbl *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(c_derived_tbl));
*pdtbl = (c_derived_tbl *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(c_derived_tbl));
dtbl = *pdtbl;
/* Figure C.1: make table of Huffman code length for each symbol */
@@ -1256,22 +1255,88 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
int codesize[257]; /* codesize[k] = code length of symbol k */
int others[257]; /* next symbol in current branch of tree */
int c1, c2;
int p, i, j;
int c1, c2, i, j;
UINT8 *p;
long v;
freq[256] = 1; /* make sure 256 has a nonzero count */
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
* that no real symbol is given code-value of all ones, because 256
* will be placed last in the largest codeword category.
* In the symbol list build procedure this element serves as sentinel
* for the zero run loop.
*/
#ifndef DONT_USE_FANCY_HUFF_OPT
/* Build list of symbols sorted in order of descending frequency */
/* This approach has several benefits (thank to John Korejwa for the idea):
* 1.
* If a codelength category is split during the length limiting procedure
* below, the feature that more frequent symbols are assigned shorter
* codewords remains valid for the adjusted code.
* 2.
* To reduce consecutive ones in a Huffman data stream (thus reducing the
* number of stuff bytes in JPEG) it is preferable to follow 0 branches
* (and avoid 1 branches) as much as possible. This is easily done by
* assigning symbols to leaves of the Huffman tree in order of decreasing
* frequency, with no secondary sort based on codelengths.
* 3.
* The symbol list can be built independently from the assignment of code
* lengths by the Huffman procedure below.
* Note: The symbol list build procedure must be performed first, because
* the Huffman procedure assigning the codelengths clobbers the frequency
* counts!
*/
/* Here we use the others array as a linked list of nonzero frequencies
* to be sorted. Already sorted elements are removed from the list.
*/
/* Building list */
/* This item does not correspond to a valid symbol frequency and is used
* as starting index.
*/
j = 256;
for (i = 0;; i++) {
if (freq[i] == 0) /* skip zero frequencies */
continue;
if (i > 255)
break;
others[j] = i; /* this symbol value */
j = i; /* previous symbol value */
}
others[j] = -1; /* mark end of list */
/* Sorting list */
p = htbl->huffval;
while ((c1 = others[256]) >= 0) {
v = freq[c1];
i = c1; /* first symbol value */
j = 256; /* pseudo symbol value for starting index */
while ((c2 = others[c1]) >= 0) {
if (freq[c2] > v) {
v = freq[c2];
i = c2; /* this symbol value */
j = c1; /* previous symbol value */
}
c1 = c2;
}
others[j] = others[i]; /* remove this symbol i from list */
*p++ = (UINT8) i;
}
#endif /* DONT_USE_FANCY_HUFF_OPT */
/* This algorithm is explained in section K.2 of the JPEG standard */
MEMZERO(bits, SIZEOF(bits));
MEMZERO(codesize, SIZEOF(codesize));
for (i = 0; i < 257; i++)
others[i] = -1; /* init links to empty */
freq[256] = 1; /* make sure 256 has a nonzero count */
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
* that no real symbol is given code-value of all ones, because 256
* will be placed last in the largest codeword category.
*/
/* Huffman's basic algorithm to assign optimal code lengths to symbols */
@@ -1301,7 +1366,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
/* Done if we've merged everything into one frequency */
if (c2 < 0)
break;
/* Else merge the two counts/trees */
freq[c1] += freq[c2];
freq[c2] = 0;
@@ -1312,9 +1377,9 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
c1 = others[c1];
codesize[c1]++;
}
others[c1] = c2; /* chain c2 onto c1's tree branch */
/* Increment the codesize of everything in c2's tree branch */
codesize[c2]++;
while (others[c2] >= 0) {
@@ -1329,7 +1394,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
/* The JPEG standard seems to think that this can't happen, */
/* but I'm paranoid... */
if (codesize[i] > MAX_CLEN)
ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
bits[codesize[i]]++;
}
@@ -1345,13 +1410,16 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
* shortest nonzero BITS entry is converted into a prefix for two code words
* one bit longer.
*/
for (i = MAX_CLEN; i > 16; i--) {
while (bits[i] > 0) {
j = i - 2; /* find length of new prefix to be used */
while (bits[j] == 0)
while (bits[j] == 0) {
if (j == 0)
ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
j--;
}
bits[i] -= 2; /* remove two symbols */
bits[i-1]++; /* one goes in this length */
bits[j+1] += 2; /* two new symbols in this length */
@@ -1363,24 +1431,27 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
while (bits[i] == 0) /* find largest codelength still in use */
i--;
bits[i]--;
/* Return final symbol counts (only for lengths 0..16) */
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
#ifdef DONT_USE_FANCY_HUFF_OPT
/* Return a list of the symbols sorted by code length */
/* It's not real clear to me why we don't need to consider the codelength
* changes made above, but the JPEG spec seems to think this works.
/* Note: Due to the codelength changes made above, it can happen
* that more frequent symbols are assigned longer codewords.
*/
p = 0;
p = htbl->huffval;
for (i = 1; i <= MAX_CLEN; i++) {
for (j = 0; j <= 255; j++) {
if (codesize[j] == i) {
htbl->huffval[p] = (UINT8) j;
p++;
*p++ = (UINT8) j;
}
}
}
#endif /* DONT_USE_FANCY_HUFF_OPT */
/* Set sent_table FALSE so updated table will be written to JPEG file. */
htbl->sent_table = FALSE;
}
@@ -1400,13 +1471,13 @@ finish_pass_gather (j_compress_ptr cinfo)
boolean did_dc[NUM_HUFF_TBLS];
boolean did_ac[NUM_HUFF_TBLS];
/* It's important not to apply jpeg_gen_optimal_table more than once
* per table, because it clobbers the input frequency counts!
*/
if (cinfo->progressive_mode)
/* Flush out buffered data (all we care about is counting the EOB symbol) */
emit_eobrun(entropy);
/* It's important not to apply jpeg_gen_optimal_table more than once
* per table, because it clobbers the input frequency counts!
*/
MEMZERO(did_dc, SIZEOF(did_dc));
MEMZERO(did_ac, SIZEOF(did_ac));
@@ -1475,9 +1546,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
entropy->pub.encode_mcu = encode_mcu_AC_refine;
/* AC refinement needs a correction bit buffer */
if (entropy->bit_buffer == NULL)
entropy->bit_buffer = (char *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
MAX_CORR_BITS * SIZEOF(char));
entropy->bit_buffer = (char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, MAX_CORR_BITS * SIZEOF(char));
}
}
@@ -1505,9 +1575,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
/* Allocate and zero the statistics tables */
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
if (entropy->dc_count_ptrs[tbl] == NULL)
entropy->dc_count_ptrs[tbl] = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
257 * SIZEOF(long));
entropy->dc_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));
} else {
/* Compute derived values for Huffman tables */
@@ -1525,9 +1594,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
if (entropy->ac_count_ptrs[tbl] == NULL)
entropy->ac_count_ptrs[tbl] = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
257 * SIZEOF(long));
entropy->ac_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));
} else {
jpeg_make_c_derived_tbl(cinfo, FALSE, tbl,
@@ -1556,9 +1624,8 @@ jinit_huff_encoder (j_compress_ptr cinfo)
huff_entropy_ptr entropy;
int i;
entropy = (huff_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(huff_entropy_encoder));
entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass_huff;
+3 -5
View File
@@ -2,7 +2,7 @@
* jcmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding.
* Modified 2003-2019 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.
*
@@ -471,7 +471,6 @@ emit_adobe_app14 (j_compress_ptr cinfo)
break;
default:
emit_byte(cinfo, 0); /* Color transform = 0 */
break;
}
}
@@ -702,9 +701,8 @@ jinit_marker_writer (j_compress_ptr cinfo)
my_marker_ptr marker;
/* Create the subobject */
marker = (my_marker_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_marker_writer));
marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_marker_writer));
cinfo->marker = &marker->pub;
/* Initialize method pointers */
marker->pub.write_file_header = write_file_header;
+18 -15
View File
@@ -2,7 +2,7 @@
* jcmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2017 by Guido Vollbeding.
* Modified 2003-2019 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.
*
@@ -62,7 +62,7 @@ initial_setup (j_compress_ptr cinfo)
case 5: cinfo->natural_order = jpeg_natural_order5; break;
case 6: cinfo->natural_order = jpeg_natural_order6; break;
case 7: cinfo->natural_order = jpeg_natural_order7; break;
default: cinfo->natural_order = jpeg_natural_order; break;
default: cinfo->natural_order = jpeg_natural_order;
}
/* Derive lim_Se from block_size */
@@ -114,20 +114,24 @@ initial_setup (j_compress_ptr cinfo)
*/
ssize = 1;
#ifdef DCT_SCALING_SUPPORTED
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
if (! cinfo->raw_data_in)
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2;
}
#endif
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
ssize = 1;
#ifdef DCT_SCALING_SUPPORTED
while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
if (! cinfo->raw_data_in)
while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2;
}
#endif
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
@@ -620,9 +624,8 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
{
my_master_ptr master;
master = (my_master_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_comp_master));
master = (my_master_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_comp_master));
cinfo->master = &master->pub;
master->pub.prepare_for_pass = prepare_for_pass;
master->pub.pass_startup = pass_startup;
+138
View File
@@ -2,6 +2,7 @@
* jcomapi.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2019 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.
*
@@ -104,3 +105,140 @@ jpeg_alloc_huff_table (j_common_ptr cinfo)
tbl->sent_table = FALSE; /* make sure this is false in any new table */
return tbl;
}
/*
* Set up the standard Huffman tables (cf. JPEG standard section K.3).
* IMPORTANT: these are only valid for 8-bit data precision!
* (Would jutils.c be a more reasonable place to put this?)
*/
GLOBAL(JHUFF_TBL *)
jpeg_std_huff_table (j_common_ptr cinfo, boolean isDC, int tblno)
{
JHUFF_TBL **htblptr, *htbl;
const UINT8 *bits, *val;
int nsymbols, len;
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
if (cinfo->is_decompressor) {
if (isDC)
htblptr = ((j_decompress_ptr) cinfo)->dc_huff_tbl_ptrs;
else
htblptr = ((j_decompress_ptr) cinfo)->ac_huff_tbl_ptrs;
} else {
if (isDC)
htblptr = ((j_compress_ptr) cinfo)->dc_huff_tbl_ptrs;
else
htblptr = ((j_compress_ptr) cinfo)->ac_huff_tbl_ptrs;
}
switch (tblno) {
case 0:
if (isDC) {
bits = bits_dc_luminance;
val = val_dc_luminance;
} else {
bits = bits_ac_luminance;
val = val_ac_luminance;
}
break;
case 1:
if (isDC) {
bits = bits_dc_chrominance;
val = val_dc_chrominance;
} else {
bits = bits_ac_chrominance;
val = val_ac_chrominance;
}
break;
default:
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
return NULL; /* avoid compiler warnings for uninitialized variables */
}
if (htblptr[tblno] == NULL)
htblptr[tblno] = jpeg_alloc_huff_table(cinfo);
htbl = htblptr[tblno];
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jxhuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
if (nsymbols > 0)
MEMCOPY(htbl->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
htbl->sent_table = FALSE;
return htbl;
}
+14 -103
View File
@@ -2,7 +2,7 @@
* jcparam.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2013 by Guido Vollbeding.
* Modified 2003-2019 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.
*
@@ -162,112 +162,23 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
/*
* Huffman table setup routines
* Reset standard Huffman tables
*/
LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
int nsymbols, len;
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jchuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols < 1 || nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*htblptr)->sent_table = FALSE;
}
LOCAL(void)
std_huff_tables (j_compress_ptr cinfo)
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
{
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
bits_ac_luminance, val_ac_luminance);
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
bits_dc_chrominance, val_dc_chrominance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
bits_ac_chrominance, val_ac_chrominance);
if (cinfo->dc_huff_tbl_ptrs[0] != NULL)
(void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 0);
if (cinfo->ac_huff_tbl_ptrs[0] != NULL)
(void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 0);
if (cinfo->dc_huff_tbl_ptrs[1] != NULL)
(void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 1);
if (cinfo->ac_huff_tbl_ptrs[1] != NULL)
(void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 1);
}
@@ -306,7 +217,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
cinfo->data_precision = BITS_IN_JSAMPLE;
/* Set up two quantization tables using default quality of 75 */
jpeg_set_quality(cinfo, 75, TRUE);
/* Set up two Huffman tables */
/* Reset standard Huffman tables */
std_huff_tables(cinfo);
/* Initialize default arithmetic coding conditioning */
+14 -14
View File
@@ -1,7 +1,7 @@
/*
* jdarith.c
*
* Developed 1997-2015 by Guido Vollbeding.
* Developed 1997-2019 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.
*
@@ -280,7 +280,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
@@ -370,7 +370,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
@@ -404,7 +404,8 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
int p1, blkn;
JCOEF p1;
int blkn;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
@@ -440,7 +441,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
JCOEFPTR thiscoef;
unsigned char *st;
int tbl, k, kex;
int p1, m1;
JCOEF p1, m1;
const int * natural_order;
/* Process restart marker if needed */
@@ -459,7 +460,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
m1 = -p1; /* -1 in the bit position being coded */
/* Establish EOBx (previous stage end-of-block) index */
kex = cinfo->Se;
@@ -555,7 +556,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
@@ -612,7 +613,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
if ((m <<= 1) == (int) 0x8000U) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
@@ -766,9 +767,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
arith_entropy_ptr entropy;
int i;
entropy = (arith_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(arith_entropy_decoder));
entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_decoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass;
@@ -785,9 +785,9 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
if (cinfo->progressive_mode) {
/* Create progression status table */
int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2])
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components*DCTSIZE2*SIZEOF(int));
cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 * SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (i = 0; i < DCTSIZE2; i++)
+10 -13
View File
@@ -2,7 +2,7 @@
* jdatadst.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2017 by Guido Vollbeding.
* Modified 2009-2019 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 @@ typedef struct {
struct jpeg_destination_mgr pub; /* public fields */
unsigned char ** outbuffer; /* target buffer */
unsigned long * outsize;
size_t * outsize;
unsigned char * newbuffer; /* newly allocated buffer */
JOCTET * buffer; /* start of buffer */
size_t bufsize;
@@ -66,9 +66,8 @@ init_destination (j_compress_ptr cinfo)
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
/* Allocate the output buffer --- it will be released when done with image */
dest->buffer = (JOCTET *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
dest->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
@@ -131,7 +130,7 @@ empty_mem_output_buffer (j_compress_ptr cinfo)
nextbuffer = (JOCTET *) malloc(nextsize);
if (nextbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11);
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
@@ -204,9 +203,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
* sizes may be different. Caveat programmer.
*/
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_destination_mgr));
cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_destination_mgr));
}
dest = (my_dest_ptr) cinfo->dest;
@@ -233,7 +231,7 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
GLOBAL(void)
jpeg_mem_dest (j_compress_ptr cinfo,
unsigned char ** outbuffer, unsigned long * outsize)
unsigned char ** outbuffer, size_t * outsize)
{
my_mem_dest_ptr dest;
@@ -244,9 +242,8 @@ jpeg_mem_dest (j_compress_ptr cinfo,
* can be written to the same buffer without re-executing jpeg_mem_dest.
*/
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_mem_destination_mgr));
cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_mem_destination_mgr));
}
dest = (my_mem_dest_ptr) cinfo->dest;
+15 -16
View File
@@ -2,7 +2,7 @@
* jdatasrc.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2015 by Guido Vollbeding.
* Modified 2009-2019 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.
*
@@ -156,21 +156,23 @@ METHODDEF(void)
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
struct jpeg_source_mgr * src = cinfo->src;
size_t nbytes;
/* Just a dumb implementation for now. Could use fseek() except
* it doesn't work on pipes. Not clear that being smart is worth
* any trouble anyway --- large skips are infrequent.
*/
if (num_bytes > 0) {
while (num_bytes > (long) src->bytes_in_buffer) {
num_bytes -= (long) src->bytes_in_buffer;
nbytes = (size_t) num_bytes;
while (nbytes > src->bytes_in_buffer) {
nbytes -= src->bytes_in_buffer;
(void) (*src->fill_input_buffer) (cinfo);
/* note we assume that fill_input_buffer will never return FALSE,
* so suspension need not be handled.
*/
}
src->next_input_byte += (size_t) num_bytes;
src->bytes_in_buffer -= (size_t) num_bytes;
src->next_input_byte += nbytes;
src->bytes_in_buffer -= nbytes;
}
}
@@ -219,13 +221,11 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
* manager serially with the same JPEG object. Caveat programmer.
*/
if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_source_mgr));
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_source_mgr));
src = (my_src_ptr) cinfo->src;
src->buffer = (JOCTET *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
INPUT_BUF_SIZE * SIZEOF(JOCTET));
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
}
src = (my_src_ptr) cinfo->src;
@@ -247,7 +247,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
GLOBAL(void)
jpeg_mem_src (j_decompress_ptr cinfo,
const unsigned char * inbuffer, unsigned long insize)
const unsigned char * inbuffer, size_t insize)
{
struct jpeg_source_mgr * src;
@@ -259,9 +259,8 @@ jpeg_mem_src (j_decompress_ptr cinfo,
* the first one.
*/
if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(struct jpeg_source_mgr));
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(struct jpeg_source_mgr));
}
src = cinfo->src;
@@ -270,6 +269,6 @@ jpeg_mem_src (j_decompress_ptr cinfo,
src->skip_input_data = skip_input_data;
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
src->term_source = term_source;
src->bytes_in_buffer = (size_t) insize;
src->bytes_in_buffer = insize;
src->next_input_byte = (const JOCTET *) inbuffer;
}
+59 -71
View File
@@ -2,7 +2,7 @@
* jdcolor.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2017 by Guido Vollbeding.
* Modified 2011-2019 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.
*
@@ -124,28 +124,22 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x;
SHIFT_TEMPS
cconvert->Cr_r_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 1.402 * x */
cconvert->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
/* Cb=>B value is nearest int to 1.772 * x */
cconvert->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
/* Cr=>G value is scaled-up -0.714136286 * x */
cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
/* Cb=>G value is scaled-up -0.344136286 * x */
@@ -164,28 +158,22 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x;
SHIFT_TEMPS
cconvert->Cr_r_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 2.804 * x */
cconvert->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
/* Cb=>B value is nearest int to 3.544 * x */
cconvert->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
/* Cr=>G value is scaled-up -1.428272572 * x */
cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
/* Cb=>G value is scaled-up -0.688272572 * x */
@@ -201,6 +189,7 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
* Note that we change from noninterleaved, one-plane-per-component format
* to interleaved-pixel format. The output buffer is therefore three times
* as wide as the input buffer.
*
* A starting row offset is provided only for the input buffer. The caller
* can easily adjust the passed output_buf value to accommodate any row
* offset required on that side.
@@ -264,9 +253,8 @@ build_rgb_y_table (j_decompress_ptr cinfo)
INT32 i;
/* Allocate and fill in the conversion tables. */
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(TABLE_SIZE * SIZEOF(INT32)));
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, TABLE_SIZE * SIZEOF(INT32));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;
@@ -286,8 +274,8 @@ rgb_gray_convert (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
@@ -313,6 +301,7 @@ rgb_gray_convert (j_decompress_ptr cinfo,
/*
* Convert some rows of samples to the output colorspace.
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
* (inverse color transform).
* This can be seen as an adaption of the general YCbCr->RGB
@@ -364,8 +353,8 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
@@ -396,6 +385,7 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
/*
* Convert some rows of samples to the output colorspace.
* No colorspace change, but conversion from separate-planes
* to interleaved representation.
*/
@@ -430,6 +420,7 @@ rgb_convert (j_decompress_ptr cinfo,
/*
* Color conversion for no colorspace change: just copy the data,
* converting from separate-planes to interleaved representation.
* We assume out_color_components == num_components.
*/
METHODDEF(void)
@@ -437,20 +428,21 @@ null_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
int ci;
register int nc = cinfo->num_components;
register JSAMPROW outptr;
register JSAMPROW inptr;
register JDIMENSION col;
register JDIMENSION count;
register int num_comps = cinfo->num_components;
JDIMENSION num_cols = cinfo->output_width;
int ci;
while (--num_rows >= 0) {
for (ci = 0; ci < nc; ci++) {
/* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < num_comps; ci++) {
inptr = input_buf[ci][input_row];
outptr = output_buf[0] + ci;
for (col = 0; col < num_cols; col++) {
*outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
outptr += nc;
for (count = num_cols; count > 0; count--) {
*outptr = *inptr++; /* don't need GETJSAMPLE() here */
outptr += num_comps;
}
}
input_row++;
@@ -504,9 +496,10 @@ gray_rgb_convert (j_decompress_ptr cinfo,
/*
* Adobe-style YCCK->CMYK conversion.
* We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
* conversion as above, while passing K (black) unchanged.
* Convert some rows of samples to the output colorspace.
* This version handles Adobe-style YCCK->CMYK conversion,
* where we convert YCbCr to R=1-C, G=1-M, and B=1-Y using the
* same conversion as above, while passing K (black) unchanged.
* We assume build_ycc_rgb_table has been called.
*/
@@ -577,9 +570,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
my_cconvert_ptr cconvert;
int ci;
cconvert = (my_cconvert_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_color_deconverter));
cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_deconverter));
cinfo->cconvert = &cconvert->pub;
cconvert->pub.start_pass = start_pass_dcolor;
@@ -607,7 +599,6 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
default: /* JCS_UNKNOWN can be anything */
if (cinfo->num_components < 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
}
/* Support color transform only for RGB colorspaces */
@@ -684,19 +675,18 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_BG_RGB:
cinfo->out_color_components = RGB_PIXELSIZE;
if (cinfo->jpeg_color_space == JCS_BG_RGB) {
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb1_rgb_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
} else
if (cinfo->jpeg_color_space != JCS_BG_RGB)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb1_rgb_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
break;
case JCS_CMYK:
@@ -714,14 +704,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
}
break;
default:
/* Permit null conversion to same output space */
if (cinfo->out_color_space == cinfo->jpeg_color_space) {
cinfo->out_color_components = cinfo->num_components;
cconvert->pub.color_convert = null_convert;
} else /* unsupported non-null conversion */
default: /* permit null conversion to same output space */
if (cinfo->out_color_space != cinfo->jpeg_color_space)
/* unsupported non-null conversion */
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
cinfo->out_color_components = cinfo->num_components;
cconvert->pub.color_convert = null_convert;
}
if (cinfo->quantize_colors)
+1 -8
View File
@@ -2,7 +2,7 @@
* jdct.h
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2017 by Guido Vollbeding.
* Modified 2002-2019 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.
*
@@ -358,13 +358,6 @@ EXTERN(void) jpeg_idct_1x2
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
* This macro is used only when the two inputs will actually be no more than
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
+56 -50
View File
@@ -2,7 +2,7 @@
* jdhuff.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2006-2016 by Guido Vollbeding.
* Modified 2006-2019 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.
*
@@ -341,13 +341,12 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
htbl =
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
/* Allocate a workspace if we haven't already done so. */
if (*pdtbl == NULL)
*pdtbl = (d_derived_tbl *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(d_derived_tbl));
*pdtbl = (d_derived_tbl *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(d_derived_tbl));
dtbl = *pdtbl;
dtbl->pub = htbl; /* fill in back link */
@@ -706,7 +705,7 @@ process_restart (j_decompress_ptr cinfo)
METHODDEF(boolean)
decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int Al = cinfo->Al;
register int s, r;
@@ -730,7 +729,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (! entropy->insufficient_data) {
/* Load up working state */
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(state, entropy->saved);
/* Outer loop handles each block in the MCU */
@@ -759,12 +758,13 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -777,7 +777,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
unsigned int EOBRUN;
@@ -809,7 +809,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (EOBRUN) /* if it's a band of zeroes... */
EOBRUN--; /* ...process it now (we do nothing) */
else {
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
Se = cinfo->Se;
Al = cinfo->Al;
natural_order = cinfo->natural_order;
@@ -842,15 +842,16 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
}
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
}
/* Completed MCU, so update state */
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -864,9 +865,10 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int p1, blkn;
JCOEF p1;
int blkn;
BITREAD_STATE_VARS;
/* Process restart marker if needed; may have to suspend */
@@ -881,7 +883,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
/* Load up working state */
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
@@ -896,10 +898,11 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -911,11 +914,12 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
unsigned int EOBRUN;
int Se, p1, m1;
int Se;
JCOEF p1, m1;
const int * natural_order;
JBLOCKROW block;
JCOEFPTR thiscoef;
@@ -937,11 +941,11 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Se = cinfo->Se;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
m1 = -p1; /* -1 in the bit position being coded */
natural_order = cinfo->natural_order;
/* Load up working state */
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
/* There is always only one block per MCU */
@@ -1043,12 +1047,13 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
@@ -1091,7 +1096,7 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Se = cinfo->lim_Se;
/* Load up working state */
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(state, entropy->saved);
/* Outer loop handles each block in the MCU */
@@ -1178,12 +1183,13 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -1215,7 +1221,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (! entropy->insufficient_data) {
/* Load up working state */
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(state, entropy->saved);
/* Outer loop handles each block in the MCU */
@@ -1302,12 +1308,13 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Completed MCU, so update state */
BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
ASSIGN_STATE(entropy->saved, state);
}
/* Account for restart interval (no-op if not using restarts) */
entropy->restarts_to_go--;
/* Account for restart interval if using restarts */
if (cinfo->restart_interval)
entropy->restarts_to_go--;
return TRUE;
}
@@ -1343,11 +1350,11 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
goto bad;
}
if (cinfo->Al > 13) { /* need not check for < 0 */
/* Arguably the maximum Al value should be less than 13 for 8-bit precision,
* but the spec doesn't say so, and we try to be liberal about what we
* accept. Note: large Al values could result in out-of-range DC
* coefficients during early scans, leading to bizarre displays due to
* overflows in the IDCT math. But we won't crash.
/* Arguably the maximum Al value should be less than 13 for 8-bit
* precision, but the spec doesn't say so, and we try to be liberal
* about what we accept. Note: large Al values could result in
* out-of-range DC coefficients during early scans, leading to bizarre
* displays due to overflows in the IDCT math. But we won't crash.
*/
bad:
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
@@ -1451,7 +1458,8 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
compptr = cinfo->cur_comp_info[ci];
/* Precalculate which table to use for each block */
entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
entropy->ac_cur_tbls[blkn] = /* AC needs no table when not present */
cinfo->lim_Se ? entropy->ac_derived_tbls[compptr->ac_tbl_no] : NULL;
/* Decide whether we really care about the coefficient values */
if (compptr->component_needed) {
ci = compptr->DCT_v_scaled_size;
@@ -1494,7 +1502,6 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
if (ci <= 0 || ci > 8) ci = 8;
if (i <= 0 || i > 8) i = 8;
entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];
break;
}
} else {
entropy->coef_limit[blkn] = 0;
@@ -1522,9 +1529,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
huff_entropy_ptr entropy;
int i;
entropy = (huff_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(huff_entropy_decoder));
entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass_huff_decoder;
entropy->pub.finish_pass = finish_pass_huff;
@@ -1532,9 +1538,9 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
if (cinfo->progressive_mode) {
/* Create progression status table */
int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2])
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components*DCTSIZE2*SIZEOF(int));
cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * DCTSIZE2 * SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (i = 0; i < DCTSIZE2; i++)
@@ -1545,7 +1551,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
entropy->derived_tbls[i] = NULL;
}
} else {
/* Mark tables unallocated */
/* Mark derived tables unallocated */
for (i = 0; i < NUM_HUFF_TBLS; i++) {
entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
}
+7 -13
View File
@@ -2,7 +2,7 @@
* jdmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2009-2013 by Guido Vollbeding.
* Modified 2009-2019 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.
*
@@ -496,8 +496,6 @@ get_dht (j_decompress_ptr cinfo)
if (count > 256 || ((INT32) count) > length)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */
for (i = 0; i < count; i++)
INPUT_BYTE(cinfo, huffval[i], return FALSE);
@@ -517,7 +515,8 @@ get_dht (j_decompress_ptr cinfo)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
if (count > 0)
MEMCOPY((*htblptr)->huffval, huffval, count * SIZEOF(UINT8));
}
if (length != 0)
@@ -577,14 +576,14 @@ get_dqt (j_decompress_ptr cinfo)
count = DCTSIZE2;
}
switch (count) {
switch ((int) count) {
case (2*2): natural_order = jpeg_natural_order2; break;
case (3*3): natural_order = jpeg_natural_order3; break;
case (4*4): natural_order = jpeg_natural_order4; break;
case (5*5): natural_order = jpeg_natural_order5; break;
case (6*6): natural_order = jpeg_natural_order6; break;
case (7*7): natural_order = jpeg_natural_order7; break;
default: natural_order = jpeg_natural_order; break;
default: natural_order = jpeg_natural_order;
}
for (i = 0; i < count; i++) {
@@ -784,7 +783,6 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
default:
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
GETJOCTET(data[5]), (int) totallen);
break;
}
} else {
/* Start of APP0 does not match "JFIF" or "JFXX", or too short */
@@ -858,7 +856,6 @@ get_interesting_appn (j_decompress_ptr cinfo)
default:
/* can't get here unless jpeg_save_markers chooses wrong processor */
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
break;
}
/* skip any remaining data -- could be lots */
@@ -964,7 +961,6 @@ save_marker (j_decompress_ptr cinfo)
default:
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
(int) (data_length + length));
break;
}
/* skip any remaining data -- could be lots */
@@ -1240,7 +1236,6 @@ read_markers (j_decompress_ptr cinfo)
* ought to change!
*/
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
break;
}
/* Successfully processed marker, so reset state variable */
cinfo->unread_marker = 0;
@@ -1416,9 +1411,8 @@ jinit_marker_reader (j_decompress_ptr cinfo)
int i;
/* Create subobject in permanent pool */
marker = (my_marker_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_marker_reader));
marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_marker_reader));
cinfo->marker = &marker->pub;
/* Initialize public method pointers */
marker->pub.reset_marker_reader = reset_marker_reader;
+24 -23
View File
@@ -2,7 +2,7 @@
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2002-2017 by Guido Vollbeding.
* Modified 2002-2019 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.
*
@@ -104,7 +104,7 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
*/
{
#ifdef IDCT_SCALING_SUPPORTED
int ci;
int ci, ssize;
jpeg_component_info *compptr;
#endif
@@ -124,19 +124,23 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
*/
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
int ssize = 1;
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
ssize = 1;
if (! cinfo->raw_data_out)
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2;
}
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
ssize = 1;
while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
if (! cinfo->raw_data_out)
while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
0) {
ssize = ssize * 2;
}
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
/* We don't support IDCT ratios larger than 2. */
@@ -144,13 +148,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
}
/* Recompute downsampled dimensions of components;
* application needs to know these if using raw downsampled data.
*/
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Recompute downsampled dimensions of components;
* application needs to know these if using raw downsampled data.
*/
/* Size in samples, after IDCT scaling */
compptr->downsampled_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width *
@@ -172,8 +173,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
break;
case JCS_RGB:
case JCS_BG_RGB:
#if RGB_PIXELSIZE != 3
cinfo->out_color_components = RGB_PIXELSIZE;
break;
#endif /* else share code with YCbCr */
case JCS_YCbCr:
case JCS_BG_YCC:
cinfo->out_color_components = 3;
@@ -184,7 +187,6 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
break;
default: /* else must be same colorspace as in file */
cinfo->out_color_components = cinfo->num_components;
break;
}
cinfo->output_components = (cinfo->quantize_colors ? 1 :
cinfo->out_color_components);
@@ -525,9 +527,8 @@ jinit_master_decompress (j_decompress_ptr cinfo)
{
my_master_ptr master;
master = (my_master_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_decomp_master));
master = (my_master_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_decomp_master));
cinfo->master = &master->pub;
master->pub.prepare_for_output_pass = prepare_for_output_pass;
master->pub.finish_output_pass = finish_output_pass;
+26 -39
View File
@@ -2,7 +2,7 @@
* jdmerge.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2013-2017 by Guido Vollbeding.
* Modified 2013-2019 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.
*
@@ -95,28 +95,22 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x;
SHIFT_TEMPS
upsample->Cr_r_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 1.402 * x */
upsample->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
upsample->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
/* Cb=>B value is nearest int to 1.772 * x */
upsample->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
upsample->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
/* Cr=>G value is scaled-up -0.714136286 * x */
upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
/* Cb=>G value is scaled-up -0.344136286 * x */
@@ -135,28 +129,22 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
INT32 x;
SHIFT_TEMPS
upsample->Cr_r_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 2.804 * x */
upsample->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
upsample->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
/* Cb=>B value is nearest int to 3.544 * x */
upsample->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
upsample->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
/* Cr=>G value is scaled-up -1.428272572 * x */
upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
/* Cb=>G value is scaled-up -0.688272572 * x */
@@ -419,9 +407,8 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
{
my_upsample_ptr upsample;
upsample = (my_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_upsampler));
upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler));
cinfo->upsample = &upsample->pub;
upsample->pub.start_pass = start_pass_merged_upsample;
upsample->pub.need_context_rows = FALSE;
@@ -432,9 +419,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
upsample->pub.upsample = merged_2v_upsample;
upsample->upmethod = h2v2_merged_upsample;
/* Allocate a spare row buffer */
upsample->spare_row = (JSAMPROW)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
upsample->spare_row = (JSAMPROW) (*cinfo->mem->alloc_large)
((j_common_ptr) cinfo, JPOOL_IMAGE,
(size_t) upsample->out_row_width * SIZEOF(JSAMPLE));
} else {
upsample->pub.upsample = merged_1v_upsample;
upsample->upmethod = h2v1_merged_upsample;
+2 -2
View File
@@ -2,7 +2,7 @@
* jerror.h
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2012 by Guido Vollbeding.
* Modified 1997-2018 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.
*
@@ -84,7 +84,7 @@ JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_CLEN_OUTOFBOUNDS, "Huffman code size table out of bounds")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+61 -55
View File
@@ -2,7 +2,7 @@
* jfdctint.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modification developed 2003-2015 by Guido Vollbeding.
* Modification developed 2003-2018 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.
*
@@ -3261,78 +3261,84 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
GLOBAL(void)
jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{
INT32 tmp0, tmp1;
INT32 tmp10, tmp11;
DCTELEM *dataptr;
DCTELEM tmp0, tmp2, tmp10, tmp12, tmp4, tmp5;
INT32 tmp1, tmp3, tmp11, tmp13;
INT32 z1, z2, z3;
JSAMPROW elemptr;
int ctr;
SHIFT_TEMPS
/* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
/* Pass 1: process rows.
* Note results are scaled up by sqrt(8) compared to a true DCT;
* furthermore, we scale the results by 2**PASS1_BITS.
* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here.
* Note results are scaled up by sqrt(8) compared to a true DCT.
* 4-point FDCT kernel,
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
*/
dataptr = data;
for (ctr = 0; ctr < 2; ctr++) {
elemptr = sample_data[ctr] + start_col;
/* Row 0 */
elemptr = sample_data[0] + start_col;
/* Even part */
/* Even part */
tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
tmp0 = tmp4 + tmp5;
tmp2 = tmp4 - tmp5;
/* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));
/* Odd part */
/* Odd part */
z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
/* Add fudge factor here for final descale. */
tmp0 += ONE << (CONST_BITS-PASS1_BITS-4);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
/* Add fudge factor here for final descale. */
z1 += ONE << (CONST_BITS-3-1);
tmp1 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
dataptr[1] = (DCTELEM)
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
CONST_BITS-PASS1_BITS-3);
dataptr[3] = (DCTELEM)
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
CONST_BITS-PASS1_BITS-3);
/* Row 1 */
elemptr = sample_data[1] + start_col;
dataptr += DCTSIZE; /* advance pointer to next row */
}
/* Even part */
tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
tmp10 = tmp4 + tmp5;
tmp12 = tmp4 - tmp5;
/* Odd part */
z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
tmp11 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp13 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
/* Pass 2: process columns.
* We remove the PASS1_BITS scaling, but leave the results scaled up
* by an overall factor of 8.
* We leave the results scaled up by an overall factor of 8.
* We must also scale the output by (8/4)*(8/2) = 2**3.
*/
dataptr = data;
for (ctr = 0; ctr < 4; ctr++) {
/* Even part */
/* Column 0 */
/* Apply unsigned->signed conversion. */
data[DCTSIZE*0] = (tmp0 + tmp10 - 8 * CENTERJSAMPLE) << 3;
data[DCTSIZE*1] = (tmp0 - tmp10) << 3;
/* Add fudge factor here for final descale. */
tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1));
tmp1 = dataptr[DCTSIZE*1];
/* Column 1 */
data[DCTSIZE*0+1] = (DCTELEM) RIGHT_SHIFT(tmp1 + tmp11, CONST_BITS-3);
data[DCTSIZE*1+1] = (DCTELEM) RIGHT_SHIFT(tmp1 - tmp11, CONST_BITS-3);
dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);
/* Column 2 */
data[DCTSIZE*0+2] = (tmp2 + tmp12) << 3;
data[DCTSIZE*1+2] = (tmp2 - tmp12) << 3;
/* Odd part */
dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);
dataptr++; /* advance pointer to next column */
}
/* Column 3 */
data[DCTSIZE*0+3] = (DCTELEM) RIGHT_SHIFT(tmp3 + tmp13, CONST_BITS-3);
data[DCTSIZE*1+3] = (DCTELEM) RIGHT_SHIFT(tmp3 - tmp13, CONST_BITS-3);
}
@@ -4312,7 +4318,6 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
/* Pass 1: process rows.
* Note results are scaled up by sqrt(8) compared to a true DCT.
* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here.
*/
dataptr = data;
@@ -4325,17 +4330,18 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp1 = GETJSAMPLE(elemptr[1]);
/* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3);
dataptr[0] = (DCTELEM) (tmp0 + tmp1 - 2 * CENTERJSAMPLE);
/* Odd part */
dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3);
dataptr[1] = (DCTELEM) (tmp0 - tmp1);
dataptr += DCTSIZE; /* advance pointer to next row */
}
/* Pass 2: process columns.
* We leave the results scaled up by an overall factor of 8.
* We must also scale the output by (8/2)*(8/4) = 2**3.
* 4-point FDCT kernel,
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
*/
@@ -4350,21 +4356,21 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1);
dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1);
dataptr[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1) << 3);
dataptr[DCTSIZE*2] = (DCTELEM) ((tmp0 - tmp1) << 3);
/* Odd part */
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
/* Add fudge factor here for final descale. */
tmp0 += ONE << (CONST_BITS-1);
tmp0 += ONE << (CONST_BITS-3-1);
dataptr[DCTSIZE*1] = (DCTELEM)
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
CONST_BITS);
CONST_BITS-3);
dataptr[DCTSIZE*3] = (DCTELEM)
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
CONST_BITS);
CONST_BITS-3);
dataptr++; /* advance pointer to next column */
}
+6 -6
View File
@@ -2,7 +2,7 @@
* jidctint.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2016 by Guido Vollbeding.
* Modification developed 2002-2018 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.
*
@@ -1474,7 +1474,7 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a 11x11 output block.
* producing an 11x11 output block.
*
* Optimized algorithm with 24 multiplications in the 1-D kernel.
* cK represents sqrt(2) * cos(K*pi/22).
@@ -3675,7 +3675,7 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a 8x4 output block.
* producing an 8x4 output block.
*
* 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
*/
@@ -3835,7 +3835,7 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a reduced-size 6x3 output block.
* producing a 6x3 output block.
*
* 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
*/
@@ -4082,7 +4082,7 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a 8x16 output block.
* producing an 8x16 output block.
*
* 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
*/
@@ -5004,7 +5004,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/*
* Perform dequantization and inverse DCT on one block of coefficients,
* producing a reduced-size 3x6 output block.
* producing a 3x6 output block.
*
* 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).
*/
+28 -32
View File
@@ -2,7 +2,7 @@
* jmemmgr.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2012 by Guido Vollbeding.
* Modified 2011-2019 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.
*
@@ -130,7 +130,7 @@ typedef struct {
jvirt_barray_ptr virt_barray_list;
/* This counts total space obtained from jpeg_get_small/large */
long total_space_allocated;
size_t total_space_allocated;
/* alloc_sarray and alloc_barray set this value for use by virtual
* array routines.
@@ -195,7 +195,7 @@ print_mem_stats (j_common_ptr cinfo, int pool_id)
* This is helpful because message parm array can't handle longs.
*/
fprintf(stderr, "Freeing pool %d, total space = %ld\n",
pool_id, mem->total_space_allocated);
pool_id, (long) mem->total_space_allocated);
for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
lhdr_ptr = lhdr_ptr->hdr.next) {
@@ -260,11 +260,11 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
{
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
small_pool_ptr hdr_ptr, prev_hdr_ptr;
char * data_ptr;
size_t odd_bytes, min_request, slop;
char * data_ptr;
/* Check for unsatisfiable request (do now to ensure no overflow below) */
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(small_pool_hdr))
out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
@@ -293,8 +293,8 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
else
slop = extra_pool_slop[pool_id];
/* Don't ask for more than MAX_ALLOC_CHUNK */
if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
if (slop > (size_t) MAX_ALLOC_CHUNK - min_request)
slop = (size_t) MAX_ALLOC_CHUNK - min_request;
/* Try to get space, if fail reduce slop and try again */
for (;;) {
hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
@@ -348,7 +348,7 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
size_t odd_bytes;
/* Check for unsatisfiable request (do now to ensure no overflow below) */
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(large_pool_hdr))
out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
@@ -404,7 +404,7 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
long ltemp;
/* Calculate max # of rows allowed in one allocation chunk */
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
ltemp = (MAX_ALLOC_CHUNK - SIZEOF(large_pool_hdr)) /
((long) samplesperrow * SIZEOF(JSAMPLE));
if (ltemp <= 0)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
@@ -416,15 +416,14 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
/* Get space for row pointers (small object) */
result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
(size_t) (numrows * SIZEOF(JSAMPROW)));
(size_t) numrows * SIZEOF(JSAMPROW));
/* Get the rows themselves (large objects) */
currow = 0;
while (currow < numrows) {
rowsperchunk = MIN(rowsperchunk, numrows - currow);
workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
* SIZEOF(JSAMPLE)));
(size_t) rowsperchunk * (size_t) samplesperrow * SIZEOF(JSAMPLE));
for (i = rowsperchunk; i > 0; i--) {
result[currow++] = workspace;
workspace += samplesperrow;
@@ -452,7 +451,7 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
long ltemp;
/* Calculate max # of rows allowed in one allocation chunk */
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
ltemp = (MAX_ALLOC_CHUNK - SIZEOF(large_pool_hdr)) /
((long) blocksperrow * SIZEOF(JBLOCK));
if (ltemp <= 0)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
@@ -464,15 +463,14 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
/* Get space for row pointers (small object) */
result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
(size_t) (numrows * SIZEOF(JBLOCKROW)));
(size_t) numrows * SIZEOF(JBLOCKROW));
/* Get the rows themselves (large objects) */
currow = 0;
while (currow < numrows) {
rowsperchunk = MIN(rowsperchunk, numrows - currow);
workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
* SIZEOF(JBLOCK)));
(size_t) rowsperchunk * (size_t) blocksperrow * SIZEOF(JBLOCK));
for (i = rowsperchunk; i > 0; i--) {
result[currow++] = workspace;
workspace += blocksperrow;
@@ -585,8 +583,8 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Allocate the in-memory buffers for any unrealized virtual arrays */
{
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
long space_per_minheight, maximum_space, avail_mem;
long minheights, max_minheights;
long bytesperrow, space_per_minheight, maximum_space;
long avail_mem, minheights, max_minheights;
jvirt_sarray_ptr sptr;
jvirt_barray_ptr bptr;
@@ -598,18 +596,16 @@ realize_virt_arrays (j_common_ptr cinfo)
maximum_space = 0;
for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
if (sptr->mem_buffer == NULL) { /* if not realized yet */
space_per_minheight += (long) sptr->maxaccess *
(long) sptr->samplesperrow * SIZEOF(JSAMPLE);
maximum_space += (long) sptr->rows_in_array *
(long) sptr->samplesperrow * SIZEOF(JSAMPLE);
bytesperrow = (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
space_per_minheight += (long) sptr->maxaccess * bytesperrow;
maximum_space += (long) sptr->rows_in_array * bytesperrow;
}
}
for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
if (bptr->mem_buffer == NULL) { /* if not realized yet */
space_per_minheight += (long) bptr->maxaccess *
(long) bptr->blocksperrow * SIZEOF(JBLOCK);
maximum_space += (long) bptr->rows_in_array *
(long) bptr->blocksperrow * SIZEOF(JBLOCK);
bytesperrow = (long) bptr->blocksperrow * SIZEOF(JBLOCK);
space_per_minheight += (long) bptr->maxaccess * bytesperrow;
maximum_space += (long) bptr->rows_in_array * bytesperrow;
}
}
@@ -618,7 +614,7 @@ realize_virt_arrays (j_common_ptr cinfo)
/* Determine amount of memory to actually use; this is system-dependent. */
avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
mem->total_space_allocated);
(long) mem->total_space_allocated);
/* If the maximum space needed is available, make all the buffers full
* height; otherwise parcel it out with the same number of minheights
@@ -694,7 +690,7 @@ do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
file_offset = ptr->cur_start_row * bytesperrow;
file_offset = (long) ptr->cur_start_row * bytesperrow;
/* Loop to read or write each allocation chunk in mem_buffer */
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
/* One chunk, but check for short chunk at end of buffer */
@@ -727,7 +723,7 @@ do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
file_offset = ptr->cur_start_row * bytesperrow;
file_offset = (long) ptr->cur_start_row * bytesperrow;
/* Loop to read or write each allocation chunk in mem_buffer */
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
/* One chunk, but check for short chunk at end of buffer */
@@ -771,7 +767,7 @@ access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
/* Make the desired part of the virtual array accessible */
if (start_row < ptr->cur_start_row ||
end_row > ptr->cur_start_row+ptr->rows_in_mem) {
end_row > ptr->cur_start_row + ptr->rows_in_mem) {
if (! ptr->b_s_open)
ERREXIT(cinfo, JERR_VIRTUAL_BUG);
/* Flush old buffer contents if necessary */
@@ -856,7 +852,7 @@ access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
/* Make the desired part of the virtual array accessible */
if (start_row < ptr->cur_start_row ||
end_row > ptr->cur_start_row+ptr->rows_in_mem) {
end_row > ptr->cur_start_row + ptr->rows_in_mem) {
if (! ptr->b_s_open)
ERREXIT(cinfo, JERR_VIRTUAL_BUG);
/* Flush old buffer contents if necessary */
@@ -1093,7 +1089,7 @@ jinit_memory_mgr (j_common_ptr cinfo)
mem->total_space_allocated = SIZEOF(my_memory_mgr);
/* Declare ourselves open for business */
cinfo->mem = & mem->pub;
cinfo->mem = &mem->pub;
/* Check for an environment variable JPEGMEM; if found, override the
* default max_memory setting from jpeg_mem_init. Note that the
+6 -2
View File
@@ -2,6 +2,7 @@
* jmemnobs.c
*
* Copyright (C) 1992-1996, Thomas G. Lane.
* Modified 2019 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.
*
@@ -12,7 +13,7 @@
* This is very portable in the sense that it'll compile on almost anything,
* but you'd better have lots of main memory (or virtual memory) if you want
* to process big images.
* Note that the max_memory_to_use option is ignored by this implementation.
* Note that the max_memory_to_use option is respected by this implementation.
*/
#define JPEG_INTERNALS
@@ -66,13 +67,16 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
/*
* This routine computes the total memory space available for allocation.
* Here we always say, "we got all you want bud!"
*/
GLOBAL(long)
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
long max_bytes_needed, long already_allocated)
{
if (cinfo->mem->max_memory_to_use)
return cinfo->mem->max_memory_to_use - already_allocated;
/* Here we say, "we got all you want bud!" */
return max_bytes_needed;
}
+8 -1
View File
@@ -2,7 +2,7 @@
* jpegint.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2017 by Guido Vollbeding.
* Modified 1997-2019 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.
*
@@ -302,6 +302,13 @@ struct jpeg_color_quantizer {
#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + ((INT32) 1 << ((n)-1)), n)
/* Short forms of external names for systems with brain-damaged linkers. */
+7 -4
View File
@@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2017 by Guido Vollbeding.
* Modified 2002-2019 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 3
#define JPEG_LIB_VERSION_MINOR 4
/* Various constants determining the sizes of things.
@@ -909,6 +909,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
#define jpeg_suppress_tables jSuppressTables
#define jpeg_alloc_quant_table jAlcQTable
#define jpeg_alloc_huff_table jAlcHTable
#define jpeg_std_huff_table jStdHTable
#define jpeg_start_compress jStrtCompress
#define jpeg_write_scanlines jWrtScanlines
#define jpeg_finish_compress jFinCompress
@@ -977,10 +978,10 @@ EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
/* Data source and destination managers: memory buffers. */
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
unsigned char ** outbuffer,
unsigned long * outsize));
size_t * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
const unsigned char * inbuffer,
unsigned long insize));
size_t insize));
/* Default parameter setup for compression */
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
@@ -1005,6 +1006,8 @@ EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_std_huff_table JPP((j_common_ptr cinfo,
boolean isDC, int tblno));
/* Main entry points for compression */
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+3 -3
View File
@@ -2,7 +2,7 @@
* jutils.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2009-2011 by Guido Vollbeding.
* Modified 2009-2019 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.
*
@@ -185,7 +185,7 @@ jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
{
register JSAMPROW inptr, outptr;
#ifdef FMEMCOPY
register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
register size_t count = (size_t) num_cols * SIZEOF(JSAMPLE);
#else
register JDIMENSION count;
#endif
@@ -213,7 +213,7 @@ jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
/* Copy a row of coefficient blocks from one place to another. */
{
#ifdef FMEMCOPY
FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
FMEMCOPY(output_row, input_row, (size_t) num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
#else
register JCOEFPTR inptr, outptr;
register long count;
+3 -3
View File
@@ -1,7 +1,7 @@
/*
* jversion.h
*
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1991-2020, 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 "9c 14-Jan-2018"
#define JVERSION "9d 12-Jan-2020"
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding"
+2 -2
View File
@@ -74,7 +74,7 @@ if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif(MSVC)
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
add_library(${PNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare)
@@ -92,7 +92,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(libpng LICENSE README)
Vendored Executable → Regular
View File
+9 -20
View File
@@ -20,9 +20,8 @@
# Author: qtang@openailab.com or https://github.com/BUG1989
# qli@openailab.com
# sqfu@openailab.com
#
SET(TENGINE_COMMIT_VERSION "2f3cd86217f3530c8e4a82f3ed5af14c7a4e3943")
SET(TENGINE_COMMIT_VERSION "e89cf8870de2ff0a80cfe626c0b52b2a16fb302e")
SET(OCV_TENGINE_DIR "${OpenCV_BINARY_DIR}/3rdparty/libtengine")
SET(OCV_TENGINE_SOURCE_PATH "${OCV_TENGINE_DIR}/Tengine-${TENGINE_COMMIT_VERSION}")
@@ -32,11 +31,10 @@ IF(EXISTS "${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
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url
SET(tengine_md5sum 23f61ebb1dd419f1207d8876496289c5) #md5sum
#MESSAGE(STATUS "**** TENGINE DOWNLOAD BEGIN ****")
ocv_download(FILENAME ${OCV_TENGINE_FILENAME}
HASH ${tengine_md5sum}
URL
@@ -62,30 +60,21 @@ 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()
if(NOT ANDROID)
# linux system
if(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
SET(CONFIG_ARCH_ARM32 ON)
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv7-a")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) ## AARCH64
SET(CONFIG_ARCH_ARM64 ON)
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv8-a")
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 "")
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/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()
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
endif()
+5 -2
View File
@@ -239,6 +239,9 @@ if(HOST_BIG_ENDIAN)
else()
set(HOST_BIG_ENDIAN 0)
endif()
if(HOST_BIG_ENDIAN)
add_definitions(-DWORDS_BIGENDIAN)
endif()
# IEEE floating point
set(HAVE_IEEEFP 1 CACHE STRING "IEEE floating point is available")
@@ -462,7 +465,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456 /wd4457 /wd4312) # vs2015
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018 /wd4311 /wd4312)
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
add_library(${TIFF_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs})
target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})
set_target_properties(${TIFF_LIBRARY}
@@ -479,7 +482,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(libtiff COPYRIGHT)
+2326
View File
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -24,6 +24,10 @@
#ifndef _LIBPORT_
#define _LIBPORT_
#if defined(HAVE_CONFIG_H)
# include <tif_config.h>
#endif
int getopt(int argc, char * const argv[], const char *optstring);
extern char *optarg;
extern int opterr;
@@ -36,16 +40,16 @@ int strcasecmp(const char *s1, const char *s2);
# define HAVE_GETOPT 1
#endif
#if HAVE_STRTOL
#if !defined(HAVE_STRTOL)
long strtol(const char *nptr, char **endptr, int base);
#endif
#if HAVE_STRTOLL
#if !defined(HAVE_STRTOLL)
long long strtoll(const char *nptr, char **endptr, int base);
#endif
#if HAVE_STRTOUL
#if !defined(HAVE_STRTOUL)
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
#if HAVE_STRTOULL
#if !defined(HAVE_STRTOULL)
unsigned long long strtoull(const char *nptr, char **endptr, int base);
#endif
+62 -27
View File
@@ -35,27 +35,61 @@
uint32
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
{
uint32 bytes = first * second;
if (second && bytes / second != first) {
if (second && first > TIFF_UINT32_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
bytes = 0;
return 0;
}
return bytes;
return first * second;
}
uint64
_TIFFMultiply64(TIFF* tif, uint64 first, uint64 second, const char* where)
{
uint64 bytes = first * second;
if (second && bytes / second != first) {
if (second && first > TIFF_UINT64_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
bytes = 0;
return 0;
}
return bytes;
return first * second;
}
tmsize_t
_TIFFMultiplySSize(TIFF* tif, tmsize_t first, tmsize_t second, const char* where)
{
if( first <= 0 || second <= 0 )
{
if( tif != NULL && where != NULL )
{
TIFFErrorExt(tif->tif_clientdata, where,
"Invalid argument to _TIFFMultiplySSize() in %s", where);
}
return 0;
}
if( first > TIFF_TMSIZE_T_MAX / second )
{
if( tif != NULL && where != NULL )
{
TIFFErrorExt(tif->tif_clientdata, where,
"Integer overflow in %s", where);
}
return 0;
}
return first * second;
}
tmsize_t _TIFFCastUInt64ToSSize(TIFF* tif, uint64 val, const char* module)
{
if( val > (uint64)TIFF_TMSIZE_T_MAX )
{
if( tif != NULL && module != NULL )
{
TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
}
return 0;
}
return (tmsize_t)val;
}
void*
@@ -63,13 +97,14 @@ _TIFFCheckRealloc(TIFF* tif, void* buffer,
tmsize_t nmemb, tmsize_t elem_size, const char* what)
{
void* cp = NULL;
tmsize_t bytes = nmemb * elem_size;
tmsize_t count = _TIFFMultiplySSize(tif, nmemb, elem_size, NULL);
/*
* XXX: Check for integer overflow.
* Check for integer overflow.
*/
if (nmemb && elem_size && bytes / elem_size == nmemb)
cp = _TIFFrealloc(buffer, bytes);
if (count != 0)
{
cp = _TIFFrealloc(buffer, count);
}
if (cp == NULL) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
@@ -235,7 +270,7 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
return (1);
case TIFFTAG_EXTRASAMPLES:
*va_arg(ap, uint16 *) = td->td_extrasamples;
*va_arg(ap, uint16 **) = td->td_sampleinfo;
*va_arg(ap, const uint16 **) = td->td_sampleinfo;
return (1);
case TIFFTAG_MATTEING:
*va_arg(ap, uint16 *) =
@@ -257,8 +292,8 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
case TIFFTAG_YCBCRCOEFFICIENTS:
{
/* defaults are from CCIR Recommendation 601-1 */
static float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f };
*va_arg(ap, float **) = ycbcrcoeffs;
static const float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f };
*va_arg(ap, const float **) = ycbcrcoeffs;
return 1;
}
case TIFFTAG_YCBCRSUBSAMPLING:
@@ -270,14 +305,14 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
return (1);
case TIFFTAG_WHITEPOINT:
{
static float whitepoint[2];
/* TIFF 6.0 specification tells that it is no default
value for the WhitePoint, but AdobePhotoshop TIFF
Technical Note tells that it should be CIE D50. */
whitepoint[0] = D50_X0 / (D50_X0 + D50_Y0 + D50_Z0);
whitepoint[1] = D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0);
*va_arg(ap, float **) = whitepoint;
static const float whitepoint[] = {
D50_X0 / (D50_X0 + D50_Y0 + D50_Z0),
D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0)
};
*va_arg(ap, const float **) = whitepoint;
return 1;
}
case TIFFTAG_TRANSFERFUNCTION:
@@ -286,16 +321,16 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space for \"TransferFunction\" tag");
return (0);
}
*va_arg(ap, uint16 **) = td->td_transferfunction[0];
*va_arg(ap, const uint16 **) = td->td_transferfunction[0];
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
*va_arg(ap, uint16 **) = td->td_transferfunction[1];
*va_arg(ap, uint16 **) = td->td_transferfunction[2];
*va_arg(ap, const uint16 **) = td->td_transferfunction[1];
*va_arg(ap, const uint16 **) = td->td_transferfunction[2];
}
return (1);
case TIFFTAG_REFERENCEBLACKWHITE:
if (!td->td_refblackwhite && !TIFFDefaultRefBlackWhite(td))
return (0);
*va_arg(ap, float **) = td->td_refblackwhite;
*va_arg(ap, const float **) = td->td_refblackwhite;
return (1);
}
return 0;
+1 -1
View File
@@ -264,7 +264,7 @@ TIFFGetConfiguredCODECs()
return NULL;
}
codecs = new_codecs;
_TIFFmemcpy(codecs + i - 1, cd, sizeof(TIFFCodec));
_TIFFmemcpy(codecs + i - 1, cd->info, sizeof(TIFFCodec));
i++;
}
for (c = _TIFFBuiltinCODECS; c->name; c++) {
+79 -28
View File
@@ -29,6 +29,7 @@
* (and also some miscellaneous stuff)
*/
#include "tiffiop.h"
#include <float.h> /*--: for Rational2Double */
/*
* These are used in the backwards compatibility code...
@@ -46,8 +47,8 @@ setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
*vpp = 0;
}
if (vp) {
tmsize_t bytes = (tmsize_t)(nmemb * elem_size);
if (elem_size && bytes / elem_size == nmemb)
tmsize_t bytes = _TIFFMultiplySSize(NULL, nmemb, elem_size, NULL);
if (bytes)
*vpp = (void*) _TIFFmalloc(bytes);
if (*vpp)
_TIFFmemcpy(*vpp, vp, bytes);
@@ -123,7 +124,7 @@ setExtraSamples(TIFF* tif, va_list ap, uint32* v)
{
TIFFWarningExt(tif->tif_clientdata,module,
"ExtraSamples tag value is changing, "
"but TransferFunction was read with a different value. Cancelling it");
"but TransferFunction was read with a different value. Canceling it");
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
_TIFFfree(td->td_transferfunction[0]);
td->td_transferfunction[0] = NULL;
@@ -205,7 +206,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
/*
* If the data require post-decoding processing to byte-swap
* samples, set it up here. Note that since tags are required
* to be ordered, compression code can override this behaviour
* to be ordered, compression code can override this behavior
* in the setup method if it wants to roll the post decoding
* work in with its normal work.
*/
@@ -275,7 +276,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
TIFFWarningExt(tif->tif_clientdata,module,
"SamplesPerPixel tag value is changing, "
"but SMinSampleValue tag was read with a different value. Cancelling it");
"but SMinSampleValue tag was read with a different value. Canceling it");
TIFFClrFieldBit(tif,FIELD_SMINSAMPLEVALUE);
_TIFFfree(td->td_sminsamplevalue);
td->td_sminsamplevalue = NULL;
@@ -284,7 +285,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
TIFFWarningExt(tif->tif_clientdata,module,
"SamplesPerPixel tag value is changing, "
"but SMaxSampleValue tag was read with a different value. Cancelling it");
"but SMaxSampleValue tag was read with a different value. Canceling it");
TIFFClrFieldBit(tif,FIELD_SMAXSAMPLEVALUE);
_TIFFfree(td->td_smaxsamplevalue);
td->td_smaxsamplevalue = NULL;
@@ -296,7 +297,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
TIFFWarningExt(tif->tif_clientdata,module,
"SamplesPerPixel tag value is changing, "
"but TransferFunction was read with a different value. Cancelling it");
"but TransferFunction was read with a different value. Canceling it");
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
_TIFFfree(td->td_transferfunction[0]);
td->td_transferfunction[0] = NULL;
@@ -393,7 +394,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
if (tif->tif_mode != O_RDONLY)
goto badvalue32;
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
"Nonstandard tile width %d, convert file", v32);
"Nonstandard tile width %u, convert file", v32);
}
td->td_tilewidth = v32;
tif->tif_flags |= TIFF_ISTILED;
@@ -404,7 +405,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
if (tif->tif_mode != O_RDONLY)
goto badvalue32;
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
"Nonstandard tile length %d, convert file", v32);
"Nonstandard tile length %u, convert file", v32);
}
td->td_tilelength = v32;
tif->tif_flags |= TIFF_ISTILED;
@@ -559,6 +560,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
* Set custom value ... save a copy of the custom tag value.
*/
tv_size = _TIFFDataSize(fip->field_type);
/*--: Rational2Double: For Rationals evaluate "set_field_type" to determine internal storage size. */
if (fip->field_type == TIFF_RATIONAL || fip->field_type == TIFF_SRATIONAL) {
tv_size = _TIFFSetGetFieldSize(fip->set_field_type);
}
if (tv_size == 0) {
status = 0;
TIFFErrorExt(tif->tif_clientdata, module,
@@ -638,6 +643,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|| fip->field_writecount == TIFF_VARIABLE2
|| fip->field_writecount == TIFF_SPP
|| tv->count > 1) {
/*--: Rational2Double: For Rationals tv_size is set above to 4 or 8 according to fip->set_field_type! */
_TIFFmemcpy(tv->value, va_arg(ap, void *),
tv->count * tv_size);
} else {
@@ -698,6 +704,22 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
/*-- Rational2Double: For Rationals tv_size is set above to 4 or 8 according to fip->set_field_type! */
{
if (tv_size == 8) {
double v2 = va_arg(ap, double);
_TIFFmemcpy(val, &v2, tv_size);
} else {
/*-- default should be tv_size == 4 */
float v3 = (float)va_arg(ap, double);
_TIFFmemcpy(val, &v3, tv_size);
/*-- ToDo: After Testing, this should be removed and tv_size==4 should be set as default. */
if (tv_size != 4) {
TIFFErrorExt(0,"TIFFLib: _TIFFVSetField()", "Rational2Double: .set_field_type in not 4 but %d", tv_size);
}
}
}
break;
case TIFF_FLOAT:
{
float v2 = _TIFFClampDoubleToFloat(va_arg(ap, double));
@@ -1011,19 +1033,19 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, uint16*) = td->td_halftonehints[1];
break;
case TIFFTAG_COLORMAP:
*va_arg(ap, uint16**) = td->td_colormap[0];
*va_arg(ap, uint16**) = td->td_colormap[1];
*va_arg(ap, uint16**) = td->td_colormap[2];
*va_arg(ap, const uint16**) = td->td_colormap[0];
*va_arg(ap, const uint16**) = td->td_colormap[1];
*va_arg(ap, const uint16**) = td->td_colormap[2];
break;
case TIFFTAG_STRIPOFFSETS:
case TIFFTAG_TILEOFFSETS:
_TIFFFillStriles( tif );
*va_arg(ap, uint64**) = td->td_stripoffset;
*va_arg(ap, const uint64**) = td->td_stripoffset_p;
break;
case TIFFTAG_STRIPBYTECOUNTS:
case TIFFTAG_TILEBYTECOUNTS:
_TIFFFillStriles( tif );
*va_arg(ap, uint64**) = td->td_stripbytecount;
*va_arg(ap, const uint64**) = td->td_stripbytecount_p;
break;
case TIFFTAG_MATTEING:
*va_arg(ap, uint16*) =
@@ -1032,7 +1054,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
break;
case TIFFTAG_EXTRASAMPLES:
*va_arg(ap, uint16*) = td->td_extrasamples;
*va_arg(ap, uint16**) = td->td_sampleinfo;
*va_arg(ap, const uint16**) = td->td_sampleinfo;
break;
case TIFFTAG_TILEWIDTH:
*va_arg(ap, uint32*) = td->td_tilewidth;
@@ -1067,7 +1089,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
break;
case TIFFTAG_SUBIFD:
*va_arg(ap, uint16*) = td->td_nsubifd;
*va_arg(ap, uint64**) = td->td_subifd;
*va_arg(ap, const uint64**) = td->td_subifd;
break;
case TIFFTAG_YCBCRPOSITIONING:
*va_arg(ap, uint16*) = td->td_ycbcrpositioning;
@@ -1077,20 +1099,20 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, uint16*) = td->td_ycbcrsubsampling[1];
break;
case TIFFTAG_TRANSFERFUNCTION:
*va_arg(ap, uint16**) = td->td_transferfunction[0];
*va_arg(ap, const uint16**) = td->td_transferfunction[0];
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
*va_arg(ap, uint16**) = td->td_transferfunction[1];
*va_arg(ap, uint16**) = td->td_transferfunction[2];
*va_arg(ap, const uint16**) = td->td_transferfunction[1];
*va_arg(ap, const uint16**) = td->td_transferfunction[2];
} else {
*va_arg(ap, uint16**) = NULL;
*va_arg(ap, uint16**) = NULL;
*va_arg(ap, const uint16**) = NULL;
*va_arg(ap, const uint16**) = NULL;
}
break;
case TIFFTAG_REFERENCEBLACKWHITE:
*va_arg(ap, float**) = td->td_refblackwhite;
*va_arg(ap, const float**) = td->td_refblackwhite;
break;
case TIFFTAG_INKNAMES:
*va_arg(ap, char**) = td->td_inknames;
*va_arg(ap, const char**) = td->td_inknames;
break;
default:
{
@@ -1132,7 +1154,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, uint32*) = (uint32)tv->count;
else /* Assume TIFF_VARIABLE */
*va_arg(ap, uint16*) = (uint16)tv->count;
*va_arg(ap, void **) = tv->value;
*va_arg(ap, const void **) = tv->value;
ret_val = 1;
} else if (fip->field_tag == TIFFTAG_DOTRANGE
&& strcmp(fip->field_name,"DotRange") == 0) {
@@ -1200,6 +1222,23 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
{
/*-- Rational2Double: For Rationals evaluate "set_field_type" to determine internal storage size and return value size. */
int tv_size = _TIFFSetGetFieldSize(fip->set_field_type);
if (tv_size == 8) {
*va_arg(ap, double*) = *(double *)val;
ret_val = 1;
} else {
/*-- default should be tv_size == 4 */
*va_arg(ap, float*) = *(float *)val;
ret_val = 1;
/*-- ToDo: After Testing, this should be removed and tv_size==4 should be set as default. */
if (tv_size != 4) {
TIFFErrorExt(0,"TIFFLib: _TIFFVGetField()", "Rational2Double: .set_field_type in not 4 but %d", tv_size);
}
}
}
break;
case TIFF_FLOAT:
*va_arg(ap, float*) =
*(float *)val;
@@ -1282,8 +1321,9 @@ TIFFFreeDirectory(TIFF* tif)
CleanupField(td_transferfunction[0]);
CleanupField(td_transferfunction[1]);
CleanupField(td_transferfunction[2]);
CleanupField(td_stripoffset);
CleanupField(td_stripbytecount);
CleanupField(td_stripoffset_p);
CleanupField(td_stripbytecount_p);
td->td_stripoffsetbyteallocsize = 0;
TIFFClrFieldBit(tif, FIELD_YCBCRSUBSAMPLING);
TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING);
@@ -1296,10 +1336,8 @@ TIFFFreeDirectory(TIFF* tif)
td->td_customValueCount = 0;
CleanupField(td_customValues);
#if defined(DEFER_STRILE_LOAD)
_TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
_TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
#endif
}
#undef CleanupField
@@ -1365,6 +1403,17 @@ TIFFCreateEXIFDirectory(TIFF* tif)
return TIFFCreateCustomDirectory(tif, exifFieldArray);
}
/*
* Creates the EXIF GPS custom directory
*/
int
TIFFCreateGPSDirectory(TIFF* tif)
{
const TIFFFieldArray* gpsFieldArray;
gpsFieldArray = _TIFFGetGpsFields();
return TIFFCreateCustomDirectory(tif, gpsFieldArray);
}
/*
* Setup a default directory structure.
*/
@@ -1387,7 +1436,9 @@ TIFFDefaultDirectory(TIFF* tif)
td->td_tilewidth = 0;
td->td_tilelength = 0;
td->td_tiledepth = 1;
#ifdef STRIPBYTECOUNTSORTED_UNUSED
td->td_stripbytecountsorted = 1; /* Our own arrays always sorted. */
#endif
td->td_resolutionunit = RESUNIT_INCH;
td->td_sampleformat = SAMPLEFORMAT_UINT;
td->td_imagedepth = 1;
+10 -4
View File
@@ -58,6 +58,7 @@ typedef struct {
uint32 toff_long;
uint64 toff_long8;
} tdir_offset; /* either offset or the data itself if fits */
uint8 tdir_ignore; /* flag status to ignore tag when parsing tags in tif_dirread.c */
} TIFFDirEntry;
/*
@@ -97,13 +98,14 @@ typedef struct {
* number of striles */
uint32 td_stripsperimage;
uint32 td_nstrips; /* size of offset & bytecount arrays */
uint64* td_stripoffset;
uint64* td_stripbytecount;
uint64* td_stripoffset_p; /* should be accessed with TIFFGetStrileOffset */
uint64* td_stripbytecount_p; /* should be accessed with TIFFGetStrileByteCount */
uint32 td_stripoffsetbyteallocsize; /* number of elements currently allocated for td_stripoffset/td_stripbytecount. Only used if TIFF_LAZYSTRILELOAD is set */
#ifdef STRIPBYTECOUNTSORTED_UNUSED
int td_stripbytecountsorted; /* is the bytecount array sorted ascending? */
#if defined(DEFER_STRILE_LOAD)
#endif
TIFFDirEntry td_stripoffset_entry; /* for deferred loading */
TIFFDirEntry td_stripbytecount_entry; /* for deferred loading */
#endif
uint16 td_nsubifd;
uint64* td_subifd;
/* YCbCr parameters */
@@ -118,6 +120,8 @@ typedef struct {
int td_customValueCount;
TIFFTagValue *td_customValues;
unsigned char td_deferstrilearraywriting; /* see TIFFDeferStrileArrayWriting() */
} TIFFDirectory;
/*
@@ -257,6 +261,7 @@ extern "C" {
extern const TIFFFieldArray* _TIFFGetFields(void);
extern const TIFFFieldArray* _TIFFGetExifFields(void);
extern const TIFFFieldArray* _TIFFGetGpsFields(void);
extern void _TIFFSetupFields(TIFF* tif, const TIFFFieldArray* infoarray);
extern void _TIFFPrintFieldInfo(TIFF*, FILE*);
@@ -265,6 +270,7 @@ extern int _TIFFFillStriles(TIFF*);
typedef enum {
tfiatImage,
tfiatExif,
tfiatGps, /* EXIF-GPS fields array type */
tfiatOther
} TIFFFieldArrayType;

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