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

Compare commits

...

4591 Commits

Author SHA1 Message Date
Maksim Shabunin 00171ca935 Patched libpng to address CVE-2019-7317 2019-03-18 12:24:18 +03:00
Alexander Alekhin 9c748beef5 OpenCV version '-openvino' 2019-03-18 08:07:09 +03:00
Alexander Alekhin 26087e28ad Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-15 22:42:57 +00:00
Alexander Alekhin 2c3f02c83f Merge pull request #14071 from alalek:cmake_remove_unreferenced_functions 2019-03-15 17:50:19 +00:00
Alexander Alekhin 19e8121a38 Merge pull request #14059 from alalek:imgcodecs_disable_jasper 2019-03-15 16:32:57 +00:00
Alexander Alekhin 69fd8964a2 Merge pull request #14057 from alalek:fix_libtiff_build 2019-03-15 16:31:38 +00:00
Alexander Alekhin ccbc16f3a9 cmake: clean unreferenced functions from OpenCV modules too 2019-03-15 18:54:08 +03:00
Alexander Alekhin ec469b5530 Merge pull request #14070 from zuoshaobo:my3.4 2019-03-15 13:11:31 +00:00
zuoshaobo 8b52eabd48 fix the region layer's output anchor size normalization error 2019-03-15 08:41:11 -04:00
Alexander Alekhin d4b9e2d0f4 Merge pull request #14068 from alalek:fix_python_standalone_build 2019-03-15 11:33:08 +00:00
Alexander Alekhin 470dfba96c python: update CMake install rules 2019-03-15 13:11:00 +03:00
Alexander Alekhin 43c68d1864 imgcodecs: OPENCV_IO_ENABLE_JASPER runtime parameter 2019-03-14 21:43:24 +00:00
Alexander Alekhin 40dd96e83a 3rdparty: fix libtiff build
Keep `_FILE_OFFSET_BITS` undefined in Android builds.
2019-03-14 19:35:02 +00:00
Alexander Alekhin 73bf170800 Merge pull request #14050 from npochhi:mlp_ann_eps_change 2019-03-14 13:36:57 +00:00
Alexander Alekhin 17ad33c919 Merge pull request #14051 from LaurentBerger:i14047 2019-03-14 13:27:44 +00:00
Alexander Alekhin 1ed47900d8 Merge pull request #14048 from alalek:issue_13522 2019-03-14 13:26:34 +00:00
Alexander Alekhin 990afa9032 Merge pull request #14054 from mshabunin:fix-dc1394 2019-03-14 13:04:56 +00:00
Alexander Alekhin c03a936cfc Merge pull request #14040 from seiko2plus:issue13211 2019-03-14 13:04:35 +00:00
Maksim Shabunin e4a4f93b72 Removed obsolete functions from cap_dc1394_v2.cpp 2019-03-14 12:08:16 +03:00
npochhi f1a99995c4 Changed eps checking condition 2019-03-14 14:01:34 +05:30
Sayed Adel 872e7894b4 core:vsx working around gcc aligned memory access bug
- allow cmake to check sanity of vsx aligned ld/st
 - force universal intrinsics v_load_aligned/v_store_aligned
   to failback to unaligned ld/st if cmake runtime vsx aligned test fail
2019-03-14 01:55:40 +02:00
LaurentBerger d338644159 Issue 14047 2019-03-13 22:28:02 +01:00
Alexander Alekhin bd1fd59fc1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-13 19:13:13 +00:00
Alexander Alekhin 1fa3d21f6a android: don't install java/build.gradle 2019-03-13 18:52:15 +00:00
Alexander Alekhin de8eda5fdf Merge pull request #13655 from sturkmen72:update_doc_photo 2019-03-13 17:57:17 +00:00
Richard Veale 8158e5b7a0 Merge pull request #13695 from flyingfalling:3.4
* Fixed bug that made cuda::filter give corrupted output when different filters called in different threads. This was due to use of global texture variable shared by all filters.

* REV: fixed tab issue for opencv coding style...
2019-03-13 20:53:59 +03:00
Alexander Alekhin f4b6ae46d1 Merge pull request #14045 from rpici:fix_bug_in_test_tiff 2019-03-13 16:17:43 +00:00
Alexander Alekhin cdf6e460e8 Merge pull request #14021 from dkurt:init_opencv_wasm 2019-03-13 16:09:21 +00:00
Alexander Alekhin be1ae9d4a6 Merge pull request #14046 from alalek:fix_static_analysis_issues_3.4 2019-03-13 16:03:21 +00:00
Alexander Alekhin 3f42122387 Merge pull request #14043 from alalek:revert_13843 2019-03-13 16:02:42 +00:00
rpici 9cca066ee8 Fix bug in test_tiff.cpp
The big endian data in the tiff_sample_data array was never being tested.  This could be observed by e.g. changing the 9th byte in the big endian data from 0xde to something that should fail the test, e.g. 0xdd, and the test would still pass even though it should fail.
2019-03-13 09:42:47 -05:00
Alexander Alekhin 8c8715c4dd fix static analysis issues 2019-03-13 17:19:39 +03:00
Alexander Alekhin 915c3fd7fa Merge pull request #14041 from nglee:dev_cudaarithmLUTPtr 2019-03-13 14:15:48 +00:00
Alexander Alekhin f73b4f4a26 imgproc: revert #13843
This reverts commit 00e8c7810f
2019-03-13 15:07:37 +03:00
Namgoo Lee a54affeb8d Move Ptr-related code from lut.cu to lut.cpp 2019-03-13 20:25:28 +09:00
Dmitry Kurtaev 18ab85efc2 Backport commits from
https://github.com/opencv/opencv/pull/12601
https://github.com/opencv/opencv/pull/12622
2019-03-13 13:32:44 +03:00
Alexander Alekhin bd1342c164 Merge pull request #14029 from LaurentBerger:creategrid 2019-03-12 14:46:15 +00:00
Alexander Alekhin ea9a17ebc2 Merge pull request #14036 from jveitchmichaelis:Y16_v4l_fix 2019-03-12 14:38:37 +00:00
Alexander Alekhin 61eb1a6848 Merge pull request #14038 from alalek:update_version_3.4.6-pre 2019-03-12 12:43:02 +00:00
Alexander Alekhin a534af68b8 Merge pull request #14037 from alalek:update_version_4.1.0-pre 2019-03-12 12:42:32 +00:00
Josh Veitch-Michaelis 2143f7cee1 release frame after disabling convert rgb 2019-03-12 12:42:07 +00:00
Alexander Alekhin 80e5642ca2 pre: OpenCV 3.4.6 (version++) 2019-03-12 13:29:42 +03:00
Alexander Alekhin 6e2ede8c56 pre: OpenCV 4.1.0 (version++) 2019-03-12 13:01:44 +03:00
LaurentBerger af0a83f0b3 Tutorial create pattern grid for calibration using gen_pattern.py 2019-03-12 08:29:17 +01:00
Alexander Alekhin 8c0b0714e7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-11 19:20:22 +00:00
Alexander Alekhin f3074fd559 Merge pull request #14013 from alalek:imgproc_dispatch_filter 2019-03-11 18:59:30 +00:00
Giles Payne 55f02d8c66 Merge pull request #14011 from komakai:debug-build
* Add Android SDK debug build flag

* Change LOG_TAG define for consistency with other modules
2019-03-11 17:16:42 +03:00
Alexander Alekhin 2c07c6718f imgproc: dispatch morph 2019-03-11 13:54:12 +00:00
Alexander Alekhin 5a01227aa1 imgproc: dispatch box_filter 2019-03-11 13:54:12 +00:00
Alexander Alekhin ce3c92eb1f imgproc: dispatch bilateral_filter 2019-03-11 13:54:12 +00:00
Alexander Alekhin b99c9145bf imgproc: dispatch smooth 2019-03-11 13:54:12 +00:00
Alexander Alekhin 6ec08f268f imgproc: dispatch medianBlur 2019-03-11 13:54:12 +00:00
Alexander Alekhin 8546ac3ce6 imgproc: get rid of filter.avx2.cpp 2019-03-11 13:54:12 +00:00
Alexander Alekhin 9a8dbfd57f imgproc: dispatch filter.cpp 2019-03-11 13:54:12 +00:00
Alexander Alekhin 756a98a395 imgproc: keep history of filters files 2019-03-11 13:54:07 +00:00
Alexander Alekhin 9dc7554089 imgproc: copy .dispatch.cpp 2019-03-11 13:53:59 +00:00
Alexander Alekhin 6eac8f78b9 imgproc: copy .simd.hpp 2019-03-11 13:53:59 +00:00
Alexander Alekhin 98e2bb8721 Merge pull request #14022 from alalek:core_fix_neon_intrinsics 2019-03-11 13:52:43 +00:00
Alexander Alekhin 842c58a7d6 core(intrin): NEON v_load_expand_q() support unaligned addr 2019-03-11 12:06:05 +00:00
Alexander Alekhin 7a2dca5947 Merge pull request #14015 from saskatchewancatch:issue-13921 2019-03-11 10:08:06 +00:00
Alexander Alekhin 49093d6d38 Merge pull request #13847 from ghellwig:jpeg2000-compression-flag 2019-03-11 10:03:18 +00:00
Dmitry Kurtaev 110e80f0ee Add onRuntimeInitialized for opencv.js 2019-03-11 11:44:16 +03:00
Gregor Mittag d71977b4dd Add JPEG2000 compression flag. 2019-03-10 07:59:09 +01:00
Giles Payne 11dbd86aa3 Merge pull request #13956 from komakai:java-mat-class-improvements
* Expose more C++ functionality in the Java wrapper of the Mat class
In particular expose methods for handling Mat with more than 2 dimensions
* add constructors taking an array of dimension sizes
* add constructor taking an existing Mat and an array of Ranges
* add override of the create method taking an array of dimension sizes
* add overrides of the ones and zeros methods taking an array of dimension sizes
* add override of the submat method taking an array of ranges
* add overrides of put and get taking arrays of indices
* add wrapper for copySize method
* fix crash in the JNI wrapper of the reshape(int cn, int[] newshape) method
* add test for each method added to Mat.java

* Fix broken test
2019-03-10 00:11:04 +03:00
Rajkiran Natarajan 40af53b1d6 issue-13921: Support setting compression setting for writing tiff images 2019-03-09 15:48:21 -05:00
Alexander Alekhin 7e8cc580c9 Merge pull request #13997 from alalek:imgproc_dispatch_cvtcolor 2019-03-08 16:18:44 +00:00
Alexander Alekhin a1ef612662 Merge pull request #14000 from nglee:dev_FixCuda101BuildIssueMaster 2019-03-07 20:19:50 +00:00
Adrian Renner 442fdfd4b2 Merge pull request #13999 from addyi:fixAndroidLintingErrors
* fix android lint error in BaseLoaderCallback (LongLogTag)

Lint Error that was causde by the to long TAG:
BaseLoaderCallback.java:31:
Error: The logging tag can be at most 23 characters,
was 31 (OpenCVLoader/BaseLoaderCallback) [LongLogTag]
Log.e(TAG, "Package installation failed!");

* add requested "OCV" prefix for android logging
2019-03-07 23:18:22 +03:00
Alexander Alekhin 922cd208f7 Merge pull request #13875 from allnes:optimization_fuse 2019-03-07 14:38:59 +00:00
Alexander Alekhin 4f9a99141e Merge pull request #13937 from smirnov-alexey:gapi_change_standalone_cmake 2019-03-07 14:38:14 +00:00
Namgoo Lee 713d91b04e CUDA 10.1 Build Issue Fix on Master Branch 2019-03-07 23:13:03 +09:00
Alexander Alekhin 8b541e450b imgproc: dispatch color*
Lab/XYZ modes have been postponed (color_lab.cpp):
- need to split code for tables initialization and for pixels processing first
- no significant performance improvements for switching between SSE42 / AVX2 code generation
2019-03-07 15:45:05 +03:00
Alexander Alekhin 39783a6584 core: keep history of color*.cpp 2019-03-07 15:38:13 +03:00
Alexander Alekhin f26912960f imgproc: clone color*.dispatch.cpp 2019-03-07 15:35:49 +03:00
Alexander Alekhin db588bb831 imgproc: clone color*.simd.hpp 2019-03-07 15:35:13 +03:00
Alexander Alekhin b9d2e6664d Merge pull request #13979 from alalek:issue_13772 2019-03-07 09:53:25 +00:00
Alexander Alekhin a43337c28e Merge pull request #13986 from alalek:perf_ignore_ovx 2019-03-07 09:50:49 +00:00
Alexander Alekhin eb9001665e Merge pull request #13993 from liuyuns:issue_13963_thresh_nms_yolov3 2019-03-07 07:55:34 +00:00
Easton Liu fcfb29766b Add ability to read thresh and nms_threshold from YOLO layer in YOLOV3 cfg file.
Currently the thresh is hard-coded to be 0.2 and nms_threshold as 0.4.
2019-03-07 09:55:48 +08:00
Alexander Alekhin d8b58205be Merge pull request #13988 from raymanfx:gstreamer 2019-03-06 20:47:03 +00:00
Christopher N. Hesse 796b0fec7d videoio: gst: Fix gst assertion on null msg
According to the gstreamer docs [1], the GstMessage pointer returned by
gst_bus_pop() is nullable, meaning NULL is a valid return value.

Previously, gst_is_missing_plugin_message would throw an assert when its
message object parameter would fail the GST_IS_MESSAGE macro check,
crashing the entire process (unless running in a try-catch block of course).

Instead of relying on valid messages, check if the message object itself is
valid before passing it to other gstreamer functions.

[1] https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-pop

Signed-off-by: Christopher N. Hesse <raymanfx@gmail.com>
2019-03-06 17:37:02 +01:00
Alexander Alekhin d5a2fe5180 perf: ignore _ovx tests 2019-03-06 15:52:23 +03:00
Alexander Alekhin 332c37f332 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-06 11:43:16 +03:00
Alexander Nesterov 74574dfae4 Added optimization fuse 2019-03-05 18:12:03 -01:00
Alexander Alekhin d2f70f61aa Merge pull request #13880 from catree:add_hand_eye_calibration 2019-03-05 16:02:39 +00:00
Alexander Alekhin 3182cc4277 Merge pull request #13980 from terfendail:bresize3_fix 2019-03-05 15:59:21 +00:00
Alexander Alekhin 3b43f90cc8 Merge pull request #13962 from Christianwidjaya:master 2019-03-05 15:00:55 +00:00
Alexander Alekhin b9a6a96324 Merge pull request #13953 from saskatchewancatch:patch-1 2019-03-05 14:59:18 +00:00
Alexander Alekhin 7bcfe8f204 Merge pull request #13974 from alalek:fix_build_warnings 2019-03-05 14:57:50 +00:00
Vitaly Tuzov 99b39aa5bd Fixed out of bound reading in LINEAR_EXACT resize for 8UC3 2019-03-05 17:21:21 +03:00
catree bbf39b0964 Add Hand-Eye calibration methods (Tsai, Park, Horaud, Andreff, Daniilidis). 2019-03-05 14:51:33 +01:00
Alexander Alekhin 7366eebebb core: fix condition in OutputArray::create(allowTransposed=True) 2019-03-05 16:26:59 +03:00
Alexander Alekhin e36a3acbc0 Merge pull request #13967 from alalek:backport_android_build_py 2019-03-05 12:46:08 +00:00
Alexander Alekhin 89c106b29e Merge pull request #13945 from alalek:backport_bindings_generator 2019-03-05 12:45:21 +00:00
Alexander Alekhin b46fa2e556 Merge pull request #13970 from alalek:videoio_plugins_update 2019-03-05 11:48:39 +00:00
Alexander Alekhin 35edad3e74 build: fix warnings 2019-03-05 14:47:04 +03:00
RAJKIRAN NATARAJAN 98f89f9079 Need -DBUILD_DOCS CMake flag to build docs
Must have that flag. Otherwise following "doxygen overview" tutorial won't work.
2019-03-05 14:02:31 +03:00
Alexander Alekhin 8ee1be7d09 cmake: support MSVS 2019 2019-03-05 13:38:47 +03:00
Alexander Alekhin 45c4d3a62b Merge pull request #13969 from alalek:issue_13929 2019-03-05 10:28:59 +00:00
Alexander Alekhin 25a9a32f8e videoio: plugins, add strict checks 2019-03-05 13:22:52 +03:00
Alexander Alekhin 11fd9e5fdc videoio: revert registry chages, update cap.cpp 2019-03-04 21:37:20 +00:00
Alexander Alekhin 403f11fdbf videoio: update plugin API 2019-03-04 21:36:22 +00:00
Alexander Alekhin b4cba524d3 videoio: move backend.cpp -> backend_plugin.cpp 2019-03-04 20:06:19 +00:00
Alexander Alekhin 746cd1e1e6 Merge pull request #13949 from alalek:videoio_plugins_target 2019-03-04 19:25:11 +00:00
x3lif 19cf511895 Merge pull request #13910 from x3lif:Issue_13908
* Fix Issue 13908

Allocate the matrix _Jo only when the solver needs it (ie when solver.state == CvLevMarq::CALC_J)

* Fix calib3D unit test

Fix _Jo allocation when stddev is not empty

* Removing trailing whitespaces

* scope _dp* variables

* fix whitespaces
2019-03-04 19:34:10 +03:00
Alexander Alekhin 93dab9e1e9 videoio(v4l): fix build due missing defines
- V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT
- V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH
2019-03-04 18:46:56 +03:00
smirnov-alexey 6b31f58092 Modifies standalone G-API cmake for testing it properly 2019-03-04 15:33:15 +03:00
Alexander Alekhin 480c6dae6d android: backport build_sdk.py 2019-03-04 15:29:09 +03:00
Giles Payne 7444f0c651 Merge pull request #13939 from komakai:android-build-improvements
* Android build improvements
* look for NDK in "ndk-bundle" directory under the SDK directory if location not specified
* look for cmake and ninja in "cmake" directory under the SDK directory if not found in the path
* disable use of ccache if not found in the path

* Redo build tool existence checks
2019-03-04 15:19:29 +03:00
Alexander Alekhin dd37c10d4a Merge pull request #13922 from smirnov-alexey:gapi_fix_nv12_asserts 2019-03-04 11:36:53 +00:00
Alexander Alekhin dd262b7087 Merge pull request #13960 from nglee:dev_FixWindowsBuildIssue 2019-03-04 11:18:20 +00:00
Namgoo Lee 65e76adeda Windows Build Issue Fix 2019-03-04 09:52:50 +09:00
Alexander Alekhin 3132c8ee08 Merge pull request #13958 from nglee:dev_FixCuda101BuildIssue 2019-03-03 18:44:28 +00:00
Namgoo Lee 5a2faab2e6 CUDA 10.1 Build Issue Fix 2019-03-03 16:40:43 +00:00
Alexander Alekhin 6e9b6a27cf Merge pull request #13951 from alalek:dnn_fix_logging_verbose 2019-03-02 20:09:07 +00:00
JoeHowse c0d41f05d6 Merge pull request #13947 from JoeHowse:4.0.1-patches
* core, stitching: revise syntax to support Visual C++ 2013

* stitching: revise syntax again to support Visual C++ 2013 and other compilers

* stitching: minor update to clarify changes
2019-03-02 19:00:32 +03:00
Alexander Alekhin 80d37ba698 dnn: fix usage of CV_LOG_VERBOSE macro 2019-03-02 14:49:21 +00:00
Alexander Alekhin 9a6f2630b2 cmake: +opencv_videoio_plugins virtual target
- support comma-separated list in VIDEOIO_PLUGIN_LIST
- opencv tests/samples depend on plugins virtual target
2019-03-02 09:19:08 +00:00
Alexander Alekhin 0a98bc0ee9 java: avoid enum values with references on other enums
declaration order is not fixed

Error message:
Core.java:97: error: illegal forward reference
    Hamming_normType = NORM_HAMMING,
2019-03-01 21:32:03 +00:00
Alexander Alekhin 47b6955ba0 Merge pull request #13942 from alalek:imgproc_lsd 2019-03-01 21:16:29 +00:00
Alexander Alekhin 030e955db7 python: support Python list for cv::Range 2019-03-01 20:52:35 +00:00
Alexander Alekhin f5b58e5fc9 bindings: backport generator from OpenCV 4.x
- better handling of enum arguments
- less merge conflicts
2019-03-01 20:18:48 +00:00
Alexander Alekhin f0179f96a7 Merge pull request #13940 from alalek:fix_13914 2019-03-01 19:32:36 +00:00
Alexander Alekhin 3ba49ccecc imgproc: removed LSD code due original code license conflict 2019-03-01 16:25:39 +03:00
Alexander Alekhin d034ef6f27 Merge pull request #13935 from seiko2plus:issue13934 2019-03-01 10:52:41 +00:00
Alexander Alekhin 7d24727184 ml: handle sigmoid NaN result (should be Inf)
- added more debug checks
2019-03-01 13:47:45 +03:00
smirnov-alexey 939ea4ba30 Remove incorrect asserts in NV12 to RGB/BGR kernels 2019-03-01 13:31:16 +03:00
Sayed Adel 5478165e16 core:vsx Fix narrowing warning on vector splats 2019-03-01 00:48:38 +00:00
Alexander Alekhin a9f67c2d1d Merge pull request #13905 from terfendail:pyr_wintr2 2019-02-28 14:53:42 +00:00
Alexander Alekhin ed8f0ab265 Merge pull request #13931 from berak:core_fix_mat_max_mult 2019-02-28 14:29:31 +00:00
berak 20afae5a14 core: fix mat matx multiplication 2019-02-28 14:22:54 +01:00
Alexander Alekhin caa013b2a4 Merge pull request #13925 from alalek:core_disable_io_perf_test 2019-02-28 12:21:03 +00:00
Vitaly Tuzov 9548093b46 Horizontal line processing for pyrDown() reworked using wide universal intrinsics. 2019-02-28 00:12:57 +03:00
Alexander Alekhin 5fd47352cf Merge pull request #13904 from cftang0827:dnn_tf_text_graph_common_bug 2019-02-27 16:32:40 +00:00
Alexander Alekhin f1f0f630c7 core: disable I/O perf test
- can be enable separately if needed
- not stable (due storage I/O processing)
2019-02-27 18:07:45 +03:00
Alexander Alekhin c3cf35ab63 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-26 17:34:42 +03:00
Alexander Alekhin 4188e8aaf9 Merge pull request #13677 from mshabunin:video_plugins 2019-02-26 11:36:25 +00:00
Maksim Shabunin 9702987209 Framework for dynamic videoio backends, FFmpeg and GStreamer plugins 2019-02-26 13:50:30 +03:00
Alexander Alekhin dd696066b5 Merge pull request #13901 from reunanen:update_libjpeg-turbo 2019-02-26 10:35:32 +00:00
Alexander Alekhin 1bf1694506 Merge pull request #13840 from jaewoosong:jaewoosong-patch-1 2019-02-26 10:19:17 +00:00
Alexander Alekhin 865c29a754 Merge pull request #13892 from dkurt:onnx_upsample_unsqueeze 2019-02-26 10:17:07 +00:00
Maksim Shabunin 8c1e0537ec Merge pull request #13889 from mshabunin:enable-narrowing-warning
* Enabled -Wnarrowing warning

* Fixed type narrowing issues

* Cast python constants

* Use long long for python constants

* Use int for python constants with fallback to long

* Update cv2.cpp
2019-02-26 13:15:59 +03:00
Alexander Alekhin d5a3ad5b64 3rdparty: update libjpeg-turbo/CMakeLists.txt 2019-02-26 12:30:46 +03:00
Juha Reunanen 30cf5e0164 Update libjpeg-turbo from 1.5.3 to 2.0.2 2019-02-26 12:30:46 +03:00
Alexander Alekhin 5421d0866b Merge pull request #13912 from alalek:cmake_workaround_trycompile_ios 2019-02-26 09:28:36 +00:00
Jaewoo Song 225bdc21c0 Making JavaCamera2View behaves in the same way as JavaCameraView 2019-02-26 14:18:29 +08:00
Alexander Alekhin a065c10bcb cmake: workaround iOS try_compile(COPY_FILE) bug 2019-02-25 21:35:46 +00:00
cftang 98d8436440 fix tf_text_graph_common tensor_content type bug 2019-02-26 01:20:54 +08:00
Alexander Alekhin 4cf321f3f8 Merge pull request #13903 from nglee:dev_CudevRework 2019-02-25 16:11:38 +00:00
Alexander Alekhin 0aa0f2ada2 Merge pull request #13906 from dkurt:fix_tf_ssd_min_size 2019-02-25 16:09:57 +00:00
Alexander Alekhin f6d3adcf3d Merge pull request #13887 from dkurt:dnn_ie_lrn_bug 2019-02-25 14:26:22 +00:00
Alexander Alekhin e11213dcef Merge pull request #13900 from alalek:core_dispatch_merge 2019-02-25 13:54:10 +00:00
Dmitry Kurtaev fe7c93cc05 Fix priors boxes generation in case of non square inputs for TensorFlow SSDs 2019-02-25 12:43:42 +03:00
Namgoo Lee 2b6be3cb0f cudev - Rework some code
- Use shfl_down, instead of __shfl_down, on warp scan
- Remove race conditions
2019-02-25 13:46:32 +09:00
Alexander Alekhin fd49ee5f39 core: dispatch merge.cpp 2019-02-23 15:42:26 +00:00
Alexander Alekhin 93a36b0df1 core: keep history of merge.cpp 2019-02-23 15:41:39 +00:00
Alexander Alekhin 4e12febe90 core: clone merge.simd.hpp 2019-02-23 15:41:33 +00:00
Alexander Alekhin 6eabe6bc14 core: clone merge.dispatch.cpp 2019-02-23 15:41:33 +00:00
Alexander Alekhin 3bc9912f6e Merge pull request #13893 from alalek:core_dispatch_split 2019-02-23 15:39:54 +00:00
AKAMath 4c94804bb0 Merge pull request #13837 from amithjkamath:test
New computeECC function, and updated findTransformECC function to make gaussian filtering optional (#13837)

* fix for https://github.com/opencv/opencv/issues/12432 with doc and tests

* Added doc string for new parameter.

* Fixes suggested by Alalek for getting around ABI incompatibility.

* Update to docstring, to remove parameter that isn't relevant.

* More updates based on Alalek's usggestions.
2019-02-22 18:36:40 +03:00
Alexander Alekhin 682e03bdb2 Merge pull request #13877 from LaurentBerger:pythonvideo 2019-02-22 11:33:42 +00:00
Alexander Alekhin ca4fd1e427 Merge pull request #13884 from dkurt:dnn_drop_ie_r1_r2 2019-02-22 11:21:43 +00:00
Alexander Alekhin 91d152e2c2 core: dispatch split.cpp 2019-02-22 09:54:31 +00:00
Alexander Alekhin 1d8b30bf4f core: keep history of split.cpp 2019-02-22 09:18:51 +00:00
Alexander Alekhin 0311770e8b core: clone split.simd.hpp 2019-02-22 09:18:27 +00:00
Alexander Alekhin 82cd2f8c93 core: clone split.dispatch.cpp 2019-02-22 09:17:51 +00:00
Dmitry Kurtaev 20400aa9f7 Import Upsample and Unsqueeze from ONNX 2019-02-21 20:17:28 +03:00
Dmitry Kurtaev 4cbd09c41c Add extra limitations for LRN from Inference Engine backend 2019-02-21 14:20:24 +03:00
LaurentBerger 4ebb617000 Check return value in python tutorial 2019-02-21 11:02:12 +01:00
Alexander Alekhin 0e70363f4a Merge pull request #13882 from dkurt:fix_13479 2019-02-21 09:38:26 +00:00
Alexander Alekhin 7baa5efbe4 Merge pull request #13874 from dkurt:dnn_default_conf_thresh 2019-02-21 09:36:44 +00:00
Dmitry Kurtaev ed710eaa1c Make Inference Engine R3 as a minimal supported version 2019-02-21 09:32:26 +03:00
Dmitry Kurtaev bfd663c281 Add a test for grouped deconvolution from ONNX 2019-02-21 08:54:35 +03:00
Ayush Pandey 5c7fe0fe05 Fix Issue #13479 2019-02-21 08:36:16 +03:00
Alexander Alekhin 1db5d82b7f Merge pull request #13844 from brad-kelly:integral_avx512_cn234 2019-02-20 12:27:16 +00:00
Alexander Alekhin 3064e40d9e Merge pull request #13866 from alalek:core_dispatch_mean 2019-02-20 11:50:21 +00:00
Vitaly Tuzov 334c4d62b5 Merge pull request #13781 from terfendail:warp_wintr
Resize reworked using wide universal intrinsics (#13781)

* Added wide universal intrinsics optimized implementation for 3 channel bit-exact linear resize

* Reworked linear resize using new wide LUT intrinsics

* Fix for VSX intrinsics
2019-02-20 14:30:28 +03:00
Dmitry Kurtaev 715f881dda Replace default confidence threshold for dnn detections from -FLT_MAX to 0 2019-02-20 13:09:09 +03:00
Alexander Alekhin 8bde6aea4b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-19 19:49:13 +00:00
Brad Kelly 507f8add1c Implementing AVX512 Support for 2 and 4 channel mats for CV_64F format 2019-02-19 11:31:20 -08:00
Alexander Alekhin f1d9666a20 Merge pull request #13858 from rgarnov:fluid_nv12_support 2019-02-19 19:26:10 +00:00
Ruslan Garnov c0076b58cd Added NV12 support to fluid backend 2019-02-19 18:18:23 +03:00
Alexander Alekhin 8cedc052ca Merge pull request #13841 from dkurt:dnn_ie_future_3 2019-02-19 14:19:36 +00:00
Alexander Alekhin 6e34d2778f Merge pull request #13865 from lsr0:flann_cudacc 2019-02-19 14:03:54 +00:00
Alexander Alekhin dc84cf9914 core: dispatch mean.cpp 2019-02-19 16:58:32 +03:00
Alexander Alekhin 4b82c8a22b core: keep history of mean.cpp 2019-02-19 16:46:46 +03:00
Alexander Alekhin 7af7bcae18 core: clone mean.dispatch.cpp 2019-02-19 16:46:28 +03:00
Alexander Alekhin 93cea6e46e core: clone mean.simd.hpp 2019-02-19 16:45:42 +03:00
Lindsay Roberts 7c72e095fa Fix Flann compilation under nvcc + NEON
All <arm_neon.h> includes in core/cv_cpu_dispatch.h are protected by an
ifndef __CUDACC__ to prevent attempting to use neon intrinsics when
compiling cuda kernels (.cu) -- this prevents hard errors such as
  error: identifier "__builtin_neon_qi" is undefined

Add this same protection to flann/dist.h to fix compilation involving
flann.hpp.
2019-02-19 15:11:01 +02:00
Pierre Chatelier 00e8c7810f LineIterator witout a Mat (#13843)
* LineIterator witout a Mat

cv::LineIterator can be used without being attached to any cv::Mat, it only needs the size and type of data. An alternative constructor has been defined for that.
In that case, a LineIterator can no more be dereferenced with the * operator, but pos() still returns valid pixel positions.
It can be useful when LineIterator is just used to compute positions of pixels on a line, without requiring to build a Mat just for that.
Use case : with a dataset that would represent a huge image, pixel positions can be pre-computed before querying the dataset API.

* Update imgproc.hpp

removed trailing spaces

* Update drawing.cpp

fixed warning
2019-02-19 13:44:41 +03:00
Alexander Alekhin aebb66682b Merge pull request #13857 from LaurentBerger:bug13853 2019-02-19 10:34:30 +00:00
Ruslan Garnov 322115bfcf Removed unused functions from View::Priv 2019-02-18 19:26:54 +03:00
Dmitry Kurtaev ca5976e3d4 Fix IE backend considering future changes. 2019-02-18 19:26:04 +03:00
LaurentBerger 9e94212eac Solves bug 13853 2019-02-18 17:15:05 +01:00
Alexander Alekhin 3bba5b5a31 Merge pull request #13850 from nglee:dev_FixCudaStereoBMHangRace 2019-02-18 14:50:03 +00:00
Alexander Alekhin 9b71f5fd54 Merge pull request #13835 from catree:real_time_pose_tutorial_keypoints_matching 2019-02-18 14:39:10 +00:00
Alexander Alekhin a6160b6994 Merge pull request #13777 from smirnov-alexey:gapi_update_tutorial 2019-02-18 14:00:31 +00:00
Alexander Alekhin 428720f490 Merge pull request #13833 from alalek:core_dispatch_matmul 2019-02-18 13:38:44 +00:00
catree 3c92d40f6e Fix arguments parsing. Add possibility to choose between different features type. Add keypoints matching visualization. Auto format code. 2019-02-18 14:15:44 +01:00
Alexander Alekhin cd66f6e3db core: dispatch matmul
- gemm: keep baseline only (lapack is 10x+ faster, lets reduce binary size)
- transform / distTransform
- scaleAdd (32f/64f only)
- Mahalanobis: keep baseline only (no perf tests)
- mulTransposed: keep baseline only (no perf tests)
- dot
2019-02-18 14:36:46 +03:00
Namgoo Lee 1a961660d8 cuda::StereoBM - fix hanging and racing issue
- Fix hanging issue on 2080 Ti
- Fix racing issue
2019-02-18 06:03:12 +00:00
Alexander Alekhin abfcb60118 Merge pull request #13838 from smirnov-alexey:gapi_add_nv12_to_rgb 2019-02-15 13:55:48 +00:00
Alexander Alekhin 9d3d5e9d65 Merge pull request #13774 from l-bat:fix-IE-tests 2019-02-15 13:54:24 +00:00
smirnov-alexey 406392e13d Introduces yuv420p(nv12) to rgb and bgr color conversion 2019-02-15 14:25:57 +03:00
smirnov-alexey 7b7d21ebef Updates gapi tutorial using normalize kernel
Changes doc, images and sample code itself
2019-02-15 14:13:42 +03:00
Alexander Alekhin fbde57dba8 core: keep history of matmul.cpp 2019-02-14 19:07:41 +03:00
Alexander Alekhin dcee7b1605 core: clone matmul.dispatch.cpp 2019-02-14 19:07:37 +03:00
Alexander Alekhin b769ad2c23 core: clone matmul.simd.hpp 2019-02-14 19:07:37 +03:00
Alexander Alekhin 3c70d966cb Merge pull request #13823 from alalek:core_dispatch_countNonZero 2019-02-14 15:52:21 +00:00
Alexander Alekhin d9b573795b Merge pull request #13726 from nicolaerosia:android-ffmpeg 2019-02-14 11:40:27 +00:00
Nicolae Rosia 3aaf8dfd11 cmake: allow FFmpeg linking on Android
details: https://github.com/opencv/opencv/pull/13726

In order to help CMake and PkgConfig find FFmpeg you need to:
1) export `PKG_CONFIG_LIBDIR=${SYSROOT}`
where `SYSROOT=${ANDROID_NDK}/sysroot`
2) Add `-DCMAKE_PREFIX_PATH=${FFMPEG_INSTALL_PREFIX}`
3) Append `-DCMAKE_FIND_ROOT_PATH=${FFMPEG_INSTALL_PREFIX}`
2019-02-14 13:58:15 +03:00
Alexander Alekhin e3633ec4a2 core: dispatch count_non_zero 2019-02-14 13:16:20 +03:00
Alexander Alekhin 0b49680339 core: keep history of count_non_zero.cpp 2019-02-14 13:15:43 +03:00
Alexander Alekhin 439e43a027 core: clone count_non_zero.dispatch.cpp 2019-02-14 13:15:39 +03:00
Alexander Alekhin af8a3a0b66 core: clone count_non_zero.simd.hpp 2019-02-14 13:15:39 +03:00
Liubov Batanina 183c0fcab1 Changed condition for resize and lrn layers 2019-02-14 13:11:14 +03:00
Alexander Alekhin bd00471a89 Merge pull request #13808 from tailsu:sd/libtiff-4.0.10 2019-02-14 09:36:10 +00:00
Stefan Dragnev ff1ec6ccc6 update to libtiff-4.0.10 2019-02-14 09:28:14 +01:00
Alexander Alekhin 86136c0ccc Merge pull request #13796 from alalek:core_dispatch_sum 2019-02-14 08:16:42 +00:00
Alexander Alekhin 087d9745b3 Merge pull request #13807 from tailsu:sd/libpng-1.6.36 2019-02-13 16:19:16 +00:00
Alexander Alekhin b40a7ffbe4 core: dispatch sum 2019-02-13 18:17:38 +03:00
Stefan Dragnev 094615b2c5 update libpng to 1.6.36
* re-enabled NEON routines for arm64
2019-02-13 14:54:18 +01:00
Alexander Alekhin c88e6b344b core: keep history of sum.cpp 2019-02-13 13:49:36 +03:00
Alexander Alekhin 6e88bff3e3 core: clone sum.dispatch.cpp 2019-02-13 13:49:29 +03:00
Alexander Alekhin 5aceac6b93 core: clone sum.simd.hpp 2019-02-13 13:49:29 +03:00
Alexander Alekhin b12e1acdec Merge pull request #13810 from nglee:dev_CudaSafeBlockScan 2019-02-12 21:50:29 +00:00
Alexander Alekhin 54a1bbe1c4 Merge pull request #13812 from smirnov-alexey:gapi_fix_sobelxy_valgrind 2019-02-12 18:15:14 +00:00
Namgoo Lee 21eb60f88b cudalegacy: Use safe block scan function 2019-02-13 01:55:02 +09:00
smirnov-alexey caf438c63b Fixes an issue with valgrind and sobelxy 2019-02-12 18:36:06 +03:00
Alexander Alekhin dfef04b325 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-12 17:54:40 +03:00
Alexander Alekhin b1caa4f4d5 Merge pull request #13803 from thangktran:thangktran/fix-misleading-runtime-assertion-calibrateCamera 2019-02-12 14:25:21 +00:00
Alexander Alekhin 9e7014b59f Merge pull request #13799 from dkurt:dnn_ie_future_2 2019-02-12 14:07:42 +00:00
Thang Tran a1f4e65d03 calib3d: Fix calibrateCamera() misleading error
objectPoints and imagePoints are not checked whether they're empty and
cause checkVector() to fail, thus result in a wrong error message.

Fixes: https://github.com/opencv/opencv/issues/6002
2019-02-12 16:23:34 +03:00
Alexander Alekhin f3d62c94b1 Merge pull request #13800 from dkurt:fix_nvidia_caffe 2019-02-12 13:02:22 +00:00
Alexander Alekhin 2e28ff78c1 Merge pull request #13780 from alalek:core_dispatch_convertTo 2019-02-12 12:08:30 +00:00
Dmitry Kurtaev 1606137df2 Read raw floats data from Caffe models 2019-02-11 20:08:17 +03:00
Dmitry Kurtaev 0711dab09d Fix Intel's Inference Engine backend from future. Second try. 2019-02-11 19:47:57 +03:00
Alexander Alekhin 5f57842575 Merge pull request #13794 from alalek:backport_13786 2019-02-11 14:05:43 +00:00
Alexander Alekhin 4e16ec2826 Merge pull request #13793 from vertextau:tutorial-fix 2019-02-11 12:39:35 +00:00
Alexander Alekhin f8ac46ba07 Merge pull request #13786 from ka7:spelling 2019-02-11 12:38:49 +00:00
klemens 5d9c6723ee spelling fixes
backport 997b7b18af
2019-02-11 15:35:10 +03:00
Liubov Batanina 6b4becfd03 Enabled tests on IE backend 2019-02-11 12:39:28 +03:00
Oleh c8777da2d6 Update video_input_psnr_ssim.markdown 2019-02-11 10:45:16 +02:00
klemens 997b7b18af spelling fixes 2019-02-09 22:29:54 +01:00
Alexander Alekhin b17c1c6721 Merge pull request #13782 from paroj:pypath 2019-02-09 15:26:11 +00:00
Alexander Alekhin f8786c9bf4 Merge pull request #13783 from alalek:fix_13741 2019-02-09 15:25:48 +00:00
Alexander Alekhin f414c16c13 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-08 17:18:56 +00:00
Pavel Rojtberg f0ef4b2246 python: sys.path[0] is reserved for the main script 2019-02-08 17:24:31 +01:00
Alexander Alekhin d32d576d6d core: dispatch convert_scale 2019-02-08 18:32:10 +03:00
Alexander Alekhin 39b90ae9fb core: dispatch convert 2019-02-08 18:32:10 +03:00
Alexander Alekhin c6f39870ff Merge pull request #13776 from alalek:fix_13741 2019-02-08 15:30:36 +00:00
Alexander Alekhin 757d8ac8f7 Merge pull request #13769 from savuor:cvtColor_tests_16u_32f 2019-02-08 15:29:35 +00:00
Alexander Alekhin 5e2a81dc26 Merge pull request #13766 from dkurt:dnn_mask_rcnn_atrous 2019-02-08 15:23:46 +00:00
Alexander Alekhin 52050ebe32 Merge pull request #13760 from AnastasiaaSenina:fix-bug 2019-02-08 15:22:17 +00:00
Alexey Smirnov b1cc114b7b Merge pull request #13723 from smirnov-alexey:gapi_add_sobelxy
* Add Sobel kernel which returns both dx and dy

* Splice dx and dy and extend add_border function

Also change some tests parameters

* Add borderValue parameter in test

* Introduces fluid kernel for sobelxy

Adds tests (basic and performance) on new backend

* Introduces BufHelper struct for some arithmetic
2019-02-08 16:59:56 +03:00
Alexander Alekhin 33d477e049 core: keep history of convert_scale.cpp 2019-02-08 16:39:13 +03:00
Alexander Alekhin c4abdb8050 core: clone convert_scale.dispatch.cpp 2019-02-08 16:38:50 +03:00
Alexander Alekhin 0af9e19be7 core: clone convert_scale.simd.hpp 2019-02-08 16:35:52 +03:00
Alexander Alekhin b6a0acb8f6 core: keep history of convert.cpp 2019-02-08 16:29:54 +03:00
Alexander Alekhin 5527c41468 core: clone convert.dispatch.cpp 2019-02-08 16:29:16 +03:00
Alexander Alekhin 1629e29b98 core: clone convert.simd.hpp 2019-02-08 16:27:59 +03:00
Alexander Alekhin 3091d10b00 Merge pull request #13746 from allnes:fix_step_dnn 2019-02-08 10:18:43 +00:00
Alexey Smirnov 766fd20faa Merge pull request #13745 from smirnov-alexey:gapi_add_gout_overloading
* Add GOut overloading for tuple of parameter pack

* Move getGOut_impl into namespace and add const to input references
2019-02-08 13:16:50 +03:00
Alexander Alekhin 8f7e92e466 Merge pull request #13764 from nglee:dev_CudaCLAHE16bitSupport 2019-02-08 10:13:11 +00:00
AnastasiaaSenina d7b1f28a90 fixed bug: added threshold for variables 'rotate_a', ' rotate_c' 2019-02-08 13:06:23 +03:00
Rostislav Vasilikhin 4e679e1cc5 disabled 16u and 32f perf tests 2019-02-07 19:26:36 +03:00
Alexander Alekhin d2174e2e75 Merge pull request #13775 from terfendail:morph_fix 2019-02-07 15:53:58 +00:00
Rostislav Vasilikhin 87f651c119 disabled sanity check for 32f 2019-02-07 18:20:29 +03:00
Vitaly Tuzov 07c10d6fc3 Fixed out of bound reading issue in erode() and dilate() 2019-02-07 17:28:58 +03:00
Alexander Alekhin 66d9a33b50 core(ocl): fix log messages 2019-02-07 16:35:14 +03:00
Alexey Smirnov 315e7fbbee Merge pull request #13721 from smirnov-alexey:gapi_add_normalize
GAPI: Add normalize kernel in G-API (#13721)

* Add normalize kernel in G-API

In addition add several tests on new kernel

* Fix indentations and normalize test structure

* Move normalize kernel from imgproc to core

Set default parameter ddepth to -1

* Fix alignment
2019-02-07 16:05:39 +03:00
Alexander Nesterov 9cbdb48d6d Fix change step 2019-02-07 11:14:20 -01:00
Liubov Batanina b068d26fad Using IE backend for normalize layer tests 2019-02-07 11:52:27 +03:00
Namgoo Lee fb8e652c3f Add CV_16UC1 support for cuda::CLAHE
Due to size limit of shared memory, histogram is built on
the global memory for CV_16UC1 case.

The amount of memory needed for building histogram is:

    65536 * 4byte = 256KB

and shared memory limit is 48KB typically.

Added test cases for CV_16UC1 and various clip limits.
Added perf tests for CV_16UC1 on both CPU and CUDA code.

There was also a bug in CV_8UC1 case when redistributing
"residual" clipped pixels. Adding the test case where clip
limit is 5.0 exposes this bug.
2019-02-06 17:21:55 +00:00
Rostislav Vasilikhin bbedebb57c perf tests for cvtColor for 16U and 32f added 2019-02-06 17:56:44 +03:00
Alexander Alekhin f67b197d49 Merge pull request #13738 from dkurt:dnn_ie_lock_shared_plugins 2019-02-06 12:09:58 +00:00
Dmitry Kurtaev 6ad3bf3130 Enable ResNet-based Mask-RCNN models from TensorFlow Object Detection API 2019-02-06 13:05:11 +03:00
Dmitry Kurtaev bc4e471847 Add a mutex for shared Inference Engine plugins 2019-02-05 19:26:58 +03:00
Alexander Alekhin fcec053d59 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-05 19:12:41 +03:00
Alexander Alekhin a63f66c90e Merge pull request #13762 from alalek:ocl_dnn_mvn_local_size 2019-02-05 14:58:27 +00:00
Alexander Alekhin eab6744ac7 dnn(ocl): use compile-time LOCAL_SIZE parameter
instead of get_local_size(0) and dynamic local memory allocation
2019-02-05 15:51:16 +03:00
Alexander Alekhin f46cd9dbf5 Merge pull request #13670 from allnes:dnn_fix_obj_detect_sample 2019-02-05 12:37:53 +00:00
winice 37a5af3673 Merge pull request #13737 from winice-test:master
* Optical Flow rework to use wide universal intrinsics

* remove if (useSIMD) check as review requested
2019-02-04 18:59:00 +03:00
Alexander Alekhin b19bb95d66 Merge pull request #12855 from dkurt:js_features2d_tests 2019-02-02 14:22:02 +00:00
Dmitry Kurtaev 8ecc5e6f64 Add tests for features2d JavaScript bindings 2019-02-01 19:12:31 +03:00
Alexander Alekhin d073215f10 Merge pull request #13705 from mshabunin:clang-warnings 2019-02-01 16:11:00 +00:00
Rostislav Vasilikhin 554eae56d1 Merge pull request #13708 from savuor:yuv42x_wide
YUV42x color conversions rewritten to wide intrinsics (#13708)

* a*b+c -> fma

* YUV420sp2RGB initially vectorized

* shorter var names

* loops by 4

* yuv420p2rgb vectorized

* yuv422toRGB vectorized

* reg arrays

* rgb2yuv420 vectorized

* warnings fixed

* try to fix align error
2019-02-01 19:09:31 +03:00
Alexander Alekhin 4e66d078d2 Merge pull request #13722 from alalek:ocl_pass_ptr_for_empty_umat 2019-02-01 16:07:43 +00:00
Alexander Alekhin 665408e57f Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-02-01 13:17:32 +03:00
Alexander Alekhin a42bbc9722 Merge pull request #13736 from dkurt:dnn_ie_future 2019-02-01 10:01:39 +00:00
Alexander Alekhin fe33ce02af Merge pull request #13735 from dkurt:fix_13725 2019-02-01 09:58:14 +00:00
Alexander Alekhin 9362639437 Merge pull request #13716 from dkurt:dnn_conv_weights_clone 2019-02-01 09:57:08 +00:00
Hannah McLaughlin 418898029c Merge pull request #13718 from lochsh:svm-sigmoid-fix
SVM sigmoid kernel fix (issue #13621) (#13718)

* Added test for sigmoid case for retrieving support vectors

* undo unhelpful test

* add test for sigmoid SVM with data that is easily separable into two concentric circles

* Update sigmoid kernel to use tanh(gamma * <x, y> + coef0) instead of -tanh(gamma * <x, y> + coef0)

* remove unnecessary constraint on coef0

* cleanup

* fixing inappropriate use of doubles

* Add f to float literal

* replace CV_Assert with ASSERT_EQ where appropriate
2019-01-31 15:34:36 +03:00
Dmitry Kurtaev c918ac298c Fix IE tests 2019-01-31 14:14:38 +03:00
Dmitry Kurtaev 252fd63194 Align TensorFlow and OpenCV paths to create a text graph 2019-01-31 13:40:54 +03:00
Vitaly Tuzov 2f5af1bd33 Merge pull request #13693 from terfendail:spatialgrad_wintr
* spatialGradient() reworked to use wide universal intrinsics

* Moved row pointers inside loops
2019-01-30 22:37:27 +03:00
Alexander Nesterov cca2c4b314 Update obj. detect sample 2019-01-30 16:44:42 -01:00
Alexander Alekhin 4501a2cdea ocl: support empty "ptr only" UMat in Kernel::set()
add messages to avoid silent kernel destruction
2019-01-30 14:51:06 +03:00
Maksim Shabunin ea3dc78986 Fixed warnings produced by clang-9.0.0 2019-01-30 14:05:32 +03:00
Ramez Rafla eb00dce78e Merge pull request #13710 from ramezrafla:3.4
* Added DMatch bindings

* Added CR which was accidently removed to maintain consistency

* Removed trailing white-space
2019-01-30 00:14:33 +03:00
Alexander Alekhin 268d73165e Merge pull request #13684 from terfendail:lblend_wintr 2019-01-29 16:21:08 +00:00
Alexander Alekhin 5916ebf500 Merge pull request #13679 from alalek:imgproc_median_blur_cleanup
* imgproc: cleanup medianBlur_8u_O1 code

Unnecessary per-channel buffers: H[c] / lut[c]

* imgproc(medianBlur_8u_O1): use CV_SIMD_WIDTH for alignment
2019-01-29 19:20:24 +03:00
Dmitry Kurtaev ac262f5b5d Clone convolution layer weights only for fusion 2019-01-29 14:29:47 +03:00
Arnaud Brejeon d998e70a25 Merge pull request #13672 from arnaudbrejeon:bug_fix_12961
PyrDown: Fix bug #12961 (#13672)

* Force unaligned pointer and create test

* More cross-platform solution

* MSVC expects a proper order

* Remove useless clang macro
2019-01-28 21:36:00 +03:00
Alexander Alekhin 3585522b24 Merge pull request #13692 from dkurt:dnn_do_not_crash_myriad_in_tests 2019-01-28 18:34:20 +00:00
Alexander Alekhin 02e9636f1b Merge pull request #13707 from dkurt:fix_13575 2019-01-28 18:32:21 +00:00
Dmitry Kurtaev 3c3c5ef2b6 Fix a dnn bug with retrieving all the output blobs 2019-01-28 18:48:56 +03:00
Alexey Smirnov a65ccc0603 Merge pull request #13678 from smirnov-alexey:gapi_fix_descrof_overloading
* Return vector of MetaArg instead of MatDesc and fix test with ADL check

* Fix construction of vector

* Change names and tests according to review
Also add GAPI_EXPORTS prefix for two ostream operators
2019-01-28 16:26:32 +03:00
Dmitry Kurtaev ff775b2e54 Remove ASSERT_ANY_THROW checks fpr Myriad plugin and FP32 networks 2019-01-25 20:09:54 +03:00
Alexander Alekhin e2dbf054ac Merge pull request #13686 from mshabunin:fix-avfoundation 2019-01-25 14:06:24 +00:00
ExpandingDev 62f3c9bfa9 Merge pull request #13675 from ExpandingDev:patch-1
* Add note about building for pkg-config

* minor fixes
2019-01-25 16:36:28 +03:00
Alexander Alekhin 4f668e1023 Merge pull request #13608 from allnes:dnn_rework 2019-01-25 11:59:29 +00:00
Vitaly Tuzov ed2e1af3e8 Added performance test for blendLinear 2019-01-25 14:16:19 +03:00
Vitaly Tuzov 266725a378 blendLinear() reworked to use wide universal intrinsics 2019-01-25 14:16:20 +03:00
Suleyman TURKMEN 9be8ab06ed Update photo.hpp 2019-01-25 10:44:44 +03:00
Alexander Alekhin 287ee9d0ea Merge pull request #13687 from rgarnov:gapi_fix_fluid_heterogeneity 2019-01-24 16:22:12 +00:00
Alexander Alekhin 190ad749e4 Merge pull request #13685 from mshabunin:fix-avfoundation-34 2019-01-24 16:21:49 +00:00
Ruslan Garnov 3c6d5aba22 Fixed fluid heterogeneity support 2019-01-24 17:45:26 +03:00
Alexander Nesterov 97c3bcb1b7 Added fix for other size 2019-01-24 12:51:16 -01:00
Maksim Shabunin 9c4eb20221 AVFoundation on Mac: fixed frame count and unsupported format handling 2019-01-24 16:15:08 +03:00
Maksim Shabunin eeb6f7726e AVFoundation on Mac: fixed frame count and unsupported format handling 2019-01-24 16:12:38 +03:00
Alexander Alekhin 631b246881 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-01-22 18:00:34 +00:00
Alexander Alekhin e1c8256602 Merge pull request #13666 from savuor:yuv_wide_port 2019-01-22 15:31:28 +00:00
Alexey Smirnov 5728679fd5 Merge pull request #13664 from smirnov-alexey:gapi_add_descrof_overloading
* Add version of descr_of function taking vector of Mat

* Overload descr_of function for cv::Mat

* Add template function instead of copypasting and change tests a little
2019-01-22 13:14:33 +03:00
Alexander Alekhin dcdbaef348 Merge pull request #13658 from nglee:dev_CudaShflUpCompat 2019-01-21 18:12:38 +00:00
Alexander Alekhin 20d82cf6d5 Merge pull request #13668 from alalek:imgproc_rgb2yuv_regression 2019-01-21 18:10:25 +00:00
Rostislav Vasilikhin a6af9c75e9 a*b+c -> fma 2019-01-21 18:57:08 +03:00
Namgoo Lee 970293a229 __shfl_up_sync with mask for CUDA >= 9
* __shfl_up_sync with proper mask value for CUDA >= 9

* BlockScanInclusive for CUDA >= 9

* compatible_shfl_up for use in integral.hpp

* Use CLAHE in cudev

* Add tests for BlockScan
2019-01-21 15:31:15 +00:00
Rostislav Vasilikhin 74ba4b7ae2 fixed (un)signed packing s16 -> u8 2019-01-21 18:10:29 +03:00
Rostislav Vasilikhin 6de86e325f fixed (un)signed packing s16 -> u8 2019-01-21 18:01:44 +03:00
Alexander Alekhin a84e11451b imgproc(test): RGB2YUV regression test 2019-01-21 16:07:20 +03:00
Rostislav Vasilikhin 48e471fdd4 YUV vectorizations ported to master from 3.4 2019-01-21 15:35:34 +03:00
Alexander Alekhin 3478240de9 Merge pull request #13656 from dkurt:dnn_tf_atrous_faster_rcnn 2019-01-20 18:39:04 +00:00
Alexander Alekhin e5917a8fa5 Merge pull request #13580 from LaurentBerger:PythonStitch2 2019-01-19 13:44:30 +00:00
LaurentBerger 49a43dfc8f Check syntax of stitchnig detailed 2019-01-18 19:31:05 +01:00
Alexander Alekhin 0395b2ea9c Merge pull request #13650 from terfendail:shapedescr_wintr 2019-01-18 16:18:47 +00:00
Rostislav Vasilikhin 3812ae7949 Merge pull request #13649 from savuor:yuv_wide
YUV/YCrCb conversions rewritten to wide intrinsics (#13649)

* YUV: minors

* YUV42x conversions template-merged

* more template-merged YUV42x conversions; some NEON code removed

* rgb2yuv<float> vectorized

* yuv2rgb<float> vectorized

* memcpy removed

* Yuv2RGB<ushort> vectorized

* unused code removed

* rgb2yuv<ushort> vectorized

* rgb2yuv<uchar> vectorized

* v_pack_u used (up to +30% perf)

* yuv2rgb<uchar> vectorized

* fixed compilation
2019-01-18 19:06:29 +03:00
Alexander Alekhin 400fd5c3ec Merge pull request #13539 from dkurt:ie_graph_api 2019-01-18 16:00:18 +00:00
Dmitry Kurtaev 67e6a6077d Create text graphs for Faster-RCNN from TensorFlow with dilated convolutions 2019-01-18 18:46:52 +03:00
Vitaly Tuzov a84bbc62b1 boundingRect() reworked to use wide universal intrinsics 2019-01-18 18:31:54 +03:00
Alexander Alekhin dc5e69b4d4 Revert "Merge pull request #13586 from eightco:Core_bugfix3"
This reverts commit 3721c8bb06
except changes in modules/dnn/test/test_tf_importer.cpp
2019-01-18 18:29:12 +03:00
Alexander Alekhin 40959fcc61 Merge pull request #13637 from berak:fix_openvx 2019-01-18 14:56:31 +00:00
Vitaly Tuzov 78f80c35d2 Performance test for bounding rect estimation 2019-01-18 15:50:21 +03:00
Andrey Golubev 55770c9853 Merge pull request #13640 from andrey-golubev:gapi_gcallpriv_doc
* GAPI: document GCall's recursive behavior

* Move documentation outside the class
2019-01-17 20:59:47 +03:00
Lee Jaehwan 3721c8bb06 Merge pull request #13586 from eightco:Core_bugfix3
* Add Operator override for multi-channel Mat with literal constant.

* simple test

* Operator overloading channel constraint for primitive types

* fix some test for #13586
2019-01-17 17:23:09 +03:00
Alexander Alekhin b9496f8d9d Merge pull request #13645 from mshabunin:doc-includes 2019-01-17 12:35:20 +00:00
Alexander Alekhin bbc6b95c02 Merge pull request #13644 from berak:dnn_samples_googlenet 2019-01-17 12:34:53 +00:00
Dmitry Kurtaev f0ddf302b2 Move Inference Engine to new API 2019-01-17 14:28:48 +03:00
berak 6596eab66c dnn/samples: add googlenet to model zoo 2019-01-17 12:14:35 +01:00
Maksim Shabunin 9205ad6990 Enabled #include documentation in all members 2019-01-17 13:57:40 +03:00
Alexander Alekhin 49de982ee7 Merge pull request #13625 from nglee:dev_CudaFarnebackInitFlowFix 2019-01-16 18:18:57 +00:00
Alexander Alekhin 2ea4626911 Merge pull request #13639 from andrey-golubev:gapi_fix_gcall_misuse 2019-01-16 17:49:06 +00:00
Alexander Alekhin ca00c1dce2 Merge pull request #13631 from terfendail:thresh_wintr 2019-01-16 15:45:26 +00:00
Andrey Golubev c8a89134a7 GAPI: fix GCall misuse in unrollExpr 2019-01-16 18:15:44 +03:00
berak 53c2ebf7f6 fix openvx wrappers 2019-01-16 12:10:22 +01:00
Alexander Alekhin 133eb8d13a Merge pull request #13593 from brad-kelly:integral_avx512_ver34 2019-01-15 17:47:21 +00:00
Alexander Alekhin dcdb3b36ef Merge pull request #13622 from sturkmen72:code_clean_up 2019-01-15 17:46:26 +00:00
Vitaly Tuzov a202dc9a90 threshold() reworked to use wide universal intrinsics 2019-01-15 19:15:19 +03:00
Alexander Alekhin 0e9c90a0d9 Merge pull request #13610 from terfendail:morph_wintr 2019-01-15 11:22:00 +00:00
Brad Kelly 0165ffa90d Implementing AVX512 support for 3 channel cv::integral for CV_64F 2019-01-14 16:11:01 -08:00
Suleyman TURKMEN 794c14b29a code clean up 2019-01-14 22:21:21 +03:00
Vitaly Tuzov 012e43de4b Morphology reworked to use wide universal intrinsics 2019-01-14 19:02:58 +03:00
Alexander Alekhin 36dfb71c60 Merge pull request #13619 from alalek:issue_13595 2019-01-14 14:54:11 +00:00
Namgoo Lee 4366c8734f Fix Farneback Optical Flow Algorithm
- Before this PR, following tests failed on some platform.
  CUDA_OptFlow/FarnebackOpticalFlow.Accuracy/19
  CUDA_OptFlow/FarnebackOpticalFlow.Accuracy/23

- The algorithm now recognizes the OPTFLOW_USE_INITIAL_FLOW flag.
  Previously, when the flag was set, it did not use the flow data
  passed as input, instead used some garbage data in memory.

- More strict test limit.
2019-01-13 15:14:45 +00:00
Alexander Alekhin 4ced27e149 Merge pull request #13617 from terfendail:always_inline 2019-01-13 09:35:24 +00:00
atinfinity e48682a9f7 Merge pull request #13616 from atinfinity:fixed-py_matcher-tutorial
* fixed tutorial code of py_matcher

* fixed imread mode
2019-01-13 12:34:05 +03:00
Alexander Alekhin 6e39856623 Merge pull request #13614 from dkurt:dnn_tf_ssd_fpn 2019-01-13 09:33:05 +00:00
Alexander Alekhin 6bd5d7f037 cmake: don't use LIB_SUFFIX with CMAKE_INSTALL_LIBDIR 2019-01-12 11:14:18 +00:00
Vitaly Tuzov ea882d58c6 Added CV_ALWAYS_INLINE macro 2019-01-11 22:40:35 +03:00
Jim Zhou 78bd55c8df Merge pull request #13601 from JimZhou-001:JimZhou-001
* Fix the bug in case determinant of rotation matrix is -1

* calib3d(test): check det(R) == 1
2019-01-11 16:58:47 +03:00
Dmitry Kurtaev 4ae5df5509 SSD with FPN proposals from TensorFlow 2019-01-11 12:20:03 +03:00
Alexander Alekhin 7812a805ad Merge pull request #13606 from rrrapha:malloc-h 2019-01-10 15:15:09 +00:00
Raphael Graf 82c77fa244 dnn: remove malloc.h include 2019-01-10 13:07:36 +01:00
Alexander Alekhin 7e2ebecd52 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-01-10 12:29:41 +03:00
Alexander Alekhin 054bd23a43 Merge pull request #13560 from cuihaoleo:master 2019-01-09 15:45:09 +00:00
Alexander Alekhin 3bbe5d3956 Merge pull request #13592 from tdp2110:master 2019-01-09 14:42:57 +00:00
Alexander Alekhin fd674b85bb Merge pull request #13600 from dkurt:fix_13576 2019-01-09 14:02:59 +00:00
Alexander Alekhin facd5988ce Merge pull request #13599 from dkurt:dnn_conv_error_msg 2019-01-09 14:02:14 +00:00
Quentin Chateau 581d0ef8a9 Merge pull request #13584 from qchateau:improve_stitching_detailed
Improve stitching detailed (#13584)

* Added block size getter/setters

* Added a bunch of new features to the stitching_detailed sample

* Do not required XFEATURES2D for default use

* Add support for akaze features in stitching_detailed

* Improved sample logs
2019-01-09 17:01:07 +03:00
Alexander Alekhin a9c1af39d6 Merge pull request #13571 from paroj:jsaruco 2019-01-09 13:59:49 +00:00
Alexander Alekhin 5f419c014f Merge pull request #13583 from qchateau:fix_13582 2019-01-09 13:38:57 +00:00
Alexander Alekhin b11566bfc7 Merge pull request #13553 from luctowers:master 2019-01-09 13:33:45 +00:00
CUI Hao (Lab) e5e1ba3c97 Fix typo in core+RotatedRect.java 2019-01-09 16:30:54 +03:00
Alexander Alekhin ebe14fa4ac Merge pull request #13587 from catree:add_matplotlib_colormaps 2019-01-09 13:30:21 +00:00
Alexander Alekhin 3da8b4ccad Merge pull request #13591 from scramsby:fix-unicode-errors 2019-01-09 13:25:14 +00:00
Alexander Alekhin e986ff46f7 Merge pull request #13596 from nglee:dev_RemoveCudaIncludeWarningMsg 2019-01-09 13:23:54 +00:00
Dmitry Kurtaev 62199df815 Fix edge_detection.py sample for Python 3 2019-01-09 15:28:10 +03:00
Lucas Towers 9cc12ff0ac Fix improper defining of CV_XADD when using Intel C++ 2019-01-09 14:41:21 +03:00
Dmitry Kurtaev d0504c95f4 Add a text message for Convolution layer's input channels check 2019-01-09 13:10:19 +03:00
Thomas Peters e8ac3ea9ea fix implicit fallthrough warning. 2019-01-08 09:49:45 -05:00
Namgoo Lee 4b4874e67a Remove build warning msg with CUDA10.0 2019-01-08 10:57:12 +09:00
Scott Ramsby 7d0d6cd5ee Fix build error when building with Unicode on Windows 2019-01-07 10:18:58 -08:00
catree d745af6763 Add Matplotlib Perceptually Uniform Sequential colormaps (viridis, plasma, inferno, magma, cividis, twilight and twilight shifted). 2019-01-06 22:48:06 +01:00
Quentin Chateau ed7607935e Do not compute gains when no images overlap 2019-01-05 16:39:09 +01:00
Alexander Alekhin 78da679472 Merge pull request #13555 from qchateau:nr_blocks_gain_filtering_iterations 2019-01-04 12:12:35 +00:00
Lee Jaehwan 71aee662bd Merge pull request #13544 from eightco:bugfix
Fix a bug in cv :: merge when array of 3-channel mat is input (#13544)

* Mat merge function bug fix - Bug fix of merge function of 3-channel vector <Mat> of 3 or 4 matrices

* Add Core_merge test for opencv#13544

* fixups
2019-01-04 15:10:50 +03:00
Pavel Rojtberg 2f89158339 js: allow building with basic aruco functionality 2019-01-03 19:04:00 +01:00
Pavel Rojtberg 27d15894d8 js: allow building without dnn 2019-01-03 18:50:36 +01:00
Alexander Alekhin 79e13be04c Merge pull request #13566 from qchateau:fix_13563 2019-01-03 12:15:54 +00:00
Quentin Chateau c72a855214 Fixed uninitialized value and naming 2019-01-02 22:06:29 +01:00
Alexander Alekhin fd08d0d80d copyright: 2019 2019-01-02 01:20:38 +00:00
Alexander Alekhin 14d943f588 copyright: 2019 2019-01-02 01:18:04 +00:00
Quentin Chateau d93ec07dd8 Setter/getter for number of gain filtering iterations 2018-12-31 18:52:47 +01:00
Quentin Chateau 6b96512d46 Merge pull request #13532 from Tytan:channel_exp_comp
Channels exposure compensators (#13532)

* feed compatible with single channel images

* Simplified BlockGainCompensator::apply

* ChannelsCompensator

* BlocksChannelsCompensator

* Make source level compatibility detector happy
2018-12-28 13:53:46 +03:00
Alexander Alekhin a9cf01113a Merge pull request #13534 from mshabunin:fix-external-ffmpeg 2018-12-28 10:51:12 +00:00
Alexander Alekhin 85ade61ef7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-27 18:15:50 +03:00
WuZhiwen 3d44e9ad92 Merge pull request #13520 from wzw-intel:hang
* dnn/Vulkan: fix GPU hang for heavy convolution tasks

Intel i915 driver will declare GPU hang if the compute shader
takes too long to complete. See
https://bugs.freedesktop.org/show_bug.cgi?id=108947 for details.

The idea in this commit is to divide heavy task into several light
ones and run compute shader multiple times to make each run take
short time enough.

TODO: Add more efficient compute shader

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: add a more efficient conv shader
2018-12-27 15:06:44 +03:00
Maksim Shabunin a8fb72a807 Fixed standalone FFmpeg search with pkg-config 2018-12-27 14:40:44 +03:00
Maksim Shabunin 73959fed45 Merge pull request #13422 from mshabunin:split-videoio-cmake
* Split videoio dependencies search into pieces, removed obsolete backends
2018-12-26 15:50:20 +03:00
Alexander Alekhin 5f2fed0e25 Merge pull request #13453 from crackwitz:w32-opengl-mouse-position 2018-12-26 12:38:59 +00:00
Alexander Alekhin caa3633cbf Merge pull request #13451 from crackwitz:gdi-off-by-one 2018-12-26 12:10:09 +00:00
Christoph Rackwitz deb8ba2237 fix for #4990: highgui w32 ogl: correct calculation of image coordinates from window coordinates 2018-12-26 15:00:39 +03:00
Alexander Alekhin e267342108 Merge pull request #13504 from Tytan:stitcher_result_mask 2018-12-26 10:27:38 +00:00
Quentin Chateau 757411bffc Merge pull request #13503 from Tytan:gain_comp_multi_feed
Stitching: multi-feed on gain and block compensator (#13503)

* multi-feed on gain and block compensator

* ABI compatibility
2018-12-26 10:24:38 +03:00
Alexander Alekhin 7d69289092 Merge pull request #13511 from knsong:3.4 2018-12-26 07:23:49 +00:00
Alexander Alekhin c9dfcc4de8 Merge pull request #13492 from terfendail:matx_addition 2018-12-26 07:23:30 +00:00
Christoph Rackwitz beba82b22b Off-by-ones in windows/GDI window calculations
Check for "gutter" around displayed image. there was one row/column missing on the bottom/right.
Might as well set gutter = 0?
2018-12-25 17:54:44 +01:00
Vitaly Tuzov cd169941f2 Added test for addition of Mat and Matx 2018-12-25 19:22:04 +03:00
Vitaly Tuzov c8f59bf1e0 Fixed operations on Mat and Matx simultaneously 2018-12-25 19:22:09 +03:00
Dmitry Kurtaev ff8c53ea20 Merge pull request #13481 from dkurt:fix_13227
* Fix drawMatches and drawKeypoints for BGRA input images

* keep BGRA too

* Combine different input types for drawMatches test
2018-12-25 17:29:12 +03:00
Alexander Alekhin 148aee31e4 Merge pull request #13486 from allnes:dnn_rework 2018-12-25 14:27:45 +00:00
Alexander Nesterov a208c3bf04 Fix openpose samples 2018-12-25 14:12:44 -01:00
Alexander Alekhin d9089741bc Merge pull request #13524 from terfendail:filter_unroll 2018-12-25 14:26:59 +00:00
Vitaly Tuzov 7beb24553a Speedup filter2d by loop unrolling
Added filter2d tests for 16S
2018-12-25 14:40:48 +03:00
Alexander Alekhin 6142b21dd5 Merge pull request #13518 from wzw-intel:test_vulkan 2018-12-24 16:49:45 +00:00
Alexander Alekhin b363489702 Merge pull request #13517 from wzw-intel:check_vulkan 2018-12-24 16:48:13 +00:00
Wu Zhiwen dae03273cd dnn: fixup missing vkcom/vulkan combination of backend/target in dnn test 2018-12-24 11:00:45 +08:00
Wu Zhiwen be6a837e15 dnn: add Vulkan device check for BackendRegistry 2018-12-24 10:41:58 +08:00
Kangning Song d4917a5bd3 fix initial values bug 2018-12-23 11:28:28 +08:00
Alexander Alekhin ffc9aa050d Merge pull request #13507 from alalek:revert_13506 2018-12-22 07:38:15 +00:00
Alexander Alekhin e1f5b886fb Merge tag '4.0.1'
OpenCV 4.0.1
2018-12-22 07:05:31 +00:00
Alexander Alekhin c9ad5779f2 release: OpenCV 4.0.1 (version++) 2018-12-22 07:03:30 +00:00
Alexander Alekhin 26c5b0c71f Merge tag '4.0.1-openvino'
OpenCV 4.0.1 for Intel(R) OpenVINO(TM) toolkit
2018-12-22 07:01:13 +00:00
Alexander Alekhin 1dee705074 Merge branch '3.4' into merge-3.4 2018-12-22 05:40:15 +00:00
Alexander Alekhin c0e11bb50e imgproc: revert "Speedup filter2d by loop unrolling"
Commit: 124011c321
PR: https://github.com/opencv/opencv/pull/13392

Sobel filter with 16S/16U datatype is broken.
2018-12-22 05:37:29 +00:00
Quentin Chateau f9c951440d stitcher result mask getter 2018-12-21 23:21:22 +01:00
Alexander Alekhin f35e043cf9 Merge tag '3.4.5' 2018-12-21 21:48:03 +03:00
Alexander Alekhin 8f1356c3c5 OpenCV version++ (3.4.5)
OpenCV 3.4.5
2018-12-21 17:31:20 +03:00
Alexander Alekhin 14633bc857 Merge pull request #13497 from dkurt:dnn_torch_bn_train 2018-12-21 14:29:10 +00:00
Alexander Alekhin 578ea4bae9 Merge pull request #13386 from alalek:android_gradle 2018-12-21 13:56:03 +00:00
Alexander Alekhin 2bba0f297b Merge pull request #13493 from dkurt:dnn_ie_r5 2018-12-21 12:18:23 +00:00
Alexander Alekhin 6c1638b132 Merge pull request #13487 from alalek:videoio_test_frame_size_changing 2018-12-21 12:17:06 +00:00
Alexander Alekhin 1a6c2b37ea Merge pull request #13499 from alalek:issue_13498 2018-12-21 12:15:59 +00:00
Dmitry Kurtaev 840c892abd Batch normalization in training phase from Torch 2018-12-21 14:36:55 +03:00
Alexander Alekhin 09d8bbb138 Merge pull request #13467 from alalek:issue_12594 2018-12-21 11:01:25 +00:00
Alexander Alekhin 832217907f Merge pull request #13435 from alalek:issue_13434 2018-12-21 11:01:04 +00:00
Alexander Alekhin 26c5b846e6 Merge pull request #13392 from terfendail:filter_wintr 2018-12-21 11:00:44 +00:00
Dmitry Kurtaev 59ce1d80a5 Fix dnn tests for Inference Engine R5 2018-12-21 12:33:30 +03:00
Alexander Alekhin 2f3e06ac1f objdetect(qrcode): don't process small/non-regular images 2018-12-21 12:19:35 +03:00
Alexander Alekhin 37a63ca02b Merge pull request #13488 from alalek:fix_videoio_v4l2_build 2018-12-21 09:07:38 +00:00
Alexander Alekhin 0d63bd575c Merge pull request #13489 from alalek:openvino_2018r5 2018-12-21 10:05:04 +03:00
Dmitry Kurtaev 257f60582a Add serialize method for IE net wrapper
backport 4ba4901ca9
2018-12-21 05:52:27 +00:00
Alexander Alekhin bbdc987fc6 dnn: add OpenVINO 2018R5 defines
https://software.intel.com/en-us/openvino-toolkit
2018-12-21 05:52:27 +00:00
Vitaly Tuzov 124011c321 Speedup filter2d by loop unrolling 2018-12-20 21:18:42 +03:00
Alexander Alekhin 8456d096d2 videoio(v4l2): fix build due missing V4L2_CID_ISO_SENSITIVITY 2018-12-20 16:28:12 +03:00
Alexander Alekhin 32c975b533 Merge pull request #13484 from va-sorokin:fix-v4l-size 2018-12-20 12:55:41 +00:00
Alexander Alekhin a3a3670027 videoio(test): test V4L frame size changing manual test 2018-12-20 15:14:20 +03:00
Vasiliy Sorokin b6a72826dd videio: Fix new frame size appling in v4l. 2018-12-20 14:59:39 +03:00
Dmitry Kurtaev 6bcf0b5519 Merge pull request #13482 from dkurt:fix_python_bindings_without_stitching
* Fix python bindings without stitching module

* stitching: move stitching specific code into modules/stitching/misc
2018-12-19 23:37:55 +03:00
Alexander Alekhin 3d5cebb3ac Merge pull request #13478 from terfendail:medianblur_fix 2018-12-19 16:03:55 +00:00
Alexander Alekhin e82d03ef61 Merge pull request #13480 from dbudniko:dbudniko/gapi_ocl_backend_internal_umat_size_fix 2018-12-19 15:50:32 +00:00
Vitaly Tuzov 131c09cf76 Fixed medianBlur implementation for hi-resolution images 2018-12-19 18:05:42 +03:00
Vitaly Tuzov 06f32e3b3e Reworked separable filter to use wide universal intrinsics 2018-12-19 17:50:09 +03:00
Dmitry Budnikov eedd7bfd50 fix size 2018-12-19 17:45:00 +03:00
Alexander Alekhin cbf80117af eliminate build warnings 2018-12-19 15:42:38 +03:00
Alexander Alekhin 2b35c1708b android: gradle-based package and samples
- drop hello-android sample
2018-12-19 14:59:48 +03:00
Alexander Alekhin e093a19c70 Merge pull request #13471 from dkurt:fix_enum_struct_java 2018-12-19 11:53:41 +00:00
Dmitry Kurtaev 6fbcb283b9 Try to fix "enum struct" wrapping for Java 2018-12-19 13:16:43 +03:00
Alexander Alekhin 7fb70e1701 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-18 19:07:43 +00:00
LaurentBerger 2fb409b286 Merge pull request #13267 from LaurentBerger:StitchPython
* Python wrapper for detail

* hide pyrotationwrapper

* copy code in pyopencv_rotationwarper.hpp

* move ImageFeatures MatchInfo and CameraParams in core/misc/

* add python test for detail

* move test_detail in test_stitching

* rename
2018-12-18 21:49:16 +03:00
Alexander Alekhin b0a08cced9 Merge pull request #13466 from pstieber:AddTuringCudaGeneration 2018-12-18 18:35:47 +00:00
Alexander Alekhin 82b7803a7a Merge pull request #13456 from alalek:fix_eigen2cv_type_check 2018-12-18 18:35:27 +00:00
Peter J. Stieber 50ef9830e2 Added Turing to the _generations list. 2018-12-18 08:52:15 -08:00
Alexander Alekhin d5f430cc11 android: gradle wrapper
https://github.com/gradle/gradle/tree/v4.6.0

License: Apache 2.0
2018-12-18 15:45:45 +03:00
Alexander Alekhin 8ed4fb9405 Merge pull request #13464 from alalek:ocl_max_group_size_parameter 2018-12-18 12:06:14 +00:00
Alexander Alekhin de82d9da9e Merge pull request #13458 from alalek:fix_python_install_path 2018-12-18 11:46:03 +00:00
Quentin Chateau fd27d5ea00 Merge pull request #13449 from Tytan:stitching-warp-interpolation
Stitching: added functions to set warp interpolation mode (#13449)

* Added functions to set warp interpolation mode

* Use InterpolationFlags enum

* Improved getter/setter naming
2018-12-18 14:43:05 +03:00
vishwesh5 715f8fcce0 Merge pull request #13432 from vishwesh5:patch-1
* Create text_detection.py

#12270 #13429
**Deep Learning text detection sample (Python)**
- Tested on **Ubuntu 18.04** - OpenCV 3.4.3, OpenCV 3.4.4, OpenCV 4.0 (master branch)
- Python version supported - Python 2 and Python 3

* Fix trailing whitespaces

* Update text_detection.py

* Remove whitespace

* Remove comments

* Remove unused packages

* Update description
2018-12-18 13:40:04 +03:00
Alexander Alekhin 3f3c8823ac features2d: fix retainBest() implementation 2018-12-18 05:33:21 +00:00
Alexander Alekhin d9d9b05912 core(ocl): add parameter to limit device max workgroup size
used by OpenCV
2018-12-17 18:33:05 +00:00
Alexander Alekhin 55171b25f8 Merge pull request #13463 from vishwesh5:patch-2 2018-12-17 18:08:20 +00:00
vishwesh5 3eb2c940de Fix Scharr and Sobel functions
Resolves #13375
2018-12-17 20:39:22 +05:30
Rostislav Vasilikhin 493611ace5 Merge pull request #13440 from savuor:rgb_wide
* conversions of color_rgb.cpp vectorized

* CL impl: coeffs updated

* unused constants removed

* CUDA color coeffs updated
2018-12-17 17:22:38 +03:00
Alexander Alekhin bb8c19aad3 cmake: fix python install paths 2018-12-17 14:32:29 +03:00
Alexander Alekhin b571f03016 Merge pull request #13455 from alalek:issue_13454 2018-12-16 10:16:19 +00:00
Alexander Alekhin f605898bae core: fix eigen2cv() - don't change fixed type of 'dst' 2018-12-16 06:43:08 +00:00
Alexander Alekhin 5736bf5dd5 stitching: fix l_gains data type from Eigen solver (float / double) 2018-12-16 06:29:18 +00:00
Alexander Alekhin 4f9c1da806 Merge pull request #13447 from alalek:issue_13445 2018-12-15 21:17:17 +00:00
Alexander Alekhin eb1f3733ee videoio(dc1394): use lazy initialization on demand 2018-12-15 07:58:39 +00:00
Alexander Alekhin d993b9c1df Merge pull request #13443 from seiko2plus:issue13442 2018-12-14 22:31:35 +00:00
Sayed Adel 4e16ae9a1f core:vsx fix build failure on GCC<=6 due implementation of v_reduce_sum(v_float64x2) 2018-12-14 19:24:12 +00:00
Quentin Chateau ab86f15ba0 Merge pull request #13400 from Tytan:optimize_exposure_compensation
Optimize exposure compensation (#13400)

* Added perf test

* Optimized gains computation

* Use Eigen for gains calculation
2018-12-14 21:37:00 +03:00
Alexander Alekhin e058febaad Merge pull request #13441 from paroj:capimg 2018-12-14 15:41:40 +00:00
Alexander Alekhin 0a801354b1 Merge pull request #13438 from madan-ram:patch-2 2018-12-14 14:35:56 +00:00
Pavel Rojtberg d7f60f69f1 videoio: fix CAP_IMAGES
broken in 11eafca3e2
2018-12-14 15:32:33 +01:00
Rostislav Vasilikhin d99a4af229 Merge pull request #13379 from savuor:color_5x5
RGB to/from Gray rewritten to wide intrinsics (#13379)

* 5x5 to RGB added

* RGB25x5 added

* Gray2RGB added

* Gray2RGB5x5 added

* vx_set moved out of loops

* RGB5x52Gray added

* RGB2Gray written

* warnings fixed (int -> (u)short conversion)

* warning fixed

* warning fixed

* "i < n-vsize+1" to "i <= n-vsize"

* RGBA2mRGBA vectorized

* try to fix ARM builds

* fixed ARM build for RGB2RGB5x5

* mRGBA2RGBA: saturation, vectorization

* fixed CL implementation of mRGBA2RGBA (saturation added)
2018-12-14 17:01:01 +03:00
Alexander Alekhin 4b33910449 Merge pull request #13428 from rgarnov:gapi_add_kernels_pass_stage 2018-12-14 12:30:36 +00:00
Madan Ram c1e9a7ee4b Update template_matching.markdown
Replaced CV_TM_SQDIFF to TM_SQDIFF and the rest since methods are renamed in opencv 3.4
2018-12-14 16:34:58 +05:30
Alexander Alekhin 82a02d8585 Merge pull request #13436 from alalek:cmake_with_msmf_dxva_3.4 2018-12-14 10:36:39 +00:00
Alexander Alekhin 8d907d2e32 cmake(java): add OPENCV_JAVA_SOURCE_VERSION/OPENCV_JAVA_TARGET_VERSION 2018-12-14 00:15:57 +00:00
Alexander Alekhin 0c16d8f6c3 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-13 15:12:26 +03:00
Alexander Alekhin b7bb79c7c8 videoio(MSMF): backport WITH_MSMF_DXVA flag 2018-12-13 14:56:20 +03:00
Ruslan Garnov 5340073770 Removed UNUSED macro 2018-12-13 14:39:33 +03:00
Vitaly Tuzov 3903174f7c Merge pull request #13334 from terfendail:histogram_wintr
* added performance test for compareHist

* compareHist reworked to use wide universal intrinsics

* Disabled vectorization for CV_COMP_CORREL and CV_COMP_BHATTACHARYYA if f64 is unsupported
2018-12-13 14:20:22 +03:00
Alexander Alekhin a9771078df Merge pull request #13427 from dkurt:dnn_onnx_dynamic_reshape 2018-12-13 11:15:51 +00:00
Alexander Alekhin eb1f7797e4 Merge pull request #13387 from dkurt:dnn_minor_ie_fixes 2018-12-13 10:08:34 +00:00
Alexander Alekhin aa666dfa9c Merge pull request #13430 from tomoaki0705:fixCudaJetsonTX2file 2018-12-13 09:14:26 +00:00
Tomoaki Teshima 3e710d8eec use correct CC value for Jetson Xavier 2018-12-13 13:35:19 +09:00
Alexander Alekhin 384ac63490 Merge pull request #13425 from alalek:issue_13277 2018-12-12 16:21:46 +00:00
Alexander Alekhin 954098d1cb Merge pull request #13423 from alalek:issue_13418 2018-12-12 15:38:47 +00:00
Dmitry Kurtaev e71758cfdf Operate with shapes in ONNX models 2018-12-12 18:34:22 +03:00
Alexander Alekhin cea3289bd4 Merge pull request #13420 from ThadHouse:Windows7shlwapi 2018-12-12 14:58:51 +00:00
Adrian Kashivskyy 00285a5e88 Merge pull request #13424 from akashivskyy:pr/ios-nonfree
Add ability to build iOS and macOS frameworks with nonfree modules (#13424)

* Allow building ios framework with nonfree

* Allow building osx framework with nonfree
2018-12-12 17:32:19 +03:00
Ruslan Garnov d38676085a Added "kernels" pass stage to compiler, removed unused opaque from cv::gimpl::Op 2018-12-12 17:22:52 +03:00
Alexander Alekhin d8583b2c7a dnn: fix vulkan backend builds with Clang 2018-12-12 15:25:39 +03:00
Alexander Alekhin 82227b5ace Merge pull request #13419 from seanm:SemiWarnings 2018-12-12 11:07:00 +00:00
Alexander Alekhin 6fa23f330f cmake: fix compiler flags filtering 2018-12-12 13:35:43 +03:00
Alexander Alekhin c8f934b5b1 Merge pull request #13415 from alalek:issue_13406
* python: add checks for drawKeypoints() symbol

* python: more hacks in hdr_parser.py
2018-12-12 13:26:31 +03:00
Thad House 857fba0878 Remove MinCore_Downlevel, replace with Shlwapi
On windows 7, MinCore_Downlevel does not work correctly. However, the only API used was QISearch, which can be found in Shlwapi.

Closes #12010
2018-12-11 17:06:01 -08:00
Sean McBride a4111fab39 Fixed -Wextra-semi warnings in public headers 2018-12-11 14:45:27 -05:00
Alexander Alekhin 54de51ef3c Merge pull request #13416 from alalek:avoid_cv2_in_docs 2018-12-11 17:47:41 +03:00
Alexander Alekhin 0915df5b18 python: don't use 'cv2.' in documentation 2018-12-11 16:05:12 +03:00
Dmitry Kurtaev 53f6198f27 Minor fixes in IE backend tests 2018-12-10 20:08:13 +03:00
Maksim Shabunin 81e7c7d8c8 OpenVINO version bump 2018-12-10 14:44:53 +03:00
Alexander Alekhin ea64e860de Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-09 13:21:58 +00:00
Rijubrata Bhaumik e70786e05e Merge pull request #13300 from riju:photoModule
* Enable Javascript bindings for photo module.

1. Enable the build flag in build_js.py.
2. Append js into WRAP list of photo’s CMakefiles.txt
3. Add photo module's API into JS API whitelist (embindgen.py)

Exposing the HDR imaging part of photo module.

[TODO]
Add tests
Fix opencv/doc/js_tutorials/

* [WIP] TODO: Add tests

* Remove TonemapDurand: algorithm patented in US, so moved to opencv_contrib

* Fix ningxin's comment: expose the base class.

* Add some more simple binding tests.

Also expose process function
2018-12-09 15:08:59 +03:00
LaurentBerger f1dc26d7ce Merge pull request #13382 from LaurentBerger:imreadsize
* try to solve #13381

* Add note
2018-12-09 15:05:27 +03:00
Alexander Alekhin 40a53e3d64 Merge pull request #13388 from alalek:ocl_fix_perf_stitching 2018-12-08 17:51:47 +00:00
Alexander Alekhin e5f298cca5 Merge pull request #13385 from alalek:cmake_cleanup_build_junk_dir 2018-12-08 17:51:09 +00:00
Alexander Alekhin 85b1750660 Merge pull request #13316 from alalek:cmake_fix_baseline_detect 2018-12-08 17:50:03 +00:00
Alexander Alekhin 92e86292dd Merge pull request #13389 from dkurt:dnn_tf_eltwise_sub 2018-12-07 13:54:09 +00:00
Maksim Shabunin 05131af8da Merge pull request #13367 from mshabunin:cmake-verify
* Added dependency verification mechanism for cmake
2018-12-07 15:57:25 +03:00
Dmitry Kurtaev 8422dda2c7 Element-wise subtraction from TensorFlow 2018-12-07 13:38:05 +03:00
Alexander Alekhin 606622ab36 stitching(perf): increase threshold of transform vector 2018-12-07 13:22:39 +03:00
Alexander Alekhin d77612fe70 cmake: hide 'junk' dir from the root of build directory
moved to CMakeFiles (no conflicts are expected)
2018-12-07 05:14:08 +00:00
Alexander Alekhin cab15f6c5e Merge pull request #13377 from dkurt:hotfix_dnn_ie_master 2018-12-06 15:11:09 +00:00
Alexander Alekhin 492a072ea8 Merge pull request #13376 from dkurt:hotfix_dnn_ie 2018-12-06 15:09:51 +00:00
Alexander Alekhin e82e672a93 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-06 07:06:58 +00:00
Dmitry Kurtaev 93971a53d9 Exclude Input layer from list of outputs for IE networks 2018-12-06 09:12:05 +03:00
Dmitry Kurtaev 3868cb44f1 Exclude Input layer from list of outputs for IE networks 2018-12-06 09:08:50 +03:00
Alexander Alekhin 6fbf6f8bea Merge pull request #13359 from dkurt:dnn_keras_pad_concat 2018-12-05 19:48:58 +00:00
Alexander Alekhin e090ea3efd Merge pull request #13370 from alalek:ocl_update_perf_stitching_matchers_threshold 2018-12-05 19:46:12 +00:00
Alexander Alekhin a618d8bc9e stitching(perf): update test threshold 2018-12-05 18:59:30 +00:00
Tsukasa Sugiura 09b3dcb6db Merge pull request #13341 from UnaNancyOwen:fix_librealsense
* videoio(librealsense): fix pipeline start with config

fix to apply pipeline settings by passing config to start.

* videoio(librealsense): add support get props

add support get some props.
2018-12-05 20:12:25 +03:00
Alexander Alekhin f26e86e4d8 Merge pull request #13369 from alalek:fixup_13332 2018-12-05 17:02:02 +00:00
Alexander Alekhin 9ff1c39daa dnn: fixup available backends/targets 2018-12-05 19:19:17 +03:00
okriof ef42baf9f0 Merge pull request #13361 from okriof:brisk_getset
* Get/Set functions for BRISK parameters, issue #11527.

Allows setting threshold and octaves parameters after creating a brisk object. These parameters do not affect the initial pattern initialization and can be changed later without re-initialization.

* Fix doc parameter name.

* Brisk get/set functions tests. Check for correct value and make tests independent of default parameter values.

* Add dummy implementations for BRISK get/set functions not to break API in case someone has overloaded the Feature2d::BRISK interface. This makes BRISK different from the other detectors/descriptors on the other hand, where get/set functions are pure virtual in the interface.
2018-12-05 18:44:23 +03:00
Maksim Shabunin fe459c82e5 Merge pull request #13332 from mshabunin:dnn-backends
DNN backends registry (#13332)

* Added dnn backends registry

* dnn: process DLIE/FPGA target
2018-12-05 18:11:45 +03:00
Alexander Alekhin cdf906b233 Merge pull request #12945 from terfendail:core_wintr_full 2018-12-05 12:52:03 +00:00
Alexander Alekhin ead7bc883d Merge pull request #13364 from nglee:dev_FixLineIteratorExample 2018-12-05 10:09:48 +00:00
Alexander Alekhin e55ad25355 Merge pull request #13363 from kartikmohta:patch-1 2018-12-05 09:50:09 +00:00
Alexander Alekhin 838624bf53 Merge pull request #13362 from alalek:photo_move_durand_contrib 2018-12-05 09:46:30 +00:00
Namgoo Lee 83c7dfb6a4 Fix error in LineIterator example code in doc 2018-12-05 11:31:19 +09:00
Kartik Mohta 80a3d7bffa Fix comment marker in OpenCVDetectCudaArch.cu 2018-12-04 11:47:28 -08:00
Dmitry Kurtaev c9e0c77d73 Concat layer from TensorFlow with constant inputs 2018-12-04 19:41:40 +03:00
Alexander Alekhin 742f22c09b photo: move TonemapDurand to opencv_contrib 2018-12-04 18:59:27 +03:00
Maksim Shabunin 6481397710 Merge pull request #13358 from terfendail:disflow_warn 2018-12-04 14:21:43 +00:00
Vitaly Tuzov 6ad8a9c09d Replaced core module calls to universal intrinsics with wide universal intrinsics 2018-12-04 16:24:20 +03:00
Vitaly Tuzov 388ccda85d Fixed static analyzer warnings in DISOpticalFlow 2018-12-04 12:57:14 +03:00
Alexander Alekhin 2e0150e601 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-03 18:38:27 +03:00
Alexander Alekhin aee865fec9 Merge pull request #13352 from alalek:issue_13324 2018-12-03 15:34:23 +00:00
Alexander Alekhin 2dc5e245d0 Merge pull request #13350 from alalek:fix_kw_gapi 2018-12-03 15:16:45 +00:00
Alexander Alekhin ea3a5950a3 Merge pull request #13346 from alalek:fix_kw_persistence 2018-12-03 15:16:31 +00:00
Alexander Alekhin 0d439a9879 Merge pull request #13351 from mshabunin:fix-va-compile 2018-12-03 15:15:55 +00:00
Alexander Alekhin 99f6f8ea9d Merge pull request #13348 from alalek:kw_videoio_v4l 2018-12-03 14:45:03 +00:00
Alexander Alekhin 39e448f7be Merge pull request #13347 from alalek:kw_resize_check 2018-12-03 14:44:41 +00:00
Alexander Alekhin 80c2adbda1 core: add getcwd() stub 2018-12-03 17:38:57 +03:00
Maksim Shabunin c26c43c69c Fixed compilation with VA-interop on 32-bit platforms 2018-12-03 17:16:09 +03:00
Alexander Alekhin 4e8311085f core(persistence): fix KW issues 2018-12-03 17:10:20 +03:00
Alexander Alekhin cf0be1a0af Merge pull request #13349 from mshabunin:fix-highgui-test 2018-12-03 13:06:09 +00:00
Alexander Alekhin 26d2095dd6 videoio(v4l): initialize members in ctor 2018-12-03 15:22:20 +03:00
Alexander Alekhin c577c2cc6a gapi: eliminate KW issues 2018-12-03 15:20:47 +03:00
Maksim Shabunin 905d96dd4a Restored 500ms delay in highgui test 2018-12-03 14:34:29 +03:00
Alexander Alekhin 2d5ccc7b3e imgproc(resize): update checks (static analyzers) 2018-12-03 13:13:48 +03:00
Alexander Alekhin a0fed8d9ea Merge pull request #13338 from alalek:fix_resize_bitexact_test 2018-11-30 15:46:33 +00:00
Alexander Alekhin 4e29e2fc7d imgproc(test): fix resize bitexact test
- use "random" area on input image
- avoid duplicate cases
2018-11-30 16:38:07 +03:00
Alexander Alekhin a811059bfb Merge pull request #13336 from sergiud:core_sse_immediates_gcc-5.4.0 2018-11-30 09:51:59 +00:00
Sergiu Deitsch e43a5ff9be fixed gcc 5.4.0 compilation errors 2018-11-30 08:48:19 +01:00
Vitaly Tuzov 00c9ab8c23 Merge pull request #13317 from terfendail:norm_wintr
* Added performance tests for hal::norm functions

* Added sum of absolute differences intrinsic

* norm implementation updated to use wide universal intrinsics

* improve and fix v_reduce_sad on VSX
2018-11-29 19:34:14 +03:00
Alexander Alekhin 197285d12a Merge pull request #13331 from dbudniko:dbudniko/gapi_gpu_to_ocl_renaming_patch 2018-11-29 15:39:14 +00:00
Evgeny Latkin ab430b8c87 Merge pull request #13329 from elatkin:el/gapi_perf_medblur
GAPI (fluid): Median blur optimization (#13329)

* GAPI (fluid): Median blur optimization: reference 3x3

* GAPI (fluid): Median blur optimization: CPU dispatcher

* GAPI (fluid): Median blur optimization: manual CV_SIMD
2018-11-29 18:02:29 +03:00
Dmitry Budnikov d1029faa90 patch removes gpu mention from ocl backend 2018-11-29 17:05:41 +03:00
Dmitry Budnikov 6374b99a1a Merge pull request #13240 from dbudniko:dbudniko/gapi_gpu_to_ocl_renaming
G-API rename GPU backend to OCL backend (#13240)

* renaming draft

* inline namespace instead non-safe define

* more back compatibility

* Updates after review from Dmitry
2018-11-29 16:29:11 +03:00
Alexander Alekhin ccf96b9e05 Merge pull request #13323 from alalek:issue_13297 2018-11-29 12:40:03 +00:00
Alexander Alekhin 3fe70d5cd5 Merge pull request #13327 from allnes:qrcode_modifications 2018-11-29 12:39:06 +00:00
Alexander Nesterov adb630ba3a Corrected parameters 2018-11-29 11:57:45 -01:00
Alexander Alekhin 5ed7d5a5d9 imgproc: local "CV_Assert(totalSampleCount > 0)" check 2018-11-28 20:16:37 +00:00
Alexander Alekhin 4fb9bce79f Merge pull request #13264 from mshabunin:fix-windows 2018-11-28 20:00:04 +00:00
Alexander Alekhin 487f631243 Merge pull request #13320 from alalek:api_checks_4.0.0 2018-11-28 19:51:29 +00:00
Alexander Alekhin 1f7728db35 Merge pull request #13322 from akashivskyy:pr/iossim-archs 2018-11-28 19:34:25 +00:00
Adrian Kashivskyy b7c134617d Add ability to specify iPhoneSimulator ARCHS 2018-11-28 19:27:20 +01:00
Evgeny Latkin c928c21fe7 Merge pull request #13319 from elatkin:el/gapi_perf_erdilate_2
GAPI (fluid): Erode/Dilate optimization, part 2 (#13319)

* GAPI (fluid): Erode/Dilate optimization: hard-code 3x3 case

* GAPI (fluid): Erode/Dilate optimization: CPU dispatcher

* GAPI (fluid): Erode/Dilate optimization: speed-up 10-15x times with CV_SIMD

* GAPI (fluid): Erode/Dilate optimization: 20-30% speed-up
2018-11-28 19:50:39 +03:00
Alexander Alekhin 59fa477edb opencv4: fix abi-checker (to enable API/source checks only) 2018-11-28 18:42:19 +03:00
Evgeny Latkin 992d5b8bcd Merge pull request #13315 from elatkin:el/gapi_perf_erdilate
GAPI (fluid): Erode/Dilate optimization (#13315)

* GAPI (fluid): Erode/Dilate optimization: hard-code 3x3 case

* GAPI (fluid): Erode/Dilate optimization: CPU dispatcher

* GAPI (fluid): Erode/Dilate optimization: speed-up 10-15x times with CV_SIMD
2018-11-28 18:20:31 +03:00
Alexander Alekhin fab0eb0d75 cmake: fix compiler flags (CPU_BASELINE_REQUIRED=xxx + CPU_BASELINE=DETECT) 2018-11-28 14:04:03 +03:00
Evgeny Latkin 6808d33b2f Merge pull request #13290 from elatkin:el/gapi_perf_filter2d
GAPI (fluid): Filter 2D optimization (#13290)

* GAPI (fluid): Filter 2D optimization: speedup 13x if float, 2x if integral

* GAPI (fluid): Filter 2D speedup 8x if output is short/ushort

* GAPI (fluid): Filter 2D speedup 7x if output is uchar

* GAPI (fluid): Filter 2D optimization: fixed compiler warnings

* GAPI (fluid): fix compiler warnings on Mac

* GAPI (fluid): fix compiler warnings on Mac

* GAPI (fluid): fix compiler errors on VS2015

* GAPI (fluid): fix compiler errors on VS2015

* GAPI (fluid): fix compiler errors on VS2015
2018-11-27 19:12:14 +03:00
Alexander Alekhin 65f22292ed Merge pull request #13298 from mshabunin:fix-intrin-indent 2018-11-27 13:58:02 +00:00
Alexander Alekhin b1064efb44 Merge pull request #13294 from terfendail:contours_wintr 2018-11-27 13:54:23 +00:00
Alexander Alekhin df96159eb6 Merge pull request #13301 from alalek:build_warnings 2018-11-27 13:53:02 +00:00
Maksim Shabunin 89f0e0a8d1 Fixed misleading indentation in intrin_cpp.hpp 2018-11-27 15:29:37 +03:00
Maksim Shabunin 966f27df34 Merge pull request #13293 from dkurt:dnn_add_extra_ie_net_method 2018-11-27 12:26:09 +00:00
Alexander Alekhin 83c8214b38 eliminate build warnings 2018-11-27 15:24:59 +03:00
Alexander Alekhin 21bb17e3ee Merge pull request #13292 from mshabunin:fix-filenode-compat 2018-11-27 10:56:23 +00:00
Dmitry Kurtaev 4ba4901ca9 Add serialize method for IE net wrapper 2018-11-27 12:02:00 +03:00
Maksim Shabunin 9de63c1edd Made FileNode::operator string inline 2018-11-27 11:47:23 +03:00
Vitaly Tuzov e991e05b9b Added anonymous namespace to perf_contours 2018-11-27 11:35:40 +03:00
Dmitry Budnikov 51cc78b2a2 Merge pull request #13251 from dbudniko:dbudniko/gapi_more_fixes_for_tests
More fixes for G-API tests (#13251)

* scalar comparator and more fixes for tests

* add weighted aligned

* white space

* more white space

* Add weighted test accuracy check enabled
2018-11-26 17:44:46 +03:00
Alexander Alekhin 8f4e5c2fb8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-26 15:37:45 +03:00
Alexander Alekhin 223893ea5a Merge pull request #13242 from terfendail:contours_wintr 2018-11-26 12:29:31 +00:00
Maksim Shabunin db1c8b3f9e Restored function to rescale pixel values before imshow 2018-11-26 15:25:05 +03:00
Alexander Alekhin 5bd1cc44ec Merge pull request #13280 from dkurt:enable_dnn_ie_r4_tests 2018-11-26 12:24:17 +00:00
Evgeny Latkin f07856eab9 Merge pull request #13221 from elatkin:el/gapi_perf_sepfilter
GAPI (fluid): optimization of Separable filter (#13221)

* GAPI (fluid): Separable filter: performance test

* GAPI (fluid): enable all performance tests

* GAPI: separable filters: alternative code for Sobel

* GAPI (fluid): hide unused old code for Sobel filter

* GAPI (fluid): especial code for Sobel if U8 into S16

* GAPI (fluid): back to old code for Sobel

* GAPI (fluid): run_sepfilter3x3_impl() with CPU dispatcher

* GAPI (fluid): run_sepfilter3x3_impl(): fix compiler warnings

* GAPI (fluid): new engine for separable filters (but Sobel)

* GAPI (fluid): new performance engine for Sobel

* GAPI (fluid): Sepfilters performance: fixed compilation error
2018-11-26 15:05:35 +03:00
Matthias Winkelmann 24acd5fb83 Merge pull request #13228 from MatthiasWinkelmann:master
Add URLs, harmonise formatting, and fix parse error in bibliography (#13228)

* Fixed parse error in bibliography

* Removed extra curly braces

* harmonized whitespace

* changed organisation -> publisher where appropriate. Organisation is intended as the author's organisation, not the publishing.

* harmonized capitalisation and whitespace

* Add links to about 1/3 of references
2018-11-26 15:04:16 +03:00
Dmitry Kurtaev 84ce2cc211 Enable some dnn tests according to the new Intel's Inference Engine release (R4) 2018-11-26 13:02:24 +03:00
Alexander Alekhin 37d064f553 Merge pull request #13279 from mshabunin:fix-carotene-build-3.4 2018-11-26 09:30:32 +00:00
Alexander Alekhin dd952f6d68 Merge pull request #13278 from mshabunin:fix-carotene-build 2018-11-26 09:29:48 +00:00
Alexander Alekhin e63efe2978 Merge pull request #13275 from wzw-intel:thread_safe 2018-11-26 09:15:09 +00:00
Maksim Shabunin 26cb154f40 Fixed NEON detection in Carotene build 2018-11-26 11:33:18 +03:00
Maksim Shabunin fb6929ac3d Fixed NEON detection in Carotene build 2018-11-26 11:30:20 +03:00
Wu Zhiwen 4e65283081 dnn/Vulkan: make thread safe
Use a global dedicated mutex to make sure initialize once and
protect command buffer pool and queue.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-11-26 14:08:37 +08:00
Alexander Alekhin ca5455c592 Merge pull request #13270 from 1over:flann_dist_fix 2018-11-25 18:27:42 +00:00
Alexander Alekhin 82f4322d18 Merge pull request #13269 from alalek:ocl_fix_kernels_with_use_host_mem 2018-11-25 18:27:01 +00:00
Alexander Alekhin 36b6bcb674 Merge pull request #13268 from alalek:core_findfile_linux_use_dladdr 2018-11-25 18:26:28 +00:00
Alexander Alekhin 5a804e3c74 Merge pull request #13254 from alalek:update_python_install_path 2018-11-25 18:25:48 +00:00
1over 5ff76088b9 fixed memory issue in flann 2018-11-25 01:31:54 +01:00
Alexander Alekhin 9fd822f97e ocl: fix kernels launching with USE_HOST_PTR UMat
created from RAW memory buffers (without proper lifetime management)
2018-11-24 15:37:16 +00:00
Alexander Alekhin 3c49b1dbbe core: use dladdr() instead of parsing /proc/self/maps 2018-11-24 15:22:54 +00:00
Alexander Alekhin ad35b79e3f python: update install paths
- don't require "OPENCV_PYTHON{2,3}_INSTALL_PATH" if OPENCV_SKIP_PYTHON_LOADER=ON
- avoid unnecessary relative paths in generated config-X.Y.py
2018-11-24 13:55:46 +00:00
Alexander Alekhin 342366e314 Merge pull request #13263 from dkurt:dnn_refactor_tests 2018-11-23 17:12:01 +00:00
Alexander Alekhin c6daa4aa16 Merge pull request #13260 from alalek:cmake_ade_12856 2018-11-23 17:09:47 +00:00
Alexander Alekhin c0016d7fe9 Merge pull request #13253 from alalek:fix_13201
* cmake: install 'legacy/constants_c.h' files

* samples: add compatibility test code
2018-11-23 20:02:46 +03:00
Dmitry Kurtaev 2f6f52d644 Fix ONNX's emotion_ferplus model.
Reduce input size for OpenPose tests
2018-11-23 19:00:17 +03:00
Dmitry Budnikov a518e7063d Merge pull request #13120 from dbudniko:dbudniko/gapi_opencl_kernel_example
* custom OpenCL G-API kernel draft

* clean up and warnings fix

* more warnings

* white space

* new blank line at the EOF removed

* HAVE_OPENCL guard

* remove unnecessary ocl API call

* remove sum test workaround

* check if opencl activated

* fix std::str warning

* CPU fall back for symm7x7

* gpu test kernel draft

* adjust have opencl guard

* more guards

* one more attempt to adjust guards

* empty stub files and kernel source files creation in the test directory

* try to force auto generation

* one more attempt to force build

* remove symm7x7 custom from gapi module

* looks like that this version works properly on Win desktop

* clean up

* more clean up

* address some suggestions from Dmitry's review

* const kernel coefficients

* CV_Error in kernel + try to fix cpu fallback

* CV_Error_ instead CV_Error

* everything in one gapi_gpu_test.cpp

* fix warning

* remove kernel generation, add kernel string

* avoid generated code and ocl internal namespace

* fix misprint

* c_str
2018-11-23 17:51:15 +03:00
Alexander Alekhin de8696aa43 cmake: allow to disable ADE build too (BUILD_opencv_gapi=OFF is not enough)
CMake option: WITH_ADE=OFF
2018-11-23 12:52:41 +03:00
WuZhiwen 02cc1cd6e6 Merge pull request #13244 from wzw-intel:init_vulkan
* dnn/Vulkan: don't init Vulkan runtime if using other backend/target

Don't need to explictly call a init API but will automatically
init Vulkan environment the first time to use an VkCom object.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: depress compilier warning for "-Wsign-promo"

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-11-22 19:46:30 +03:00
Alexander Alekhin dc80f9d0fb Merge pull request #13243 from etienne02:3.4 2018-11-22 16:05:14 +00:00
Alexander Alekhin 0e6cf41923 Merge pull request #13241 from pasbi:master 2018-11-22 17:18:23 +03:00
Alexander Alekhin ad0d812aa0 Merge pull request #13239 from bramton:freebsd-build-fix 2018-11-22 14:17:35 +00:00
Bram 724620b476 Fixed build on FreeBSD 2018-11-22 09:23:09 +01:00
Etienne Brateau 736683ce2f Fix missing check part (defined(__cplusplus)) in header types_c.h 2018-11-22 01:39:09 +01:00
pascal 7579cd8068 updated documentation for imread and imwrite (added pfm image format) 2018-11-21 17:59:37 +01:00
Vitaly Tuzov e9e8bf4b81 Added performance tests for findContours 2018-11-21 19:57:02 +03:00
Vitaly Tuzov e1a2c034e8 Updated findContours to use wide universal intrinsics 2018-11-21 19:57:02 +03:00
Alexander Alekhin 6b346c92be Merge pull request #13236 from tomoaki0705:featureHighguiGetProp 2018-11-21 15:55:00 +00:00
Alexander Alekhin b6a447798a Merge pull request #13235 from berak:highgui_window_w32 2018-11-21 15:54:42 +00:00
Alexander Alekhin adf2013052 Merge pull request #13209 from alalek:issue_12865 2018-11-21 14:30:32 +00:00
Tomoaki Teshima a1c073d289 add missing API cvGetPropVisible_W32 2018-11-21 23:04:23 +09:00
berak 9344d0d0e3 highgui: restore convertscale semantics in window_w32.cpp 2018-11-21 11:05:24 +01:00
Alexander Alekhin 7fa7fa0226 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-21 08:33:39 +00:00
Alexander Alekhin 45d2e18808 Merge pull request #13232 from huangqinjin:openmp 2018-11-21 08:32:14 +00:00
huangqinjin e1ac8589f8 fix numThreadsMax for OpenMP
introduced by commit 4e62900009
2018-11-21 10:54:24 +08:00
Alexander Alekhin 6e67fd2752 Merge pull request #13224 from seiko2plus:core_ppc64le_infa 2018-11-20 21:26:05 +00:00
Sayed Adel 474a0dac49 core: several improves and fixes on ppc64le infrastructure
- add infrastructure support for Power9/VSX3
  - fix missing VSX flags on GCC4.9 and CLANG4(#13210, #13222)
  - fix disable VSX optimzation on GCC by using flag ENABLE_VSX
  - flag ENABLE_VSX is deprecated now, use CPU_BASELINE, CPU_DISPATCH instead
  - add VSX3 to arithmetic dispatchable flags
2018-11-20 15:28:46 +00:00
Alexander Alekhin 495cadddbd Merge pull request #13223 from dan-masek:fix_drawmatches_alpha 2018-11-20 14:59:35 +00:00
Alexander Alekhin 60b13d50c9 Merge pull request #13214 from 1over:fix_rect 2018-11-20 14:55:42 +00:00
Alexander Alekhin eaf39f6b6b Merge pull request #13213 from alalek:fix_format 2018-11-20 14:53:20 +00:00
Ruslan Garnov a3df05d93b Merge pull request #13215 from rgarnov:rg/overhead
* Added caching of agents execution sequence

* Merged linesRead() and nextWindow() methods on FluidAgent in one method

* Added caching of input lines for fluid::View

* Added caching of output lines for fluid::Buffer

* Fixed GAPI_Assert to work in standalone mode
2018-11-20 17:25:04 +03:00
Dan Mašek 2075fa9c15 Resolve #13219: Make randomly generated colours opaque. 2018-11-20 15:08:40 +01:00
Alexander Alekhin 798e2779f2 Merge pull request #13218 from dmatveev:fix_standalone 2018-11-20 13:25:13 +00:00
Dmitry Matveev 1b13df5368 G-API: Recent inclusion has broken STANDALONE build
This MR fixes this.
2018-11-20 14:00:08 +03:00
1over b6367f5821 fixed operator- for Rect 2018-11-20 00:48:17 +01:00
Alexander Alekhin d7272f76fb dnn: fix format 2018-11-19 19:33:56 +00:00
Alexander Alekhin 1317c3d178 cmake: don't generate dllmain for cudev module 2018-11-19 19:11:52 +03:00
Alexander Alekhin 36432cf4d9 Merge pull request #13181 from dkurt:ocv_dnn_fpga 2018-11-19 16:03:20 +00:00
Alexander Alekhin 605071e76f Merge pull request #13146 from terfendail:bilateral_nan 2018-11-19 15:59:12 +00:00
Alexander Alekhin 94d7c0f7f5 Merge pull request #13144 from dkurt:update_tf_mask_rcnn 2018-11-19 15:55:35 +00:00
Evgeny Latkin 083332f85f Merge pull request #13206 from elatkin:el/gapi_perf_rgb2lab
GAPI (fluid): RGB to Lab optimization (#13206)

* GAPI (fluid): BGR2LUV, RGB2Lab: performance test

* GAPI (fluid): BGR2LUV, RGB2Lab: using cv::hal::cvtBGRtoLab

* GAPI (fluid): BGR2LUV, RGB2Lab: hide reference code with #ifdef
2018-11-19 18:52:48 +03:00
Evgeny Latkin 6757c2c5a6 Merge pull request #13174 from elatkin:el/gapi_perf_rgb2yuv
GAPI (fluid): RGB to YUV optimization (#13174)

* GAPI (fluid): RGB to YUV: activate performance tests

* GAPI (fluid): speedup 4-8x RGB-to-YUV, 2.5x YUV to RGB with int16 arithmetic

* GAPI (fluid): RGB <--> YUV: fixed compiler warning

* GAPI (fluid): RGB <--> YUV: additional speedup 2-3x times (10-15x over original) via manual CV_SIMD

* GAPI (fluid): RGB <--> YUV: dynamic CV_SIMD dispatching
2018-11-19 17:30:14 +03:00
Dmitry Kurtaev 0d117312c9 DNN_TARGET_FPGA using Intel's Inference Engine 2018-11-19 11:41:43 +03:00
Alexander Alekhin 59e2ca16d9 Merge tag '4.0.0'
OpenCV 4.0.0
2018-11-18 09:22:00 +00:00
Alexander Alekhin 75ed282b20 release: OpenCV 4.0.0 (version++) 2018-11-18 09:19:28 +00:00
Alexander Alekhin 754956857c Merge tag '4.0.0-openvino'
OpenCV 4.0.0 for Intel(R) OpenVINO(TM) toolkit
2018-11-18 09:19:04 +00:00
Alexander Alekhin a4ab60920f Merge pull request #13195 from alalek:legacy_constants 2018-11-18 01:36:44 +00:00
Alexander Alekhin a574788e89 move legacy C-API constants into separate files 2018-11-17 23:47:51 +00:00
Alexander Alekhin 22dbcf98c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-17 14:17:35 +00:00
Alexander Alekhin 183bc5c281 Merge tag '3.4.4'
OpenCV 3.4.4
2018-11-17 13:00:28 +00:00
Alexander Alekhin a1fe8f754f OpenCV version++ (3.4.4)
OpenCV 3.4.4
2018-11-17 10:22:17 +00:00
Alexander Alekhin dd3398416b experimental version++ 2018-11-17 10:22:17 +00:00
Alexander Alekhin cf86af96ea Merge pull request #13194 from alalek:samples_fix_python_search_win32 2018-11-17 13:21:37 +03:00
Alexander Alekhin 780ae864a0 Merge pull request #13192 from alalek:fix_valgrind_3.4 2018-11-17 13:20:33 +03:00
berak 96c99c716a Merge pull request #13193 from berak:core_copyMakeBorder 2018-11-17 13:19:42 +03:00
Alexander Alekhin 73a17baeec samples(run_python): fix registry values querying 2018-11-17 09:42:51 +00:00
Alexander Alekhin c26dd5d7aa core: fix issues from valgrind builder 2018-11-17 07:32:06 +00:00
Alexander Alekhin 954969dd74 Merge pull request #13189 from alalek:cmake_options_warnings_update 2018-11-17 00:36:15 +03:00
Alexander Alekhin 43002c0c1d Merge pull request #13188 from alalek:samples_rename
* samples: rename starter_imagelist.cpp

* samples: rename intelperc_capture.cpp => videocapture_intelperc.cpp

* samples: rename openni_capture.cpp => videocapture_openni.cpp

* samples: rename image_sequence.cpp => videocapture_image_sequence.cpp

* samples: rename gstreamer_pipeline.cpp => videocapture_gstreamer_pipeline.cpp

* samples: rename autofocus.cpp => videocapture_gphoto2_autofocus.cpp

* samples: rename live_detect_qrcode.cpp => qrcode.cpp
2018-11-17 00:35:05 +03:00
Alexander Alekhin e580061b74 Merge pull request #12908 from alexevans:Issue11855 2018-11-16 20:42:54 +00:00
Dmitry Matveev d7540c9a3c Merge pull request #13176 from dmatveev:gapi_doxygen
G-API: Doxygen class reference

* G-API Doxygen documentation: covered cv::GComputation

* G-API Doxygen documentation: added sections on compile arguments

* G-API Doxygen documentation: restructuring & more text

* Added new sections (organized API reference into it);
* Documented GCompiled, compile args, backends, etc.

* G-API Doxygen documentation: documented GKernelPackage and added group for meta
2018-11-16 23:38:10 +03:00
Alexander Alekhin bea312bd65 Merge pull request #13183 from tomoaki0705:fixCaroteneColorConvert2Gray 2018-11-16 23:35:51 +03:00
Alexander Alekhin 3705648c9b Merge pull request #13184 from paroj:imshow_cvtscale 2018-11-16 20:34:22 +00:00
Alexander Alekhin 53af811530 cmake: emit warnings about unsupported options if turned ON only 2018-11-16 20:24:31 +00:00
Christopher Gundler b58a8729c2 Merge pull request #13131 from Christopher22:add_transposedConv_onnx
* Add support for ConvTranspose when parsing ONNX.

* Add support for ConvTranspose when parsing ONNX.

* Add test for Deconvolution
2018-11-16 22:50:40 +03:00
Alexander Alekhin ee417048e5 Merge pull request #13178 from alalek:fix_samples_python_video_params 2018-11-16 22:46:22 +03:00
Alexander Alekhin a4b21d9e2e Merge pull request #13177 from alalek:update_win32_scripts 2018-11-16 22:45:57 +03:00
Alexander Alekhin b321851e53 Merge pull request #12977 from alalek:python_package 2018-11-16 22:45:33 +03:00
Alexander Alekhin 1d5a528107 Merge pull request #12354 from alalek:samples_find_file 2018-11-16 22:40:49 +03:00
Alexander Alekhin a68835f7f1 features2d(test): add crossCheck=true test 2018-11-16 19:30:00 +00:00
Alexander Alekhin f2bec05e6d Merge pull request #12913 from dkurt:dnn_fix_ie_hyperparams 2018-11-16 18:36:12 +00:00
Alexander Alekhin c371df4aa2 samples: use findFile() in "python" 2018-11-16 18:08:22 +00:00
Alexander Alekhin 9ea8c775f8 samples: use findFile() in T-API samples 2018-11-16 18:08:22 +00:00
Alexander Alekhin e8e2197032 samples: use findFile() in dnn 2018-11-16 18:08:22 +00:00
Alexander Alekhin c4c31f5bba samples: use findFile() in "cpp" 2018-11-16 18:08:22 +00:00
Alexander Alekhin 940dc1f2b7 Merge pull request #13151 from paroj:nocapmodes 2018-11-16 17:20:48 +00:00
Pavel Rojtberg f54b230906 highgui: Qt - restore convertscale semantics
broken in 11eafca3e2
2018-11-16 16:13:05 +01:00
Tomoaki Teshima 3bbc4e44c3 fix test failure of ColorCvtRGB2Gray
- update parameter in carotene
2018-11-16 23:31:01 +09:00
Vitaly Tuzov 9ad1a84853 Unrolled bilateral filter neighbor processing loop 2018-11-16 13:51:46 +03:00
Vitaly Tuzov f5b6bea2d4 Raised bilateralFilter processing precision for CV_32F matrices containing NaNs 2018-11-16 12:07:04 +03:00
Alexander Alekhin ce6acd3ecd python: bindings loader package
Configures and loads OpenCV bindings extension including 3rdparty dependencies

Based on running Python specify:
- configure PYTHON_PATH (via "sys.path")
- configure LD_LIBRARY_PATH / PATH
2018-11-16 00:51:16 +00:00
Alexander Alekhin 1c04a5ec47 Merge pull request #12965 from terfendail:medianBlur_wintr 2018-11-16 00:47:11 +00:00
Alexander Alekhin 2fa9bd221d core: add utils::findDataFile() / samples::findFile() 2018-11-16 00:25:06 +00:00
Alexander Alekhin 9ca82caeb7 samples(python): fix drive handling in source path 2018-11-16 00:24:34 +00:00
Alexander Alekhin 5cf84c3765 samples: update Python launcher (winpack) 2018-11-15 23:36:26 +00:00
Alexander Alekhin 3d68b5baa1 samples: update build script (winpack)
- drop EnableDelayedExpansion
2018-11-15 23:36:26 +00:00
Alexander Alekhin 8792bddb0a win32: update setupvars.cmd
- drop EnableDelayedExpansion
- pause on failed commands (non-interactive mode)
2018-11-15 23:36:26 +00:00
Alexander Alekhin e5afa62c3d Merge pull request #13168 from alalek:cmake_dnn_warnings 2018-11-15 23:10:46 +00:00
Alexander Alekhin 33e824f5de Merge pull request #13175 from paddy74:patch-1 2018-11-16 02:10:18 +03:00
Patrick Cox 6820abd67f samples(python): Updated use of model.load instances
The load() function returns a new object, and as such does not use the one it is called on.
This commit updates the uses of model.load in this program so it will work as intended and not throw an error.
2018-11-15 22:14:40 +00:00
Dmitry Kurtaev b5c54e447c Extra hyperparameters for Intel's Inference Engine layers 2018-11-15 20:06:37 +03:00
Evgeny Latkin f81370232a Merge pull request #13162 from elatkin:el/gapi_perf_rgb2gray
GAPI (fluid): RGB/BGR to gray: optimization (#13162)

* GAPI (fluid): RGB/BGR to Gray: add performance tests

* GAPI (fluid): RGB/BGR to Gray: speedup 8-12x with manual CV_SIMD

* GAPI (fluid): RGB/BGR to Gray: fix compiler warning

* GAPI (fluid): RGB/BGR to Gray: dynamic dispatching to AVX2

* GAPI (fluid): RGB/BGR to Gray: check R/G/B coefficients

* GAPI (fluid): RGB/BGR to Gray: fixed compilation error (caused by change in master)
2018-11-15 18:14:27 +03:00
Dmitry Matveev 85fad1504a Merge pull request #13030 from dmatveev:tutorial
* G-API: First steps with tutorial

* G-API Tutorial: First iteration

* G-API port of anisotropic image segmentation tutorial;
* Currently works via OpenCV only;
* Some new kernels have been required.

* G-API Tutorial: added chapters on execution code, inspection, and profiling

* G-API Tutorial: make Fluid kernel headers public

For some reason, these headers were not moved to the public
headers subtree during the initial development. Somehow it even
worked for the existing workloads.

* G-API Tutorial: Fix a couple of issues found during the work

* Introduced Phase & Sqrt kernels, OCV & Fluid versions
* Extended GKernelPackage to allow kernel removal & policies on include()

All the above stuff needs to be tested, tests will be added later

* G-API Tutorial: added chapter on running Fluid backend

* G-API Tutorial: fix a number of issues in the text

* G-API Tutorial - some final updates

- Fixed post-merge issues after Sobel kernel renaming;
- Simplified G-API code a little bit;
- Put a conclusion note in text.

* G-API Tutorial - fix build issues in test/perf targets

Public headers were refactored but tests suites were not updated in time

* G-API Tutorial: Added tests & reference docs on new kernels

* Phase
* Sqrt

* G-API Tutorial: added link to the tutorial from the main module doc

* G-API Tutorial: Added tests on new GKernelPackage functionality

* G-API Tutorial: Extended InRange tests to cover 32F

* G-API Tutorial: Misc fixes

* Avoid building examples when gapi module is not there
* Added a volatile API disclaimer to G-API root documentation page

* G-API Tutorial: Fix perf tests build issue

This change came from master where Fluid kernels are still used
incorrectly.

* G-API Tutorial: Fixed channels support in Sqrt/Phase fluid kernels

Extended tests to cover this case

* G-API Tutorial: Fix text problems found on team review
2018-11-15 18:12:36 +03:00
Alexander Alekhin 1d10d56651 Merge pull request #13173 from dkurt:dnn_fix_vulkan_pool 2018-11-15 12:56:10 +00:00
Dmitry Kurtaev ef5d921eac Fix Vulkan's max pooling in case of no output indices 2018-11-15 14:10:54 +03:00
Alexander Alekhin 96c71dd3d2 dnn: reduce set of ignored warnings 2018-11-15 13:15:59 +03:00
Alexander Alekhin 8409aa9eba Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-14 19:41:09 +00:00
Alexander Alekhin 02d2cc58d7 Merge pull request #13164 from alalek:ocl_morph 2018-11-14 19:32:32 +00:00
Alexander Alekhin 452f0bb2ab Merge pull request #13166 from catree:fix_batch_norm_layer_missing_intrin 2018-11-14 19:02:17 +00:00
catree 10b482ff1e Fix code and missing intrin header. Remove useless header. 2018-11-14 19:00:59 +01:00
Alexander Alekhin 42742727d6 imgproc(ocl): fix morph generic filter checks
'ksize' is not updated with 'kernel'
2018-11-14 20:15:01 +03:00
Alexander Alekhin ca9aa180c1 Merge pull request #13096 from alalek:gapi_tests_checks 2018-11-14 15:59:01 +00:00
Alexander Alekhin ce46cc9852 Merge pull request #13153 from savuor:fix/filenodeit_member_ptr 2018-11-14 14:22:58 +00:00
Alexander Alekhin 47cb94e634 Merge pull request #13160 from dkurt:fix_13159 2018-11-14 14:18:21 +00:00
Alexander Alekhin 39f327acdb Merge pull request #13157 from elatkin:el/gapi_perf_sobel_3 2018-11-14 13:19:30 +00:00
Dmitry Kurtaev 80265a0815 Fix a bug with OpenVINO backend 2018-11-14 13:42:06 +03:00
Alexander Alekhin 6189b47648 gapi(test): more reliable checks
avoid `countNonZero()`, use `norm()`
2018-11-14 13:30:53 +03:00
Alexander Alekhin dd6f5949c2 gapi(test): use relative error check for Norm/Sum tests 2018-11-14 13:30:53 +03:00
Latkin, Yevgeny I a62539489d GAPI (fluid): Sobel 3x3 optimization: remove needless file 2018-11-14 10:17:40 +03:00
Alexander Alekhin 70ac734263 Merge pull request #13152 from ssnover95:docfix/fourier-transform-py-tutorial 2018-11-13 22:05:25 +03:00
ssnover95 b24a815ac1 doc(tutorial_py_fourier_transform): Correct errors in tutorial for integer division and filter symmetry 2018-11-13 12:45:23 -05:00
Rostislav Vasilikhin d6b2739525 removed FileNodeIterator::operator->() 2018-11-13 20:18:53 +03:00
Pavel Rojtberg 846a500fb4 videoio: drop VideoCaptureModes enum in favour of fourcc 2018-11-13 17:20:24 +01:00
Alexander Alekhin 8b7f805642 Merge pull request #13150 from dmatveev:update_ade011d 2018-11-13 16:18:32 +00:00
Evgeny Latkin cc5190eb91 Merge pull request #13133 from elatkin:el/gapi_perf_sobel_2
GAPI (fluid): Sobel 3x3 optimization: CV_SIMD dynamic dispatching (#13133)

* GAPI (fluid): Sobel 3x3: remove template for run_sobel_row()

* GAPI (fluid): Sobel 3x3: dynamic dispatching of CV_SIMD code

* GAPI (fluid): Sobel 3x3 optimization: fixed CV_SIMD dynamic dispatcher
2018-11-13 17:48:10 +03:00
Dmitry Matveev 4eff798270 Update ADE to version 0.1.1d 2018-11-13 16:44:29 +03:00
Evgeny Latkin 4e40e5bb88 Merge pull request #13070 from elatkin:el/gapi_perf_sobel
GAPI (fluid): optimization of Sobel 3x3 (#13070)

* GAPI: performance test for Sobel

* GAPI: performance test for Sobel w/FP32 input

* GAPI: Sobel speedup: 2.5x (U8) up to 10x (float)

* GAPI: Sobel 3x3 to support U8 into S16

* GAPI (fluid): Sobel 3x3 speedup: 10% (uchar), 1.5x (float)

* GAPI (fluid): Sobel 3x3 speedup: +10x (uchar), but -20% (float)

* GAPI (fluid): Sobel 3x3 speedup: +10% (float)

* GAPI (fluid): Sobel 3x3 speedup: +15% (float), +10% (uchar)

* GAPI (fluid): Sobel 3x3: address GCC warnings

* GAPI (fluid): Sobel 3x3: separate *.cpp file w/SIMD code

* GAPI (fluid): Sobel 3x3: fixed AVX2 code, AVX2 speedup 20-50% (uchar), 10-20% (float)

* GAPI (fluid): Sobel 3x3: fix CV_SIMD code for AVX2

* GAPI (fluid): Sobel 3x3: refactor
2018-11-13 15:04:37 +03:00
Dmitry Kurtaev 1a27ff4518 Update Mask-RCNN networks generator 2018-11-13 13:22:39 +03:00
Alexander Alekhin a456b968cf Merge tag '4.0.0-rc'
OpenCV 4.0.0-rc
2018-11-12 21:42:02 +00:00
Alexander Alekhin a6387c3012 release: OpenCV 4.0.0-rc (version++) 2018-11-12 19:39:09 +00:00
Alexander Alekhin 5f2074d757 Merge pull request #13140 from alalek:opencv3_opencv4 2018-11-12 22:34:10 +03:00
Alexander Alekhin 2a9c81eb25 Merge pull request #13124 from alalek:workaround_13121 2018-11-12 22:33:47 +03:00
Alexander Alekhin 65fb8ae33e Merge pull request #13137 from alalek:videoio_v4l_disable_normalization 2018-11-12 22:15:00 +03:00
Alexander Alekhin dc88c9f3a2 Merge pull request #13127 from alalek:fix_13114 2018-11-12 22:11:40 +03:00
Alexander Alekhin fc3fc6005e Merge pull request #13126 from mshabunin:remove_libv4l 2018-11-12 22:10:49 +03:00
Alexander Alekhin 27fd913c86 build: fix version 3->4 2018-11-12 19:05:58 +00:00
Alexander Alekhin e0e828ef5c videoio: remove using of HAVE_CAMV4L 2018-11-12 18:53:19 +00:00
Alexander Alekhin 9992c4d275 stitching(test): workaround ParallelFeaturesFinder.IsSameWithSerial 2018-11-12 20:17:28 +03:00
Maksim Shabunin ab65b9745b Repair V4L backend 2018-11-12 20:04:33 +03:00
Alexander Alekhin 4e3ab026fe videoio(v4l): turn off normalization of V4L properties 2018-11-12 19:10:13 +03:00
Alexander Alekhin f5b212a9d4 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-12 17:58:45 +03:00
Alexander Alekhin e31eb46123 Merge pull request #13123 from dkurt:fs_keys 2018-11-12 17:46:49 +03:00
Alexander Alekhin 326be0d7ba Merge pull request #13115 from catree:fix_dis_flow_intrin 2018-11-12 17:44:12 +03:00
Alexander Alekhin cae2992af1 Merge pull request #13125 from dkurt:fs_keys_test 2018-11-12 14:33:14 +00:00
Alexander Alekhin 265cb58750 Merge pull request #13112 from alalek:fix_coverity_reports_3.4 2018-11-12 14:32:51 +00:00
Alexander Alekhin b5610e77a7 Merge pull request #12983 from allnes:parallel_qrcode_pipeline 2018-11-12 14:32:29 +00:00
Alexander Alekhin 48cf103441 Merge pull request #13128 from alalek:fix_13114_3.4 2018-11-12 14:17:56 +00:00
Alexander Nesterov 82c2aa6e65 Added bugfix and some tests 2018-11-12 12:08:02 -01:00
Alexander Alekhin c54676d625 cmake: fix supporting of legacy flags 2018-11-12 14:11:57 +03:00
Alexander Alekhin e5c39ed48a cmake: fix Android features detection
avoid using of ENABLE_* flags
2018-11-12 13:51:52 +03:00
Pavel Rojtberg 0d65397ae7 videoio: remove cap_libv4l in favour of cap_v4l
cap_libv4l depends on an external library (libv4l) yet is still larger
(1966 loc vs 1822 loc).
It was initially introduced copy pasting cap_v4l in order to offload
various color conversions to libv4l.
However nowadays we handle most of the needed color conversions inside
OpenCV. Our own implementation is better tested and (probably) also
better performing. (as it can optionally leverage IPP/ OpenCL)

Currently cap_v4l is better maintained and generally the code is in
better shape. There is however an API
difference in getting unconverted frames:
* on cap_libv4l one need to set `CV_CAP_MODE_GRAY=1` or
`CV_CAP_MODE_YUYV=1`
* on cap_v4l one needs to set `CV_CAP_PROP_CONVERT_RGB=0`

the latter is more flexible though as it also allows accessing undecoded
JPEG images.

fixes #4563
2018-11-12 13:38:59 +03:00
Dmitry Kurtaev 6c76c8f881 Add a test for FileNode::keys() 2018-11-12 13:38:18 +03:00
Dmitry Kurtaev a7f30391d0 Add FileNode::keys() missed during refactoring 2018-11-12 13:34:01 +03:00
catree c96850ba59 Fix missing intrin.hpp header in dis_flow.cpp.
Fix #ifdef CV_SIMD128, should be #if CV_SIMD128.
2018-11-11 23:34:04 +01:00
Alexander Alekhin 5459c11e99 Merge pull request #12896 from alalek:cmake_deprecate_pkgconfig 2018-11-11 22:12:41 +00:00
Alexander Alekhin 93d1785820 Merge pull request #13107 from alalek:core_divzero_simd_test 2018-11-11 22:01:50 +00:00
Alexander Alekhin 801c943009 fix coverity reports 2018-11-11 13:51:47 +00:00
Alexander Alekhin e755a2a6e4 cmake: OPENCV_GENERATE_PKGCONFIG 2018-11-10 22:47:26 +00:00
Alexander Alekhin 96ee83898d core(test): extend divideByZero test
to verify SIMD code path
2018-11-10 22:17:19 +00:00
Alexander Alekhin 1913482cf5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-10 20:50:26 +00:00
Alexander Alekhin 56eebb926d Merge pull request #13102 from alalek:issue_13101 2018-11-10 19:11:06 +00:00
Alexander Alekhin c7d04c6c5c Merge pull request #13104 from alalek:docs_fix_bib_Kroeger2016
docs: fix Kroeger2016 bib reference

move from opencv_contrib
2018-11-10 20:11:28 +03:00
Jiri Horner 1ba7c728a6 Merge pull request #12827 from hrnr:stitching_4
[evolution] Stitching for OpenCV 4.0

* stitching: wrap Stitcher::create for bindings

* provide method for consistent stitcher usage across languages

* samples: add python stitching sample

* port cpp stitching sample to python

* stitching: consolidate Stitcher create methods

* remove Stitcher::createDefault, it returns Stitcher, not Ptr<Stitcher> -> inconsistent API
* deprecate cv::createStitcher and cv::createStitcherScans in favor of Stitcher::create

* stitching: avoid anonymous enum in Stitcher

* ORIG_RESOL should be double
* add documentatiton

* stitching: improve documentation in Stitcher

* stitching: expose estimator in Stitcher

* remove ABI hack

* stitching: drop try_use_gpu flag

* OCL will be used automatically through T-API in OCL-enable paths
* CUDA won't be used unless user sets CUDA-enabled classes manually

* stitching: drop FeaturesFinder

* use Feature2D instead of FeaturesFinder
* interoperability with features2d module
* detach from dependency on xfeatures2d

* features2d: fix compute and detect to work with UMat vectors

* correctly pass UMats as UMats to allow OCL paths
* support vector of UMats as output arg

* stitching: use nearest interpolation for resizing masks

* fix warnings
2018-11-10 19:53:48 +03:00
Alexander Alekhin 57a30a1dd8 Merge pull request #13097 from alalek:backport_13086 2018-11-10 13:36:06 +00:00
Alexander Alekhin 142a07cbbf Merge pull request #13103 from alalek:fix_doc_links_3.4 2018-11-10 16:34:47 +03:00
Alexander Alekhin 0e9ac7265d docs: fix links
- cv::at => cv::Mat::at()
- removed unnecessary @ref
2018-11-10 12:00:02 +00:00
Alexander Alekhin 858a7da5c0 core: rework getContinuousSize() for vector-col/row support 2018-11-10 11:08:28 +00:00
Alexander Alekhin be9b676db3 Merge pull request #13072 from gineshidalgo99:Pendantic_warning 2018-11-09 22:52:41 +00:00
Vadim Pisarevsky 82e8657a6d backport: refined QRCodeDetector API for OpenCV 4.0 2018-11-09 22:27:38 +00:00
Alexander Alekhin 8675a8c743 Merge pull request #12878 from tompollok:3.4 2018-11-09 19:54:17 +00:00
Alexander Alekhin 75a6eaf147 Merge pull request #13024 from rgarnov:gapi_fix_lut_test 2018-11-09 19:16:39 +00:00
Alexander Alekhin 533bfba75c Merge pull request #12962 from paroj:manualwb 2018-11-09 19:15:49 +00:00
Matt Bennett 10e1c2b3cd Merge pull request #11935 from mattmyne:filestorage_matx
* Support for Matx read/write by FileStorage

* Only empty filestorage read now produces default Matx. Split Matx IO test into smaller units. Test checks for exception thrown if reading a Mat into a Matx of different size.
2018-11-09 20:05:59 +03:00
Alexander Alekhin a1dd30ed50 Merge pull request #13094 from alalek:ocl_reduce_sync 2018-11-09 16:44:10 +00:00
Pavel Rojtberg afa0f80c61 videoio: add manual white-balance and implement it for V4L2 2018-11-09 17:14:33 +01:00
Vitaly Tuzov 2dd98e7cc6 bilateralFilter implementation moved to separate file 2018-11-09 18:26:26 +03:00
Alexander Alekhin f74f1a94fe core(ocl): run "reduce" kernels in synchronous mode 2018-11-09 17:57:13 +03:00
Vadim Pisarevsky 96bf26611e Merge pull request #13084 from vpisarev:shuffle_optflow_algos
* moved DIS optical flow from opencv_contrib to opencv, moved TVL1 from opencv to opencv_contrib

* fixed compile warning

* TVL1 optical flow example moved to opencv_contrib
2018-11-09 17:52:06 +03:00
Vadim Pisarevsky 841741aa52 significantly reduced OpenCV binary size by disabling IPP in some funcs (#13085)
* significantly reduced OpenCV binary size by disabling IPP calls in some OpenCV functions: Sobel, Scharr, medianBlur, GaussianBlur, filter2D, mean, meanStdDev, norm, sum, minMaxIdx, sort.

* re-enable IPP in norm, since it's much faster (without adding too much space overhead)
2018-11-09 17:39:29 +03:00
Alexander Alekhin 596ada51f3 Merge pull request #13080 from alalek:issue_13078 2018-11-09 13:20:27 +00:00
Vadim Pisarevsky 8f15a609af mostly removed obsolete C API from calib3d (at least at the interface level) (#13081) 2018-11-09 16:12:22 +03:00
Vitaly Tuzov 28fd967148 Updated bilateralFilter implementations to use wide universal intrinsics 2018-11-09 15:27:30 +03:00
Vadim Pisarevsky 8cdf7bb84b refined QRCodeDetector API for OpenCV 4.0 (#13086)
* refined QRCodeDetector API for OpenCV 4.0

* expanded and tested QRCodeDetector::detectAndDecode()
2018-11-09 12:57:27 +03:00
Alexander Alekhin 6fb780eae6 Merge pull request #13088 from alalek:gapi_fix_arm_build 2018-11-09 12:25:52 +03:00
Ruslan Garnov 858ba6c798 Fixed uniniitialized mats in tests, added operator<< for compare_f 2018-11-09 12:00:55 +03:00
Alexander Alekhin 386733aea1 gapi: fix ARM build 2018-11-09 06:37:48 +00:00
Vadim Pisarevsky 11eafca3e2 removed C API in the following modules: photo, video, imgcodecs, videoio (#13060)
* removed C API in the following modules: photo, video, imgcodecs, videoio

* trying to fix various compile errors and warnings on Windows and Linux

* continue to fix compile errors and warnings

* continue to fix compile errors, warnings, as well as the test failures

* trying to resolve compile warnings on Android

* Update cap_dc1394_v2.cpp

fix warning from the new GCC
2018-11-09 00:52:09 +03:00
Dmitry Budnikov 5087ff0814 Merge pull request #13008 from dbudniko:dbudniko/gpu_opencl_backend
G-API GPU-OpenCL backend (#13008)

* gpu/ocl backend core

* accuracy tests added and adjusted + license headers

* GPU perf. tests added; almost all adjusted to pass

* all tests adjusted and passed - ready for pull request

* missing license headers

* fix warning (workaround RGB2Gray)

* fix c++ magic

* precompiled header

* white spaces

* try to fix warning and blur test

* try to fix Blur perf tests

* more alignments with the latest cpu backend

* more gapi tests refactoring + 1 more UB issue fix + more informative tolerance exceed reports

* white space fix

* try workaround for SumTest

* GAPI_EXPORTS instead CV_EXPORTS
2018-11-08 22:14:53 +03:00
Alexey Nikolaev 8396ae6e4f Merge pull request #12893 from aleksey-nikolaev:cap-update
V4L (V4L2): Refactoring. Added missed camera properties. Fixed getting `INF` for some properties. Singlethread as always (#12893)

* cap_v4l:
1 Added cap_properties verbalization.
2 Set Get of properties elementary refactoring.
3 Removed converting parameters to/from [0,1] range.
4 Added all known conversion from V4L2_CID_* to CV_CAP_PROP_*

* cap_v4l:
1. Removed all query for parameters range.
2. Refactored capture initialization.
3. Added selecting input channel by CV_CAP_PROP_MODE. Default value -1 the channels not changed.

* cap_v4l:
1. Refactoring of Convert To RGB

* cap_v4l:
1. Fixed use of video buffer index.
2. Removed extra memcopy for grab image.
3. Removed device closing from autosetup_capture_mode_v4l2

* cap_v4l:
1. The `goto` was eliminated
2. Fixed use of temporary buffer index for V4L2_PIX_FMT_SN9C10X
3. Fixed use of the bufferIndex
4. Removed trailing spaces and unused variables.

* cap_v4l:
1. Alias for capture->buffers[capture->bufferIndex]
2. Reduced size of data for memcpy: bytesused instead of length
3. Refactoring. Code duplication. More info for debug

* cap_v4l:
1. Added the ability to grab and retrieveFrame independently several times

* cap_v4l:
1. Not need to close/open device for new capture parameters applying.
2. Removed using of device name as a flag that the capture is closed. Added sufficient function.
3. Refactoring. Added requestBuffers and createBuffers

* cap_v4l:
1. Added tryIoctl with `select` like was in mainloop_v4l2.
2. Fixed buffer request for device without closing the device.
3. Some static function moved to CvCaptureCAM_V4L
4. Removed unused defines

* cap_v4l:
1. Thread-safe now

* cap_v4l:
1. Fixed thread-safe destructor
2. Fixed FPS setting

* Missed brake

* Removed thread-safety

* cap_v4l:
1. Reverted conversion parameters to/from [0,1] by default for backward compatibility.
2. Added setting for turn off compatibility mode: set CV_CAP_PROP_MODE to 65536
3. Most static functions moved to CvCaptureCAM_V4L
4. Refactoring of icvRetrieveFrameCAM_V4L and using of frame_allocated flag

* cap_v4l:
1. Added conversion to RGB from NV12, NV21
2. Refactoring. Removed wrappers for known format conversions.

* Added `CAP_PROP_CHANNEL` to the enum VideoCaptureProperties.
CAP_V4L migrated to use VideoCaptureProperties.

* 1. Update comments.
2. Environment variable `OPENCV_VIDEOIO_V4L_RANGE_NORMALIZED` for setting default backward compatibility mode.
3. Revert getting of `CAP_PROP_MODE` as fourcc code in backward compatibility mode.

* videoio: update cap_v4l - compatibilityMode => normalizePropRange

* videoio(test): V4L2 MJPEG test

`v4l2-ctl --list-formats` should have 'MJPG' entry

* videoio: fix buffer initialization

to avoid "munmap: Invalid argument" messages
2018-11-08 21:27:45 +03:00
Alexander Alekhin 5059523937 core: fix processing of vector-rows 2018-11-08 20:04:22 +03:00
tompollok 2da56d5af6 refactoring catching all exceptions as const ref 2018-11-08 19:59:47 +03:00
Alexander Alekhin b74b05d1b3 Revert CV_TRY/CV_CATCH macros
This reverts commit 7349b8f5ce (partially).
2018-11-08 19:56:52 +03:00
Alexander Alekhin 0c261acf3a Merge pull request #13065 from dkurt:dnn_update_tf_faster_rcnn 2018-11-08 16:31:39 +00:00
Alexander Alekhin 4b298a7460 Merge pull request #13076 from berak:fix_digits_video_py 2018-11-08 16:30:41 +00:00
Alexander Alekhin ebc8015638 Merge pull request #13074 from alalek:cleanup_videoio 2018-11-08 19:09:32 +03:00
Alexander Alekhin 35c7cab742 Merge pull request #13073 from alalek:cleanup_carbon 2018-11-08 19:08:33 +03:00
Alexander Alekhin c1921f1b12 Merge pull request #13069 from alalek:move_viz_contrib 2018-11-08 19:04:31 +03:00
Alexander Alekhin 9b978afaa2 Merge pull request #13029 from alalek:move_videostab_contrib 2018-11-08 19:03:14 +03:00
Alexander Alekhin 6adbbcdde1 Merge pull request #11680 from alalek:videoio_deprecate_dshow_vfw 2018-11-08 14:07:50 +00:00
Alexander Alekhin 92a58a0eae Merge pull request #12454 from jveitchmichaelis:y16_dshow_windows 2018-11-08 14:05:23 +00:00
Alexander Alekhin bb7cfcbcdb Merge pull request #12064 from seiko2plus:coreUnvintrinArithm2 2018-11-08 14:02:40 +00:00
Alexander Alekhin 467eb4d240 Merge pull request #12901 from alalek:cmake_unsupported_option_warning 2018-11-08 12:21:38 +00:00
Alexander Alekhin cfb30572cb videoio: deprecate Video for Windows (VFW)
consider using MSMF backend
2018-11-08 14:53:54 +03:00
Alexander Alekhin 997ad12730 Merge pull request #12985 from wzw-intel:vkcom_refine 2018-11-08 10:26:57 +00:00
berak f30eafc9ac samples: fix digits_video.py 2018-11-08 09:17:41 +01:00
unknown 13ede34516 Add support for changing fourcc and support mono formats (e.g. Y8, Y16) 2018-11-07 21:03:36 +00:00
Alexander Alekhin 777eaa7352 Merge pull request #13057 from sturkmen72:Mat_to_IOArray 2018-11-07 21:00:14 +00:00
Vitaly Tuzov e5d7f446d6 Merge pull request #13056 from terfendail:box_wintr
* Updated boxFilter implementations to use wide universal intrinsics

* boxFilter implementation moved to separate file

* Replaced ROUNDUP macro with roundUp() function
2018-11-07 23:59:36 +03:00
Alexander Alekhin c72b6b3be8 Merge pull request #13043 from alalek:compatibility_12623 2018-11-07 20:54:40 +00:00
Alexander Alekhin 028ecc6c02 Merge pull request #13037 from alalek:cmake_build_3rdparty_flag 2018-11-07 20:54:10 +00:00
Alexander Alekhin 92a015b8bd Merge pull request #12897 from alalek:cmake_deprecate_pkgconfig_3.4 2018-11-07 20:53:18 +00:00
Alexander Alekhin bb61a2547a Merge pull request #13061 from alalek:ffmpeg_update 2018-11-07 19:59:41 +00:00
Alexander Alekhin cdaca22511 Merge pull request #12891 from marcoag:master 2018-11-07 19:21:43 +00:00
Alexander Alekhin fb96b7da60 Merge pull request #13067 from catree:fix_getPerfProfile_overflow 2018-11-07 17:13:21 +00:00
Alexander Alekhin 5869415a57 videoio: drop obsolete backends
- VFW
- QuickTime/QtKit
- Unicap - GPL, no active support: https://github.com/unicap/unicap
- DC1394 (1st version) / CMU1394
2018-11-07 19:49:09 +03:00
gineshidalgo99 b5248da826 Fixed pendantic warnings 2018-11-07 11:23:21 -05:00
Alexander Alekhin b059a361dd highgui: drop obsolete Carbon API
https://en.wikipedia.org/wiki/Carbon_(API)

In 2012, with the release of OS X 10.8 Mountain Lion, most Carbon APIs were considered deprecated.
2018-11-07 19:21:33 +03:00
Dmitry Kurtaev dc9e6d3af8 Update a script to generate text graphs for Faster-RCNN networks from TensorFlow 2018-11-07 18:33:01 +03:00
Alexander Alekhin 3c99dc96b1 Merge pull request #13001 from rgarnov:gapi_standalone_cmake 2018-11-07 15:12:29 +00:00
Alexander Alekhin dadba232de viz: move samples/tutorials to opencv_contrib 2018-11-07 17:11:26 +03:00
Alexander Alekhin 787f5236a9 viz: move to opencv_contrib 2018-11-07 16:14:10 +03:00
Alexander Alekhin 31498ebbea videostab: move sample to opencv_contrib 2018-11-07 15:49:35 +03:00
Alexander Alekhin 9636ffc471 videostab: move to opencv_contrib 2018-11-07 15:41:04 +03:00
Alexander Alekhin b17e1531d2 Merge pull request #13026 from alalek:move_superres_contrib 2018-11-07 12:36:55 +00:00
Alexander Alekhin 05dc645b81 Merge pull request #13025 from alalek:move_shape_contrib 2018-11-07 12:36:30 +00:00
Alexander Alekhin d4f038dfcc ffmpeg: update 4.1 (OpenCV 4.x branch)
ffmpeg 4.0.2 -> 4.1
2018-11-07 15:15:04 +03:00
catree eebf0dd7c9 Fix integer overflow when accumulating timing values. 2018-11-07 13:04:48 +01:00
Ruslan Garnov c972c94662 Added Standalone.cmake 2018-11-07 14:54:18 +03:00
Wu Zhiwen 33c9d57c6f dnn/Vulkan: skip heavy convolution task
This is a workaround for GPU hang on heavy convolution workload (> 10 GFLOPS).
e.g. ResNet101_DUC_HDC

For the long time task, vkWaitForFences() return without error but next call on
vkQueueSubmit() return -4, i.e. "VK_ERROR_DEVICE_LOST" and driver reports GPU hang.

Need more investigation on root cause of GPU hang and need to optimize convolution shader
to reduce process time.
2018-11-07 16:38:36 +08:00
Marco A. Gutierrez 6b3469268e minor typo corrections to python tutorials 2018-11-07 16:18:52 +08:00
Alexander Alekhin e75576e1ab Merge pull request #13034 from alalek:ffmpeg_update_3.4 2018-11-06 23:52:49 +03:00
Alexander Alekhin d9be552bbc Merge pull request #13006 from alalek:cmake_setup_vars
cmake: introduce setup_vars scripts
2018-11-06 23:52:00 +03:00
Alexander Alekhin 18c44b2ce8 Merge pull request #13036 from berak:java_MatOfRotatedRect_utils 2018-11-06 20:28:45 +00:00
Alexander Alekhin 4531f9f2f4 Merge pull request #13023 from terfendail:medianBlur_sep 2018-11-06 20:22:08 +00:00
Alexander Alekhin 2c6f1ab57d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-06 20:04:31 +00:00
Evgeny Latkin 000110e760 Merge pull request #13052 from elatkin:yl/gapi_sobel3x3_f32_v2
* GAPI: Sobel 3x3 with FP32 input

* GAPI: Sobel 3x3 with FP32 input, v2
2018-11-06 23:08:50 +03:00
Alexander Alekhin 30b16e0a5a Merge pull request #13005 from alalek:samples_gpu_drop_legacy 2018-11-06 18:41:28 +00:00
Alexander Alekhin fa91e4ff27 Merge pull request #12999 from fegorsch:improve-circle-detector 2018-11-06 18:40:55 +00:00
Alexander Alekhin 7a686a0c43 Merge pull request #13010 from dkurt:fix_cl_eye_fp16 2018-11-06 18:36:09 +00:00
Alexander Alekhin d4e3405db2 Merge pull request #13045 from LaurentBerger:kmeansdoc
typo in kmeans doc
2018-11-06 20:00:47 +03:00
Alexander Alekhin 857b64efef Merge pull request #13040 from alalek:docs_cleanup_3.4 2018-11-06 19:51:47 +03:00
Alexander Alekhin 835e4b6de9 Merge pull request #13032 from ijean:mingw-w64-build 2018-11-06 16:26:56 +00:00
Alexander Alekhin 0a5301bc5b Merge pull request #13041 from berak:docs_highgui 2018-11-06 19:19:51 +03:00
Alexander Alekhin 572af7640f Merge pull request #13053 from berak:highgui_win32_waitkey 2018-11-06 16:18:11 +00:00
lqy123000 cceeca3052 Merge pull request #12916 from lqy123000:bugfix_templmatch
* avoid rounding errors

* imgproc: replace condition in matchTemplate
2018-11-06 19:13:48 +03:00
Alexander Alekhin 3a4bc0d41e Merge pull request #13055 from vpisarev:remove_old_haar 2018-11-06 16:01:28 +00:00
Alexander Alekhin d9d8ad20a0 Merge pull request #13033 from alalek:videoio_fix_ffmpeg_3.4 2018-11-06 15:56:57 +00:00
berak eaee63d96b java: add converters, tests for MatOfRotatedRect 2018-11-06 16:40:56 +01:00
Alexander Alekhin cfb02b5370 shape: move sample to opencv_contrib 2018-11-06 16:52:17 +03:00
Vadim Pisarevsky b8175f8976 removed the old C API for Haar-based object detection; use CascadeClassifier from now on 2018-11-06 15:39:37 +03:00
berak cae2a53563 highgui: fix broken waitKey() condition in window_w32 2018-11-06 11:43:58 +01:00
Suleyman TURKMEN 182f43b6f9 Update imgproc.hpp 2018-11-05 04:48:49 +03:00
LaurentBerger 5132102863 typo in kmeans doc 2018-11-04 21:30:31 +01:00
Alexander Alekhin 4395c1b9f8 videoio: backport "VideoCapture(int index, int apiPreference)" interface 2018-11-04 17:27:47 +00:00
berak 6d2a97e954 docs: remove NULL strings from highgui.hpp 2018-11-04 12:59:35 +01:00
Alexander Alekhin 79dc0ed175 docs: intro formatting update, minor cleanup 2018-11-04 02:36:24 +00:00
Alexander Alekhin b3d201f148 cmake: OPENCV_FORCE_3RDPARTY_BUILD build flag 2018-11-03 11:57:34 +00:00
Alexander Alekhin 2007e1d8a3 ffmpeg: update 3.4.5 (OpenCV 3.4 branch)
ffmpeg 3.4.2 -> 3.4.5
2018-11-03 03:10:10 +00:00
Alexander Alekhin c6d2f0399a videoio: fix build of standalone ffmpeg plugin 2018-11-03 02:17:47 +00:00
Jean Carass 66e4ace39f Replaced strcpy_s, strcat_s for MinGW builds. 2018-11-02 08:51:57 -07:00
fegorsch ce00d38bd9 Add test for symmetric circles with clustering 2018-11-02 15:13:46 +01:00
Vitaly Tuzov 877de883b0 medianBlur() implementation moved to separate file 2018-11-02 16:28:23 +03:00
Alexander Alekhin a920ed9e1e superres: move to opencv_contrib 2018-11-02 16:06:16 +03:00
Vadim Pisarevsky d9b8a9d90e Merge pull request #13013 from berak:java_MatOfRotatedRect 2018-11-02 12:36:06 +00:00
Alexander Alekhin 6c8ec5336f shape: move to opencv_contrib 2018-11-02 15:23:05 +03:00
fegorsch 30bf4a5e34 CircleGridClusterFinder: map circle pattern width and height correctly
During the cluster-based detection of circle grids, the detected circle
pattern has to be mapped to 3D-points. When doing this the width (i.e.
more circles) and height (i.e. less circles) of the pattern need to
be identified in image coordinates.

Until now this was done by assuming that the shorter side in image
coordinates (length in pixels) corresponds to the height in 3D.
This assumption does not hold if we look at the pattern from
a perspective where the projection of the width is shorter
than the projection of the height. This in turn lead to misdetections in
although the circle pattern was clearly visible.

Instead count how many circles have been detected along two edges of the
projected quadrangle and use the one with more circles as width and the
one with less as height.
2018-11-02 12:03:20 +01:00
Vitaly Tuzov 0fda551dbc Updated medianBlur implementations to use wide universal intrinsics 2018-11-02 12:26:23 +03:00
Alexander Alekhin 687fa6a8ca Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-02 05:33:35 +00:00
Dmitry Kurtaev 32797515de Fix https://github.com/opencv/opencv/issues/12824 2018-11-02 08:26:08 +03:00
Vadim Pisarevsky 0f622206e4 completely new C++ persistence implementation (#13011)
* integrated the new C++ persistence; removed old persistence; most of OpenCV compiles fine! the tests have not been run yet

* fixed multiple bugs in the new C++ persistence

* fixed raw size of the parsed empty sequences

* [temporarily] excluded obsolete applications traincascade and createsamples from build

* fixed several compiler warnings and multiple test failures

* undo changes in cocoa window rendering (that was fixed in another PR)

* fixed more compile warnings and the remaining test failures (hopefully)

* trying to fix the last little warning
2018-11-02 00:27:06 +03:00
Alexander Alekhin a724525c00 Merge pull request #10584 from eruffaldi:F10583_videoio_ffmpeg_lossless 2018-11-01 16:57:11 +00:00
Alexander Alekhin 36d00f0200 Merge pull request #13003 from native-api:cross_cutting_frameworks 2018-11-01 16:46:11 +00:00
Ivan Pozdeev dbc6fe3a0f Detect cross-cutting frameworks before libraries so the latter can use them 2018-11-01 18:16:41 +03:00
Alexander Alekhin fbe41703e4 cmake: introduce setup_vars scripts
- CMake install COMPONENT: "scripts"
2018-11-01 17:38:40 +03:00
berak 0cd14e3fb4 java: add support for MatOfRotatedRect 2018-11-01 15:37:23 +01:00
Alexander Alekhin a1816e8c77 Merge pull request #13002 from dkurt:onnx_padding 2018-11-01 11:40:22 +00:00
Ilari Venäläinen e6c41f0de6 Merge pull request #12989 from venalil:fix_thresholded_tiff_read
* Fix reading of black-and-white (thresholded) TIFF images

I recently updated my local OpenCV version to 3.4.3 and found out that
I could not read my TIFF images related to my project. After debugging I
found out that there has been some static analysis fixes made
that accidentally have broken reading those black-and-white TIFF images.

Commit hash in which reading of mentioned TIFF images has been broken:
cbb1e867e5

Basically the fix is to revert back to the same functionality that has been there before,
when black-and-white images are read bpp (bitspersample) is 1.
Without the case 1: this TiffDecoder::readHeader() function always return false.

* Added type and default error message

* Added stdexcept include

* Use CV_Error instead of throw std::runtime_error

* imgcodecs(test): add TIFF B/W decoding tests
2018-11-01 14:34:34 +03:00
Alexander Alekhin ca55982669 Merge pull request #13007 from dkurt:fix_12970 2018-11-01 11:30:37 +00:00
Dmitry Kurtaev ea67060081 Fix https://github.com/opencv/opencv/issues/12970 2018-11-01 11:22:28 +03:00
Emanuele Ruffaldi b4398d62b2 ffmpeg for lossy 2018-11-01 00:06:29 +00:00
Alexander Alekhin fc21b15d6e samples(gpu): cleanup samples for legacy API 2018-10-31 23:57:10 +00:00
Alexander Alekhin 733fec020b Merge pull request #12991 from alalek:update_libpng_1.6.35 2018-10-31 16:47:48 +00:00
Dmitry Kurtaev a6f9170f10 Add ONNX's padding import 2018-10-31 18:24:05 +03:00
Alexander Alekhin 2dfaad3259 Merge pull request #12889 from alalek:drop_untested_flann_hdf5_header 2018-10-31 15:11:32 +00:00
Suleyman TURKMEN 4d0ed5c13c Merge pull request #12971 from sturkmen72:upd_imgproc_hpp
* Update imgproc.hpp

* update color conversion codes
2018-10-31 18:08:24 +03:00
Alexander Alekhin fcb56a5460 Merge pull request #12997 from alalek:eliminate_gcc4_warnings 2018-10-31 15:03:00 +00:00
Alexander Alekhin 06ffa408ce Merge pull request #12988 from LaurentBerger:test_copyto_py 2018-10-31 14:23:08 +00:00
Alexander Alekhin 98a73de526 cmake: eliminate GCC4.x warnings 2018-10-31 16:04:55 +03:00
Vadim Pisarevsky b669e9f648 Merge pull request #12994 from vpisarev:fix_imshow_mac 2018-10-31 11:13:28 +00:00
Vadim Pisarevsky ebdc870296 fixed imshow on mac; before that just the window titlebar was shown, without the window content. 2018-10-31 10:40:58 +03:00
Wu Zhiwen 34e9d1eb3c dnn/Vulkan: support log softmax
Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-10-31 09:47:38 +08:00
Wu Zhiwen 3914c17b0d dnn/Vulkan: Refine error handle mechanism
Fallback to OPENCV backend and CPU target if catch exception from
vkcom backend.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-10-31 09:47:33 +08:00
Alexander Alekhin c92e0838c1 Merge pull request #12951 from catree:easy_fixes_const_viz 2018-10-30 18:55:21 +00:00
Alexander Alekhin 850053f9ca Merge pull request #12982 from eldruin:python-gen-close-file 2018-10-30 18:41:23 +00:00
Ruslan Garnov 443fed796a Merge pull request #12990 from rgarnov:gapi_fluid_reshape_support
G-API: Introduce new `reshape()` API (#12990)

* Moved initFluidUnits, initLineConsumption, calcLatency, calcSkew to separate functions

* Added Fluid::View::allocate method (moved allocation logic from constructor)

* Changed util::zip to util::indexed, utilized collectInputMeta in GFluidExecutable constructor

* Added makeReshape method to FluidExecutable

* Removed m_outputRoi from GFluidExecutable

* Added reshape feature

* Added switch of resize mapper if agent ratio was changed

* Added more TODOs and renamed a function

* G-API reshape(): add missing `override` specifiers

Fix warnings on all platforms
2018-10-30 21:12:36 +03:00
AsyaPronina 08536943ad Merge pull request #12949 from AsyaPronina:missed_multiply_operator_for_GMAT
Made scale parameter optional for mul kernel wrapper (#12949)

* Added missed operator*(GMat, GMat). Made scale parameter optional for mul kernel.

* Fixed perf test for mul(GMat, GMat) kernel

* Removed operator*(GMat, GMat) as not needed
2018-10-30 21:10:47 +03:00
Alexander Alekhin 8cb8ba7caf 3rdparty: update libpng 1.6.35
http://www.libpng.org/pub/png/libpng.html
2018-10-30 19:03:14 +03:00
Rostislav Vasilikhin fa91d621fa Merge pull request #12876 from savuor:color_rgb2rgb_wide
* RGB2RGB initially rewritten

* NEON impl removed

* templated version added for ushort, float

* data copying allowed for RGB2RGB

* inplace processing fixed

* fields to local vars

* no zeroupper until it's fixed

* vx_cleanup() added back
2018-10-30 18:36:23 +03:00
Alexander Alekhin 2268ed1b6e Merge pull request #12948 from catree:add_drawFrameAxes 2018-10-30 13:33:01 +00:00
LaurentBerger 936523ae52 Add python test for copyto with mask 2018-10-30 13:25:38 +01:00
Sayed Adel 93ffebc273 core: reimplement SIMD arithmetic, logic and comparison operations into wide universal intrinsics
- initialize arithmetic dispatcher
  - add new universal intrinsic v_absdiffs
  - add new universal intrinsic v_pack_b
  - add accumulate version of universal intrinsic v_round
  - fix sse/avx2:uint8 multiplication overflow
  - reimplement arithmetic, logic and comparison operations into wide universal intrinsics
    with full support for all types
  - reimplement IPP arithmetic, logic and comparison operations in a sperate file arithm_ipp.hpp
  - avoid scalar multiplication if scaling factor eq 1 and use integer multiplication
  - move C arithmetic operations to precomp.hpp and delete [arithm_simd|arithm_core].hpp
  - add compatibility with new opencv4 divide policy
2018-10-30 12:48:31 +02:00
Wu Zhiwen 7fff245f87 dnn/Vulkan: Rename function_list.inl
Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-10-30 08:29:43 +08:00
Alexander Alekhin 76b6f6b017 Merge pull request #12938 from dkurt:java_ndim_mat 2018-10-29 17:06:44 +00:00
WuZhiwen 6e3ea8b49d Merge pull request #12703 from wzw-intel:vkcom
* dnn: Add a Vulkan based backend

This commit adds a new backend "DNN_BACKEND_VKCOM" and a
new target "DNN_TARGET_VULKAN". VKCOM means vulkan based
computation library.

This backend uses Vulkan API and SPIR-V shaders to do
the inference computation for layers. The layer types
that implemented in DNN_BACKEND_VKCOM include:
Conv, Concat, ReLU, LRN, PriorBox, Softmax, MaxPooling,
AvePooling, Permute

This is just a beginning work for Vulkan in OpenCV DNN,
more layer types will be supported and performance
tuning is on the way.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/vulkan: Add FindVulkan.cmake to detect Vulkan SDK

In order to build dnn with Vulkan support, need installing
Vulkan SDK and setting environment variable "VULKAN_SDK" and
add "-DWITH_VULKAN=ON" to cmake command.

You can download Vulkan SDK from:
https://vulkan.lunarg.com/sdk/home#linux

For how to install, see
https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html
https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html
respectively for linux, windows and mac.

To run the vulkan backend, also need installing mesa driver.
On Ubuntu, use this command 'sudo apt-get install mesa-vulkan-drivers'

To test, use command '$BUILD_DIR/bin/opencv_test_dnn --gtest_filter=*VkCom*'

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: dynamically load Vulkan runtime

No compile-time dependency on Vulkan library.
If Vulkan runtime is unavailable, fallback to CPU path.

Use environment "OPENCL_VULKAN_RUNTIME" to specify path to your
own vulkan runtime library.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* dnn/Vulkan: Add a python script to compile GLSL shaders to SPIR-V shaders

The SPIR-V shaders are in format of text-based 32-bit hexadecimal
numbers, and inserted into .cpp files as unsigned int32 array.

* dnn/Vulkan: Put Vulkan headers into 3rdparty directory and some other fixes

Vulkan header files are copied from
https://github.com/KhronosGroup/Vulkan-Docs/tree/master/include/vulkan
to 3rdparty/include

Fix the Copyright declaration issue.

Refine OpenCVDetectVulkan.cmake

* dnn/Vulkan: Add vulkan backend tests into existing ones.

Also fixed some test failures.

- Don't use bool variable as uniform for shader
- Fix dispathed group number beyond max issue
- Bypass "group > 1" convolution. This should be support in future.

* dnn/Vulkan: Fix multiple initialization in one thread.
2018-10-29 17:51:26 +03:00
Dmitry Budnikov 220b278575 Merge pull request #12944 from dbudniko:dbudniko/tests_thresholds
* added threshold to g-api imgproc tests

* trailing spaces remove

* try to fix warnings

* fix license header

* fix random numbers issue

* fix Sobel test

* license headers + precompiled headers included
2018-10-29 17:34:20 +03:00
catree 2b022311a4 Make cast() function const. Make parameters of addLight() const. 2018-10-29 14:53:28 +01:00
Alexander Alekhin 853f5111c2 Merge pull request #12978 from xoox:fix-collectCalibrationData-signature 2018-10-29 12:23:39 +00:00
Diego Barrios Romero 7a884ab6a5 Fix closing input file 2018-10-29 13:05:46 +01:00
Vadim Pisarevsky 792079ad33 Merge pull request #12964 from savuor:fix/zeroupper_all 2018-10-29 11:35:57 +00:00
Vadim Pisarevsky a9d77b5c64 Merge pull request #12966 from catree:fix_distortion_image 2018-10-29 11:27:49 +00:00
Vadim Pisarevsky 65ab6ed59f Merge pull request #12980 from LaurentBerger:copyToPy 2018-10-29 11:22:20 +00:00
Vadim Pisarevsky 7767352572 Merge pull request #12975 from allnes:fix_russian_test 2018-10-29 11:14:17 +00:00
Alexander Nesterov aba66352dd Fix dataset: russian.jpg 2018-10-29 10:30:49 -01:00
LaurentBerger 389aae59ae add python copyto with mask (https://github.com/opencv/opencv/issues/10225) 2018-10-29 09:09:30 +01:00
Wenfeng CAI c9abb823a7 Fix signature of static collectCalibrationData()
This is a fix to the signature of static function
collectCalibrationData() and clean-up for #12772. Since fallback scheme
in calibration method selection is not used anymore. As an input
parameter, iFixedPoint should be passed by value according to the OpenCV
coding style guide.
2018-10-29 10:19:02 +08:00
Alexander Alekhin 6c444ced08 Merge pull request #12954 from seanm:MinorMac 2018-10-28 14:52:32 +00:00
Alexander Alekhin 4e633d1f78 Merge pull request #12967 from catree:add_tutorial_video_java_python 2018-10-27 17:04:49 +00:00
AsyaPronina e6dd9a78ae Merge pull request #12947 from AsyaPronina:sobel_renaming
* Renamed Sobel operator GAPI kernel to match with OpenCV naming rules

* Fixed perf tests

* Small refactoring to check CI issue

* Refactored alignment for kernel wrappers in imgproc.hpp
2018-10-27 19:54:32 +03:00
Alexander Alekhin 012f36e47d Merge pull request #12958 from kamino410:doc_dist_param 2018-10-27 16:28:57 +00:00
root 1196eb33fc remove non-ideal pairs when using crosscheck in batchdistance 2018-10-26 20:25:24 +00:00
catree 4bea70a64a Update background subtraction tutorial with Java and Python codes. 2018-10-26 22:17:18 +02:00
catree d37164bab6 Fix distortion figure in calib3d. Positive radial distortion corresponds to pincushion distortion and negative to barrel distortion. Add another figure that illustrates the influence of k1 in the distortion effect. 2018-10-26 20:27:37 +02:00
Alexander Alekhin e0c888acf7 Merge pull request #12952 from seanm:fix12933 2018-10-26 18:27:27 +00:00
Alexander Alekhin cc2f8f1778 Merge pull request #12946 from HenryDev:patch-1 2018-10-26 18:26:06 +00:00
Rostislav Vasilikhin daff6e6484 _mm256_zeroupper replaced by zeroall 2018-10-26 18:12:07 +03:00
Alexander Alekhin 50bec53afc Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-26 17:56:55 +03:00
Alexander Alekhin eea0f7fd76 Merge pull request #12960 from alalek:workaround_ipp_sse42_meanstddev 2018-10-26 14:50:49 +00:00
Alexander Alekhin 3e0c72ea84 core(ipp): disable SSE4.2 meanStdDev() optimization for CV_32F 2018-10-26 15:57:26 +03:00
kamino410 3972c526ce fix document about camera distortion parameters 2018-10-26 19:55:46 +09:00
Sean McBride 75f67ed207 Fixed a few comments related to macOS support 2018-10-25 15:16:55 -04:00
Sean McBride 828091cfbb Fixed #12933: added cast to silence clang -Wcomma warning 2018-10-25 13:27:17 -04:00
wanghanmin eb981cc7d7 Merge pull request #12138 from wanghanmin:wanghanmin-patch-videoio_crossbarsetting-1
* Update videoio.hpp

add VideoCapturePropertie for clossbar input pin setting

* Update cap_dshow.cpp

For some kind of capture card, such as "avermedia cv710 " , it use SerialDigital as input pin and so it can not work.
Here added new PhysicalConnectorType enumeration: PhysConn_Video_YRYBY and PhysConn_Video_SerialDigital to support it.
And also provide new property parameter CAP_CROSSBAR_INPIN_TYPE to set the crossbar input pin type which will be used in videoInput::start(int deviceID, videoDevice *VD):
" if(VD->useCrossbar)
    {
        DebugPrintOut("SETUP: Checking crossbar\n");
        routeCrossbar(&VD->pCaptureGraph, &VD->pVideoInputFilter, VD->connection, CAPTURE_MODE);

    }
"

And at last ,fixed one issue for function setSizeAndSubtype, added code 
pVih->rcSource.top = pVih->rcSource.left = pVih->rcTarget.top =pVih->rcTarget.left=0;
pVih->rcSource.right = pVih->rcTarget.right= attemptWidth;
pVih->rcSource.bottom = pVih->rcTarget.bottom = attemptHeight;

without these code , rcSource and rcTarget will keeping use default resolution and cause fail in hr = VD->streamConf->SetFormat(VD->pAmMediaType) and cannot find suitable MediaType.

Tested with python3 and mfc (Avermedia cv710)
Python3 code:
import cv2
print("test cv")
cap=cv2.VideoCapture(0)
cap.set(5,60)
cap.set(3,1920)
cap.set(4,1080)
cap.set(31,6)


ret,img=cap.read()
cv2.namedWindow("cap",cv2.WINDOW_NORMAL)
cv2.resizeWindow("cap",960,640);
while True:
    ret,img=cap.read()
    if ret==False:
        continue
    cv2.imshow("cap",img)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()

cv2.destroyAllWindows()

MFC code:
void CcvtestDlg::OnBnClickedButton1()
{
VideoCapture cap(0);
cap.set(CAP_PROP_FRAME_WIDTH, 1920);
cap.set(CAP_PROP_FRAME_HEIGHT, 1080);

cap.set(CAP_CROSSBAR_INPIN_TYPE , 6);
Mat img;
namedWindow("test", WINDOW_NORMAL);
resizeWindow("test", 960, 640);
while (1)
{
if (cap.read(img))
{
imshow("test", img);
if ('q' ==waitKey(1))
break;
}
}
destroyAllWindows();
cap.release();
}

* Update cap_dshow.cpp

* Update videoio.hpp

move enum value of CAP_CROSSBAR_INPIN_TYPE to the end of list

* Update videoio.hpp

* Update cap_dshow.cpp

removed trailing whitespace

* Update test_camera.cpp

Add test for capture device using PhysConn_Video_SerialDigital as crossbar input pin

* Update test_camera.cpp

Correction of misunderstanding about how to add test case.
2018-10-25 19:41:37 +03:00
Wenfeng CAI 31be03a805 Merge pull request #12772 from xoox:calib-release-object
More accurate pinhole camera calibration with imperfect planar target (#12772)
43 commits:

* Add derivatives with respect to object points

Add an output parameter to calculate derivatives of image points with
respect to 3D coordinates of object points. The output jacobian matrix
is a 2Nx3N matrix where N is the number of points.

This commit introduces incompatibility to old function signature.

* Set zero for dpdo matrix before using

dpdo is a sparse matrix with only non-zero value close to major
diagonal. Set it to zero because only elements near major diagonal are
computed.

* Add jacobian columns to projectPoints()

The output jacobian matrix of derivatives with respect to coordinates of
3D object points are added. This might break callers who assume the
columns of jacobian matrix.

* Adapt test code to updated project functions

The test cases for projectPoints() and cvProjectPoints2() are updated to
fit new function signatures.

* Add accuracy test code for dpdo

* Add badarg test for dpdo

* Add new enum item for new calibration method

CALIB_RELEASE_OBJECT is used to whether to release 3D coordinates of
object points. The method was proposed in: K. H. Strobl and G. Hirzinger.
"More Accurate Pinhole Camera Calibration with Imperfect Planar Target".
In Proceedings of the IEEE International Conference on Computer Vision
(ICCV 2011), 1st IEEE Workshop on Challenges and Opportunities in Robot
Perception, Barcelona, Spain, pp. 1068-1075, November 2011.

* Add releasing object method into internal function

It's a simple extension of the standard calibration scheme. We choose to
fix the first and last object point and a user-selected fixed point.

* Add interfaces for extended calibration method

* Refine document for calibrateCamera()

When releasing object points, only the z coordinates of the
objectPoints[0].back is fixed.

* Add link to strobl2011iccv paper

* Improve documentation for calibrateCamera()

* Add implementations of wrapping calibrateCamera()

* Add checking for params of new calibration method

If input parameters are not qualified, then fall back to standard
calibration method.

* Add camera calibration method of releasing object

The current implementation is equal to or better than
https://github.com/xoox/calibrel

* Update doc for CALIB_RELEASE_OBJECT

CALIB_USE_QR or CALIB_USE_LU could be used for faster calibration with
potentially less precise and less stable in some rare cases.

* Add RELEASE_OBJECT calibration to tutorial code

To select the calibration method of releasing object points, a command
line parameter `-d=<number>` should be provided.

* Update tutorial doc for camera_calibration

If the method of releasing object points is merged into OpenCV. It will
be expected to be firstly released in 4.1, I think.

* Reduce epsilon for cornerSubPix()

Epsilon of 0.1 is a bigger one. Preciser corner positions are required
with calibration method of releasing object.

* Refine camera calibration tutorial

The hypothesis coordinates are used to indicate which distance must be
measured between two specified object points.

* Update sample calibration code method selection

Similar to camera_calibration tutorial application, a command line
argument `-dt=<number>` is used to select the calibration method.

* Add guard to flags of cvCalibrateCamera2()

cvCalibrateCamera2() doesn't accept CALIB_RELEASE_OBJECT unless overload
interface is added in the future.

* Simplify fallback when iFixedPoint is out of range

* Refactor projectPoints() to keep compatibilities

* Fix arg string "Bad rvecs header"

* Read calibration flags from test data files

Instead of being hard coded into source file, the calibration flags will
be read from test data files.
opencv_extra/testdata/cv/cameracalibration/calib?.dat must be sync with
the test code.

* Add new C interface of cvCalibrateCamera4()

With this new added C interface, the extended calibration method with
CALIB_RELEASE_OBJECT can be called by C API.

* Add regression test of extended calibration method

It has been tested with new added test data in xoox:calib-release-object
branch of opencv_extra.

* Fix assertion in test_cameracalibration.cpp

The total number of refined 3D object coordinates is checked.

* Add checker for iFixedPoint in cvCalibrateCamera4

If iFixedPoint is out of rational range, fall back to standard method.

* Fix documentation for overloaded calibrateCamera()

* Remove calibration flag of CALIB_RELEASE_OBJECT

The method selection is based on the range of the index of fixed point.
For minus values, standard calibration method will be chosen.  Values in
a rational range will make the object-releasing calibration method
selected.

* Use new interfaces instead of function overload

Existing interfaces are preserved and new interfaces are added. Since
most part of the code base are shared, calibrateCamera() is now a
wrapper function of calibrateCameraRO().

* Fix exported name of calibrateCameraRO()

* Update documentation for calibrateCameraRO()

The circumstances where this method is mostly helpful are described.

* Add note on the rigidity of the calibration target

* Update documentation for calibrateCameraRO()

It is clarified that iFixedPoint is used as a switch to select
calibration method. If input data are not qualified, exceptions will be
thrown instead of fallback scheme.

* Clarify iFixedPoint as switch and remove fallback

iFixedPoint is now used as a switch for calibration method selection. No
fallback scheme is utilized anymore. If the input data are not
qualified, exceptions will be thrown.

* Add badarg test for object-releasing method

* Fix document format of sample list

List items of same level should be indented the same way. Otherwise they
will be formatted as nested lists by Doxygen.

* Add brief intro for objectPoints and imagePoints

* Sync tutorial to sample calibration code

* Update tutorial compatibility version to 4.0
2018-10-25 19:38:55 +03:00
catree 644846c702 Add a function that draws frame axes. Useful for debugging purpose and to check the correctness of the output of a pose estimation method. 2018-10-25 18:38:19 +02:00
Alexander Alekhin defeda2f70 Merge pull request #12905 from tomoaki0705:fixQrcodePeakyFailure 2018-10-25 16:24:56 +00:00
Henry 4102855edd Update intro.markdown
"as opposed to" is a phrase of opposed meaning distinguished from or in contrast with. e.g., "an approach that is theoretical as opposed to practical"
synonyms: in contrast with, as against, as contrasted with, rather than, instead of, as an alternative to
example: "we use only steam, as opposed to chemical products, to clean our house"
2018-10-25 10:54:07 -05:00
Alexander Alekhin ca3848d773 Merge pull request #12937 from mshabunin:fix-static-4 2018-10-25 15:15:15 +00:00
Alexander Alekhin 602989ae9e Merge pull request #12935 from alalek:python_so_warning 2018-10-25 15:11:44 +00:00
Alexander Alekhin 88f60113a5 Merge pull request #12804 from alalek:editorconfig 2018-10-25 14:17:42 +00:00
Alexander Alekhin f50b58b509 Merge pull request #12854 from allnes:detect_qr_code 2018-10-25 14:16:55 +00:00
Alexander Alekhin 223d7cfb38 Merge pull request #12930 from aliyasineser:3.4
Update depth map for python-opencv
2018-10-25 17:12:16 +03:00
Maksim Shabunin e6d9486a6c Fixed several issues found by static analysis 2018-10-25 16:39:54 +03:00
Maksim Shabunin 9a8e47a766 Version update for OpenVINO 2018-10-25 16:38:30 +03:00
Alexander Alekhin 13f244b6a5 Merge pull request #12927 from alalek:docs_filter_gapi_exports 2018-10-25 11:53:06 +00:00
Alexander Alekhin 7e2c65ce3c Merge pull request #12925 from alalek:fix_cmake_conditions 2018-10-25 11:52:39 +00:00
Alexander Alekhin b184b19970 Merge pull request #12934 from alalek:issue_12932 2018-10-25 11:28:13 +00:00
Alexander Alekhin 28556f1498 core: move compiler defines from base.hpp into cvdef.h 2018-10-25 14:05:46 +03:00
Alexander Alekhin 55676b7173 Merge pull request #12928 from alalek:fix_typo_3.4 2018-10-25 11:04:59 +00:00
Dmitry Kurtaev 92f754c675 Add methods to reshape Mat in Java by array of shapes and retreive sizes of each dimension. 2018-10-25 10:48:23 +03:00
Maksim Shabunin 0ccd810738 Fixed several issues found by static analysis 2018-10-25 10:45:59 +03:00
Alexander Alekhin aa6e296236 python: eliminate DeprecationWarning: SO -> EXT_SUFFIX
- https://python.readthedocs.io/en/stable/whatsnew/3.4.html
- The `sysconfig` key `SO` is deprecated, it has been replaced by `EXT_SUFFIX`
2018-10-25 04:23:45 +00:00
Alexander Alekhin 7f608db244 core: move compiler defines from base.hpp into cvdef.h 2018-10-25 03:02:01 +00:00
Alexander Alekhin d61ad04f11 Merge pull request #12868 from VladKarpushin:tutorial-using-periodic-noise-removing-filter 2018-10-24 20:24:50 +00:00
Ali Yasin Eser 28a14df26c Update depth map for pytho-opencv 2018-10-24 19:29:27 +02:00
Alexander Nesterov d305fd4fca Added perf tests with sanity check 2018-10-24 16:37:56 +00:00
Alexander Alekhin 8486f1b8f0 Merge pull request #12888 from alalek:cmake_fix_objdetect 2018-10-24 16:22:26 +00:00
Alexander Alekhin a1bd39441f videoio: fix typo 2018-10-24 19:12:35 +03:00
Alexander Alekhin e959f449ae Merge pull request #12894 from alalek:c_api_drop_samples 2018-10-24 15:40:04 +00:00
Alexander Alekhin e4aea680b9 Merge pull request #12922 from alalek:fix_merge_12787 2018-10-24 15:15:13 +00:00
Alexander Alekhin 5d3822f15e docs: hide GAPI_EXPORTS from documentation 2018-10-24 18:05:21 +03:00
Alexander Alekhin 9a12aa45ad Merge pull request #12881 from huangqinjin:orb 2018-10-24 13:28:57 +00:00
Alexander Alekhin 465ae048a0 Merge pull request #12887 from alalek:fix_cmake_conditions 2018-10-24 13:17:54 +00:00
Alexander Alekhin 2c029aae46 Merge pull request #12914 from seiko2plus:issue12830 2018-10-24 13:15:23 +00:00
Alexander Alekhin 3523e0a56c Merge pull request #12921 from alalek:ios_xcode10 2018-10-24 13:06:27 +00:00
Alexander Alekhin 2933b58a2f Merge pull request #12909 from alalek:cmake_fix_baseline_detect_flags 2018-10-24 13:05:14 +00:00
Alexander Alekhin 1c1d653f3a Merge pull request #12919 from berak:fix_dnn_sample_common 2018-10-24 13:03:37 +00:00
maver1 e397434cb6 Merge pull request #12877 from maver1:3.4
* Updated ICV packages and IPP integration

* core(test): minMaxIdx IPP regression test

* core(ipp): workaround minMaxIdx problem

* core(ipp): workaround meanStdDev() CV_32FC3 buffer overrun

* Returned semicolon after CV_INSTRUMENT_REGION_IPP()
2018-10-24 15:02:53 +03:00
Alexander Alekhin 71009c9b4d core: fix merge from 3.4
`CV_ErrorNoReturn` should not be used in OpenCV
2018-10-24 14:45:45 +03:00
berak ad356e3239 dnn/samples: handle not set env vars gracefully 2018-10-24 12:37:01 +02:00
Alexander Alekhin c8fc8d210b Merge pull request #12713 from antonioborondo:depthwise_convolution 2018-10-24 09:17:57 +00:00
Antonio Borondo 7a3cb2280b Recognize ConvolutionDepthwise as Convolution 2018-10-24 08:37:51 +01:00
Sayed Adel 8b26906d6d core:vsx change behavior of v_round to rounding to nearest even 2018-10-24 06:31:31 +00:00
Dmitry Matveev dbed39a931 Merge pull request #12857 from dmatveev:hld
* G-API Documentation: first submission

This PR introduces a number of new OpenCV documentation chapters for
Graph API module.

In particular, the following topics are covered:
- Introduction & background information;
- High-level design overview;
- Kernel API;
- Pipeline example.

All changes are done in Markdown files, no headers, etc modified.

Doxygen references for main API classes will be added later.

Also, a tutorial will be introduced soon (in the common Tutorials place)

* G-API Documentation - fix warnings & trailing whitespaces

* G-API Documentation: address review issues

* G-API Documentation: export code snippets to compileable files

* gapi: move documentation samples
2018-10-24 07:47:56 +03:00
Alexander Alekhin 9a76322ef9 ios: update build script
- IPHONEOS_DEPLOYMENT_TARGET=8.0 by default (minimal for XCode 10)
2018-10-24 04:37:31 +00:00
Alexander Alekhin 0f07edded6 cmake: don't change baseline compiler flags in 'detection' mode 2018-10-24 03:54:31 +00:00
Tomoaki Teshima d3f75df0a6 objdetect: fix test failure of QR code on Aarch64
* use boundingRect instead of manual loop
2018-10-24 09:35:02 +09:00
Vadim Pisarevsky ea31c09384 rewrote the line segment intersection function to make the static analyzer happy (#12902)
* rewrote the line segment intersection function to make the static analyzer happy

* fixed bug with improper "no intersection" detection in some of corner cases

* fixed bug with improper "no intersection" detection in some of corner cases
2018-10-23 17:09:23 +03:00
Alexander Alekhin 971c4ca10b cmake: don't undefine passed options 2018-10-23 14:46:26 +03:00
Alexander Alekhin 329a1fb781 drop C-API sample code 2018-10-23 14:38:20 +03:00
Alexander Alekhin 73f65b1ccf cmake: OPENCV_GENERATE_PKGCONFIG 2018-10-23 08:50:28 +00:00
huangqinjin 1fbaa48cec ORB: compute default norm by wta_k 2018-10-22 10:10:49 +08:00
Alexander Alekhin 043e7e3516 flann: drop untested hdf5.h 2018-10-21 15:16:52 +00:00
Mansoo Kim 6974fce183 cmake: fix objdetect QR decoder link_libraries 2018-10-21 15:13:43 +00:00
Alexander Alekhin d6a8e08acc cmake: fix variable expand in CMake conditions 2018-10-21 15:02:40 +00:00
Alexander Alekhin 9c23f2f1a6 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-20 11:37:54 +00:00
Apoorv Goel d8ffddd075 Merge pull request #12871 from UnderscoreAsterisk:document-Distance
* Document distance functors in dist.h

* Add spec for Distance

* Generate appropriate links for symbols
2018-10-20 11:15:13 +03:00
Alexander Alekhin a692d87cfb Merge pull request #12875 from dkurt:dnn_enet_accuracy 2018-10-19 15:33:48 +00:00
Dmitry Matveev 5e9750d1f5 Merge pull request #12870 from dmatveev:gapi_fluid_basic_hetero_support
* G-API Fluid basic heterogeneity support: initial upload

* G-API Fluid heterogeneity: address some coding style issues

* G-API Fluid heterogeneity: fix compiler warnings

* G-API Fluid heterogeneity: fix warnings on Windows & ARMv7

* G-API Fluid heterogeneity: finally fix Windows warnings

* G-API Fluid heterogeneity: fix dangling reference problem
2018-10-19 18:32:48 +03:00
Dmitry Kurtaev e7015f6ae8 Fix ENet test 2018-10-19 17:43:26 +03:00
Alexander Alekhin 9c9fb1c6d0 Merge pull request #12867 from UnderscoreAsterisk:document-radiusSearch 2018-10-18 07:52:49 +00:00
Alexander Alekhin 80c64fce11 Merge pull request #12832 from kmansoo:fix-compile-errors-on-nvcc10 2018-10-18 07:51:47 +00:00
Karpushin Vladislav 237b867721 doc: add new tutorial periodic noise removing filter 2018-10-18 14:15:27 +07:00
Apoorv a7dfa261d8 Add documentation for radiusSearch 2018-10-18 04:09:16 +05:30
Mansoo Kim 4d1f0ef2d9 cuda: fix build with CUDA 10.x 2018-10-17 17:35:40 +00:00
Alexander Alekhin df6728e64c Merge pull request #12852 from nangchoo:bugfix/increase_magic_threshold_for_perf_test 2018-10-17 17:31:19 +00:00
Alexander Alekhin 7a73941f22 Merge pull request #12844 from jasjuang:3.4 2018-10-17 17:31:00 +00:00
Alexander Alekhin 6d9e66eca1 Merge pull request #12864 from dkurt:dnn_ie_get_batch_size 2018-10-17 14:02:25 +00:00
Alexander Alekhin 2180a67670 Merge pull request #12863 from alalek:disable_wshadow_gcc_4.x 2018-10-17 13:59:13 +00:00
Dmitry Kurtaev 365451dab0 Implement getBatchSize for Intel's Inference Engine networks 2018-10-17 14:02:37 +03:00
Alexander Alekhin 1188c6fe14 Merge pull request #12838 from dmatveev:gapi_fluid_resize_lpi 2018-10-17 09:22:28 +00:00
Alexander Alekhin a2e754c136 build: eliminate warnings 2018-10-17 08:43:18 +00:00
Alexander Alekhin c09a3cf098 Merge pull request #12860 from janisozaur:include-guards 2018-10-17 08:20:31 +00:00
Alexander Alekhin 842341fc16 Merge pull request #12859 from janisozaur:empty-block 2018-10-17 08:20:08 +00:00
Alexander Alekhin 32a5e5fae1 Merge pull request #12858 from janisozaur:catch-by-ref 2018-10-17 08:19:12 +00:00
Michał Janiszewski 85b9960f62 Fix clashing include guards
Relevant guards can be found in
https://github.com/opencv/opencv/blob/ef5579dc8667e5eb5e149acc4af898421eed99da/modules/features2d/src/kaze/AKAZEConfig.h#L8
and
https://github.com/opencv/opencv/blob/ef5579dc8667e5eb5e149acc4af898421eed99da/modules/ml/include/opencv2/ml.hpp#L44
2018-10-16 22:59:38 +02:00
Michał Janiszewski 5640b36f6d Remove unused empty block 2018-10-16 22:51:03 +02:00
Michał Janiszewski c8e6ce304f Catch exceptions by const-reference
Exceptions caught by value incur needless cost in C++, most of them can
be caught by const-reference, especially as nearly none are actually
used. This could allow compiler generate a slightly more efficient code.
2018-10-16 22:43:54 +02:00
Paul Shin 1c468add20 Increased the acceptable error margin for perf testing
- This is to accommodate the variabiilty in floating-point operations in new platforms/compilers
- Specifically due to the error margin found in NVIDIA Jetson TX2
2018-10-15 20:03:39 -07:00
Alexander Alekhin 5339ef3004 Merge tag '4.0.0-beta' 2018-10-15 20:33:41 +00:00
Alexander Alekhin 6a2b3c8d4c release: OpenCV 4.0.0-beta (version++) 2018-10-15 20:31:53 +00:00
Alexander Alekhin edacd91a27 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-15 20:15:42 +00:00
Alexander Alekhin 5dd46b54c1 Merge pull request #12848 from alalek:issue_12337 2018-10-15 20:09:36 +00:00
Alexander Alekhin ea502b6e84 Merge pull request #12845 from alalek:workaround_12824 2018-10-15 20:09:06 +00:00
Alexander Alekhin 24ced3d657 Merge pull request #12846 from alalek:issue_12834 2018-10-15 19:19:46 +00:00
Alexander Alekhin c5a5d7eb51 Merge pull request #12843 from alalek:fix_qrdecode_input_validation 2018-10-15 19:18:58 +00:00
Alexander Alekhin ab2c16b2e5 Merge pull request #12829 from tomoaki0705:fixTestVideoOpenCLPyrLK 2018-10-15 19:18:24 +00:00
Alexander Alekhin 113793fee7 Merge pull request #12837 from dkurt:dnn_fix_ie 2018-10-15 19:17:18 +00:00
Alexander Alekhin 954536073d core: update solveLP() interface 2018-10-15 18:58:11 +00:00
Alexander Alekhin b54a70a538 videoio: return -1 is incorrect for function with 'bool' result 2018-10-15 18:20:15 +00:00
Alexander Alekhin cc45c10f3d ocl: bailout from unsupported types 2018-10-15 18:06:06 +00:00
jasjuang a66fd527b0 add support for latest Turing gpu and cuda 10 2018-10-15 10:40:24 -07:00
Alexander Alekhin 6d2cfac303 objdetect: validate QRdecode inputs
- drop unnecessary matrix initialization
2018-10-15 17:16:17 +00:00
Alexander Alekhin 13aa23f706 Merge pull request #12836 from dmatveev:gapi_upd151018 2018-10-15 16:20:52 +00:00
Alexander Alekhin f8a27d2603 Merge pull request #12775 from radomsak:radomsak_dnn_fix_caffe_importer_reused_layers 2018-10-15 14:44:23 +00:00
Alexander Alekhin f185640eda Merge pull request #12799 from alalek:update_build_js
* js: update build script

- support emscipten 1.38.12 (wasm is ON by default)
- verbose build messages

* js: use builtin Math functions

* js: disable tracing code completelly
2018-10-15 17:35:21 +03:00
Alexander Alekhin 78b51fb574 Merge pull request #12826 from alalek:issue_8413 2018-10-15 14:24:56 +00:00
Alexander Alekhin 72eccb7694 Merge pull request #12825 from alalek:issue_8413_3.4 2018-10-15 14:23:21 +00:00
Dmitry Matveev 922d5796b9 G-API: Introduce LPI (multiple Lines-Per-Iteration) support for Resize
Several Resize optimizations count on fetching multiple input lines at
once to do interpolation more efficiently.

At the moment, Fluid backend supports only LPI=1 for Resize kernels.

This patch introduces scheduling support for Resizes with LPI>1 and
covers these cases with new tests.

The support is initially written by Ruslan Garnov.
2018-10-15 17:11:55 +03:00
Tomoaki Teshima 803f86b9ca fix test failure of PyrLKOpticalFlow.Mat
* remove race condition
  * upload _prevPts to OpenCL device explicitly before calling "sparse"
2018-10-15 22:57:08 +09:00
Alexander Alekhin 7bac615d8f Merge pull request #12344 from terfendail:core_wintr 2018-10-15 13:48:15 +00:00
Dmitry Kurtaev dc3406eed9 Fix Pooling and Convolution layers from Intel's Inference Engine 2018-10-15 16:40:28 +03:00
Dmitry Matveev f0ddc2a53c G-API: Fixed static analysis issue in own::Mat
Tool reported a false alarm on possible out-of-bounds access which
was work-arounded to make code more clear
2018-10-15 16:31:31 +03:00
Alexander Alekhin 1cc3f7abbb Merge pull request #12516 from seiko2plus:changeUnvMultiply16 2018-10-15 12:07:40 +00:00
Adam Radomski 70177143a7 Added test caffe importer layers sharing weights 2018-10-15 11:42:26 +02:00
Vitaly Tuzov 43d9256096 Replaced core module calls to universal intrinsics with wide universal intrinsics 2018-10-15 11:46:45 +03:00
tellowkrinkle 803ff64b14 Merge pull request #12697 from tellowkrinkle:FasterCocoaWindows
* Make cocoa windows draw faster

* Use a CALayer for rendering when possible Uses GPU to scale images, which is important because retina macs will want window sizes much larger (in pixels) than the image

* Fix mouse logic for cocoa windows

* Only halve resolution on retina if image is larger than display
2018-10-14 21:18:05 +03:00
Alexander Alekhin 824241ad5c Merge pull request #12823 from tompollok:3.4 2018-10-14 13:33:23 +00:00
Alexander Alekhin d5d059690f gapi(test): disable divide tests with zeros 2018-10-14 10:47:50 +00:00
Alexander Alekhin fd832bb57d core: follow IEEE 754 rules for floating-point division 2018-10-14 10:47:50 +00:00
Alexander Alekhin 09cb329d73 core(test): zero values divide test (4.0+) 2018-10-14 03:46:29 +00:00
Alexander Alekhin 4a9291fd89 Merge branch 'issue_8413_3.4' 2018-10-14 03:46:01 +00:00
Alexander Alekhin 5677a683a5 core(test): zero values divide test (3.x) 2018-10-14 02:23:17 +00:00
Alexander Alekhin c813ad5533 core(ocl): replace ambiguous 'depth' to 'DEPTH_dst'
- always pass DEPTH_dst value to core/arithm kernel
2018-10-14 02:18:04 +00:00
tompollok 0b77600718 change area() emptiness checks to empty() 2018-10-13 21:35:10 +02:00
Alexander Alekhin 5115e5decb Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-13 16:19:05 +00:00
Alexander Alekhin 429a643f42 Merge pull request #12805 from drkoller:imwritedoc 2018-10-13 13:20:33 +00:00
Alexander Alekhin d2a66d3c99 Merge pull request #12815 from alalek:issue_12812 2018-10-13 13:12:55 +00:00
Alexander Alekhin 0f41daeba5 Merge pull request #12641 from dkurt:dnn_samples_args_autofill 2018-10-13 12:28:08 +00:00
Alexander Alekhin 1be75437b7 Merge pull request #12802 from alalek:cmake_pdb 2018-10-13 12:25:36 +00:00
drkoller 978ad4981e Clean up documentation for imread and imwrite 2018-10-12 17:08:01 -04:00
Alexander Alekhin 8c4f886f5f core: re-throw allocation exception if there is no fallback 2018-10-12 19:10:06 +00:00
Alexander Alekhin 0d63c4c28e Merge pull request #12811 from take1014:resize_large_image 2018-10-12 16:59:25 +00:00
Alexander Alekhin 6843d368b2 Merge pull request #12806 from seiko2plus:imgprocPyramidsVSX 2018-10-12 16:59:01 +00:00
take1014 24af70c7e0 resolves 11283 2018-10-12 23:08:25 +09:00
Alexander Alekhin 1ed9ff17e1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-12 10:05:55 +00:00
Sayed Adel 9dc1d388af imgproc: Enable VSX on pyrDown & pyrUp 2018-10-11 23:03:57 +00:00
Alexander Alekhin 28cb714a09 Merge pull request #12803 from alalek:samples_use_cmake_from_msvs 2018-10-11 19:30:49 +00:00
Alexander Alekhin 91c6d36ff8 Merge pull request #12796 from alalek:fix_openmp_performance 2018-10-11 19:29:04 +00:00
Alexander Alekhin be76b451cb Merge pull request #12791 from alalek:win32_dllmain_detect_termination 2018-10-11 19:28:29 +00:00
Alexander Alekhin 53785b6ac6 Merge pull request #12784 from terfendail:pyramids_wintr 2018-10-11 19:26:36 +00:00
Alexander Alekhin 2332fb852d Merge pull request #12748 from terfendail:resize_wintr2 2018-10-11 19:26:17 +00:00
Alexander Alekhin f1fdfa1a51 Merge pull request #12623 from sturkmen72:videoio-4 2018-10-11 19:24:57 +00:00
Alexander Alekhin 0f3fe957f5 Merge pull request #12450 from sturkmen72:update_HOGDescriptor 2018-10-11 19:23:35 +00:00
Alexander Alekhin 8edff1065a add .editorconfig
https://editorconfig.org/
2018-10-11 17:57:51 +00:00
Alexander Alekhin 41398987c3 Merge pull request #12792 from tomoaki0705:fixCudaImgprocColorGray 2018-10-11 16:32:11 +00:00
Alexander Alekhin de8024ce4a samples: prefer CMake from MSVS
MSVS is shipped with CMake compoment.
2018-10-11 19:19:16 +03:00
Alexander Alekhin 7b9b876726 cmake: improve PDB support 2018-10-11 10:54:37 +00:00
Tomoaki Teshima 944710de4e update the threshold
* fix test failure of cudaimgproc convert color bgr2lab series
2018-10-11 18:45:20 +09:00
Alexander Alekhin 2b3c7490d5 Merge pull request #12521 from allnes:detect_qr_code
Objdetect: QRCode detect + decode
2018-10-11 12:42:05 +03:00
Sayed Adel 8965f3ae06 imgproc:simd Enable VSX and wide universal intrinsics for accumulate operations
- improve cpu dispatching calls to allow more SIMD extentions
    (SSE4.1, AVX2, VSX)
  - wide universal intrinsics
  - replace dummy v_expand with v_expand_low
  - replace v_expand + v_mul_wrap with v_mul_expand for product accumulate operations
  - use FMA for accumulate operations
  - add mask and more types to accumulate's performance tests
2018-10-11 04:37:12 +02:00
Sayed Adel 5771fd693d Change behaviour of 16-bit multiply operator
- redefine 16-bit multiply operator to perform saturating multiply
    instead of non-saturating multiply
  - implement 8-bit multiply operator to perform saturating multiply
  - implement v_mul_wrap() for 8-bit, 16-bit non-saturating multiply
  - improve performance of v_mul_hi() for VSX
  - update intrin tests with new changes
  - replace unv 16-bit multiplication operator with v_mul_wrap due behavior changes

  - Several improvements depend on vpisarev review

    * initial forward declarations for universal intrinsics
    * move emulating SSE intrinsics into separate file
    * implement v_mul_expand for 8-bit
    * reimplement saturating multiply using v_mul_expand + v_pack
    * map v_expand, v_load_expand, v_load_expand_q to sse4.1
    * fix overflow avx2::v_pack(uint32)
    * implement two universal intrinsics v_expand_low and v_expand_high
2018-10-11 04:35:39 +02:00
Vitaly Tuzov 1ff11c84ab Fixed meanStdDev() implementation for the case input matrix has more than 4 channels 2018-10-11 04:30:33 +02:00
Alexander Alekhin 5faaa28870 js: enable calib3d code (no bindings) 2018-10-11 00:49:45 +00:00
Alexander Alekhin fc4679d4cf Merge pull request #12795 from mshabunin:fix-win-python 2018-10-10 20:55:32 +00:00
Alexander Alekhin 761c269e47 Merge pull request #12794 from alalek:fix_warnings 2018-10-10 20:22:07 +00:00
Alexander Alekhin 131d199ae3 Merge pull request #12793 from alalek:cmake_fix_python_standalone 2018-10-10 20:03:02 +00:00
Alexander Alekhin 35c53204cb Merge pull request #12781 from alalek:videoio_drop_rectification_dc1394 2018-10-10 20:01:06 +00:00
Alexander Alekhin f731515628 cmake: fix Python detection for standalone bindings 2018-10-10 22:59:42 +03:00
Alexander Alekhin 4e62900009 core: call omp_set_dynamic() for better CPU usage
Similar to 'OMP_DYNAMIC=TRUE'.
2018-10-10 19:57:43 +00:00
Alexander Alekhin 7813eef92b fix build warnings 2018-10-10 19:26:19 +00:00
Suleyman TURKMEN 59bf2a34fa Update videoio 2018-10-10 21:58:04 +03:00
Suleyman TURKMEN abbb73e894 Update HOGDescriptor 2018-10-10 21:53:35 +03:00
Vitaly Tuzov cc10e6b344 pyrDown and pyrUp SSE2 implementations replaced with wide universal intrinsics implementations 2018-10-10 21:12:47 +03:00
Alexander Alekhin 11e2a216c5 ocl(win32): bypass deallocate() during process termination 2018-10-10 18:06:06 +00:00
Alexander Alekhin 404893810c cmake: fix Python detection for standalone bindings 2018-10-10 16:58:23 +00:00
Alexander Nesterov 53ec8f286b Added QR code decoding. 2018-10-10 15:27:00 +00:00
Alexander Alekhin 70f2ee917e cmake: add DllMain() into each OpenCV DLL
to detect process termination after ExitProcess() call
2018-10-10 11:00:59 +00:00
Alexander Alekhin ad93ed720d Merge pull request #12788 from alalek:samples_winpack_support_buildtools 2018-10-10 09:18:32 +00:00
Adam Radomski cc3ec5d453 Fix dnn caffe importer extract blobs from reused layers 2018-10-10 10:44:56 +02:00
Alexander Alekhin 288251e672 samples: add search for MSVS 2017 BuildTools 2018-10-10 00:34:34 +00:00
Alexander Alekhin dada5a422d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-09 21:20:15 +00:00
Alexander Alekhin 421fdc0e94 Merge pull request #12636 from alalek:winpack_samples_cpp_build_script
* samples: add winpack "drap & drop" build script

* samples: add search for MSVS 2017 Enterprise
2018-10-09 19:01:29 +03:00
Hamdi Sahloul c4d434fd6f CUDA/BgSegm: fix the threshold of MOG2.Update test when detectShadow=true (#12762) 2018-10-09 17:39:39 +03:00
Alexander Alekhin 8bb3d363a4 videoio: drop rectification code for VIDERE cameras 2018-10-09 14:06:15 +00:00
Apoorv Goel b8aa0cddab Merge pull request #12777 from UnderscoreAsterisk:document-cvtColorTwoPlane
* Add documentation for cvtColorTwoPlane

* Change brief and add links
2018-10-09 15:49:17 +03:00
Lubov Batanina 50811e04f2 Merge pull request #12596 from l-bat:l-bat/shufflenet_onnx
* Add Shufflenet support in ONNX

* Add test for transpose layer
2018-10-08 22:18:41 +03:00
Alexander Alekhin 449826288b Merge pull request #12765 from cv3d:ts/cuda/device_name 2018-10-08 19:15:54 +00:00
Alexander Alekhin 1522722fab Merge pull request #12728 from alalek:calib3d_move_undistort 2018-10-08 15:34:30 +00:00
Alexander Alekhin 68fe37b008 Merge pull request #12755 from alalek:fix_allocSingleton 2018-10-08 15:30:17 +00:00
Alexander Alekhin 26ba4f3c1d Merge pull request #12754 from alalek:dnn_ocl4dnn_async_expressions 2018-10-08 15:22:24 +00:00
Alexander Alekhin e19b422854 Merge pull request #12752 from alalek:dnn_cleanup_getUMat 2018-10-08 15:21:50 +00:00
Alexander Alekhin 913c4151bf Merge pull request #12725 from alalek:cmake_python_win32
* cmake: don't ignore Python from PATH environment variable

- this breaks selection between 32/64-bit Python
- this breaks Anaconda/Conda environments
- it is not the CMake default behavior, expected by many projects

* cmake: add Python version check, fallback path on CMake 3.12+

* cmake: drop Python 2.6, allow version selection for Python 3.x
2018-10-08 17:45:50 +03:00
Alexander Alekhin 78a802baae Merge pull request #12767 from dkurt:fix_js_features2d 2018-10-08 14:36:32 +00:00
Vitaly Tuzov 9d602f2752 Replaced SSE2 area resize implementation with wide universal intrinsic implementation 2018-10-08 16:27:52 +03:00
Dmitry Kurtaev 7649e537b7 Fix JavaScript bindings for features2d module 2018-10-07 22:55:38 +03:00
Hamdi Sahloul 2faa4cd933 TS/CUDA: Show device ID in case of multiple devices 2018-10-08 03:00:25 +09:00
Alexander Alekhin 0492301e76 Merge pull request #12753 from mshabunin:fix-ffmpeg-dl 2018-10-05 16:03:34 +00:00
Alexander Alekhin 18bf91a08b core: update allocSingleton implementation, valgrind suppression 2018-10-05 18:25:13 +03:00
Maksim Shabunin 09ef4c9cff FFmpeg: correct licenses install location 2018-10-05 17:10:42 +03:00
Alexander Alekhin 634dd656d5 dnn: don't use Mat expressions with async UMat functions 2018-10-05 17:09:50 +03:00
Alexander Alekhin 9d02d42afe dnn(ocl4dnn): don't use getUMat()
especially in CPU only processing
2018-10-05 15:24:51 +03:00
Alexander Alekhin c716e374c1 Merge pull request #12744 from alalek:issue_12736 2018-10-05 10:20:13 +00:00
Alexander Alekhin aeec6e43eb Merge pull request #12749 from powderluv:fix-clang-cl-tzcnt 2018-10-05 09:28:07 +00:00
Alexander Alekhin 8f1f4273a2 calib3d: move undistort files from imgproc 2018-10-05 07:52:21 +00:00
Anush Elangovan 630a94b8b7 _tzcnt_u32() is undefined in clang-cl so use alternate impl
_tzcnt_u32() is not exported by clang-cl intrin.h so check for
clang-cl and enable an alterate for _tzcnt_u32()

Some discussions:
http://lists.llvm.org/pipermail/cfe-dev/2016-October/051329.html
https://bugs.llvm.org/show_bug.cgi?id=30506

TEST=Build with clang-cl
2018-10-04 14:04:22 -07:00
Alexander Alekhin ceca139f7f Merge pull request #12745 from savuor:fix/ocl_arg_local_size 2018-10-04 16:42:16 +00:00
Rostislav Vasilikhin da5e0ef461 ocl::KernelArg::Local(): added size argument 2018-10-04 17:19:09 +03:00
Alexander Alekhin 4fa6734320 Merge pull request #12741 from GeorgeMironov:fix-cmake-protobuf 2018-10-04 14:17:22 +00:00
Alexander Alekhin a9c8a526cf Merge pull request #12695 from sam09:master 2018-10-04 12:53:37 +00:00
Alexander Alekhin 0926a84a45 cmake: define CV_ErrorNoReturn under CV_STATIC_ANALYSIS
to avoid build break without `__OPENCV_BUILD`
2018-10-04 14:43:43 +03:00
Alexander Alekhin 0101fa789c Merge pull request #12735 from tomoaki0705:fixCudaStereoTestFailure 2018-10-04 11:33:34 +00:00
Alexander Alekhin 12b3d157a5 Merge pull request #12726 from alalek:dnn_ocl_conv_avoid_multiple_expr_evaluation 2018-10-04 11:31:47 +00:00
Georgy Mironov 60c26f8f1e Fix install with external protobuf 2018-10-04 13:48:59 +03:00
Tomoaki Teshima 7294ae0f17 fix test failure of StereoBeliefPropagation
* if the src has odd number of height, access error happens
  * it could happen on width, too
  * check both dst and src range in both width and height
2018-10-04 08:35:34 +09:00
Apoorv Goel 0ffc186680 Merge pull request #12731 from UnderscoreAsterisk:fix-12012
* fix #12012

* Replace CV_StsBadFlag with Error::StsBadFlag
2018-10-03 15:50:04 +03:00
Sam Radhakrishnan 699db77293 Fixes #12692: Update samples/gpu/videoreader.cpp
Change iteration to iterate separately when the video is decode on a GPU to account for different number of frames
2018-10-03 17:42:57 +05:30
Alexander Alekhin 50beef605b Merge pull request #12727 from rnk:fix-clang-cl-cmake 2018-10-03 07:21:06 +00:00
Alexander Alekhin 068ebe8b4d Merge pull request #12693 from peters:patch-1 2018-10-03 06:14:44 +00:00
Reid Kleckner ffaf58349c Fix CMake for clang-cl
Avoids passing -Wall, which will enable literally every warning in
Clang. Avoids passing -ffunction-sections etc to clang-cl, which each
generate warnings.
2018-10-02 14:55:26 -07:00
Alexander Alekhin eec468fa13 dnn(ocl4dnn): calculate activation expression once
- to avoid multiple conditional calls via sub_group() functions
2018-10-02 21:23:41 +00:00
Alexander Alekhin 81c94357e8 Merge pull request #12722 from tomoaki0705:fixCudaFiltersFailure 2018-10-02 20:52:34 +00:00
Peter Rekdal Sunde 042c486b68 Obtain fourcc when AVStream is network stream
The `codec_tag` is only available when opening a file from disk. If `AVStream` is a network stream then `fourcc` must be obtained using `codec_id`. I have tested the following scenarios:
1) Open a `.mp4` file and verify that `codec_tag` is returned (old behavior)
2) Open a `rtsp` stream and verify that `codec_fourcc` is returned (Tested with a MJPEG, H264 and H265 stream)
2018-10-02 22:15:05 +02:00
Alexander Alekhin 6921f967a1 Merge pull request #12605 from terfendail:integral_wintr 2018-10-02 16:40:13 +00:00
Alexander Alekhin 83a0c12144 Merge pull request #12581 from terfendail:lapack_intr 2018-10-02 16:39:50 +00:00
Tomoaki Teshima fa8684b5c8 fix test failure of cudafilters Median_Accuracy
* avoid race condition
2018-10-03 00:59:08 +09:00
Alexander Alekhin 690fb0544c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-02 14:31:05 +03:00
Vitaly Tuzov 283348afc3 SSE2 code in invert() replaced with universal intrinsics 2018-10-02 12:47:07 +03:00
Suleyman TURKMEN ee0c985491 Merge pull request #12649 from sturkmen72:patch-9
Update hog.cpp (#12649)
2018-10-01 22:22:37 +03:00
Alexander Alekhin b41f38ecc7 Merge pull request #12669 from mshabunin:add-paths-config 2018-10-01 15:57:57 +00:00
Alexander Alekhin 682180e0cd Merge pull request #12620 from alalek:ocl_extra_build_options 2018-10-01 15:57:31 +00:00
Alexander Alekhin 1385db48f5 Merge pull request #12711 from alalek:dnn_ocl_idlf_drop_weights_buf 2018-10-01 15:36:49 +00:00
Alexander Alekhin 94201b7cf9 ocl: OPENCV_OPENCL_BUILD_EXTRA_OPTIONS parameter 2018-10-01 17:56:17 +03:00
Maksim Shabunin 15632c6305 Added support for multi-path configuration parameter (env) 2018-10-01 17:50:47 +03:00
Vitaly Tuzov 6b84990620 integral() implementation updated to utilize wide universal intrinsics 2018-10-01 17:25:43 +03:00
Alexander Alekhin c9b6b2cf04 Merge pull request #12714 from antonioborondo:fix_documentation_cuda_compare 2018-10-01 13:35:03 +00:00
Alexander Alekhin 617fe2545c Merge pull request #12709 from WydD:3.4 2018-10-01 13:32:51 +00:00
Alexander Alekhin 93663dc57a Merge pull request #12708 from ldevulder:protobuf-fix-compilation-issue-on-s390 2018-10-01 13:32:29 +00:00
Antonio Borondo 28e55dc5f3 Fix documentation of cv::cuda::compare 2018-10-01 13:23:18 +01:00
Alexander Alekhin ae4c72a153 Merge pull request #12668 from alalek:calib3d_chessboardsb_updates 2018-10-01 00:00:01 +03:00
Alexander Alekhin 9253e8bda2 Merge pull request #12705 from berak:imread_document_grayscale 2018-09-30 23:59:48 +03:00
Alexander Alekhin 0f031b6680 dnn(ocl4dnn): drop weights_buf
- avoid memory access violation during "prefetch" stage
2018-09-30 20:35:41 +00:00
Loic Petit 255b20f6de Fix frame rate rounding in ffmpeg wrapper (#9023) 2018-09-30 22:24:02 +02:00
Loic Devulder ac9ec55b37 3rdparty/protobuf: fix compilation issue on s390
This commit fixes an issue while trying to compile
on s390x architecture.

This is simply a backport of a fixe already applied
in official protobuf code:
- https://github.com/protocolbuffers/protobuf/pull/3955
2018-09-30 21:33:34 +02:00
berak df4139d373 document imread grayscale behaviour 2018-09-30 15:22:26 +02:00
Hamdi Sahloul 1059735bfb Merge pull request #12667 from cv3d:fix/ts_report
TS: fix Python v2/v3 compatibility (#12667)

* TS: fix Python2.7 compatibility

* TS: fix Python3 compatibility

* py3: use integer division '/' => '//' instead of cast
2018-09-29 20:03:54 +03:00
Alexander Alekhin 8f2eb60719 Merge pull request #12690 from cv3d:fix/ts_python_exe 2018-09-29 16:39:05 +00:00
Alexander Alekhin a1ffc00ba8 Merge pull request #12666 from tomoaki0705:cudevTestFailureLuvRGB 2018-09-29 16:36:25 +00:00
Hamdi Sahloul 1a81a97e9f Utilize the currently running Python executable
especially if it matches the module being tested
2018-09-29 23:58:27 +09:00
Tomoaki Teshima e6ef9221cb fix test failure of cudev
* follow the implementation of Luv2RGBfloat in imgproc/src/color_lab.cpp
  * loosen threshold in cudaimgproc
2018-09-29 23:13:12 +09:00
Alexander Alekhin ee84ae0551 Merge pull request #12682 from soonbro:patch-1 2018-09-29 16:03:38 +03:00
Alexander Alekhin bd04568baf Merge pull request #12676 from PWhiddy:patch-1 2018-09-29 16:02:33 +03:00
Alexander Alekhin ea92c2b1a6 Merge pull request #12663 from sturkmen72:patch-12 2018-09-29 12:52:27 +00:00
Alexander Alekhin 8ecdd215b6 Merge pull request #12661 from Slyce-Inc:fix-xcode10-bitcode 2018-09-29 12:50:51 +00:00
Alexander Alekhin 5a3bca8d5c Merge pull request #12576 from cv3d:fix/cuda/polar_to_cart 2018-09-29 12:45:47 +00:00
soonbro 9b9f38afc8 fix typo in FpsMeter.java
'mFramesCouner' -> 'mFramesCounter'
2018-09-29 11:36:47 +00:00
Alexander Alekhin 9ac7aea930 Merge pull request #12653 from cv3d:cuda/legacy_traits 2018-09-28 19:21:04 +00:00
Hamdi Sahloul 5f17cc1abd Fix Python wrapper for GpuMat 2018-09-29 02:47:59 +09:00
Alexander Alekhin 8f6695acc7 CUDA: drop OPENCV_TRAITS_ENABLE_DEPRECATED requirement 2018-09-29 02:47:59 +09:00
chacha21 9524abcd28 Merge pull request #12658 from chacha21:clr-mutex
* hide use of std::mutex from /clr compilation under Visual Studio

C++11 <mutex> is not available when compiling with  /clr under Visual Studio, thus opencv cannot be easily included.
It is fixed by making a CEEMutex wrapper class, around an opaque implementation using std::mutex internally

* fixed compilation outside of Visual Studio

fixed compilation outside of Visual Studio by avoiding some macros

* fixed indentation, prepare getting rid of CEEMutex/CEELockGuard

fixed indentation
After discussion, CEEMutex and CEELockGuard can be totally removed, letting the developer in a /clr context to provide his own implementation

* remove CEEMutex/CEELockGuard
2018-09-28 19:19:05 +03:00
Alexander Alekhin 4fea6179a0 Merge pull request #12659 from dkurt:js_features2d 2018-09-28 16:18:09 +00:00
Alexander Alekhin 055f177a6a Merge pull request #12630 from alalek:docs_blacklist_matlab 2018-09-28 16:15:19 +00:00
Alexander Alekhin 83efde6243 Merge pull request #12678 from cv3d:cleanup/python/enums 2018-09-28 16:07:21 +00:00
Suleyman TURKMEN 8eb987e393 Update findContours parameter type 2018-09-28 18:42:48 +03:00
Dmitry Matveev 2c6ab65476 Merge pull request #12674 from dmatveev:gapi_upd270918
* Update G-API code base to 27-Sep-18

Changes mostly improve standalone build support

* G-API code base update 28-09-2018

* Windows/Documentation warnings should be fixed
* Fixed stability issues in Fluid backend
* Fixed precompiled headers issues in G-API source files

* G-API code base update 28-09-18 EOD

* Fixed several static analysis issues
* Fixed issues found when G-API is built in a standalone mode
2018-09-28 18:42:09 +03:00
Alexander Alekhin 66fdddc339 Merge pull request #12656 from alalek:fix_documentation_build 2018-09-28 14:16:25 +00:00
Andrew Mroczkowski 3c5a6be835 Fix Xcode version parsing error (affects bitcode generation)
The regex was only parsing for a single digit in the major version, causing Xcode 10 to be treated as version "1". Other parts of the script only turn on bitcode generation if the Xcode version is > 7.
2018-09-28 17:01:40 +03:00
Alexander Alekhin 5575171652 Merge pull request #12673 from alalek:fix_build_warnings
* fix build warnings

* python: forbid wrapping of functions with "void*" arguments
2018-09-28 16:53:05 +03:00
Alexander Alekhin a8b0db4e5d Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-28 14:14:47 +03:00
Alexander Alekhin 4b895a4d1f Merge pull request #12657 from alalek:docs_repair_cuda_section 2018-09-28 09:45:50 +00:00
Dmitry Kurtaev e9f99063c7 JavaScript bindings for features2d module 2018-09-28 11:04:13 +03:00
Hamdi Sahloul e104fcc000 Generate enum bindings automatically 2018-09-28 15:39:51 +09:00
Peter Whidden 9f0ff03da5 Fix typo "wit" -> "with" 2018-09-27 14:37:59 -07:00
Alexander Alekhin 9ba659af84 Merge pull request #12660 from alalek:flann_drop_useless_mutex 2018-09-27 19:46:59 +00:00
Rostislav Vasilikhin be989b3b60 Merge pull request #12637 from savuor:fix/instr_ipp_ocl
Fixes for instrumentation of IPP and OCL (#12637)

* fixed warning about re-declaring variable when both IPP and instrumentation are enabled

* fixed segfault when no funName provided

* compilation fixed when both OCL and instrumentation are enabled
2018-09-27 22:39:06 +03:00
Alexander Alekhin 0706bd72b8 Merge pull request #12671 from alalek:fix_build_warnings_3.4 2018-09-27 16:23:05 +00:00
Alexander Alekhin f6dc396a0f Merge pull request #12568 from sturkmen72:patch-3 2018-09-27 13:42:44 +00:00
Alexander Alekhin 48e8e76a34 fix build warnings 2018-09-27 16:31:31 +03:00
Alexander Alekhin e4f71994c2 calib3d: findChessboardCornersSB() minor updates
- avoid updating of input image during equalizeHist() call
- avoid for() with double variable (use 'int' instead)
- more CV_Check*() macros
- use Mat_<T>, Matx
- static for local variables
2018-09-27 15:38:01 +03:00
Alexander Alekhin fae329a0ca Merge pull request #12650 from alalek:dnn_ocl4dnn_verification_test
* dnn(ocl4dnn): update kernel checks

* dnn: workaround for IDLF kernels on Intel iGPU

* dnn(test): remove "skip" check for unstable cases
2018-09-27 12:54:23 +03:00
Dmitry Matveev 29e88e50ff Merge pull request #12608 from dmatveev:gapi
* G-API Initial code upload

* Update G-API code base to Sep-24-2018

* The majority of OpenCV buildbot problems was addressed

* Update G-API code base to 24-Sep-18 EOD

* G-API code base update 25-Sep-2018

* Linux warnings should be resolved
* Documentation build should become green
* Number of Windows warnings should be reduced

* Update G-API code base to 25-Sep-18 EOD

* ARMv7 build issue should be resolved
* ADE is bumped to latest version and should fix Clang builds for macOS/iOS
* Remaining Windows warnings should be resolved
* New Linux32 / ARMv7 warnings should be resolved

* G-API code base update 25-Sep-2018-EOD2

* Final Windows warnings should be resolved now

* G-API code base update 26-Sep-2018

* Fixed issues with precompiled headers in module and its tests
2018-09-26 21:50:39 +03:00
Alexander Alekhin 52f52f6786 flann: drop useless mutex 2018-09-26 19:37:44 +03:00
Alexander Alekhin 852f061b26 Merge pull request #12655 from alalek:fix_printf_format_warning 2018-09-26 16:21:07 +00:00
Alexander Alekhin fe56bdeeb9 Merge pull request #12647 from alalek:cmake_js_cleanup
* cmake: js cleanup

- avoid unnecessary 2 messages for other platforms
- drop MODULE_NAME variable

* js: cleanup build_js.py
2018-09-26 18:53:02 +03:00
Vadim Pisarevsky b34d86ca24 Merge pull request #12548 from alalek:videoio_backend_name 2018-09-26 15:19:55 +00:00
Dmitry Kurtaev 24ab751547 Merge pull request #12565 from dkurt:dnn_non_intel_gpu
* Remove isIntel check from deep learning layers

* Remove fp16->fp32 fallbacks where it's not necessary

* Fix Kernel::run to prevent localsize > globalsize
2018-09-26 16:27:00 +03:00
Dmitry Kurtaev c8f3579f93 Fix #12542 (#12603)
* Fix #12542

* Remove ignore of non-virtual-dtor error
2018-09-26 16:08:51 +03:00
Menghui Xie f0d277e452 M_PI changed to CV_PI (#12645)
* M_PI changed to CV_PI

* M_PI changed to CV_PI

* M_PI changed to CV_PI
2018-09-26 16:05:02 +03:00
Alexander Alekhin 962dc21f2b docs: fix CUDA docs section 2018-09-26 15:36:55 +03:00
Alexander Alekhin 2e8483bd1c docs: fix build without opencv_contrib (avoid links to CUDA modules) 2018-09-26 15:24:52 +03:00
Alexander Alekhin 3eec8fd0eb dnn: fix printf format warning 2018-09-26 14:06:04 +03:00
Alexander Alekhin 43e66e7ff9 Merge pull request #12644 from dkurt:dnn_out_layers_names 2018-09-25 16:12:59 +00:00
Dmitry Kurtaev ad5898224d Add a file with preprocessing parameters for deep learning networks 2018-09-25 18:28:37 +03:00
Dmitry Kurtaev f8398d80bc add Net::getUnconnectedOutLayersNames method 2018-09-25 18:10:45 +03:00
Alexander Alekhin d8d025c33b Merge pull request #12599 from mshabunin:printf 2018-09-25 14:44:21 +00:00
Alexander Duda 8811dabbac Merge pull request #12615 from D-Alex:master
findChessboardCornersSB: speed improvements (#12615)

* chessboard: fix do not modify const image

* chessboard: speed up scale space using parallel_for

* chessboard: small improvements

* chessboard: speed up board growing using parallel_for

* chessboard: add flags for tuning detection

* chessboard: fix compiler warnings

* chessborad: change flag name to CALIB_CB_EXHAUSTIVE

This also fixes a typo

* chessboard: fix const ref + remove to_string
2018-09-25 17:06:46 +03:00
Alexander Alekhin 9faacfbc0d Merge pull request #12639 from tomoaki0705:fixFp16CudaFailure 2018-09-25 13:19:51 +00:00
Alexander Alekhin a610be6335 Merge pull request #12591 from sturkmen72:patch-6 2018-09-25 10:05:16 +00:00
Tomoaki Teshima 6a5266df79 fix CvFp16Test failure 2018-09-25 15:00:37 +09:00
Alexander Alekhin 238a3806b0 Merge pull request #12632 from mshabunin:move-opengl-sample 2018-09-24 17:53:11 +00:00
Alexander Alekhin a07a4cefe1 Merge pull request #12629 from cv3d:fix/opengl 2018-09-24 11:32:07 +00:00
Maksim Shabunin a0211a1c2f Moved OpenGL sample to opengl folder 2018-09-24 13:13:30 +03:00
Hamdi Sahloul 47bb09bc4b OpenGL: avoid losing precision in double-to-float conversion 2018-09-24 19:06:48 +09:00
Alexander Alekhin efca746d36 Merge pull request #12622 from cv3d:fix/js_property 2018-09-24 09:36:51 +00:00
Alexander Alekhin 93b0b03447 docs: DOXYGEN_BLACKLIST CMake variable for modules exclusion 2018-09-24 11:34:03 +03:00
Maksim Shabunin e0f524d3b7 Fixed several incorrect printf format specifiers 2018-09-24 11:31:40 +03:00
Pavel Rojtberg d1c842cf29 core: fix printf warnings by using c++11 format 2018-09-24 11:31:40 +03:00
Pavel Rojtberg 4d23a5d92d core: enable printf format warnings for cv::format 2018-09-24 11:31:40 +03:00
Hamdi Sahloul 0739d1c2eb JS: Support enum properties 2018-09-24 16:37:52 +09:00
Alexander Alekhin 475c775b25 Merge pull request #12621 from cv3d:fix/opengl 2018-09-23 20:00:53 +00:00
Hamdi Sahloul b7e8ce4523 fix a bug in OpenGL 2018-09-23 23:07:28 +09:00
Alexander Alekhin 0a23c1bf11 Merge pull request #12614 from alalek:winpack_samples_python_launcher_update 2018-09-23 13:37:36 +00:00
Alexander Alekhin e8fcd721b8 Merge pull request #12612 from alalek:winpack_samples_python_launcher_update 2018-09-22 20:44:46 +00:00
Alexander Alekhin ecef7f7930 samples: update winpack python samples launcher
- accepts script parameter (allows drag & drop from 'explorer')
- use script dir instead of current dir (can launch samples from 'samples/dnn')
- added 'pause' to show error messages (about missing numpy) instead of instant closing
2018-09-22 17:28:58 +00:00
Hamdi Sahloul 5db13fe2a7 cuda::polarToCart: update documentation 2018-09-22 07:02:43 +09:00
Hamdi Sahloul 9932612373 cuda::polarToCart: test double precision and tune tolerance 2018-09-22 07:02:43 +09:00
Hamdi Sahloul 6203c95d31 cuda::polarToCart: Support double precision 2018-09-22 07:02:43 +09:00
Alexander Alekhin d5d19a9f67 Merge pull request #12592 from alalek:dnn_test_at_least_one 2018-09-21 16:49:51 +00:00
Hamdi Sahloul ef5579dc86 Merge pull request #12310 from cv3d:chunks/enum_interface
* Cleanup macros and enable expansion of `__VA_ARGS__` for Visual Studio

* Macros for enum-arguments backwards compatibility

* Convert struct Param to enum struct

* Enabled ParamType.type for enum types

* Enabled `cv.read` and `cv.write` for enum types

* Rename unnamed enum to AAKAZE.DescriptorType

* Rename unnamed enum to AccessFlag

* Rename unnamed enum to AgastFeatureDetector.DetectorType

* Convert struct DrawMatchesFlags to enum struct

* Rename unnamed enum to FastFeatureDetector.DetectorType

* Rename unnamed enum to Formatter.FormatType

* Rename unnamed enum to HOGDescriptor.HistogramNormType

* Rename unnamed enum to DescriptorMatcher.MatcherType

* Rename unnamed enum to KAZE.DiffusivityType

* Rename unnamed enum to ORB.ScoreType

* Rename unnamed enum to UMatData.MemoryFlag

* Rename unnamed enum to _InputArray.KindFlag

* Rename unnamed enum to _OutputArray.DepthMask

* Convert normType enums to static const NormTypes

* Avoid conflicts with ElemType

* Rename unnamed enum to DescriptorStorageFormat
2018-09-21 18:12:35 +03:00
Hamdi Sahloul 84ae8097b1 Merge pull request #12601 from cv3d:fix/js
* JS: Support enum types in constructors

* JS: Avoid unary expression on enum-based consts
2018-09-21 18:11:46 +03:00
Alexander Alekhin f33f236ab6 Merge pull request #12598 from cv3d:cmake/js 2018-09-21 14:59:27 +00:00
Hamdi Sahloul 95b1fe0776 JS: Provides meaningful message in case of compile issues 2018-09-21 04:02:34 +09:00
Hamdi Sahloul 35bee663eb JS: Improves Emscripten detection 2018-09-21 04:02:34 +09:00
Suleyman TURKMEN 98f6ea0785 Update hog.cpp 2018-09-20 13:45:01 +03:00
Alexander Alekhin 295b988657 Merge tag '4.0.0-alpha' 2018-09-19 20:47:17 +00:00
Alexander Alekhin 68942affdb release: OpenCV 4.0.0-alpha (version++) 2018-09-19 19:30:30 +03:00
Alexander Alekhin e0980c4d73 Merge pull request #12585 from alalek:move_cuda_modules
cuda: move CUDA modules to opencv_contrib: https://github.com/opencv/opencv_contrib/pull/1781
2018-09-19 19:30:02 +03:00
Alexander Alekhin c5920df159 cuda: move CUDA modules to opencv_contrib
OpenCV 4.0+
2018-09-19 18:57:00 +03:00
Alexander Alekhin 86ddff0b88 Merge pull request #12401 from alalek:opencv_install_paths 2018-09-19 15:49:47 +00:00
Alexander Alekhin 908978d00b Merge pull request #12589 from xoox:fix-stddev-request 2018-09-19 15:07:58 +00:00
Alexander Alekhin a956732874 cmake: update install paths (Linux) 2018-09-19 15:43:52 +03:00
Alexander Alekhin 879e046b22 Merge pull request #12586 from Slyce-Inc:bug-xcode10-compile 2018-09-19 10:58:51 +00:00
Alexander Alekhin e0a5824028 dnn(test): test at least CPU code path 2018-09-19 13:56:59 +03:00
Alexander Alekhin 5fb0f34e8a Merge pull request #12570 from alalek:drop_usrtype1
* core: drop usage of CV_USRTYPE1 in OpenCV

avoid OpenCV crashes due size change CV_ELEM_SIZE(CV_USRTYPE1): 8 -> 2

* ! fix persistence internal types
2018-09-19 13:55:26 +03:00
Alexander Alekhin 861415133e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-19 10:58:43 +03:00
Alexander Alekhin 87b1835cb6 Merge pull request #12587 from alalek:ts_update_valgrind_test_filter 2018-09-19 07:37:21 +00:00
Wenfeng CAI fce75cd858 Fix failure to request stddev of non-intrinsics
Before this fix, the code would fail if only standard deviations of
extrinsic parameters are requested. While standard deviations matrix
should be computed if any set of standard deviations is requested. A
variable is added to represent this case.
2018-09-19 12:27:07 +08:00
Alexander Alekhin ec9c53eeff ts: update valgrind test filter
- DNN: avoid very large models
- build filter per module
- fixed longTestFilter
2018-09-19 00:55:56 +00:00
Andrew Mroczkowski b6d5565df1 build: fix Xcode 10 build problems
Updating the base SDK from 6.0 to 8.0 where applicable
2018-09-18 15:42:03 -04:00
Alexander Alekhin d3eed2cf23 videoio: CAP_PROP_BACKEND property interface 2018-09-18 16:25:01 +00:00
Alexander Alekhin 51f7eb3a3c videoio(test): add "camera" tests
- disabled due specific requirements (camera, OpenNI camera, etc)
- designed for manual validation
2018-09-18 16:19:19 +00:00
Alexander Alekhin b35fbff675 videoio: added '.getBackendName()' method 2018-09-18 16:19:19 +00:00
Alexander Alekhin 15e9e3304c Merge pull request #12579 from dkurt:dnn_reset_myriad_device 2018-09-18 16:14:38 +00:00
Alexander Alekhin 3961b214f0 Merge pull request #12577 from dkurt:dnn_tf_scripts 2018-09-18 16:13:59 +00:00
Alexander Alekhin 53ad291ef1 Merge pull request #12572 from alalek:ffmpeg_update_master 2018-09-18 16:12:10 +00:00
Alexander Alekhin 145d3ba99d Merge pull request #12574 from alalek:fixes_master 2018-09-18 11:16:24 +00:00
Dmitry Kurtaev 8ac7b21716 Enable Myriad device for OpenVINO models test 2018-09-18 13:49:24 +03:00
Alexander Alekhin e6171d17f8 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-18 12:49:52 +03:00
Alexander Alekhin de54d45afd Merge pull request #12573 from alalek:fixes_3.4 2018-09-18 09:47:22 +00:00
Alexander Alekhin 3cab9e7a9c 3.4: fixes 2018-09-18 08:31:11 +00:00
Alexander Alekhin aa1c86f95e ts: flush stdout/stderr before and after test code run 2018-09-18 08:04:52 +00:00
Alexander Alekhin 699565828d videoio(test): dump file size information 2018-09-18 08:04:51 +00:00
Dmitry Kurtaev b0ad7f759a Import tensorflow to create text graphs if import cv is failed 2018-09-18 09:11:51 +03:00
Suleyman TURKMEN 30597e5c98 Update seamless_cloning.cpp 2018-09-18 07:22:39 +03:00
Alexander Alekhin 38de2a8754 calib3d: fix build warnings 2018-09-17 22:16:31 +00:00
Alexander Alekhin 8b661cde15 ffmpeg: update 4.0 (master)
- ffmpeg 4.0.2
- openh264 1.8.0
2018-09-17 21:36:52 +00:00
Alexander Alekhin 70f38b4dfa Merge pull request #12510 from take1014:doc_hough 2018-09-17 21:39:12 +03:00
Alexander Alekhin d389edd843 Merge pull request #12528 from dkurt:dnn_py_tests 2018-09-17 18:34:43 +00:00
Alexander Alekhin 27a4e370f9 Merge pull request #12559 from dkurt:dnn_remove_usrtype1 2018-09-17 18:13:29 +00:00
Alexander Alekhin b4fd3e8674 Merge pull request #12563 from cv3d:bug/cuda_msseg 2018-09-17 18:09:11 +00:00
Lubov Batanina 43f889ae1f Merge pull request #12519 from l-bat:l-bat/onnx_parser
Support asymmetric padding in pooling layer (#12519)

* Add Inception_V1 support in ONNX

* Add asymmetric padding in OpenCL and Inference engine

* Refactoring
2018-09-17 20:26:17 +03:00
Gaetano Checinski e628fd7bce Merge pull request #12503 from nikhedonia:12500-move-gcgraph
* feat: move gcgraph to detail

* chore: puts gcgraph cv::detail namespace
2018-09-17 20:13:47 +03:00
Dmitry Kurtaev 7d75526373 Use TorchType enum 2018-09-17 18:55:05 +03:00
Hamdi Sahloul ecc9bd0925 Support GpuMat in copyTo() functions 2018-09-17 23:43:14 +09:00
Dmitry Kurtaev d259eb28bb Add python tests for dnn module 2018-09-17 15:22:47 +03:00
Alexander Alekhin 76d4aa0c06 Merge pull request #12531 from VladKarpushin:tutorial-using-anisotropic-image-segmentation 2018-09-17 12:06:46 +00:00
Vadim Pisarevsky 2113818f19 Merge pull request #12364 from dkurt:dnn_change_blob_from_image 2018-09-17 12:04:41 +00:00
Alexander Alekhin 29bee6f07e cmake: move Matlab scripts to opencv_contrib (#12541)
* matlab: move to opencv_contrib

* cmake: preserve variables scope for processing modules

- use macro instead of function to avoid scope resets
2018-09-17 14:55:42 +03:00
Dmitry Kurtaev a7b3d2581f Replace CV_USRTYPE1 for int64 to CV_32SC2 in Torch importer 2018-09-17 12:31:09 +03:00
Alexander Alekhin 3512cb2226 Merge pull request #12529 from gkaneto:master
Minor changes in docs (Python Tutorials)
2018-09-15 22:52:37 +03:00
gkaneto 96a50d5eb0 Update py_basic_ops.markdown
Correcting indentation of border type flags
2018-09-15 19:35:40 +00:00
gkaneto 79db32bcd9 Update py_trackbar.markdown
For some mysterious (for me) reason, two lines of the code appears in my browser (Chrome) in the same line.
I've add an "enter" (just pressed enter), but don't know if it's the best solution.
2018-09-15 19:35:40 +00:00
Alexander Alekhin 808ba552c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-14 23:44:35 +00:00
Alexander Alekhin 14b438317e Merge pull request #12512 from sturkmen72:patch-1 2018-09-14 17:27:14 +00:00
Suleyman TURKMEN 6d5f7b72c0 Update seamless_cloning.cpp 2018-09-14 19:51:40 +03:00
Alexander Alekhin cecb878915 Merge pull request #12527 from terfendail:mean_wintr 2018-09-14 16:34:30 +00:00
Alexander Alekhin 29c10b6792 Merge pull request #12535 from terfendail:testparser_update 2018-09-14 16:32:25 +00:00
Alexander Alekhin 92ec971453 Merge pull request #12526 from terfendail:avx2_resize_fix 2018-09-14 15:57:47 +00:00
Vitaly Tuzov 95502242c9 meanStdDev() implementation updated to use wide universal intrinsics 2018-09-14 17:52:08 +03:00
Vitaly Tuzov 1f88a1af9c testlog_parser updated to handle output of latest GTest as well 2018-09-14 17:29:06 +03:00
Alexander Alekhin 65e2961fee Merge pull request #12530 from cv3d:lint/instrument_semicolon 2018-09-14 08:57:31 +00:00
Karpushin Vladislav c5687caf1a doc: add new tutorial anisotropic image segmentation 2018-09-14 13:14:17 +07:00
Hamdi Sahloul 5d54def264 Add semicolons after CV_INSTRUMENT macros 2018-09-14 06:45:31 +09:00
Alexander Alekhin dbfeb8892d Merge pull request #12403 from dkurt:dnn_replace_darknet_reorg 2018-09-13 20:58:11 +00:00
Alexander Alekhin 949d7d7d25 Merge pull request #12524 from alalek:fix_dnn_skx_dlie 2018-09-13 20:56:31 +00:00
Takuho NAKANO 451340fd3d Merge pull request #12523 from takotakot:12455_rotatedrect_constructor
* Fix perpendicular decision of RotatedRect::RotatedRect

Error estimation is based on #12455.

* Fix abs to std::fabs and atan to std::atan
2018-09-13 22:26:05 +03:00
Alexander Alekhin fdaeb20253 dnn(test): run DL IE tests on Intel OpenCL devices only 2018-09-13 15:45:51 +00:00
Vitaly Tuzov 29770e13e8 Fixed bit-exact resize SIMD implementation for AVX2 baseline 2018-09-13 18:20:27 +03:00
Alexander Alekhin e51d7cb3d8 Merge pull request #12502 from alalek:fix_dnn_tests_32bit 2018-09-13 14:20:42 +00:00
Alexander Alekhin d66f3efd36 Merge pull request #12504 from kraj:3.4 2018-09-13 14:19:25 +00:00
Alexander Alekhin f512bf7004 Merge pull request #12522 from mshabunin:remove-va-msdk-34 2018-09-13 14:15:59 +00:00
Alexander Alekhin 63affb2be9 Merge pull request #12515 from hmaarrfk:fix_bayer2rgba_blue_channel 2018-09-13 12:53:08 +00:00
Alexander Alekhin 87b1100027 Merge pull request #12410 from terfendail:sum_wintr 2018-09-13 15:49:56 +03:00
Alexander Duda a024593fa6 Merge pull request #12147 from D-Alex:master
* add new chessboard detector

The chessboar detector is based on the paper.
Accurate Detection and Localization of Checkerboard Corners for
Calibration Alexander Duda, Udo Frese
British Machine Vision Conference, o.A., 2018.

It utilizes point symmetry of checkerboard corners in combination with a
localized Radon transform approximated by box filters to achieve high
performance even on large images. Here, tests have shown that the
ability to localize checkerboard corners is close to the theoretical
limit of 1/100 of a pixel while being considerably less sensitive
to image noise than standard methods.

* chessboard: add reference to bibtex file

* chessboard: add dependency to opencv_flann

* fix: test chesscorners. It is valid to return an empty list

In case no chessboard was detected it should be valid for the detector
to return an empty list.

For simplifcation, it should be allowed to return any number of corners
if they are flagged as not found.

* fix: opencv.bib remove empty lines

* fix: doc findChessboardCorners replace cvSize with cv::Size

* chessboard tests: factor out logic selecting detector

* chessboard: add unit test for findChessboardCorners2

This is includes a new chessboard generator which supports subpix
corners with high accuracy by wrapping an optimal chessboard using
wrapPerspective.

* fix: chessboard unit test - overwrite of default parameter flag of findCirclesGrid

* chessboard: remove trailing whitespace

* chessboard: fix debug drawing

* chessboard: fix some issues during code review

* chessboard: normalize asymmetric chessboard

* chessboard: fix float double warning

* remove trailing whitespace

* chessboards: fix compiler warnings

* chessboards: fix compiler warnings

* checkerboard: some performance improvements

* chessboard: remove NULL macros for language bindinges from internal headers

* chessboard: shorten license terms

* chessboard: remove unused internal method

* chessboard: set helper functions to static

* chessboard: fix normalizePoints1D using unshifted points

* chessboard: remove wrongly copied text

* chessboard: use CV_CheckTypeEQ macro

* chessboard: comment all NaN checks

* chessboard: use consistent color conversion

* chessboard: use CheckChannelEQ macro

* chessboard: assume gray color image for internal methods

* chessboard: use std::swap

* chessboard: use Mat.dataend

* chessboard: fix compiler warnings

* chessboard: replace some checks witch CV_CHECK macro

* chessboard: fix comparison function for partial sort

* chessboard: small cleanup

* chessboard: use short license header

* chessboard: rename findChessboard2 to findChessboardSB

* chessboard: fix type in unit test
2018-09-13 15:43:04 +03:00
Maksim Shabunin 78c500e97a Removed unnecessary build-time MediaSDK detection 2018-09-13 13:43:11 +03:00
Khem Raj a4f53988c4 Check for clang before using -isystem
When cross compiling with clang, the internal C++ headers are not found
when adding sysroot to -isystem, that is redundant anyway because it
will look for headers insider --sysroot path with same quality as it
would do with -isystem otherwise

Fixes errors like

FAILED: 3rdparty/openexr/CMakeFiles/IlmImf.dir/Iex/IexBaseExc.cpp.o
....
In file included from
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/git/3rdparty/openexr/Iex/IexBaseExc.cpp:43:
In file included from
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/git/3rdparty/openexr/Iex/IexBaseExc.h:48:
In file included from
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/recipe-sysroot/usr/lib//arm-bec-linux-musleabi/8.2.0/../../../include/c++/8.2.0/string:52:
In file included from
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/recipe-sysroot/usr/lib//arm-bec-linux-musleabi/8.2.0/../../../include/c++/8.2.0/bits/basic_string.h:6391:
In file included from
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/recipe-sysroot/usr/lib//arm-bec-linux-musleabi/8.2.0/../../../include/c++/8.2.0/ext/string_conversions.h:41:
TOPDIR/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/opencv/3.4.3+gitAUTOINC+b38c50b3d0_1f6d6f0626_bdb7bb85f3_34e4206aef_fccf7cd6a4-r0/recipe-sysroot/usr/lib//arm-bec-linux-musleabi/8.2.0/../../../include/c++/8.2.0/cstdlib:75:15:
fatal error: 'stdlib.h' file not found
              ^~~~~~~~~~
1 error generated.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-09-12 18:16:39 -07:00
Alexander Alekhin 347e09cd07 Merge pull request #12511 from GeorgeMironov:rename-tf-namespace 2018-09-12 20:13:43 +00:00
Mark Harfouche 095b0d3272 Fix BayerXX2RGBA when blue is on the first line. 2018-09-12 16:06:44 -04:00
Alexander Alekhin 87b5737293 Merge pull request #12509 from alalek:fix_cv_ptr_default_deleter 2018-09-12 18:45:01 +00:00
Alexander Alekhin b7b82c1cef dnn(tensorflow): re-generate files using protoc 2018-09-12 21:33:45 +03:00
George Mironov cb5da8983f Rename tensorflow namespace 2018-09-12 21:33:11 +03:00
Alexander Alekhin 796795ac89 Merge pull request #12501 from alalek:fix_qt_build 2018-09-12 17:14:23 +00:00
Alexander Alekhin 3e8934dec0 Merge pull request #12507 from cv3d:fix_warnings 2018-09-12 17:12:46 +00:00
Dmitry Kurtaev 58ac3e09da Change default value of crop argument of blobFromImage from true to false 2018-09-12 19:02:58 +03:00
Dmitry Kurtaev 09fa758725 Replace Darknet's Reorg to permute layer 2018-09-12 18:13:39 +03:00
take1014 57ae3ac7a2 fix document about HoughLines 2018-09-12 22:18:30 +09:00
Alexander Alekhin 6fc855865f dnn(test): fix failures of 32-bit builders 2018-09-12 13:06:16 +00:00
Alexander Alekhin b80c978f5d core: change cv::Ptr DefaultDeleter 2018-09-12 12:20:15 +00:00
Vadim Pisarevsky f4b9acb4db Merge pull request #12497 from tomoaki0705:removeRawSSE 2018-09-12 11:59:44 +00:00
Vadim Pisarevsky acbfd85737 Merge pull request #12204 from allnes:detect_qr_code 2018-09-12 11:55:44 +00:00
Hamdi Sahloul 03b3be0f51 MSVC: Slience external/meaningless warnings 2018-09-12 20:02:13 +09:00
Marat K 38f8fc6c82 Merge pull request #12249 from kopytjuk:feature/region-layer-batch-mode
Feature/region layer batch mode (#12249)

* Add batch mode for Darknet networks.

Swap variables in test_darknet.

Adapt reorg layer to batch mode.

Adapt region layer.

Add OpenCL implementation.

Remove trailing whitespace.

Bugifx reorg opencl implementation.

Fix bug in OpenCL reorg.

Fix modulo bug.

Fix bug.

Reorg openCL.

Restore reorg layer opencl code.

OpenCl fix.

Work on openCL reorg.

Remove whitespace.

Fix openCL region layer implementation.

Fix bug.

Fix softmax region opencl bug.

Fix opencl bug.

Fix openCL bug.

Update aff_trans.cpp

When the fullAffine parameter is set to false, the estimateRigidTransform function maybe return empty, then the _localAffineEstimate function will be called, but the bug in it will result in incorrect results.

core(libva): support YV12 too

Added to CPU path only.
OpenCL code path still expects NV12 only (according to Intel OpenCL extension)

cmake: allow to specify own libva paths

via CMake:
- `-DVA_LIBRARIES=/opt/intel/mediasdk/lib64/libva.so.2\;/opt/intel/mediasdk/lib64/libva-drm.so.2`

android: NDK17 support

tested with NDK 17b (17.1.4828580)

Enable more deep learning tests using Intel's Inference Engine backend

ts: don't pass NULL for std::string() constructor

openvino: use 2018R3 defines

experimental version++

OpenCV version++

OpenCV 3.4.3

OpenCV version '-openvino'

openvino: use 2018R3 defines

Fixed windows build with InferenceEngine

dnn: fix variance setting bug for PriorBoxLayer

- The size of second channel should be size[2] of output tensor,
- The Scalar should be {variance[0], variance[0], variance[0], variance[0]}
  for _variance.size() == 1 case.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

Fix lifetime of networks which are loaded from Model Optimizer IRs

Adds a small note describing BUILD_opencv_world (#12332)

* Added a mall note describing BUILD_opencv_world cmake option to the Installation in Windows tutorial.

* Made slight changes in BUILD_opencv_world documentation.

* Update windows_install.markdown

improved grammar

Update opengl_interop.cpp

resolves #12307

java: fix LIST_GET macro

fix typo

Added option to fail on missing testdata

Fixed that object_detection.py does not work in python3.

cleanup: IPP Async (IPP_A)

except header file with conversion routines (will be removed in OpenCV 4.0)

imgcodecs: add null pointer check

Include preprocessing nodes to object detection TensorFlow networks (#12211)

* Include preprocessing nodes to object detection TensorFlow networks

* Enable more fusion

* faster_rcnn_resnet50_coco_2018_01_28 test

countNonZero function reworked to use wide universal intrinsics instead of SSE2 intrinsics

resolve #5788

imgcodecs(webp): multiple fixes

- don't reallocate passed 'img' (test fixed - must use IMREAD_UNCHANGED / IMREAD_ANYCOLOR)
- avoid memory DDOS
- avoid reading of whole file during header processing
- avoid data access after allocated buffer during header processing (missing checks)
- use WebPFree() to free allocated buffers (libwebp >= 0.5.0)
- drop unused & undefined `.close()` method
- added checks for channels >= 5 in encoder

ml: fix adjusting K in KNearest (#12358)

dnn(perf): fix and merge Convolution tests

- OpenCL tests didn't run any OpenCL kernels
- use real configuration from existed models (the first 100 cases)
- batch size = 1

dnn(test): use dnnBackendsAndTargets() param generator

Bit-exact resize reworked to use wide intrinsics (#12038)

* Bit-exact resize reworked to use wide intrinsics

* Reworked bit-exact resize row data loading

* Added bit-exact resize row data loaders for SIMD256 and SIMD512

* Fixed type punned pointer dereferencing warning

* Reworked loading of source data for SIMD256 and SIMD512 bit-exact resize

Bit-exact GaussianBlur reworked to use wide intrinsics (#12073)

* Bit-exact GaussianBlur reworked to use wide intrinsics

* Added v_mul_hi universal intrinsic

* Removed custom SSE2 branch from bit-exact GaussianBlur

* Removed loop unrolling for gaussianBlur horizontal smoothing

doc: fix English gramma in tutorial out-of-focus-deblur filter (#12214)

* doc: fix English gramma in tutorial out-of-focus-deblur filter

* Update out_of_focus_deblur_filter.markdown

slightly modified one sentence

doc: add new tutorial motion deblur filter (#12215)

* doc: add new tutorial motion deblur filter

* Update motion_deblur_filter.markdown

a few minor changes

Replace Slice layer to Crop in Faster-RCNN networks from Caffe

js: use generated list of OpenCV headers

- replaces hand-written list

imgcodecs(webp): use safe cast to size_t on Win32

* Put Version status back to -dev.

follow the common codestyle

Exclude some target engines.

Refactor formulas.

Refactor code.

* Remove unused variable.

* Remove inference engine check for yolov2.

* Alter darknet batch tests to test with two different images.

* Add yolov3 second image GT.

* Fix bug.

* Fix bug.

* Add second test.

* Remove comment.

* Add NMS on network level.

* Add helper files to dev.

* syntax fix.

* Fix OD sample.

Fix sample dnn object detection.

Fix NMS boxes bug.

remove trailing whitespace.

Remove debug function.

Change thresholds for opencl tests.

* Adapt score diff and iou diff.

* Alter iouDiffs.

* Add debug messages.

* Adapt iouDiff.

* Fix tests
2018-09-12 13:29:43 +03:00
jsxyhelu 7828854c9d Merge pull request #12206 from jsxyhelu/3.4
find innercircle of contour by using pointPolygonTest: (#12206)
2018-09-11 23:58:01 +03:00
Alexander Alekhin d7ac4495c3 highgui: fix QT build 2018-09-11 20:30:50 +00:00
Alexander Alekhin 492ef14550 Merge pull request #12494 from DEEPIR:3.4 2018-09-11 19:38:00 +00:00
Hamdi Sahloul 10ae0c4364 Merge pull request #12486 from cv3d:fix_cpp11
Support MSVC 2013 (#12486)

* Added CV_CONSTEXPR macro

* Utilize CV_NOEXCEPT and CV_CONSTEXPR

* Provides some Ptr<> logical operators
2018-09-11 22:35:03 +03:00
Alexander Alekhin be2ccdbf0b Merge pull request #12479 from sturkmen72:patch-2 2018-09-11 19:33:50 +00:00
Alexander Alekhin cb3ae1232b Merge pull request #12478 from alalek:fix_python_converters 2018-09-11 19:33:11 +00:00
Alexander Alekhin e73e393c82 Merge pull request #12477 from alalek:drop_legacy_headers 2018-09-11 19:31:16 +00:00
Tomoaki Teshima 88b04c3cd4 remove raw SSE2 implementation 2018-09-11 21:28:18 +09:00
Alexander Nesterov 1fb7ee0e16 Optimiaztion search template lines and added sample 2018-09-11 11:46:36 +00:00
cyy 8f78a1123b fix uninitialized read errors reported by CUDA-INITCHECK 2018-09-11 14:47:39 +08:00
Alexander Alekhin d7885ed819 Merge pull request #12482 from GeorgeMironov:protobuf-cmake-fix 2018-09-11 06:35:47 +00:00
Alexander Alekhin b9fd5f8186 Merge pull request #12483 from terfendail:meanstddev_multichan 2018-09-10 19:27:51 +00:00
Lubov Batanina 0c8590027f Merge pull request #12071 from l-bat/l-bat:onnx_parser
* Add Squeezenet support in ONNX

* Add AlexNet support in ONNX

* Add Googlenet support in ONNX

* Add CaffeNet and RCNN support in ONNX

* Add VGG16 and VGG16 with batch normalization support in ONNX

* Add RCNN, ZFNet, ResNet18v1 and ResNet50v1 support in ONNX

* Add ResNet101_DUC_HDC

* Add Tiny Yolov2

* Add CNN_MNIST, MobileNetv2 and LResNet100 support in ONNX

* Add ONNX models for emotion recognition

* Add DenseNet121 support in ONNX

* Add Inception v1 support in ONNX

* Refactoring

* Fix tests

* Fix tests

* Skip unstable test

* Modify Reshape operation
2018-09-10 21:07:51 +03:00
Vitaly Tuzov 0a5bd0ac8b sum() implementation updated to use wide universal intrinsics 2018-09-10 20:16:38 +03:00
Vitaly Tuzov 2f929376ec Fixed meanStdDev() implementation for the case input matrix has more than 4 channels 2018-09-10 20:05:45 +03:00
Vadim Pisarevsky b01f63835e Merge pull request #12467 from alalek:core_use_shared_ptr 2018-09-10 13:59:14 +00:00
Vadim Pisarevsky 6d7f5871db added basic support for CV_16F (the new datatype etc.) (#12463)
* added basic support for CV_16F (the new datatype etc.). CV_USRTYPE1 is now equal to CV_16F, which may break some [rarely used] functionality. We'll see

* fixed just introduced bug in norm; reverted errorneous changes in Torch importer (need to find a better solution)

* addressed some issues found during the PR review

* restored the patch to fix some perf test failures
2018-09-10 16:56:29 +03:00
Suleyman TURKMEN 30a4e2f7ac Update hog.cpp 2018-09-10 16:49:39 +03:00
George Mironov 8e0781648b Fix include paths when building with external protobuf 2018-09-10 16:39:39 +03:00
Alexander Alekhin 89720ae24d python: fix "unsigned int" / "size_t" overloading conflict 2018-09-10 11:24:47 +00:00
Alexander Alekhin c331a214d0 Merge pull request #12054 from alalek:debug_bindings 2018-09-10 10:44:32 +00:00
Alexander Alekhin 9097ccf515 drop legacy headers 2018-09-10 08:33:16 +00:00
Alexander Alekhin dca657a2fd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-10 00:10:21 +03:00
Alexander Alekhin c35c5a47df Merge pull request #12475 from sturkmen72:patch-1 2018-09-09 20:16:47 +00:00
Alexander Alekhin 17cc21c9d6 Merge pull request #12473 from cv3d:cmake/python_detection 2018-09-09 20:16:28 +00:00
Hamdi Sahloul 5e241e7c36 CMAKE: Improve python detection 2018-09-10 04:40:06 +09:00
Alexander Alekhin df8b057b44 avoid Ptr<> == NULL checks 2018-09-09 19:30:46 +00:00
Alexander Alekhin 64b3c1e691 core(test): update cv::Ptr tests 2018-09-09 19:30:46 +00:00
Alexander Alekhin 15aee09c7f core: replace cv::Ptr implementation => std::shared_ptr 2018-09-09 19:30:46 +00:00
Suleyman TURKMEN 92517fa359 Update window.cpp 2018-09-09 19:24:25 +00:00
Sergey Nuzhny 80610ca054 Merge pull request #12449 from Nuzhny007:master
* Fixed compilation error WITH_OPENMP under Windows

* Move up OpenMP condition
2018-09-08 23:20:14 +03:00
Alexander Alekhin 95dd4b3f27 bindings: add debug helpers for args conversions 2018-09-08 12:23:08 +00:00
Alexander Alekhin 87ed12b8f3 Merge pull request #12465 from hmaarrfk:fix_bayer2rgba 2018-09-08 11:44:04 +00:00
Alexander Alekhin fd0df5a89b Merge pull request #12469 from cv3d:fix/js/python3_msvc 2018-09-08 11:42:11 +00:00
Hamdi Sahloul b487e2df0b opencv_js: Support Python3 and MSVC 2018-09-08 18:23:41 +09:00
Hamdi Sahloul c6ed2bf9aa opencv_js: fix a bug in handling enums using the new parser 2018-09-08 18:23:41 +09:00
Alexander Alekhin 40b1dc12de Merge pull request #12464 from alalek:fix_contrib_1754 2018-09-07 20:03:41 +00:00
Mark Harfouche 53bbed89ae Output RGBA images when bayer_xx2YYYA is called 2018-09-07 16:03:04 -04:00
Alexander Alekhin 8eba3c1e7e Merge pull request #12462 from alalek:issue_12453 2018-09-07 16:55:01 +00:00
Alexander Alekhin b50c70bbfa features2d(test): extract common extract/invariance test code
to share with opencv_contrib/xfeatures2d
2018-09-07 19:30:51 +03:00
cyy 286c2c236b Merge pull request #12458 from DEEPIR:3.4
* may be an typo fix

* remove identical branch,may be paste error

* add parentheses around macro parameter

* simplify if condition

* check malloc fail

* change the condition of branch removed by commit 3041502861
2018-09-07 18:43:47 +03:00
Alexander Alekhin af021e79d9 video(perf): drop unreliable sanity checks 2018-09-07 18:09:00 +03:00
Alexander Alekhin 875de75327 Merge pull request #12460 from cv3d:lint_unused 2018-09-07 13:03:44 +00:00
Hamdi Sahloul a39e0daacf Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
Alexander Alekhin 73bfe68821 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-07 12:40:27 +03:00
Alexander Alekhin f3fae0dae0 Merge pull request #12459 from alalek:fix_cuda_build 2018-09-07 09:27:31 +00:00
Alexander Alekhin 4a73b4859f Merge pull request #12452 from seiko2plus:issue12427 2018-09-07 07:32:15 +00:00
Alexander Alekhin f90aea22b1 cuda: fix build (legacy C-API usage) 2018-09-07 07:26:17 +00:00
Alexander Alekhin bd98ed46bd Merge pull request #12446 from alalek:imgproc_grabcut_numeric_issues 2018-09-06 20:18:45 +00:00
cyy 8b48c2a10c Merge pull request #12443 from DEEPIR:master
* simplify condition

* dims must > 0 or latter sz[dims-1] will underflow
2018-09-06 23:09:39 +03:00
Alexander Alekhin f1f15841d7 Merge pull request #11630 from alalek:c_api_eliminate_constructors 2018-09-06 20:07:16 +00:00
Sayed Adel f5d181db3a python:ppc64 Add missing support for PyLongObject 2018-09-06 20:04:05 +00:00
Vadim Pisarevsky 80b62a41c6 Merge pull request #12411 from vpisarev:wide_convert
* rewrote Mat::convertTo() and convertScaleAbs() to wide universal intrinsics; added always-available and SIMD-optimized FP16<=>FP32 conversion

* fixed compile warnings

* fix some more compile errors

* slightly relaxed accuracy threshold for int->float conversion (since we now do it using single-precision arithmetics, not double-precision)

* fixed compile errors on iOS, Android and in the baseline C++ version (intrin_cpp.hpp)

* trying to fix ARM-neon builds

* trying to fix ARM-neon builds

* trying to fix ARM-neon builds

* trying to fix ARM-neon builds
2018-09-06 19:36:59 +03:00
Vadim Pisarevsky 54279523a3 Merge pull request #12437 from vpisarev:avx2_fixes
* trying to fix the custom AVX2 builder test failures (false alarms)

* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests

* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests

* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests

* seemingly disabled false alarm warning in surf.cpp; increased tolerance thresholds in the tests for SolvePnP and in DNN/ENet
2018-09-06 18:56:55 +03:00
Alexander Alekhin 24e72e151a imgproc: grabcut numeric stability 2018-09-06 17:05:54 +03:00
Alexander Alekhin 8a3c394d6a don't use constructors for C API structures 2018-09-06 14:34:16 +03:00
Alexander Alekhin ad146e5a6b core: remove constructors from C API structures
POD structures can't have constructors.
2018-09-06 14:34:09 +03:00
Alexander Alekhin 66d15e89df Merge pull request #12440 from woodychow:fix_normL2Sqr_speed_regression_3.4 2018-09-06 10:33:33 +00:00
Rostislav Vasilikhin da7e1cfb49 Merge pull request #12279 from savuor:cvtcolor_bgr2gray_8u_15bits
* bgr2gray 8u fixed to be in conformance with IPP code

* coefficients fixed so their sum is 32768

* java test for CascadeDetect fixed: equalizeHist added
2018-09-06 13:28:24 +03:00
Dmitry Kurtaev d486204a0d Merge pull request #12264 from dkurt:dnn_remove_forward_method
* Remove a forward method in dnn::Layer

* Add a test

* Fix tests

* Mark multiple dnn::Layer::finalize methods as deprecated

* Replace back dnn's inputBlobs to vector of pointers

* Remove Layer::forward_fallback from CV_OCL_RUN scopes
2018-09-06 13:26:47 +03:00
woody.chow 07c6b0a8df Replace naive normL2Sqr with hal::normL2Sqr_ for better performance 2018-09-06 17:43:07 +09:00
Alexander Alekhin 43b64140ae Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-05 19:54:09 +03:00
Alexander Alekhin 8e8315abfd Merge pull request #12434 from alalek:pr12414_rebased 2018-09-05 16:46:36 +00:00
Alexander Alekhin a18da0c55e Merge pull request #12355 from sturkmen72:update_samples 2018-09-05 16:24:02 +00:00
Zhenqing Hu d621a99e73 To fix bug #12389, which is a validation for the potential null pointer.
Signed-off-by: Zhenqing Hu <huzq85@gmail.com>
2018-09-05 19:14:34 +03:00
Alexander Alekhin 107660c7ba Merge pull request #12433 from alalek:fix_contrib_1746 2018-09-05 16:09:27 +00:00
Suleyman TURKMEN b33cb2e3f2 Update samples 2018-09-05 18:16:40 +03:00
Alexander Alekhin e70526625f imgproc: fix Subdiv2D::getTriangleList() 2018-09-05 16:24:27 +03:00
Alexander Alekhin 8a328e393d Merge pull request #12408 from dkurt:dnn_myriad_batch_tests 2018-09-05 10:04:04 +00:00
Alexander Alekhin 9fae8070dc Merge pull request #12424 from alalek:fix_build_avoid_nullptr 2018-09-05 09:46:26 +00:00
Dmitry Kurtaev 6ec230480d Enable Myriad tests with batch size > 1 2018-09-05 10:45:09 +03:00
Alexander Alekhin c441ad36c8 build: don't use nullptr without C++11 guard 2018-09-05 06:19:02 +00:00
Alexander Alekhin 59cd636ad7 Merge pull request #12420 from cv3d:fix/gtest_vc12 2018-09-05 06:12:09 +00:00
Hamdi Sahloul 3f3d805663 Workaround for GTest v1.8.1 + Visual Studio 2013 (vc12) 2018-09-05 12:16:47 +09:00
Alexander Alekhin d74b98c3d9 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-04 18:39:03 +00:00
Alexander Alekhin 351ee2e3a5 Merge pull request #12409 from dkurt:fix_12407 2018-09-04 16:34:30 +00:00
Alexander Alekhin 7f7f30a08b Merge pull request #12406 from alalek:backport_12357_12391 2018-09-04 16:09:44 +00:00
Alexander Alekhin e0bfe44cac Merge pull request #12400 from alalek:dnn_update_inline_namespace_master 2018-09-04 15:17:15 +00:00
Alexander Alekhin fda99c1c6c Merge pull request #12394 from alalek:imgproc_GaussianBlur_allow_HAL_8U 2018-09-04 15:16:08 +00:00
Alexander Alekhin 71c8de8fa1 Merge pull request #12383 from alalek:ts_qemu_support 2018-09-04 15:15:39 +00:00
Dmitry Kurtaev 27a6be8763 Fix #12407 2018-09-04 17:48:52 +03:00
Alexander Alekhin acce95f446 backport fixes for static analyzer warnings
Commits:
- 09837928d9
- 10fb88d027

Excluded changes with std::atomic (C++98 requirement)
2018-09-04 16:49:42 +03:00
cyy 10fb88d027 Merge pull request #12391 from DEEPIR:master
fix some errors found by static analyzer. (#12391)

* fix possible divided by zero and by negative values

* only 4 elements are used in these arrays

* fix uninitialized member

* use boolean type for semantic boolean variables

* avoid invalid array index

* to avoid exception and because base64_beg is only used in this block

* use std::atomic<bool> to avoid thread control race condition
2018-09-04 16:39:19 +03:00
Alexander Alekhin a78e5344df Merge pull request #12382 from alalek:update_gtest_1.8.1 2018-09-04 13:28:55 +00:00
Alexander Alekhin e5236cecd6 Merge pull request #12405 from todortomov:3.4_cap_v4l_query_conrtols 2018-09-04 12:55:05 +00:00
Alexander Alekhin 6aff916aa5 Merge pull request #12398 from alalek:samples_eliminate_cvconfig 2018-09-04 11:38:34 +00:00
Alexander Alekhin 4f9db2c03a Merge pull request #12377 from alalek:inputarray_raw_wrapper_customtype 2018-09-04 11:29:23 +00:00
Todor Tomov 9988e1b6ee cap_v4l: Fix private control enumeration end condition
Currently the private control enumeration will be stopped when QUERYCTRL
returns -EINVAL only. It is possible however that other errors occur.

One particular case is when the v4l2 device doesn't support any controls
and doesn't implement the QUERYCTRL ioctl. In that case the v4l2
framework returns -ENOTTY. In that case the current control enumeration
will go in an endless loop.

To fix this change the control enumeration stop condition. If any errors
occur, end the control enumeration.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
2018-09-04 11:33:08 +03:00
Alexander Alekhin afb81ba6e6 samples: eliminate cvconfig.h usage
- don't use TBB in samples
2018-09-04 07:28:17 +00:00
Alexander Alekhin 0f0a82b619 Merge pull request #12402 from alalek:fix_build_dnn_tests 2018-09-04 06:39:20 +00:00
Alexander Alekhin 2cf34c0fe5 dnn: fix tests build with disabled OpenCL 2018-09-03 23:11:25 +00:00
Alexander Alekhin f826709452 Merge pull request #12303 from cv3d:improvements/binding_python 2018-09-03 20:57:11 +00:00
Alexander Alekhin f10fd64630 dnn: update "guard" inline namespace
- differ from 3.4 branch
2018-09-03 20:46:57 +00:00
Alexander Alekhin 49a1328046 Merge pull request #12396 from LaurentBerger:I12392 2018-09-03 20:26:14 +00:00
Alexander Alekhin 2877f17372 Merge pull request #12397 from terfendail:resize_wintr_fix 2018-09-03 20:25:45 +00:00
Alexander Alekhin 00cbb894ec CUDA: drop OPENCV_TRAITS_ENABLE_DEPRECATED requirement 2018-09-03 18:41:48 +00:00
Alexander Alekhin a0f86479e0 core: wrap custom types via _RawArray (raw() call)
- support passing of `std::vector<KeyPoint>` via InputArray
2018-09-03 18:41:48 +00:00
Vitaly Tuzov f9a5c4d181 Fixed bit-exact resize wide intrinsics implementation for 16U 2018-09-03 20:37:25 +03:00
LaurentBerger d71812425a Solves issue 12392 2018-09-03 19:30:49 +02:00
Alexander Alekhin aa5c45339c Merge pull request #12393 from peterjozsa:issue_12301 2018-09-03 16:16:48 +00:00
Alexander Alekhin 1e362ff5c3 imgproc(GaussianBlur): restore processing order 2018-09-03 18:39:42 +03:00
Vadim Pisarevsky fc71316690 Merge pull request #12371 from alalek:issue_12366 2018-09-03 14:30:16 +00:00
yuki takehara cb7ee27cd9 Fix bug in distanceTransform (#12278)
* fix 12218

* Update test_distancetransform.cpp

marked the test as "BIGDATA_TEST" in order to skip it on low-mem platforms

* modify test

* use a smaller image in the test

* fix test code
2018-09-03 17:18:10 +03:00
Dmitry Kurtaev c7cf8fb35c Import SSDs from TensorFlow by training config (#12188)
* Remove TensorFlow and protobuf dependencies from object detection scripts

* Create text graphs for TensorFlow object detection networks from sample
2018-09-03 17:08:40 +03:00
Peter Jozsa 8b0e1c7fcb Fix https://github.com/opencv/opencv/issues/12301 2018-09-03 14:56:38 +02:00
Alexander Alekhin e3af72bb68 Merge pull request #12376 from alalek:issue_12337 2018-09-03 10:17:56 +00:00
Alexander Alekhin ec3492a22a Merge pull request #12374 from alalek:issue_12368 2018-09-03 10:17:09 +00:00
Alexander Alekhin 07808c8d5d Merge pull request #12373 from alalek:issue_12365 2018-09-03 10:16:51 +00:00
Alexander Alekhin 436e330642 Merge pull request #12386 from wzw-intel:redundant_code 2018-09-03 09:33:00 +00:00
Wu Zhiwen a11d944f51 dnn: Remove a duplicated code snippet for flatten layer
Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-09-03 10:57:33 +08:00
Alexander Alekhin c85e44697e cmake: drop unconditional forcing of CMAKE_SKIP_RPATH=TRUE
CMake "cache" entry for CMAKE_SKIP_RPATH is in the end of this file
2018-09-02 21:48:10 +00:00
Alexander Alekhin af883e88e1 ts: support QEMU launcher 2018-09-02 21:48:01 +00:00
Alexander Alekhin 3dddf703a9 ts: re-apply OpenCV-specific patch on googletest 1.8.1 2018-09-02 13:45:48 +00:00
cyy 09837928d9 Merge pull request #12357 from DEEPIR:master
* fix some static analyzer warnings

* fix some static analyzer warnings

* fix race condition of workthread control
2018-09-02 16:34:43 +03:00
Alexander Alekhin f7ccc74e09 ts: update Google Test 1.8.1
Helper script from googletest: ./scripts/fuse_gtest_files.py
2018-09-02 12:21:29 +00:00
Alexander Alekhin 546fcd990e ts: restore Google Test 1.8.0 (capture OpenCV specific patch) 2018-09-02 12:07:15 +00:00
Alexander Alekhin 5eb295adf3 Merge pull request #12379 from alalek:fix_warning_win32 2018-09-02 11:50:32 +00:00
Alexander Alekhin 20bf7b6a79 imgcodecs(webp): use safe cast to size_t on Win32 2018-09-02 10:00:52 +00:00
Alexander Alekhin dce4e94f02 Merge pull request #12372 from cv3d:fix/python_phantom 2018-09-02 04:17:34 +00:00
Alexander Alekhin af769e4ec8 Merge pull request #12362 from alalek:fix_js_headers 2018-09-02 04:15:16 +00:00
Hamdi Sahloul ee6415bd1c Improves a UMat unit test 2018-09-02 00:34:35 +09:00
Alexander Alekhin 70a27c7dd6 core: add solveLP type checks for output
to forbid Mat1f

Checks are not reliable: empty uninitialized `cv::Mat` has `CV_8UC1` type
2018-09-01 14:51:44 +00:00
Alexander Alekhin 701760dbeb calib3d: use Mat::reserveBuffer() instead of .create()
to allocate memory >2Gb
2018-09-01 13:18:08 +00:00
Alexander Alekhin 0f9f2696be imgproc: small code refactoring (findContours -> l_cinfo) 2018-09-01 12:58:40 +00:00
Alexander Alekhin 65a0587ce8 imgproc(segmentation): don't increase mask NULL pointer
Avoid manual address arithmetic
2018-09-01 12:38:57 +00:00
Hamdi Sahloul 78835ad87a Support enum arguments for Java binding 2018-09-01 15:04:55 +09:00
Hamdi Sahloul 4e6be21a44 Support enum arguments for Python binding 2018-09-01 15:04:55 +09:00
Hamdi Sahloul f89e4e7dd0 Support parsing C++11 enum struct and enum class 2018-09-01 15:04:54 +09:00
Alexander Alekhin dfa8467a08 Merge pull request #12180 from cv3d:cleanup/python_umat 2018-08-31 20:25:30 +00:00
Hamdi Sahloul 669ee0415a Rewrite the UMat Python wrapper 2018-09-01 01:36:10 +09:00
Vadim Pisarevsky f9c8bb40b1 Merge pull request #12350 from dkurt:dnn_ie_caffe_faster_rcnn 2018-08-31 14:57:14 +00:00
Vlad Karpushin 7d3a1657c9 doc: add new tutorial motion deblur filter (#12215)
* doc: add new tutorial motion deblur filter

* Update motion_deblur_filter.markdown

a few minor changes
2018-08-31 17:41:22 +03:00
Vlad Karpushin f36790d521 doc: fix English gramma in tutorial out-of-focus-deblur filter (#12214)
* doc: fix English gramma in tutorial out-of-focus-deblur filter

* Update out_of_focus_deblur_filter.markdown

slightly modified one sentence
2018-08-31 17:24:37 +03:00
Peter Leitzen 367668710c Use secure URLs in README (#12160)
Saves a redirect from HTTP -> HTTPS each.

[ci skip]
2018-08-31 17:09:40 +03:00
Vitaly Tuzov 0f2b535fcc Bit-exact GaussianBlur reworked to use wide intrinsics (#12073)
* Bit-exact GaussianBlur reworked to use wide intrinsics

* Added v_mul_hi universal intrinsic

* Removed custom SSE2 branch from bit-exact GaussianBlur

* Removed loop unrolling for gaussianBlur horizontal smoothing
2018-08-31 17:04:59 +03:00
Vitaly Tuzov e345cb03d5 Bit-exact resize reworked to use wide intrinsics (#12038)
* Bit-exact resize reworked to use wide intrinsics

* Reworked bit-exact resize row data loading

* Added bit-exact resize row data loaders for SIMD256 and SIMD512

* Fixed type punned pointer dereferencing warning

* Reworked loading of source data for SIMD256 and SIMD512 bit-exact resize
2018-08-31 16:54:05 +03:00
Alexander Alekhin 94dea84915 Merge pull request #12361 from alalek:fix_12359 2018-08-31 13:27:56 +00:00
Alexander Alekhin f33cbe94dd Merge pull request #12142 from alalek:dnn_ocl_fix_convolution_perf_tests 2018-08-31 13:27:14 +00:00
Jakub Golinowski 9f1218b00b Merge pull request #11897 from Jakub-Golinowski:hpx_backend
* Add HPX backend for OpenCV implementation
Adds hpx backend for cv::parallel_for_() calls respecting the nstripes chunking parameter. C++ code for the backend is added to modules/core/parallel.cpp. Also, the necessary changes to cmake files are introduced.
Backend can operate in 2 versions (selectable by cmake build option WITH_HPX_STARTSTOP): hpx (runtime always on) and hpx_startstop (start and stop the backend for each cv::parallel_for_() call)

* WIP: Conditionally include hpx_main.hpp to tests in core module
Header hpx_main.hpp is included to both core/perf/perf_main.cpp and core/test/test_main.cpp.
The changes to cmake files for linking hpx library to above mentioned test executalbles are proposed but have issues.

* Add coditional iclusion of hpx_main.hpp to cpp cpu modules

* Remove start/stop version of hpx backend
2018-08-31 16:23:26 +03:00
berak e13f6ded7f ml: fix adjusting K in KNearest (#12358) 2018-08-31 16:07:53 +03:00
Vadim Pisarevsky 4b03a4a841 Merge pull request #12353 from alalek:imgcodecs_fix_webp 2018-08-31 13:03:10 +00:00
Vadim Pisarevsky bab4f4f5d8 Merge pull request #12348 from take1014:subdiv_getTriangleList_5788 2018-08-31 13:01:16 +00:00
Vadim Pisarevsky a08c6e49b3 Merge pull request #12341 from terfendail:countnonzero_wintr 2018-08-31 12:58:25 +00:00
Dmitry Kurtaev 50bceea038 Include preprocessing nodes to object detection TensorFlow networks (#12211)
* Include preprocessing nodes to object detection TensorFlow networks

* Enable more fusion

* faster_rcnn_resnet50_coco_2018_01_28 test
2018-08-31 15:41:56 +03:00
Alexander Alekhin 9e42204e67 Merge pull request #12360 from alalek:issue_12356 2018-08-31 12:16:50 +00:00
Alexander Alekhin c557193b8c dnn(test): use dnnBackendsAndTargets() param generator 2018-08-31 15:11:58 +03:00
Alexander Alekhin 3e6b3a6856 dnn(perf): fix and merge Convolution tests
- OpenCL tests didn't run any OpenCL kernels
- use real configuration from existed models (the first 100 cases)
- batch size = 1
2018-08-31 15:02:19 +03:00
Alexander Alekhin d52cef1719 js: use generated list of OpenCV headers
- replaces hand-written list
2018-08-31 14:48:44 +03:00
Alexander Alekhin fcfa488250 build: fix js build (make video->calib3d dependency optional)
- estimateRigidTransform() is excluded from JS bindings
2018-08-31 14:29:25 +03:00
Alexander Alekhin 0d4fd20a73 imgcodecs: add null pointer check 2018-08-31 12:56:02 +03:00
Hamdi Sahloul 2bbe31a8f6 Support non-static phantom methods for binding generator 2018-08-31 05:44:50 +09:00
Hamdi Sahloul 7cdb0eafeb Enable the binding generator to parse shadow files 2018-08-31 05:44:02 +09:00
Alexander Alekhin 0515f930e8 imgcodecs(webp): multiple fixes
- don't reallocate passed 'img' (test fixed - must use IMREAD_UNCHANGED / IMREAD_ANYCOLOR)
- avoid memory DDOS
- avoid reading of whole file during header processing
- avoid data access after allocated buffer during header processing (missing checks)
- use WebPFree() to free allocated buffers (libwebp >= 0.5.0)
- drop unused & undefined `.close()` method
- added checks for channels >= 5 in encoder
2018-08-30 20:42:33 +00:00
Alexander Alekhin 32a02544de Merge pull request #12189 from alalek:ippa_cleanup_3.4 2018-08-30 20:29:42 +00:00
Alexander Alekhin 90f47eb952 Merge pull request #12234 from cv3d:python/cuda/wrapping_functionalities 2018-08-30 20:23:38 +00:00
Alexander Alekhin fc1dee685e Merge pull request #12351 from NobuoTsukamoto:3.4 2018-08-30 21:10:01 +03:00
Vitaly Tuzov c894fc5bae countNonZero function reworked to use wide universal intrinsics instead of SSE2 intrinsics 2018-08-30 20:43:39 +03:00
take1014 e1ee744e15 resolve #5788 2018-08-31 00:59:00 +09:00
Alexander Alekhin e86287d8ae cleanup: IPP Async (IPP_A)
except header file with conversion routines (will be removed in OpenCV 4.0)
2018-08-30 18:53:07 +03:00
Alexander Alekhin 15e57d28f5 Merge pull request #12293 from alalek:cleanup_stl_string_replacement 2018-08-30 15:43:57 +00:00
Alexander Alekhin 4c7d521413 Merge pull request #12346 from mshabunin:test-data-check 2018-08-30 15:36:58 +00:00
Nobuo Tsukamoto ade57c8bd0 Fixed that object_detection.py does not work in python3. 2018-08-31 00:21:54 +09:00
Dmitry Kurtaev ea43e28a37 Replace Slice layer to Crop in Faster-RCNN networks from Caffe 2018-08-30 17:57:08 +03:00
Hamdi Sahloul 532eace7d6 Extensive wrapping of CUDA functionalities for Python 2018-08-30 22:50:33 +09:00
Hamdi Sahloul d4ac4fcde1 Python binding: METH_STATIC instead of METH_CLASS for static functions 2018-08-30 22:50:33 +09:00
Vadim Pisarevsky 258a769567 Merge pull request #12327 from take1014:distanceTransform_type 2018-08-30 13:12:08 +00:00
Alexander Alekhin 7845f6d95c Merge pull request #12345 from berak:fix_java_list_string 2018-08-30 13:04:19 +00:00
Vadim Pisarevsky be48cdc747 Merge pull request #12314 from sturkmen72:patch-2 2018-08-30 12:44:23 +00:00
HarshDolhare 8ef2d19337 Adds a small note describing BUILD_opencv_world (#12332)
* Added a mall note describing BUILD_opencv_world cmake option to the Installation in Windows tutorial.

* Made slight changes in BUILD_opencv_world documentation.

* Update windows_install.markdown

improved grammar
2018-08-30 15:17:27 +03:00
Maksim Shabunin cecf84410c Added option to fail on missing testdata 2018-08-30 15:15:08 +03:00
Alexander Alekhin 596a0125ed Merge pull request #12336 from dkurt:dnn_ie_fix_net_lifetime 2018-08-30 11:09:18 +00:00
Alexander Alekhin 8a8d07fb17 Merge pull request #12333 from wzw-intel:prior_box 2018-08-30 11:08:44 +00:00
berak 72f422c7dc java: fix LIST_GET macro 2018-08-30 13:06:02 +02:00
Wu Zhiwen ca51bbb7ff dnn: fix variance setting bug for PriorBoxLayer
- The size of second channel should be size[2] of output tensor,
- The Scalar should be {variance[0], variance[0], variance[0], variance[0]}
  for _variance.size() == 1 case.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2018-08-30 11:05:38 +08:00
Alexander Alekhin c1db75e0c7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-29 16:24:56 +03:00
Dmitry Kurtaev 4062ef5fcb Fix lifetime of networks which are loaded from Model Optimizer IRs 2018-08-29 13:34:26 +03:00
take1014 1ae477a46d fix typo 2018-08-28 22:14:47 +09:00
Alexander Alekhin 087e9308ec Merge tag '3.4.3-openvino' 2018-08-28 16:03:30 +03:00
Alexander Alekhin d13db35f31 Merge tag '3.4.3' 2018-08-28 16:03:08 +03:00
Alexander Alekhin b38c50b3d0 OpenCV 3.4.3 2018-08-28 15:58:21 +03:00
Alexander Alekhin dd06540e1f openvino: use 2018R3 defines 2018-08-28 15:57:19 +03:00
Alexander Alekhin 50b61668e2 Merge pull request #12326 from alalek:issue_12325 2018-08-28 12:51:33 +00:00
Alexander Alekhin 1df84f7246 Merge pull request #12319 from dkurt:dnn_enable_ie_tests 2018-08-28 12:50:32 +00:00
Alexander Alekhin bdc34984f1 Merge pull request #12323 from alalek:android_ndk17_support 2018-08-28 12:09:13 +00:00
Alexander Alekhin af0c930e77 ts: don't pass NULL for std::string() constructor 2018-08-28 14:19:56 +03:00
Alexander Alekhin bb45bf9695 android: NDK17 support
tested with NDK 17b (17.1.4828580)
2018-08-27 21:07:34 +00:00
Alexander Alekhin 4e0d2a3e6c Merge pull request #12193 from alalek:fix_vaapi_sample 2018-08-27 20:56:20 +00:00
Alexander Alekhin da6d8961fc Merge pull request #12286 from logic1988:master 2018-08-27 19:05:23 +00:00
Dmitry Kurtaev 3e027df583 Enable more deep learning tests using Intel's Inference Engine backend 2018-08-27 18:37:35 +03:00
Alexander Alekhin acfdd0e1fc core: fix MSVS "unreachable code" warnings 2018-08-27 16:23:25 +03:00
Alexander Alekhin 9fb8f6347f core: don't call std::string(NULL) 2018-08-27 16:23:25 +03:00
Alexander Alekhin 7f73b105ca core: std::string more changes 2018-08-27 15:41:01 +03:00
Vladislav Sovrasov ae8dcdf40d core: get rid of built-in String type 2018-08-27 14:42:18 +03:00
Alexander Alekhin ee1e1ce377 Merge pull request #12313 from sturkmen72:patch-1 2018-08-27 11:10:45 +00:00
Suleyman TURKMEN bed388bafb Update opengl_interop.cpp
resolves #12307
2018-08-27 01:04:46 +03:00
Suleyman TURKMEN 6d165dae5e related moved enums 2018-08-27 00:43:04 +03:00
Alexander Alekhin 6477262e63 Merge pull request #12306 from berak:python_nmsboxes 2018-08-25 16:35:00 +00:00
Alexander Alekhin f79599f949 Merge pull request #12308 from StrangeTcy:patch-1 2018-08-25 16:32:32 +00:00
Maxim Smirnov c94d75874b CV_Asserts changed
Some `CV_Assert`s changed to `CV_Assert_N`s according to https://github.com/opencv/opencv/issues/12304
2018-08-25 14:52:27 +03:00
berak 21f3987d53 python: add support for NMSBoxes 2018-08-25 08:44:45 +02:00
Alexander Alekhin 335e61dc47 Merge pull request #12269 from cv3d:improvements/binding_python 2018-08-24 19:38:12 +00:00
Hamdi Sahloul 64380baa85 Documentation for the new bindings-generator features 2018-08-25 01:58:42 +09:00
Hamdi Sahloul b5eb65e53e Improve Python binding generator with mappable types and phantom headers 2018-08-25 01:58:42 +09:00
Hamdi Sahloul f1ca05c822 Extend python exception cv.error
to provide `file`, `func`, `line`, `code`, `msg`, and `err` attributes
2018-08-25 01:58:42 +09:00
Hamdi Sahloul 900df21b7d Support enum-type detection for binding generator 2018-08-25 01:58:42 +09:00
Hamdi Sahloul 93bad514a8 Easy binding for python code generator 2018-08-25 01:58:42 +09:00
Alexander Alekhin d10a219833 Merge pull request #12298 from berak:java_matofrotatedrect 2018-08-24 15:54:27 +00:00
berak bd7bf39b4b java: change MatOfRotatedRect to CV_32FC5 2018-08-24 14:20:36 +02:00
Dmitry Kurtaev 472b71ecef Merge pull request #12243 from dkurt:dnn_tf_mask_rcnn
* Support Mask-RCNN from TensorFlow

* Fix a sample
2018-08-24 14:47:32 +03:00
Alexander Alekhin 4f360f8b1a Merge pull request #12295 from alalek:cmake_gphoto_off_by_default 2018-08-24 09:10:44 +00:00
Alexander Alekhin e8d45a9cdd Merge pull request #12274 from alalek:fix_10945 2018-08-24 08:30:52 +00:00
Suleyman TURKMEN d8cd1d8fcc Merge pull request #12246 from sturkmen72:move_enums
* Update core.hpp

* Update imgproc.hpp

* Update ImgprocTest.java

* Update CameraCalibrator.java

* Update OnCameraFrameRender.java

* Update FindContoursDemo.java

* Update IntroductionToSVMDemo.java

* Update NonLinearSVMsDemo.java

* Update IntroductionToPCADemo.java

* Update Smoothing.java

* Update MainActivity.java

* Update CalcBackProjectDemo1.java

* Update CornerSubPixDemo.java

* Update CornerDetectorDemo.java

* Update GoodFeaturesToTrackDemo.java
2018-08-24 11:11:34 +03:00
Alexander Alekhin ff2eface19 Merge pull request #12126 from alalek:reproducer_12121 2018-08-24 08:08:17 +00:00
Alexander Alekhin 29ce348c4d Merge pull request #12287 from berak:java_matofrotatedrect 2018-08-24 07:03:13 +00:00
Alexander Alekhin b2a4069f55 Merge pull request #12291 from cv3d:fix/cuda_pow 2018-08-23 23:58:48 +03:00
Hamdi Sahloul 4d78342919 Closes #12281 - a bug in cuda::pow with negative base values 2018-08-24 05:12:14 +09:00
Alexander Alekhin 1272332ae3 cmake: WITH_GPHOTO2=OFF by default 2018-08-23 19:48:23 +00:00
logic1988 b47c9ac643 Update aff_trans.cpp
When the fullAffine parameter is set to false, the estimateRigidTransform function maybe return empty, then the _localAffineEstimate function will be called, but the bug in it will result in incorrect results.
2018-08-23 21:52:27 +08:00
berak 1c20a7f008 java: add a MatOfRotatedRect class 2018-08-23 12:01:36 +02:00
Alexander Alekhin 6356403964 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-22 17:38:51 +03:00
Alexander Alekhin 6700fdb81f Merge pull request #12275 from alalek:fix_build_dnn_inf_engine 2018-08-22 14:38:05 +00:00
Alexander Alekhin 096366738b dnn(build): fix CV_Assert() usage 2018-08-22 16:04:40 +03:00
Alexander Alekhin 6a6506b02d viz: call "mapper->Update()" before and after SetInputData() 2018-08-22 15:40:51 +03:00
Alexander Alekhin 59ccf2c9e0 Merge pull request #12272 from alalek:fix_build_static_analysis 2018-08-22 12:18:53 +00:00
Alexander Alekhin 2c42361ecd build: fix build with defined CV_STATIC_ANALYSIS 2018-08-22 14:19:21 +03:00
Alexander Alekhin e8a14a775e Merge pull request #12268 from cv3d:fix/cuda/meanShiftSegmentation 2018-08-22 09:49:36 +00:00
Hamdi Sahloul 7b90a1e85a Closes #6349 - a bug in cuda::meanShiftSegmentation 2018-08-22 02:08:10 +09:00
Alexander Alekhin 18833d5121 Merge pull request #12267 from alalek:dnn_unstable_tests 2018-08-21 15:26:06 +00:00
Jiri Horner 49283ec035 Merge pull request #12248 from hrnr:video_remove_ransac
* video: remove duplicate RANSAC code

* remove RANSAC code video module. The module now uses RANSAC estimators from calib3d.
* deprecate estimateRigidTransform

* replace internal usage of deprecated estimateRigidTransform

* remove from wrappers
* replace usage in shape module. shape module now links to calib3d instead of video module.
* reprecate also C API version

* remove cvEstimateRigidTransform

* supress deprecated warnings in estimateRigidTransform test

* the function is now deprecated
2018-08-21 17:08:27 +03:00
Alexander Alekhin f25450791b dnn(test): mark unstable OpenCL tests 2018-08-21 16:31:41 +03:00
Alexander Alekhin c9faa09d55 Merge pull request #12266 from mshabunin:fix-windows-ie-build 2018-08-21 13:07:44 +00:00
Alexander Alekhin 1deeca985f Merge pull request #12262 from sivaraam:v4l2_mainloop 2018-08-21 12:47:29 +00:00
Alexander Alekhin 6acabd1fd8 Merge pull request #12256 from alalek:core_intrin_fp16_fix 2018-08-21 12:47:08 +00:00
Alexander Alekhin 5ac9a2a7d0 Merge pull request #12219 from alalek:fix_assert_messages 2018-08-21 12:46:35 +00:00
Maksim Shabunin 808c89adc1 Fixed windows build with InferenceEngine 2018-08-21 14:59:13 +03:00
Kaartic Sivaraam a527e8cc73 cap-v4l: remove unwanted loop in V4L2 mainloop
The while loop would run only once making it useless and leading
to confusion.

So, remove the unwanted while loop and just keep an infinite for
loop.
2018-08-21 16:41:01 +05:30
Alexander Alekhin 10c570b558 Merge pull request #12263 from doctorcolinsmith:3.4 2018-08-21 10:12:14 +00:00
Colin Smith 76f47548b3 Add export macro for ios conversion functions 2018-08-20 14:10:54 -07:00
Alexander Alekhin 7d4bb9428b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-20 19:30:18 +03:00
Alexander Alekhin 67d46dfc6c core(intrin): restrict FP16 operations
Intrinsics must be effective, so don't declare FP16 type/operations if there is no native support.

- CV_FP16: supports load/store into/from float32
- CV_SIMD_FP16: declares FP16 types and native FP16 operations
2018-08-20 19:24:33 +03:00
Alexander Alekhin 3c03fb56e0 Merge pull request #12258 from savuor:fix/trace_fname_slash 2018-08-20 16:22:06 +00:00
Rostislav Vasilikhin 378cf2ab63 fixed filename slash processing 2018-08-20 18:02:49 +03:00
Alexander Alekhin c6f5b013ec Merge pull request #12242 from alalek:fix_12236 2018-08-20 13:53:27 +00:00
Alexander Alekhin e593d5bbc5 Merge pull request #12255 from csukuangfj:patch_5 2018-08-20 13:47:41 +00:00
Alexander Alekhin 3f5c3ddd27 Merge pull request #12254 from csukuangfj:patch_4 2018-08-20 08:46:57 +00:00
Kuang Fangjun ab8ba047a5 fix a typo. 2018-08-20 15:52:18 +08:00
Kuang Fangjun cecc19381f fix an error in the formula for cv::cornerSubPix 2018-08-20 15:49:35 +08:00
Alexander Alekhin 6e84abc746 ml: don't use "getSubVector()" with 2D matrix
It is designed for 1D vectors only
2018-08-18 20:50:36 +00:00
Alexander Alekhin 322c6b1ba4 Merge pull request #12235 from alalek:core_perf_scalar_tests 2018-08-18 20:45:47 +00:00
pasbi 76eb389761 Merge pull request #12240 from pasbi:pfm_fix
* fixed 64-float pfm auto conversion

* removed trailing whitespace
2018-08-17 18:53:09 +03:00
Alexander Alekhin e9a1ccb89a Merge pull request #12232 from cv3d:bugfix/cudafeatures2d/python_wrapper 2018-08-17 15:26:09 +00:00
Alexander Alekhin 73d44c7881 Merge pull request #12172 from alalek:core_move_const_table 2018-08-17 14:03:01 +00:00
Alexander Alekhin 31fef14d76 Merge pull request #12136 from sturkmen72:update_documentation 2018-08-17 14:02:20 +00:00
Alexander Alekhin 7ee69740e8 ml(test): test different samples layout of TrainData 2018-08-17 16:57:20 +03:00
Suleyman TURKMEN c61bc3a0cb Update documentation and samples 2018-08-17 14:21:29 +03:00
Hamdi Sahloul db262fa76a Avoid multi-inheritance in the cuda::features2d classes 2018-08-17 17:32:51 +09:00
Alexander Alekhin b24fc6954d core(perf): fix addScalar test
keep the same type for passed Scalar values
2018-08-16 19:36:28 +03:00
Alexander Alekhin 828cb4286d Merge pull request #12220 from sturkmen72:update_seamless_cloning 2018-08-16 16:26:27 +00:00
Alexander Alekhin ee5e0e16d9 Merge pull request #12233 from mshabunin:fix-world-install-headers 2018-08-16 16:03:10 +00:00
Alexander Alekhin b907bfe3e7 Merge pull request #12222 from NCBee:master 2018-08-16 16:02:39 +00:00
Maksim Shabunin f84eb3dde6 Fixed core headers installation in world builds 2018-08-16 17:16:02 +03:00
Alexander Alekhin b996b618e0 Merge pull request #12228 from tomoaki0705:fixTypoCalib3d 2018-08-16 12:29:10 +00:00
Alexander Alekhin 98c5ce9347 imgproc(test): refactor test_intersection.cpp
don't use legacy test API
2018-08-16 15:27:24 +03:00
Alexander Alekhin f89defad5d imgproc: fix rotatedRectangleIntersection() 2018-08-16 15:27:24 +03:00
Bahram Dahi 96f92c6705 imgproc(tests): intersetion calculation of RotatedRect 2018-08-16 15:00:01 +03:00
Tomoaki Teshima f0c46a4c74 fix typo 2018-08-16 19:11:40 +09:00
Alexander Alekhin 4e59d6fd12 Merge pull request #12224 from cv3d:improvments/CUDA_detection 2018-08-16 09:51:13 +00:00
Hamdi Sahloul e136c11c7c Avoid detecting dublicate CUDA archs 2018-08-16 17:40:09 +09:00
Hamdi Sahloul 0e80f56e44 Bugfix: Detect CUDA archs for Windows 2018-08-16 17:10:08 +09:00
Alexander Alekhin 9752d45c87 Merge pull request #12216 from hirocob:fix-typo 2018-08-16 05:16:58 +00:00
Suleyman TURKMEN 860ae77ec9 Update seamless_cloning 2018-08-15 22:59:18 +03:00
Hiro Kobayashi 1567a65475 Fix a typo in the tutorial 2018-08-15 19:34:38 +03:00
Alexander Alekhin d2e08a524e core: repair CV_Assert() messages
Multi-argument CV_Assert() is accessible via CV_Assert_N() (with malformed messages).
2018-08-15 17:43:10 +03:00
Alexander Alekhin 94758c18de Merge pull request #12156 from cv3d:master 2018-08-14 14:29:17 +00:00
Maksim Shabunin eff0f9d3f8 Fixed windows build with InferenceEngine 2018-08-14 15:41:16 +03:00
Alexander Alekhin c1df9ad456 OpenCV version++
OpenCV 3.4.3
2018-08-14 14:10:37 +03:00
Alexander Alekhin 8b197c58e6 openvino: use 2018R3 defines 2018-08-14 14:10:37 +03:00
Alexander Alekhin 781721ca50 experimental version++ 2018-08-14 14:10:37 +03:00
Alexander Alekhin 603eadfe51 OpenCV version '-openvino' 2018-08-14 14:10:37 +03:00
Alexander Alekhin b9b66ca437 Merge pull request #12205 from dkurt:dnn_update_tf_face_detection 2018-08-14 10:53:12 +00:00
Dmitry Kurtaev 22cb65ada9 Update face detection network in samples 2018-08-14 13:16:23 +03:00
Alexander Alekhin e76b375a31 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-13 18:57:57 +03:00
Alexander Alekhin 90b8a03a89 Merge pull request #12203 from berak:fix_interactive_calibration 2018-08-13 15:40:42 +00:00
Dmitry Kurtaev f056c0f137 UINT8 face detection network using Intel's Inference Engine backend 2018-08-13 18:38:47 +03:00
pasbi 9f5f64e14e Merge pull request #12192 from pasbi:pfm
* created new decoder and encoder for PFM

pfm file format stores binary RGB or grayscale float images.

* added test for pfm codec

* replaced large with short licence header

* little/big-endian-check is now compile time

* fixed width/height confusion, improved big/little endian recognition, fixed scaling issue and Improved signature check

* adapted tests to handle float images well

* removed data-dependency: lena.pfm

the lena image is now loaded is pam and converted to pfm.

* fixed bug in endianess detection macro

* Added endianess detection for android and win

* removed fancy endianess detection

endianess detection will be implemented in cmake scripts soonish.

* fixed minor warnings

* fixed stupid elif defined bug

* silenced some implicit cast warnings

* replaced std::to_string with std::stringstream solution

std::to_string variant did not build on android.

* replaced new endianess macros with existing ones

* improved readability
2018-08-13 13:14:12 +03:00
berak 49e0126b8e apps: fix interactive calibration 2018-08-13 11:51:08 +02:00
Alexander Alekhin a24a829490 Merge pull request #12191 from weblucas:patch-2 2018-08-10 14:15:39 +00:00
Alexander Alekhin 615883977f Merge pull request #12128 from dkurt:dnn_fix_12066 2018-08-10 14:14:16 +00:00
Alexander Alekhin 216cd7dc61 cmake: allow to specify own libva paths
via CMake:
- `-DVA_LIBRARIES=/opt/intel/mediasdk/lib64/libva.so.2\;/opt/intel/mediasdk/lib64/libva-drm.so.2`
2018-08-10 16:03:10 +03:00
Alexander Alekhin 4910f16f16 core(libva): support YV12 too
Added to CPU path only.
OpenCL code path still expects NV12 only (according to Intel OpenCL extension)
2018-08-10 16:02:05 +03:00
Lucas Teixeira f2d363feb2 Fix a Typo in the comment of asift.py 2018-08-09 23:43:39 +02:00
Alexander Alekhin 8b2122e12f Merge pull request #12174 from alalek:dnn_move_range_ostream_operator 2018-08-08 20:51:26 +00:00
Alexander Alekhin f16f818f5f Merge pull request #12184 from alalek:issue_12163 2018-08-08 20:50:54 +00:00
Alexander Alekhin 5b3ac112fe core: move const tables outside of dispatched code
To avoid duplicates in binaries
2018-08-08 17:54:54 +03:00
Alexander Alekhin a0cff0be94 imgproc(cvtColor): slightly improve error messages
Do not try to process empty inputs.
2018-08-08 17:16:42 +03:00
Alexander Alekhin 509de3fa2c Merge pull request #12178 from alalek:ipp_cvtColor_12176 2018-08-08 13:30:32 +00:00
Alexander Alekhin b00758babe imgproc(cvtColor): temporary disable IPP for 8U GRAY2BGR mode
Details 12176
2018-08-08 13:58:45 +03:00
Alexander Alekhin 4eb2966559 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-08-07 20:12:10 +03:00
Alexander Alekhin 9f2edc1135 Merge pull request #12173 from gdemarcq:Decolor_corrections 2018-08-07 17:07:19 +00:00
Alexander Alekhin a56b221559 core: cv::Range() ostream write operator
remove from DNN module headers
2018-08-07 20:03:21 +03:00
yom fb2b26c419 photo: Decolor corrections
* Keep image aspect ratio in resize called in grad_system and
weak_order
	* Bug correction in loop inside Decolor::gradvector
2018-08-07 19:08:57 +03:00
Alexander Alekhin 377e51df83 Merge pull request #12169 from berak:photo_decolor 2018-08-07 16:01:42 +00:00
Alexander Alekhin 7453a6938a core(test): extra tests/fixes for merge/split (#12171)
* core(test): merge hang test

* core(merge/split): fix intrin optimization
2018-08-07 18:11:05 +03:00
Maksim Shabunin 39f5e57321 Merge pull request #12159 from zarelaky:master 2018-08-07 13:15:19 +00:00
berak f49f6d52b4 photo: avoid resizing a const Mat in decolor() 2018-08-07 15:14:22 +02:00
zarelaky 715f23127c Update cap_gstreamer.cpp
fixed call open(int id) failed
2018-08-07 15:21:46 +03:00
Maksim Shabunin f0f652f9e9 Merge pull request #12161 from alalek:cache_dump_neighbor_directories_for_cleanup 2018-08-07 12:09:39 +00:00
Maksim Shabunin 731aa963bd Merge pull request #12166 from berak:fix_mjpeg_decoder 2018-08-07 12:09:13 +00:00
berak 7e353a1ec5 videoio: check iterator in mjpeg_encoder.cpp 2018-08-07 11:43:37 +02:00
Hamdi Sahloul 293facbae7 Support Python binding for CUDA functionalities 2018-08-07 15:48:12 +09:00
Alexander Alekhin 4fe900c399 Merge pull request #12162 from alalek:fix_intrin_12146 2018-08-06 20:39:23 +00:00
Alexander Alekhin 5c3880d302 core(intrin): avoid symbols duplication from SIMD128/256 cases
All vx_call() must be wrapped into own simd128/simd256/simd512 namespace

```
namespace CV__SIMD_NAMESPACE {
... vx_call declaration is here ...
}
```
2018-08-06 19:29:46 +00:00
Alexander Alekhin 9eaa583bfb core: dump neighbour cache directories (from old OpenCV versions)
- use '3.4.x' cache name for current maintenance series (there are no serious changes between releases)
- message is shown only once during creation of new cache directory
- use OPENCV_CACHE_SHOW_CLEANUP_MESSAGE=0 to hide this warning
2018-08-06 19:05:35 +03:00
Vadim Pisarevsky 6500700d6f Merge pull request #12157 from allnes:detect_qr_code 2018-08-06 14:50:28 +00:00
Alexander Nesterov f95a411ba3 Update binarization 2018-08-06 12:10:45 -03:00
Vadim Pisarevsky 7c8ab271fc Merge pull request #12125 from dkurt:dnn_mobilenet_ppn 2018-08-06 14:40:50 +00:00
Vadim Pisarevsky 70b893333d Merge pull request #12130 from dkurt:dnn_ie_mvn 2018-08-06 14:37:46 +00:00
Dmitry Kurtaev 449696f1e5 Enable reshape-as-shape layer from TensorFlow 2018-08-06 17:35:06 +03:00
Vadim Pisarevsky e0c93bcf6c Merge pull request #12082 from dkurt:dnn_ie_faster_rcnn 2018-08-06 14:28:58 +00:00
Vadim Pisarevsky 23022f3ffb Merge pull request #12121 from maver1:amatyuko/sse2_convert_with_saturation_fix 2018-08-06 14:26:37 +00:00
Alexander Alekhin ac4a6aad15 Merge pull request #12050 from alalek:dnn_ocl_avoid_memory_access_violation 2018-08-05 14:47:01 +00:00
Alexander Alekhin 7d7767ba42 Merge pull request #12134 from mshabunin:add-yuv420-v4l 2018-08-04 13:48:34 +00:00
Alexander Alekhin 183cfd3a2e Merge pull request #12097 from xsacha:master 2018-08-04 13:14:22 +00:00
Alexander Alekhin 9cb3e9abf0 Merge pull request #12135 from tompollok:3.4
imgproc: update cornerSubPix documentation
2018-08-04 16:02:21 +03:00
CYTing1998 053259fd92 Merge pull request #12093 from CYTing1998:update_issue
* I have updated the requirements of reporting issues inside ISSUE_TEMPLATE.md
2018-08-03 20:08:30 +03:00
Alexander Alekhin b4cea8d6d1 Merge pull request #12120 from alalek:core_test_intrin_dispatched 2018-08-03 17:07:17 +00:00
Alexander Alekhin 8f57fc93ec Merge pull request #12123 from allnes:detect_qr_code 2018-08-03 16:52:26 +00:00
Sacha 9ff4475695 Support WITH_CUDA with clang compiler. 2018-08-03 16:42:28 +10:00
Alexander Alekhin 1c73e66edf Merge pull request #12131 from alalek:issue_12083 2018-08-02 16:50:51 +00:00
tompollok 061149cbbd imgproc: update cornerSubPix documentation 2018-08-02 18:00:43 +02:00
Maksim Shabunin a2daf0c83c videoio: added YUV420 format (UV order) support to v4l capture 2018-08-02 18:34:11 +03:00
Alexander Alekhin 2dbb5871e0 Merge pull request #12129 from pierrejeambrun:stitching_detailed_sift 2018-08-02 15:22:06 +00:00
Dmitry Kurtaev be08730cd6 MVN layer using Intel's Inference Engine backend 2018-08-02 17:49:03 +03:00
Alexander Alekhin 3082ea82f9 core(merge): fix SIMD loop head processing 2018-08-02 17:23:19 +03:00
Pierre Jeambrun 5131619a1a feat(stitching): Add Sift support for the FeaturesFinder 2018-08-02 17:22:13 +03:00
Alexander Alekhin b056ce33aa Merge pull request #12124 from mshabunin:download-improve 2018-08-02 12:13:44 +00:00
Maksim Shabunin df9efbbd1f Install data for samples to correct directories, do not download face_detector models in cmake 2018-08-02 14:24:05 +03:00
Alexander Alekhin f2e1710dd5 core(test): regression test for 12121 2018-08-01 19:42:54 +03:00
Alexander Nesterov 05830874d7 Refactor code 2018-08-01 12:15:40 -03:00
Dmitry Kurtaev 4fb086d6c3 MobileNet-SSD v1 from TensorFlow with shared convolution weights 2018-08-01 16:16:48 +03:00
amatyuko 3ea2586a5a Fix for SSE2 intrinsics problem in the part of saturation arithmetic processing during 32s->16u packed conversion -
for some big negative values less than -INT_MAX+32767 the sign of the numbers is lost due to overflow that leads to
incorrect saturation to MAX value, instead of zero.
The issue is not reproduced with CV_ENABLED_INTRINSICS=OFF
2018-08-01 16:04:08 +03:00
Maksim Shabunin 2df0345985 cmake: add download helper scripts 2018-08-01 15:57:53 +03:00
CJ Smith da41ac9e60 Merge pull request #12106 from CJSmith-0141:warpPerspective_typofix
* Fixes typo in function name hal::warpPerspective.

* Fixes remaining typos in word Perspective (was Perspectve).
2018-08-01 14:41:20 +03:00
Alexander Alekhin 47e3e89e30 Merge pull request #12116 from luzpaz:misc-typos 2018-08-01 11:35:57 +00:00
Alexander Alekhin 3f302cabb8 core(test): intrinsic tests for all dispatched CPU optimizations
- tests for both SIMD128 / SIMD256
- different dispatched + baseline(SIMD128) intrinsics
2018-08-01 13:50:42 +03:00
Dmitry Kurtaev 8e034053af Faster-RCNN from TensorFlow on CPU with Intel's Inference Engine backend 2018-08-01 11:29:58 +03:00
Alexander Alekhin 82c477c9f7 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-31 21:35:00 +03:00
Alexander Alekhin 67f79aabdd Merge pull request #12119 from mshabunin:fix-IE-dnn-test 2018-07-31 18:32:52 +00:00
Maksim Shabunin 5aceee5a36 Restored tests dependencies processing 2018-07-31 19:34:19 +03:00
luz.paz 1e1a1855ae Source typo fixes 2018-07-31 18:44:23 +03:00
luz.paz 2003eb1b9b Misc. typos
Found via `codespell -q 3 -I ../opencv-whitelist.txt --skip="./3rdparty"`
2018-07-31 18:44:23 +03:00
Alexander Alekhin 17196bb4fa Merge pull request #12036 from sturkmen72:update_create_mask_cpp 2018-07-31 15:02:16 +00:00
Alexander Alekhin 7e71b1079e Merge pull request #12103 from alalek:ocl_fix_crash 2018-07-31 14:55:43 +00:00
Alexander Alekhin 814ebe39ae Merge pull request #12113 from dkurt:dnn_fix_ssd_on_myriad 2018-07-31 14:55:18 +00:00
Alexander Alekhin 61c870ae09 Merge pull request #12080 from mshabunin:fix-static-3 2018-07-31 14:53:28 +00:00
Alexander Alekhin 6949bc9ef9 Merge pull request #12105 from mshabunin:fix-ie-R2 2018-07-31 14:22:45 +00:00
Maksim Shabunin 7cf52de47e dnn: modified IE search, R2 compatibility fixed 2018-07-31 14:48:06 +03:00
Alexander Alekhin 9433784e47 Merge pull request #12111 from seiko2plus:issue12110 2018-07-31 09:21:41 +00:00
Dmitry Kurtaev ed0e79cb61 Add missing parameter to DetectionOutput layer from Intel's Inference Engine 2018-07-31 11:37:45 +03:00
Sayed Adel bb82cdc928 core:test Fix fp16 build if AVX2 sets as baseline 2018-07-31 10:02:20 +02:00
Suleyman TURKMEN db8585701d Update create_mask.cpp 2018-07-30 21:42:22 +03:00
Alexander Alekhin 57bead3a5e Merge pull request #12002 from alalek:imgproc_getPerspectiveTransform_solveMethod_param 2018-07-30 16:43:23 +00:00
Alexander Alekhin 28d0e97c09 Merge pull request #12004 from mshabunin:more-asserts 2018-07-30 16:42:09 +00:00
Alexander Alekhin 5d12c070ea Merge pull request #12046 from VladKarpushin:tutorial-using-out-of-focus-deblur-filter 2018-07-30 16:36:39 +00:00
Alexander Alekhin 5bde800ee3 Merge pull request #12088 from alalek:ocl_callback_catch_exceptions 2018-07-30 16:33:41 +00:00
Alexander Alekhin 29a1dc5719 Merge pull request #12087 from alalek:docs_videowriter_write_bgr_input 2018-07-30 16:33:23 +00:00
Alexander Alekhin dbf3362c4d Merge pull request #12056 from seiko2plus:coreExpandTests 2018-07-30 16:23:11 +00:00
Alexander Alekhin c4e0f4b2b5 Merge pull request #12102 from csukuangfj:patch_3 2018-07-30 12:48:06 +00:00
Alexander Alekhin e90e398e7a core(ocl): do not split refcount operations / compare
- check result from CV_XADD() directly
- decrease urefcount after unmap() call only
2018-07-30 15:42:09 +03:00
Alexander Alekhin 4937eeddb5 Merge pull request #12101 from miaow1988:dev-fix-mat-pushback 2018-07-30 11:26:25 +00:00
miaow1988 2988260107 Fixed the int size overflow bug of cv::Mat.push_back().
Changed the type of variable *r* from int to size_t.
This change makes sure that a valid result of std::max(r + delta,
(r*3+1)/2) can be passed into the reserve function.
2018-07-30 18:36:19 +08:00
Kuang Fangjun 83039c8752 fix a typo. 2018-07-30 18:18:18 +08:00
Sayed Adel 6499263b41 core:test Expand hal_intrin tests to support SIMD256 2018-07-30 08:50:50 +02:00
Alexander Alekhin 80cab4a163 Merge pull request #12094 from seiko2plus:coreFixAvx2Interleave32 2018-07-29 20:51:55 +00:00
Sayed Adel 47202b3349 core:avx2 fix unaligned store for v_store_interleave v_uint32x8-3ch 2018-07-29 18:22:46 +02:00
Alexander Alekhin 9076bb6089 Merge pull request #12081 from mshabunin:fix-ie-build 2018-07-28 20:34:19 +00:00
Alexander Alekhin 89528d7c3a core(ocl): don't expose exceptions from OpenCL callback
to avoid silent crashes of OpenCL worker threads.
2018-07-28 10:29:26 +00:00
Alexander Alekhin 0bef42ba12 videoio: add note about image BGR format VideoWriter::write() 2018-07-28 09:08:09 +00:00
Alexander Alekhin b41bc0ae59 Merge pull request #12067 from mshabunin:clean-test-case-list 2018-07-28 06:21:53 +00:00
Maksim Shabunin fb1f12021b Fixed build with latest IE version 2018-07-27 19:56:35 +03:00
Maksim Shabunin dd8e990451 Fixed several issues found by static analysis, GStreamer backend 2018-07-27 18:41:39 +03:00
Maksim Shabunin e031bada7d Fixed several issues found by static analysis, Windows-specific 2018-07-27 18:25:55 +03:00
Alexander Alekhin 2b7ff90e63 Merge pull request #12078 from mshabunin:fix-plus-dir 2018-07-27 15:00:33 +00:00
Alexander Alekhin b597c87bed dnn(ocl): avoid memory access violation 2018-07-27 15:35:11 +03:00
Maksim Shabunin 0aded5aae6 cmake: fixed builds in directories containing plus sign 2018-07-27 15:05:56 +03:00
Karpushin Vladislav a8e9a3a88d doc: add new tutorial "Out of focus deblur filter"
In this tutorial you will learn:
- what is a degradation image model
- what is a PSF of an out-of-focus image
- how to restore a blurred image
- what is the Wiener filter
2018-07-27 17:12:24 +07:00
Alexander Alekhin d044ac1c66 imgproc(getPerspectiveTransform): add solveMethod parameter
drop compatibility workaround via runtime parameter
2018-07-26 18:22:59 +03:00
Alexander Alekhin 2f0fc920dd Merge pull request #12061 from alalek:dnn_test_skip_checks_only 2018-07-26 15:15:32 +00:00
Alexander Alekhin 9137e2d635 Merge pull request #12060 from alalek:dnn_debug_layers 2018-07-26 15:14:32 +00:00
Alexander Alekhin c37d1a53b5 Merge pull request #12025 from Triplesalt:tfimport-relu 2018-07-26 15:08:05 +00:00
Maksim Shabunin 1165fdd0f5 Added more strict checks for empty inputs to compare, meanStdDev and RNG::fill 2018-07-26 18:06:38 +03:00
Maksim Shabunin 597db69151 ts: test case list is printed after cmd line parsing, refactored 2018-07-26 16:43:43 +03:00
Triplesalt 9eb79926df Allow a different input order for Mul+Maximum.
Squashed : ReLU operand order tests.
2018-07-26 14:19:11 +02:00
Vadim Pisarevsky fa466b022d Merge pull request #12052 from dkurt:dnn_ie_torch_tests 2018-07-26 09:09:35 +00:00
Vadim Pisarevsky 43820d89b4 further improvements in split & merge; started using non-temporary store instructions (#12063)
* 1. changed static const __m128/256 to const __m128/256 to avoid wierd instructions and calls inserted by compiler.
2. added universal intrinsics that wrap MOVNTPS and other such (non-temporary or "no cache" store) instructions. v_store_interleave() and v_store() got respective flags/overloaded variants
3. rewrote split & merge to use the "no cache" store instructions. It resulted in dramatic performance improvement when processing big arrays

* hopefully, fixed some test failures where 4-channel v_store_interleave() is used

* added missing implementation of the new universal intrinsics (v_store_aligned_nocache() etc.)

* fixed silly typo in the new intrinsics in intrin_vsx.hpp

* still trying to fix VSX compiler errors

* still trying to fix VSX compiler errors

* still trying to fix VSX compiler errors

* still trying to fix VSX compiler errors
2018-07-26 12:04:28 +03:00
Dmitry Kurtaev faa6c4e1e1 Faster-RCNN anf RFCN models on CPU using Intel's Inference Engine backend.
Enable Torch layers tests with Intel's Inference Engine backend.
2018-07-25 19:04:55 +03:00
Alexander Alekhin dd8701c1a0 dnn(test): skip checks only for unstable tests
but execute tested functions in Layer_Test_Halide/Convolution.Accuracy
2018-07-25 16:55:21 +03:00
Alexander Alekhin 74cf48b5d7 dnn(test): use Backend/Target enums
instead of 'int'
2018-07-25 16:55:21 +03:00
Alexander Alekhin 45b5b3c13a dnn: check layer output for NaN/Inf 2018-07-25 16:25:18 +03:00
Alexander Alekhin 9787ab598b Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-24 22:48:54 +03:00
Alexander Alekhin 5336b9ad19 Merge pull request #12048 from mshabunin:fix-static-2 2018-07-24 19:45:27 +00:00
Alexander Alekhin a16254de2b Merge pull request #12047 from alalek:issue_12045 2018-07-24 19:44:25 +00:00
Alexander Alekhin 8a2ce75d96 Merge pull request #12020 from alalek:videoio_backends_query_api 2018-07-24 19:43:49 +00:00
Vadim Pisarevsky 9c7040802c converted split() & merge() to wide univ intrinsics (#12044)
* fixed/updated v_load_deinterleave and v_store_interleave intrinsics; modified split() and merge() functions to use those intrinsics

* fixed a few compile errors and bug in v_load_deinterleave(ptr, v_uint32x4& a, v_uint32x4& b)

* fixed few more compile errors
2018-07-24 17:27:56 +03:00
Maksim Shabunin cbb1e867e5 More issues found by static analysis 2018-07-24 16:04:42 +03:00
Alexander Alekhin 8de08e0463 Merge pull request #12021 from dkurt:dnn_ie_tf_ssd 2018-07-24 13:03:41 +00:00
Alexander Alekhin 236f383969 Merge pull request #12037 from dkurt:test_openvino_models 2018-07-24 12:34:04 +00:00
Alexander Alekhin 93abdbf25e Merge pull request #12041 from mshabunin:fix-static-2 2018-07-24 11:10:01 +00:00
Alexander Alekhin 8f80565d9c objdetect(qr): update test code
improve error checks
2018-07-24 13:56:55 +03:00
Alexander Alekhin 391b9586ac Merge pull request #12042 from dkurt:fix_opencv_as_submodule 2018-07-24 08:17:20 +00:00
Alexander Alekhin 4283309daa dnn: update tests for OpenVINO models 2018-07-24 09:41:14 +03:00
Alexander Alekhin 6e767e2376 ts: add findDataDirectory() function 2018-07-24 09:40:58 +03:00
Dmitry Kurtaev 0c4d5ffecd Do not copy cv_cpu_helper.h to parent if OpenCV is a submodule 2018-07-24 09:36:28 +03:00
Dmitry Kurtaev 28e08ae0bd Add a sample which tests OpenVINO models 2018-07-23 19:08:51 +03:00
Maksim Shabunin e0603bb45f Fixed several issues found by static analysis tools 2018-07-23 17:22:47 +03:00
Alexander Alekhin 7d40fcead5 Merge pull request #12031 from alalek:dnn_ocl_eliminate_getUMat_with_bad_lifetime 2018-07-23 07:52:42 +00:00
Paul92 8c7555523b Merge pull request #12032 from Paul92:mser-sample-improvments
Mser sample improvments (#12032)

* Fixed bug in detect_mser sample
Wrong number of colors used to generate the synthetic images

* Formatting improvements

* Using safer casts

* Improved readability of legend generation

* Various readability fixes in detect_mser sample
2018-07-22 17:08:29 +03:00
Alexander Alekhin b117302bca Merge pull request #12016 from tyl12:fix_videoio_static_para 2018-07-21 03:50:58 +00:00
Alexander Alekhin e1205d046a Merge pull request #12003 from mshabunin:avi-error-messages 2018-07-21 03:30:55 +00:00
Teng Yiliang dadde75ef0 use struct member width_set/height_set to replace static width/height.
the static variables will cause race-condition when operating in
multithread scenarios.

Signed-off-by: Teng Yiliang <ylteng@outlook.com>
Signed-off-by: Teng Yiliang <yiliang.teng@weimob.com>
2018-07-21 07:27:17 +08:00
Alexander Alekhin ee743afebe dnn(ocl): don't use getUMat() for long live objects 2018-07-20 17:53:55 +03:00
Alexander Alekhin 767b31cfbf Merge pull request #12029 from tomoaki0705:fixBuildVS2013BinarySuffix 2018-07-20 11:27:27 +00:00
Tomoaki Teshima 18abe54497 fix build error on Visual Studio 2013
* replace binary literal prefix to hexadecimal literal prefix
2018-07-20 18:09:17 +09:00
Alexander Alekhin 05f0cb16de Merge pull request #12022 from mshabunin:fix-ie-build 2018-07-19 20:50:42 +00:00
Maksim Shabunin a4060e15a4 dnn, IE backend: updated to match new interface 2018-07-19 19:22:23 +03:00
Alexander Alekhin 7198b9e461 Merge pull request #12019 from mshabunin:static-debug-assert 2018-07-19 15:50:33 +00:00
Alexander Alekhin ab9b6e806c Merge pull request #11781 from dkurt:dnn_uint8_inputs 2018-07-19 14:38:46 +00:00
Alexander Alekhin 270cc3bcbc videoio: add routines to query information about backends API
into cv::videoio_registry namespace
2018-07-19 17:27:37 +03:00
Dmitry Kurtaev c213a3823e Run entire SSDs from TensorFlow using Intel's Inference Engine 2018-07-19 17:05:56 +03:00
Alexander Alekhin 51074b9743 Merge pull request #12007 from alalek:fix_ts_perf_test_macro 2018-07-19 12:09:48 +00:00
Dmitry Kurtaev 070393dfda uint8 inputs for deep learning networks 2018-07-19 14:37:33 +03:00
Alexander Alekhin f4df537e27 ts: fix PERF_TEST() macro to allow test_case name reusing
Example (reuse 'Transform' test case):
PERF_TEST(Transform, getPerspectiveTransform_1000) { ... }
PERF_TEST(Transform, getPerspectiveTransform_QR_1000) { ... }
2018-07-19 13:20:54 +03:00
Alexander Alekhin 905da2994a Merge pull request #12008 from alalek:test_remove_verbose_messages 2018-07-19 09:37:36 +00:00
Alexander Alekhin 7e9b5d9e30 Merge pull request #12006 from mshabunin:static-debug-assert 2018-07-19 09:36:36 +00:00
Alexander Alekhin e526c4bfe4 core(test): remove verbose messages 2018-07-18 16:09:27 +03:00
Maksim Shabunin fe806878be Enable debug assertions for static analysis builds 2018-07-18 15:53:16 +03:00
Maksim Shabunin a2a9a01e05 AVI container: verbose error messages 2018-07-18 15:22:42 +03:00
Alexander Alekhin 3d141280aa Merge pull request #12000 from tomoaki0705:fixVS2013noexcept 2018-07-18 11:43:23 +00:00
Tomoaki Teshima 9df7517dea fix build error on Visual Studio 2013 and earlier 2018-07-18 12:56:02 +03:00
Alexander Alekhin 4560909a5e Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-17 19:27:48 +03:00
Alexander Alekhin 6c4f618db5 Merge pull request #11104 from asciian:reading_from_stream 2018-07-17 16:24:06 +00:00
Alexander Alekhin f3ee07ca11 Merge pull request #11986 from alalek:build_eliminate_gcc8_warnings 2018-07-17 15:41:36 +00:00
Alexander Alekhin 7cc84ce8ab Merge pull request #11984 from mshabunin:fix-static-1 2018-07-17 15:40:48 +00:00
Alexander Alekhin 40b8ca2eed Merge pull request #11968 from allnes:detect_qr_code 2018-07-17 15:38:46 +00:00
Alexander Alekhin 4dcef28023 Merge pull request #11964 from mshabunin:avi-container-fixes 2018-07-17 15:35:07 +00:00
Alexander Alekhin 0a41b3df45 Merge pull request #11990 from alalek:clone_nodiscard_attribute 2018-07-17 15:34:08 +00:00
Alexander Alekhin f086fc5b18 Merge pull request #11994 from alalek:cmake_find_package_inference_engine 2018-07-17 15:14:41 +00:00
Maksim Shabunin c473718bc2 Check for empty Mat in compare, operator= and RNG::fill, fixed related tests 2018-07-17 17:50:50 +03:00
Maksim Shabunin 1da46fe6fb Fixed issues found by static analysis (mostly DBZ) 2018-07-17 16:14:54 +03:00
Alexander Alekhin 5b72e83687 cmake: prefer using find_package(InferenceEngine) 2018-07-17 15:31:11 +03:00
Alexander Alekhin 78d07e841d Merge pull request #11959 from pengli:3.4 2018-07-17 11:20:02 +00:00
Dmitry Kurtaev f38808a39f Add Java overloads for each default argument (#11940)
* Add Java overloads for each default argument

* Add "fisheye_" prefix for cv::fisheye:: functions and enums
2018-07-17 13:41:46 +03:00
Pavel Rojtberg 3f65924c45 core: FileStorage - add support for writing vector<String> with bindings (#11883)
* core: FileStorage - add support for writing vector<String> with bindings

* python: extend persistence test for string sequences
2018-07-17 13:38:48 +03:00
Alexander Alekhin 540415dc5e Merge pull request #11989 from csukuangfj:patch_2 2018-07-17 10:27:21 +00:00
Li Peng f0cadaa6e3 enable concat layer fuse for OCL target
Signed-off-by: Li Peng <peng.li@intel.com>
2018-07-17 12:46:16 +08:00
Vadim Pisarevsky f058b5fb1e Wide univ intrinsics (#11953)
* core:OE-27 prepare universal intrinsics to expand (#11022)

* core:OE-27 prepare universal intrinsics to expand (#11022)

* core: Add universal intrinsics for AVX2

* updated implementation of wide univ. intrinsics; converted several OpenCV HAL functions: sqrt, invsqrt, magnitude, phase, exp to the wide universal intrinsics.

* converted log to universal intrinsics; cleaned up the code a bit; added v_lut_deinterleave intrinsics.

* core: Add universal intrinsics for AVX2

* fixed multiple compile errors

* fixed many more compile errors and hopefully some test failures

* fixed some more compile errors

* temporarily disabled IPP to debug exp & log; hopefully fixed Doxygen complains

* fixed some more compile errors

* fixed v_store(short*, v_float16&) signatures

* trying to fix the test failures on Linux

* fixed some issues found by alalek

* restored IPP optimization after the patch with AVX wide intrinsics has been properly tested

* restored IPP optimization after the patch with AVX wide intrinsics has been properly tested
2018-07-16 18:57:24 +03:00
Alexander Alekhin 481829a81b Merge pull request #11957 from alalek:issue_11956 2018-07-16 15:54:34 +00:00
Alexander Alekhin c9439476da Merge pull request #11970 from dkurt:dnn_enable_tf_tests 2018-07-16 15:51:27 +00:00
Alexander Alekhin 60994389a6 Merge pull request #11985 from alalek:cmake_update_inference_engine_detection 2018-07-16 15:49:19 +00:00
Alexander Alekhin b0ee5d9023 core: CV_NODISCARD macro with semantic of [[nodiscard]] attr
[[nodiscard]] is defined in C++17.
There is fallback alias for modern GCC / Clang compilers.
2018-07-16 18:03:32 +03:00
Kuang Fangjun 84f2f37680 remove a useless statement. 2018-07-16 22:44:11 +08:00
Alexander Alekhin d5951bc033 build: eliminate GCC8 warnings 2018-07-16 17:24:12 +03:00
Alexander Alekhin a5e8ae2183 Merge pull request #11969 from alalek:core_Matx_inv_solve_templates 2018-07-16 14:18:12 +00:00
Alexander Alekhin 1dec480974 Merge pull request #11951 from alalek:cuda_use_external_cmake_module 2018-07-16 13:41:45 +00:00
Alexander Alekhin d6c669f5cf Merge pull request #11963 from dkurt:dnn_cl_fix_matmul 2018-07-16 11:10:32 +00:00
Alexander Alekhin 014ae55379 cmake: update DL IE detection to align with OpenVINO 2018 R2
These CMake options are enough:
- `-DWITH_INF_ENGINE=ON`
- `-DIE_PLUGINS_PATH=lib/ubuntu_16.04/intel64`
- `-DENABLE_CXX11=ON` (OpenCV 3.4 only)
2018-07-16 14:02:23 +03:00
Maksim Shabunin 53eb27f508 AVI container: use C++ streams for file operations, check some operations for overflow 2018-07-16 13:46:28 +03:00
Alexander Alekhin 4a3dfffd46 Merge pull request #11965 from alalek:issue_11944 2018-07-16 09:48:33 +00:00
Alexander Alekhin 50751ae6ff Merge pull request #11967 from catree:add_tutorial_ml_java_python 2018-07-16 09:24:32 +00:00
Alexander Alekhin 10676f86d5 Merge pull request #11971 from csukuangfj:patch_1 2018-07-15 15:06:17 +00:00
Alexander Alekhin 5e31c82b5b Merge pull request #11980 from berak:core_lda_dataAsRow 2018-07-15 14:32:15 +00:00
berak 4382bdc859 core: remove unused dataAsRow flag from LDA 2018-07-15 11:32:00 +02:00
Alexander Nesterov dee5f9a67b Update qrcode algorithm: fix seg. fault with kmeans 2018-07-14 21:51:21 +03:00
Kuang Fangjun 2b6aa50b81 avoid negative index. 2018-07-14 16:05:29 +08:00
Alexander Alekhin 3c74fde349 core: eliminate 'if' logic from Matx::inv()/solve()
- 'if' logic is moved into templates.
- removed unnecessary cv::Mat objects creation.
- fixed inv() test (invA * A == eye)
- added more Matx tests to cover all defined template specializations
2018-07-13 20:09:01 +03:00
Dmitry Kurtaev 6eb8faea85 Enable TensorFlow networks tests for different backends and targets 2018-07-13 19:58:56 +03:00
Alexander Alekhin 23fc96e98f Merge pull request #11955 from terfendail:matx_solve_fix2 2018-07-13 15:15:03 +00:00
Vadim Pisarevsky abceae1ac0 Merge pull request #11921 from allnes:detect_qr_code 2018-07-13 14:26:17 +00:00
Alexander Alekhin eed1130327 Merge pull request #11966 from alalek:core_solve_method_check 2018-07-13 14:25:42 +00:00
catree 41b95cae38 Add Java and Python code for ML tutorials. 2018-07-13 15:52:28 +02:00
Dmitry Kurtaev de6f0a537d Fix fully-connected layer in case of number of rows less than 4 2018-07-13 16:35:37 +03:00
catree 4dc7e617a4 Add overloaded cv::PCACompute() that returns also the eigenvalues. Useful for Java and Python OpenCV where PCA is not available. 2018-07-13 15:05:54 +02:00
Alexander Alekhin 0155851929 imgproc(getPerspectiveTransform): add configuration parameter 2018-07-13 15:31:33 +03:00
Alexander Alekhin 71c6cb9c22 imgproc(getPerspectiveTransform): solve(DECOMP_SVD -> LU) 2018-07-13 15:31:33 +03:00
Alexander Alekhin 2170811e48 imgproc(perf): update getPerspectiveTransform perf test
Function is very fast, so 0.000 ms results are useless.
1000 runs requires 25ms on i7-6700K.
2018-07-13 15:31:33 +03:00
Alexander Alekhin 9d8495f8b3 Merge pull request #11960 from dkurt:dnn_cl_clip_kernel 2018-07-13 12:29:47 +00:00
Alexander Alekhin 5385086fef core: solve(): add check for passed 'method' values 2018-07-13 15:15:48 +03:00
Dmitry Kurtaev dcc1beb1f8 Clip kernel for OpenCL PriorBox layer 2018-07-13 14:49:13 +03:00
Alexander Nesterov e38ea3a888 Update detect QRCode algorithm 2018-07-12 18:18:57 -03:00
Alexander Alekhin 33b7028be2 core: use "explicit" for Matx() ctor 2018-07-12 19:50:56 +00:00
Vitaly Tuzov 850a8577b2 Fixed unreachable code warnings for Matx::solve() 2018-07-12 19:19:51 +03:00
Alexander Alekhin e79c729b20 CUDA: allow to use external FindCUDA from modern CMake
CMake 3.9.0+ is required
2018-07-12 14:33:14 +03:00
Alexander Alekhin 625d20b9b4 Merge pull request #11949 from berak:dnn_object_detection_typo 2018-07-12 09:48:08 +00:00
berak 1c75f3d037 dnn: fix typo in object_detection.cpp sample 2018-07-12 11:06:53 +02:00
Alexander Alekhin 9c3ec05825 Merge pull request #11941 from alalek:dnn_ocl_fix_verify_umat_mapping 2018-07-12 07:37:55 +00:00
Alexander Alekhin 875f23881f Merge pull request #11942 from catree:add_tutorial_core_java_python 2018-07-11 20:27:17 +00:00
Vitaly Tuzov d0a3686812 Merge pull request #11904 from terfendail/matx_solve_fix
Fixed Matx::solve function for non-square matrixes (#11904)
2018-07-11 22:00:57 +03:00
catree c9fe6f1afe Add Java and Python code for the following tutorials:
- Changing the contrast and brightness of an image!
      - Operations with images
2018-07-11 20:14:58 +02:00
Alexander Alekhin 2508f7f971 dnn(ocl): fix wrong usage of stalled .getMat() pointers
Temporary object lifetime must be greater than pointer usage.
2018-07-11 19:11:36 +03:00
Dmitry Kurtaev 8b5f061dae Replace std::vector<char> to std::vector<uchar> for Java bindings of dnn importers 2018-07-11 18:58:56 +03:00
Alexander Alekhin 999aba3807 Merge pull request #11936 from berak:dnn_shufflelayer_name 2018-07-11 12:01:31 +00:00
Alexander Alekhin fa66c6b797 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-11 12:35:10 +03:00
Alexander Alekhin 82c7ab0231 Merge pull request #11927 from pengli:3.4 2018-07-11 09:33:24 +00:00
Li Peng 4c5a86828a Fix gemmlike convolution input reading
use vload3 for half3 or float3 input vector reading,
also check read position to see if it exceed input width

Signed-off-by: Li Peng <peng.li@intel.com>
2018-07-11 15:25:21 +08:00
berak a7b502f04a dnn: preserve name, type strings for ShuffleLayer 2018-07-11 08:19:23 +02:00
Alexander Alekhin e4b5e9b9c9 Merge pull request #11931 from catree:add_doc_eye_ones 2018-07-10 15:43:32 +00:00
Alexander Alekhin e9bb26267e Merge pull request #11929 from alalek:dnn_test_drop_enums 2018-07-10 15:31:52 +00:00
catree d7bd662c95 Add a note in the documentation about Mat::ones and mat::eye. With multi-channels type (e.g. CV_8UC3), only the first channel is treated. 2018-07-10 15:35:46 +02:00
Alexander Alekhin 452fa3011c dnn(test): drop CV_ENUM for DNNBackend / DNNTarget 2018-07-10 15:12:01 +03:00
Dmitry Kurtaev d57e5406f0 Add readNet* functions which parse models from byte arrays 2018-07-10 11:12:01 +03:00
Alexander Alekhin 2da96be217 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-09 19:44:51 +03:00
Alexander Alekhin 7fe0727930 Merge pull request #11924 from alalek:dnn_ocl_fix_max_pool_forward 2018-07-09 16:25:34 +00:00
Alexander Alekhin 529d38613b Merge pull request #11923 from alalek:dnn_external_protobuf 2018-07-09 16:07:42 +00:00
Alexander Alekhin 88d56dc700 Merge pull request #11922 from alalek:dnn_test_myriad_check 2018-07-09 16:07:18 +00:00
Alexander Alekhin 7ba66a1682 Merge pull request #11703 from alalek:c_api_calib3d_chessboard_detector 2018-07-09 15:37:26 +00:00
Alexander Alekhin b6255ab9e7 dnn(ocl4dnn): fix args for 'max_pool_forward' kernel 2018-07-09 18:02:20 +03:00
Alexander Alekhin 924ff903ad Merge pull request #11903 from alalek:issue_9002 2018-07-09 14:49:37 +00:00
Alexander Alekhin e2b5d11290 dnn: allow to use external protobuf
"custom layers" feature will not work properly in these builds.
2018-07-09 17:28:45 +03:00
Alexander Alekhin e41f19d2f3 Merge pull request #11919 from dkurt:dnn_replace_convert_fp16 2018-07-09 14:07:37 +00:00
Alexander Alekhin 52b151dceb dnn(test): use checkMyriadTarget() in Test_Caffe_layers.Conv_Elu test 2018-07-09 16:20:46 +03:00
Dmitry Kurtaev 362d4f5395 Replace convertFp16 from dnn::Net::setInput() 2018-07-09 14:35:54 +03:00
Alexander Alekhin a29d11240e Merge pull request #11906 from berak:fix_qrcode 2018-07-09 09:36:41 +00:00
asciian 61d8719b8d Reading net from std::ifstream
Remove some assertions

Replace std::ifstream to std::istream

Add test for new importer

Remove constructor to load file

Rename cfgStream and darknetModelStream to ifile

Add error notification to inform pathname to user

Use FileStorage instead of std::istream

Use FileNode instead of FileStorage

Fix typo
2018-07-09 10:02:05 +03:00
Alexander Alekhin 0fd74fa177 Merge pull request #11911 from berak:core_fix_autobuffer_opengl 2018-07-08 13:50:35 +00:00
berak 45677819e8 core: fix autobuffer usage in opengl.cpp 2018-07-08 09:51:06 +02:00
berak e14b2ba43c objdetect: validate input in qrcode 2018-07-07 16:56:40 +02:00
Arnaud Brejeon 43f821afb9 Merge pull request #11899 from arnaudbrejeon:moveable_types
Add missing constructors and operator= (#11899)
2018-07-06 23:36:08 +03:00
Alexander Alekhin 81325a3fa0 highgui(gtk): use recursive cv::Mutex for 'window_mutex' variable 2018-07-06 17:35:47 +03:00
Alexander Alekhin aa0c6ddb4c highgui: fix GTK issues with external UI thread 2018-07-06 17:35:47 +03:00
Alexander Alekhin 5e6a3f1f6c Merge pull request #11901 from alalek:fix_cuda_build 2018-07-06 14:07:50 +00:00
Vadim Pisarevsky 523b6f32ba Merge pull request #11867 from dkurt:dnn_ie_layers 2018-07-06 13:13:20 +00:00
Alexander Alekhin fc59498b2b cuda: fix build
use cv::AutoBuffer::data() to get data pointer
2018-07-06 15:32:36 +03:00
Alexander Alekhin 3b01777c98 Merge pull request #11895 from alalek:fix_fn_types 2018-07-06 12:01:31 +00:00
Alexander Alekhin aa10cdbfa2 Merge pull request #11900 from alalek:build_warnings 2018-07-06 12:00:43 +00:00
Alexander Alekhin 06fc77610b core(hal): eliminate build warnings 2018-07-06 13:00:41 +03:00
Dmitry Kurtaev 019c2f2115 Enable more deep learning tests 2018-07-05 14:23:15 +03:00
Alexander Alekhin 4bc080dc50 fix function signatures, drop invalid casts 2018-07-05 13:55:26 +03:00
Alexander Alekhin c7fc563dc0 calib3d: chessboard detector - replace OpenCV C API 2018-07-05 13:09:10 +03:00
Alexander Alekhin 0bb2c115aa Merge pull request #11719 from alalek:update_autobuffer_api 2018-07-05 10:01:15 +00:00
Alexander Alekhin ccd2370bb7 Merge pull request #11890 from dkurt:keras_resize_nearest 2018-07-05 09:57:24 +00:00
Alexander Alekhin c0d0cf5e74 Merge pull request #11893 from dkurt:fix_11884 2018-07-05 09:56:50 +00:00
Alexander Alekhin b09a4a98d4 opencv: Use cv::AutoBuffer<>::data() 2018-07-04 19:11:29 +03:00
Alexander Alekhin 135ea264ef core: align cv::AutoBuffer API with std::vector/std::array
- added .data() methods
- added operator[] (int i)
- extend checks support to generic and debug-only cases
- deprecate existed operator* ()
2018-07-04 19:10:38 +03:00
Dmitry Kurtaev f25a01bb5a Disable fusion to output layers 2018-07-04 15:53:47 +03:00
Alexander Alekhin 6309e28dd0 Merge tag '3.4.2-openvino' 2018-07-04 14:08:21 +03:00
Alexander Alekhin bd8c8e720e Merge tag '3.4.2' 2018-07-04 14:08:11 +03:00
Alexander Alekhin 9e1b1e5389 OpenCV 3.4.2 2018-07-04 14:05:47 +03:00
Dmitry Kurtaev 36288eebe7 Nearest neighbor resize from Keras 2018-07-04 11:53:24 +03:00
Vadim Pisarevsky a0baae8a55 Merge pull request #11875 from dkurt:dnn_fix_reshape 2018-07-04 08:08:04 +00:00
Alexander Alekhin 9a66331984 Merge pull request #11882 from alalek:videoio_vfw_lower_priority 2018-07-03 14:54:54 +00:00
Alexander Alekhin c9fab28214 Merge pull request #11881 from alalek:sample_use_camera_0 2018-07-03 14:54:26 +00:00
Alexander Alekhin e93e1ba2c9 Merge pull request #11879 from alalek:fix_msmf_32bit 2018-07-03 14:10:42 +00:00
Alexander Alekhin f545aee66d videoio(VFW): lower priority (after DSHOW) 2018-07-03 15:54:45 +03:00
Alexander Alekhin 203f95d3be samples: videocapture_camera use VideoCapture with 0 index
Not all backends support -1 index.
2018-07-03 15:44:53 +03:00
Alexander Alekhin b3578710cf videoio(MSMF): fix 32-bit build crash 2018-07-03 15:28:55 +03:00
Alexander Alekhin 117e97adac Merge pull request #11876 from ilovezfs:patch-1 2018-07-03 09:15:15 +00:00
ilovezfs 0c4328fbf3 Python 3.7 compatability
The result of PyUnicode_AsUTF8() is now of type const char * rather of 
char *.
2018-07-03 00:38:59 -07:00
Dmitry Kurtaev 7ed5d85f25 Add Reshape layer tests 2018-07-03 08:26:43 +03:00
Alexander Alekhin c52b4cf450 Merge pull request #11873 from catree:add_tutorial_features2d_java_python2 2018-07-02 15:02:14 +00:00
catree 481af5c469 Add Java and Python code for AKAZE local features matching tutorial. Fix incorrect uses of Mat.mul() in Java code.
Uniform Lowe's ratio test in the code.
2018-07-02 15:10:53 +02:00
Alexander Alekhin 3165baa1f1 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-07-02 14:58:29 +03:00
Alexander Alekhin 74da80dbda Merge pull request #11869 from alalek:fix_11827 2018-07-02 11:54:34 +00:00
Alexander Alekhin f73eff7517 Merge pull request #11865 from csukuangfj:patch_1 2018-07-02 10:08:34 +00:00
Alexander Alekhin 5557474467 imgcodecs(sunras): avoid buffer overrun
`src_pitch` may be large than data `step`
2018-07-02 12:56:50 +03:00
Kuang Fangjun 8e24a8b7c0 remove a redundant option. 2018-07-02 09:45:28 +08:00
Alexander Alekhin 5a27f7c81f Merge pull request #11856 from alalek:videoio_msmf_fix_check 2018-06-30 04:52:36 +00:00
Alexander Alekhin 6ce26b72b1 Merge pull request #11860 from alalek:videoio_msmf_remove_cxx11_code 2018-06-30 04:51:20 +00:00
Alexander Alekhin 86885c5ed0 Merge pull request #11859 from alalek:fix_videoio_msmf_win7 2018-06-30 04:50:31 +00:00
Alexander Alekhin 2dbaba077a videoio(msmf): avoid using of C++11 code
build fails with MSVS 2012 without additional flags
2018-06-29 20:48:58 +00:00
Alexander Alekhin 7a2448672c videoio(MSMF): avoid OpenCV load failure on Win7 machines
OpenCV binaries are compiled on Win10 environment
2018-06-29 20:22:26 +00:00
Alexander Alekhin 9be3f7d41a Merge pull request #11854 from dkurt:dnn_tf_data_layouts_v2 2018-06-29 15:02:22 +00:00
Alexander Alekhin f40231af5d Merge pull request #11851 from pengli:3.4 2018-06-29 15:01:20 +00:00
Alexander Alekhin c3a90ccbad videoio(MSMF): remove "always true" check 2018-06-29 15:23:48 +03:00
Li Peng 145eae321e pooling ocl kernel optimization
set global size with real output size, also optimize

max pooling index computation if necessary.

Signed-off-by: Li Peng <peng.li@intel.com>
2018-06-29 15:22:49 +08:00
Dmitry Kurtaev d971678add Add a planar data layout tracking for TensorFlow importer 2018-06-29 09:50:14 +03:00
Vadim Pisarevsky 6c196d3066 Merge pull request #11852 from dkurt:dnn_dldt_ir_outs 2018-06-28 10:34:42 +00:00
Dmitry Kurtaev 346871e27f Set output layers names and types for models in DLDT's intermediate representation 2018-06-28 10:21:45 +03:00
Vadim Pisarevsky e4b51fa8ad Merge pull request #11849 from catree:add_tutorial_imgproc_java_python4 2018-06-27 18:17:39 +00:00
Vadim Pisarevsky 67259d7082 Merge pull request #11768 from alalek:videoio_msmf_async_live_capture 2018-06-27 18:12:10 +00:00
catree 7469981d1a Add Java and Python code for Image Segmentation with Distance Transform and Watershed Algorithm tutorial. Use more Pythonic code. 2018-06-27 18:48:32 +02:00
Vadim Pisarevsky db48f7b5d1 Merge pull request #11804 from mshabunin:gst-sample 2018-06-27 14:26:27 +00:00
Vadim Pisarevsky 9a8a964b69 Merge pull request #11847 from floe:gray8 2018-06-27 14:25:48 +00:00
Vadim Pisarevsky 75ee536d6d Filter homography decomp: updated PR #7153 (#11846)
* Add functionality to filter homography decompositions

* documentation + small refactor

* fix comparing int to size_t (compiler warning)

* fix whitespace issues

* clarification of function return values in documentation

* refactor of function parameters and change in loop nesting

* cleanup useless .h, fix size_t to int compare, small refactor

* fix documentation and whitespace

* change output from return value to outputarray parameter

* update function docs to reflect changes in parameters

* whitespace

* failing test

* fixed warnings related to extended initialisers and improper types

* initialize vectors from arrays

* initialize vectors from arrays part 2

* fix whitespace

* fix trailing whitespace

* Include <inttypes.h> in test_filter_homography_decomp.cpp, should fix 'uint8_t' : undeclared identifier error

* updated the test (made it shorter and providing better diagnostic) and significantly improved implementation (get rid of heavy repeated and/or unnecessary operations)

* fixed compile warning; removed trailing whitespace
2018-06-27 16:47:35 +03:00
Nesterov Alexander 0081dc478f Init qrcode algo (#11829) 2018-06-27 16:37:10 +03:00
Florian Echtler 17888ce0fd add support for 8-bit greyscale format 2018-06-27 15:31:53 +02:00
Vadim Pisarevsky 5dc0e51682 Merge pull request #11839 from dkurt:dnn_ie_r2 2018-06-27 09:56:02 +00:00
Vadim Pisarevsky ba1a6ad4cc Merge pull request #11840 from dkurt:dnn_tf_nchw 2018-06-26 19:27:25 +00:00
Vadim Pisarevsky 051b40f956 a part of PR #11364 (extended findNonZero & PSNR) (#11837)
* a part of https://github.com/opencv/opencv/pull/11364 by Tetragramm. Rewritten and extended findNonZero & PSNR to support more types, not just 8u.

* fixed compile & doxygen warnings

* fixed small bug in findNonZero test
2018-06-26 17:10:00 +03:00
branka-plateiq 34ad9b8a42 Pass RANSAC parameters as function input (#10569)
* Pass RANSAC parameters as function input

* Clean up unnecessary code

* Keep the original function signature

* Clean up based on PR comments

Replace array with vector.

Correct naming convention for input variables.

Add checks on input variables.

* Use vector instead of array for dynamic size

* Revert change.

* Use dynamic array

* Fix wrong syntax in array allocation

* Undo change

* Fix variable name

* Use vector and not array

* fixed compile warning on Windows
2018-06-26 16:40:28 +03:00
Dmitry Kurtaev dbeb4a11be Parse strides and convolution kernel shapes considering data layout 2018-06-26 16:18:21 +03:00
Dmitry Kurtaev b11e22c25b Update Inference Engine tests 2018-06-26 15:38:08 +03:00
Vadim Pisarevsky 53a475d63c Merge pull request #11836 from terfendail:msmf_camfallback 2018-06-26 12:17:55 +00:00
Vadim Pisarevsky e87425f047 Merge pull request #11835 from dkurt:dnn_tf_two_inputs 2018-06-26 12:12:24 +00:00
Vitaly Tuzov 67b67003c5 Disable MSMF VideoCapture fallback to existing camera in case provided index is out of range. 2018-06-26 14:04:02 +03:00
Dmitry Kurtaev 9510551c63 Multiple inputs for TensorFlow models 2018-06-26 14:03:59 +03:00
Alessandro de Oliveira Faria (A.K.A.CABELO) cc8db99695 Include ELA example (#11819)
* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* Include ELA example

* did some code cleanup

* fixed compile error
2018-06-26 12:10:52 +03:00
Vadim Pisarevsky b80c7bca0d Merge pull request #11826 from dkurt:dnn_tf_data_layouts 2018-06-26 06:36:27 +00:00
Vadim Pisarevsky dc27d52221 temporarily disabled OpenCL use in DNN module on Mac (#11828)
* temporarily disabled OpenCL use in DNN module on Mac, since some of the tests fail

* disable OpenCL in DNN on Mac at CMake level, not source level (thanks to alalek for the advice)
2018-06-26 09:35:18 +03:00
Alexander Alekhin b39cd06249 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-06-25 22:03:17 +03:00
Dmitry Kurtaev 715f40a48d Use layers consumers to predict data layout 2018-06-25 18:25:40 +03:00
Li, Peng ab8022f74e update convolution opencl kernels in dnn module (#11762)
* optimize ocl kernel enqueue in fc layer

Signed-off-by: Li Peng <peng.li@intel.com>

* use CV_LOG_INFO in convolution auto tuning

Signed-off-by: Li Peng <peng.li@intel.com>

* update convolution IDLF kernel

extend parameter tuning range, also cleanup
ocl kernel implementation

Signed-off-by: Li Peng <peng.li@intel.com>

* update in-memory convolution cache config

fp16 and fp32 cache config are stored separately

Signed-off-by: Li Peng <peng.li@intel.com>
2018-06-25 17:06:18 +03:00
Maksim Shabunin a2bc075924 cmake: function for application creation (#11736)
* apps: add Win32 friendly opencv_version app

Improve experience of launching app from explorer:
- application just flash (open/close) the console window
Suggested Win32 application flavor additionally shows MessageBox
and waits for User interaction.

* cmake: added unified application creation function
2018-06-25 17:02:58 +03:00
Vadim Pisarevsky e3dc7e5ec9 Merge pull request #11743 from alalek:samples_avoid_double_VideoCapture_open 2018-06-25 12:54:09 +00:00
Vadim Pisarevsky 46def2fdc1 Merge pull request #11757 from freiling:master 2018-06-25 12:53:07 +00:00
Rostislav Vasilikhin 18bc2a1a93 Kinect2 support added to OpenNI2 backend (#11794)
* Kinect2 support added to OpenNI2 backend

* more fixes for OpenNI2 backend

* whitespace fixed

* libfreenect2 support added

* const cast added

* mutable removed
2018-06-25 13:19:20 +03:00
Vadim Pisarevsky df38624e10 Merge pull request #11812 from dkurt:dnn_interp_layer_impl 2018-06-25 10:16:28 +00:00
Alexander Alekhin 70d6b8774d Merge pull request #11790 from berak:dnn_fix_coco_txt 2018-06-23 18:51:07 +00:00
Alexander Alekhin 2195f0cc62 Merge pull request #11795 from paroj:realsensev2 2018-06-23 18:50:43 +00:00
Alexander Alekhin fa813d02fa Merge pull request #11815 from tomoaki0705:suppressDeprecatedWarning 2018-06-23 17:55:12 +00:00
Tomoaki Teshima ffb9ce8287 suppress warning while building the samples 2018-06-23 21:35:25 +09:00
Alexander Alekhin 8b5e29c234 Merge pull request #11808 from tomoaki0705:caroteneSuppressWarnings 2018-06-23 08:46:29 +00:00
Dmitry Kurtaev e8e9d1d021 Implement Interp layer using Resize layer 2018-06-22 19:26:47 +03:00
Tomoaki Teshima e324d2e534 suppress warning on Arm platform 2018-06-22 20:17:22 +09:00
Alexander Alekhin 1894f1a37f Merge pull request #11773 from alalek:dnn_ocl_update_force_tuning_flag 2018-06-22 05:23:55 +00:00
Alexander Alekhin 50c607d206 dnn(ocl): fix external / predefined builtin configuration behavior
OPENCV_OCL4DNN_FORCE_AUTO_TUNING should ignore existed configuration from:
- builtin predefined configurations (for Intel OpenCL iGPUs)
- external configuration (via OPENCV_OCL4DNN_CONFIG_PATH)

Prefer external configuration over builtin.
2018-06-21 20:59:03 +03:00
Alexander Alekhin 443670262d Merge pull request #11791 from dkurt:dnn_shufflenet 2018-06-21 17:45:21 +00:00
Dmitry Kurtaev 4626246087 Add ShuffleChannel layer 2018-06-21 19:10:42 +03:00
Maksim Shabunin fe20fa8326 gstreamer sample: fixed incorrect pipelines being generated 2018-06-21 17:14:42 +03:00
Alexander Alekhin 387e92353c Merge pull request #11772 from PhilLab:patch-5 2018-06-21 11:57:24 +00:00
Alexander Alekhin 86c1114463 Merge pull request #11798 from dkurt:dnn_layers_names_with_dot 2018-06-21 11:51:54 +00:00
Dmitry Kurtaev 40b85c1cd9 Remove undocumented feature to retreive layers outputs by indices 2018-06-20 14:44:21 +03:00
Pavel Rojtberg 2047abd9c3 videoio: realsense - add cvtColor as the pixel-format is only a hint 2018-06-19 17:55:09 +02:00
berak 8f7a3b15b2 dnn: add a coco labels file for yolov3 2018-06-19 10:45:49 +02:00
Alexander Alekhin 64f2b1b250 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-06-17 16:26:48 +03:00
Alexander Alekhin eed43a231b Merge pull request #11775 from alalek:issue_11771 2018-06-17 13:25:44 +00:00
Alexander Alekhin 8622b1254e Merge pull request #11774 from adamrankin:cap_dshow_autofocus 2018-06-16 14:11:44 +00:00
Alexander Alekhin 5e2c112697 photo: remove redundant broken check
`dest(roi_d)` operation contains similar check inside.
2018-06-16 11:36:51 +03:00
Adam Rankin ecf4b639e1 Adding the ability to toggle autofocus on/off for DirectShow webcams 2018-06-15 12:32:12 -04:00
Philipp Hasper 577546ccd9 Added Size_::aspectRatio 2018-06-15 14:59:54 +02:00
Alexander Alekhin db1550a410 Merge pull request #11760 from vishwesh5:patch-1 2018-06-14 15:59:49 +00:00
Alexander Alekhin 9629af1aa9 videoio: MSMF async reader for camera stream
Synchronized reading from camera with heavy frame processing
provides bad effects (huge frame latency, processing frames from the past).
Generally, there is no way to process each frame and some frames will be dropped.
Allow preventive frame dropping to reduce lag of processed frames.

This mode is applied to cameras only (opened by 'index').
2018-06-14 18:37:05 +03:00
Alexander Alekhin 30d4e0261a Merge pull request #11766 from dkurt:dnn_darknet_avgpool_softmax 2018-06-14 13:18:30 +00:00
Alexander Alekhin 001f5faa0d Merge pull request #11763 from dkurt:dnn_keras_relu6_v2 2018-06-14 13:17:54 +00:00
Alexander Alekhin a6ad44a7c7 Merge pull request #11764 from alalek:videoio_msmf_refactor_ComPtr_wrapper 2018-06-14 13:01:22 +00:00
Dmitry Kurtaev bd87eb6e66 Import average pooling and softmax layers from Darknet 2018-06-14 15:22:08 +03:00
Alexander Alekhin 2bb5d1bca3 videoio(msmf): cleanup unused methods from ComPtr wrapper
Use Win32 TRUE/FALSE in SetUINT32() calls for bool parameters
2018-06-14 14:15:09 +03:00
Dmitry Kurtaev 693a7663e7 Import ClipByValue from Keras 2018-06-14 13:30:30 +03:00
Alexander Alekhin 8f24db048c Merge pull request #11735 from alalek:videoio_msmf_fix_configureHW_reopen_condition 2018-06-14 09:57:39 +00:00
Alexander Alekhin 13a4700084 Merge pull request #11755 from alalek:dnn_backend_default_config 2018-06-14 09:57:03 +00:00
vishwesh5 018eab7040 Corrected formula
Corrected formula for weighted within-class variance
2018-06-14 12:30:06 +05:30
Forrest Reiling e858c21e1f Fix system.cpp includes on Fuchsia. 2018-06-13 12:14:53 -07:00
Alexander Alekhin 0d6518aaa0 Merge remote-tracking branch 'upstream/3.4' into merge-3.4
OpenCV FFmpeg wrapper download links are preserved from ffmpeg/master branch
2018-06-13 19:34:44 +03:00
Alexander Alekhin 5fd7cfbcad dnn: add runtime parameter OPENCV_DNN_BACKEND_DEFAULT
to control DNN_BACKEND_DEFAULT enumeration value behavior
2018-06-13 19:00:04 +03:00
Alexander Alekhin 54e8487f56 Merge pull request #11707 from kdpatters:patch-1 2018-06-13 15:51:10 +00:00
Alexander Alekhin 1c2ee8a5f1 Merge pull request #11737 from alalek:videoio_msmf_replace_debug_print 2018-06-13 13:31:31 +00:00
Alexander Alekhin 09c63e4f00 videoio(msmf): fix reopen condition in configureHW()
`camid` value is always -1 after close().
2018-06-13 16:29:45 +03:00
Alexander Alekhin f040282bf8 Merge pull request #11739 from dkurt:more_ie_models 2018-06-13 13:26:50 +00:00
yuki takehara 4fe648b15c Merge pull request #11706 from take1014:setTo_Nan_10507
* setTo_#10507

* setTo_Nan_10507

* setTo: update check / test for NaNs
2018-06-12 18:05:44 +00:00
Alexander Alekhin aef16d51ec samples: don't call twice of VideoCapture::open() 2018-06-11 23:17:49 +00:00
Alexander Alekhin ff3d4d8b7f Merge pull request #11740 from catree:add_tutorial_imgproc_java_python3 2018-06-11 16:32:05 +00:00
catree a11ef2650e Add Java and Python code for the following imgproc tutorials: Finding contours in your image, Convex Hull, Creating Bounding boxes and circles for contours, Creating Bounding rotated boxes and ellipses for contours, Image Moments, Point Polygon Test. 2018-06-10 23:57:11 +02:00
Alexander Alekhin 8c4e0dfd13 Merge pull request #11738 from dkurt:dnn_batch_norm_fusion_base 2018-06-10 17:12:04 +00:00
Alexander Alekhin 49886ebae3 OpenCV version '-openvino' 2018-06-10 10:20:38 +03:00
Alexander Alekhin d69a327d6d OpenCV version++
OpenCV 3.4.2
2018-06-10 10:20:38 +03:00
Alexander Alekhin ab11b17d4b experimental version++ 2018-06-10 10:20:38 +03:00
Dmitry Kurtaev 7d727ac2fb Fuse top layers to batch normalization 2018-06-09 18:06:53 +03:00
Alexander Alekhin 0d249c7448 videoio(msmf): replace custom debug print function 2018-06-09 17:38:32 +03:00
Alexander Alekhin 93f2fd396b Merge pull request #11723 from alalek:sample_videocapture_camera 2018-06-09 13:49:21 +00:00
Alexander Alekhin d068ec3a3d Merge pull request #11734 from alalek:opencv_version_win32 2018-06-09 13:48:06 +00:00
Dmitry Kurtaev 2c291bc2fb Enable FastNeuralStyle and OpenFace networks with IE backend 2018-06-09 15:57:12 +03:00
Alexander Alekhin 95360a5539 apps: add Win32 friendly opencv_version app
Improve experience of launching app from explorer:
- application just flash (open/close) the console window
Suggested Win32 application flavor additionally shows MessageBox
and waits for User interaction.
2018-06-09 15:55:35 +03:00
Alexander Alekhin 8221f57c26 Merge pull request #11729 from alalek:ffmpeg_update_3.4 2018-06-09 12:25:23 +00:00
Alexander Alekhin c198a35368 Merge pull request #11733 from alalek:opencv_ffmpeg_download_ps1 2018-06-09 12:11:39 +00:00
Alexander Alekhin c0feea50a9 Merge pull request #11732 from alalek:cmake_build_apps_list 2018-06-09 12:10:49 +00:00
Alexander Alekhin 34fc8e9260 Merge pull request #11714 from alalek:win32_waitKey_accuracy 2018-06-09 12:10:24 +00:00
Alexander Alekhin 390f0a5dcd cmake: generate and install ffmpeg-download.ps1
64-bit only
2018-06-09 13:19:48 +03:00
Alexander Alekhin e8a520ed96 cmake: add BUILD_APPS_LIST
- build "opencv_version" only: `cmake -DBUILD_APPS_LIST=version ...`
- option 'BUILD_opencv_apps' should be 'ON'
2018-06-09 12:52:27 +03:00
Alexander Alekhin 0614ee3f95 Merge pull request #11726 from catree:add_tutorial_java_ld_preload_mkl 2018-06-08 19:10:38 +00:00
Alexander Alekhin d1a598c652 Merge pull request #11730 from paroj:realsensev2 2018-06-08 19:06:11 +00:00
Alexander Alekhin 929d39f69a Merge pull request #11728 from dkurt:dnn_update_tf_ssd 2018-06-08 19:04:28 +00:00
Alexander Alekhin f72633b9f5 Merge pull request #11727 from alalek:videoio_msmf_use_Lock2D 2018-06-08 19:01:40 +00:00
Alexander Alekhin 486f31fae9 Merge pull request #11715 from catree:add_tutorial_objDetect_HDR_java_python 2018-06-08 18:59:29 +00:00
Alexander Alekhin c05180ccce Merge pull request #11702 from terfendail:msmf_sizefix 2018-06-08 18:56:31 +00:00
catree afa5b0cc93 Add Java and Python code for cascade classifier and HDR tutorials. 2018-06-08 19:30:30 +02:00
Pavel Rojtberg bfc227b8d4 videoio: update librealsense to API 2.0
this enables the usage of current sensors, while dropping support for
legacy devices, see:
https://github.com/IntelRealSense/librealsense#overview

Given limited resources, and that the legacy sensors where not that
great, I think we should focus on v2.
2018-06-08 18:23:00 +02:00
Vitaly Tuzov cb4b6bb2dc Fixed setting of frame size properties for MSMF-based VideoCapture 2018-06-08 18:55:06 +03:00
Alexander Alekhin d3696f3ad2 ffmpeg: update OpenCV FFmpeg wrapper (3.4) 2018-06-08 18:47:00 +03:00
Alexander Alekhin c64f6b3c22 videoio(MSMF): refactor grabFrame() / retrieveFrame() methods
- no behavior changes in grabFrame()
- added Lock2D() support into retrieveFrame()
2018-06-08 17:20:47 +03:00
Dmitry Kurtaev 40765c5f8d Enable SSD models from TensorFlow with OpenCL plugin of Intel's Inference Engine 2018-06-08 16:55:21 +03:00
catree 9a7f426b7b Add LD_PRELOAD instruction to be able to run Java code that calls OpenCV functions that use the Intel MKL library. 2018-06-08 15:47:06 +02:00
Alexander Alekhin f5ddbbf659 Merge pull request #11722 from gnthibault:3.4 2018-06-08 12:59:19 +00:00
Alexander Alekhin a7047dd4b6 samples: add videocapture_camera sample
- show capturing information: width / height / fps
- show average FPS for cap.read()+imshow() via cv::getTickCount()
- optional frame processing code path
2018-06-08 15:51:46 +03:00
gnthibault b46fef327e Fixed Assertin error due to Size.area() overflowing 2018-06-08 11:22:36 +02:00
Alexander Alekhin 8620bd5a84 highgui(win32): improve waitKey() timeout condition
- use cv::getTickCount() instead of Win32 GetTickCount()
- process message queue before timeout exit
2018-06-07 19:31:08 +03:00
rockzhan 1187a7fa34 Merge pull request #11649 from rockzhan:dnn_dw_prelu
dnn: Fix output mismatch when forward dnn model contain [depthwise conv(group=1) + bn + prelu]  (#11649)

* this can make sure [depthwise conv(group=1) + bn + prelu] output not shift

* add TEST to show the output mismatch in [DWconv+Prelu]

* fix typo

* change loading image to init cvMat directly

* build runtime model, without loading external model

* remove whitespace

* change way to create a cvmat

* add bias_term, add target output

* fix [dwconv + prelu] value mismatch when no optimizations

* fix Test error when change output channels

* add parametric test

* change num_output to group value

* change conv code and change test back
2018-06-07 13:45:54 +00:00
David 7175f257b5 Added ResizeBilinear op for tf (#11050)
* Added ResizeBilinear op for tf

Combined ResizeNearestNeighbor and ResizeBilinear layers into Resize (with an interpolation param).

Minor changes to tf_importer and resize layer to save some code lines

Minor changes in init.cpp

Minor changes in tf_importer.cpp

* Replaced implementation of a custom ResizeBilinear layer to all layers

* Use Mat::ptr. Replace interpolation flags
2018-06-07 16:29:04 +03:00
Maksim Shabunin 60fa6bea70 Merge pull request #11711 from alalek:python_standalone 2018-06-07 13:27:19 +00:00
Alexander Alekhin dd7f88bd68 python: support standalone Python bindings build
- requires OpenCV source directory
- requires OpenCV binary directory with built modules and 'python_bindings_generator' target
2018-06-07 15:16:39 +03:00
Vadim Pisarevsky 5e5d997dff Merge pull request #11620 from terfendail:hmmorph_fix 2018-06-07 11:19:21 +00:00
Sayed Adel e0d28aa893 core:ppc Fix java CoreTest/testMahalanobis (#11677)
* core:ppc Fix java CoreTest/testMahalanobis

* core:ppc Fix warning unused variable on clang
2018-06-07 14:16:48 +03:00
Alexander Alekhin 8542887257 Merge pull request #11705 from alalek:fix_samples_callback 2018-06-07 11:14:53 +00:00
Alexander Alekhin 749530978c Merge pull request #11704 from alalek:apps_avoid_catch_by_value 2018-06-07 11:13:30 +00:00
Vadim Pisarevsky 828f33311f Merge pull request #11700 from dkurt:dnn_ie_try_catch 2018-06-07 11:09:00 +00:00
Dmitry Kurtaev f3a6ae5f00 Wrap Inference Engine init to try-catch 2018-06-07 12:55:52 +03:00
Kyle D. Patterson f581992a62 Update py_calibration.markdown
Improved readability by correcting grammar and idioms.

Further improved language and readability.

Attempted to fix list bullets.

Again, attempted to fix list bullets.

Removed trailing whitespace on line 8.
2018-06-06 16:26:11 -04:00
Vitaly Tuzov 2e22f8e790 Fix for morphologyEx MORPH_HITMISS mode 2018-06-06 21:04:17 +03:00
Alexander Alekhin 9b0bafb82c samples: fix callback function type 2018-06-06 18:29:05 +03:00
Alexander Alekhin caa6915b83 apps: catch() with "const reference" 2018-06-06 18:23:29 +03:00
Vadim Pisarevsky 7c3090ddcf Merge pull request #11683 from alalek:videoio_ffmpeg_cleanup_dead_code 2018-06-06 12:21:00 +00:00
Vadim Pisarevsky 3cbd2e2764 Merge pull request #11650 from dkurt:dnn_default_backend 2018-06-06 09:30:39 +00:00
Alexander Alekhin afaf5f940e Merge pull request #11695 from alalek:dnn_test_fix_sa_warnings 2018-06-05 20:07:39 +00:00
Alexander Alekhin 31a1df0fae Merge pull request #11692 from alalek:default_log_level_warnings 2018-06-05 20:07:15 +00:00
Alexander Alekhin b0ae357cfb Merge pull request #11687 from alalek:gstreamer_write_pipeline 2018-06-05 20:06:55 +00:00
Alexander Alekhin 95f948a9e4 Merge pull request #11685 from alalek:videoio_fix_backend_modes 2018-06-05 20:06:27 +00:00
Alexander Alekhin 4091ced5ab core: set default logger level to 'warning' in Release builds
should hide unnecessary 'info' messages
2018-06-05 18:39:47 +03:00
Alexander Alekhin 03d3966d15 Merge pull request #11690 from peters:master 2018-06-05 14:59:16 +00:00
Peter Rekdal Sunde 9492f46d77 3rdparty: update libwebp 0.6.1 => 1.0.0
Commit: https://github.com/webmproject/libwebp/commit/698b8844e38a0c5ca50bb20f866e71291bfc3b36
Tag: https://github.com/webmproject/libwebp/releases/tag/v1.0.0
2018-06-05 13:17:20 +03:00
Alexander Alekhin 6816495bee dnn(test): reuse test/test_common.hpp, eliminate dead code warning 2018-06-05 12:52:53 +03:00
Alexander Alekhin 277e9279cc videoio(gstreamer): support dumping of VideoWriter pipeline 2018-06-04 18:39:20 +00:00
Alexander Alekhin d041b0a599 videoio: fix capture modes 2018-06-04 19:48:51 +03:00
Alexander Alekhin 45dd575ed2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4
Revert "documentation: avoid links to 'master' branch from 3.4 maintenance branch"
This reverts commit 9ba9358ecb.

Revert "documentation: avoid links to 'master' branch from 3.4 maintenance branch (2)"
This reverts commit f185802489.
2018-06-04 19:26:10 +03:00
Alexander Alekhin b2cff44084 Merge pull request #11682 from alalek:fix_pylint 2018-06-04 16:16:08 +00:00
Alexander Alekhin 9c2b924dfc Merge pull request #11681 from alalek:fix_docs_bs4_spaces 2018-06-04 16:15:45 +00:00
Alexander Alekhin 2628662586 videoio(ffmpeg): cleanup, remove dead code 2018-06-04 19:07:22 +03:00
Dmitry Kurtaev b781ac7346 Make Intel's Inference Engine backend is default if no preferable backend is specified. 2018-06-04 18:31:46 +03:00
Alexander Alekhin 15130f4f43 Merge pull request #11646 from alalek:gtest_support_params_from_anonymous_namespace 2018-06-04 15:27:33 +00:00
Alexander Alekhin dcb9bc2544 python: eliminate pylint warnings
Tested with:
- pylint 1.9.1
2018-06-04 17:58:06 +03:00
Alexander Alekhin ec30b1294f Merge pull request #11636 from alalek:cmake_ffmpeg_find_package 2018-06-04 14:37:36 +00:00
Alexander Alekhin 0560747d3d docs: preserve space symbols during bs4 processing 2018-06-04 17:27:18 +03:00
Rostislav Vasilikhin fc35c77f00 Merge pull request #11610 from savuor:fix/stereobm_simd_fixed_float
* StereoBM: fixed SIMD processing for fixed-type output arrays

* changed norm type and threshold, added assertion

* fixed disp_shift
2018-06-04 13:03:12 +00:00
Alexander Alekhin 04802e41e9 gtest: support parameters with types from anonymous namespace 2018-06-04 13:30:24 +03:00
Vadim Pisarevsky ccbc0b91ea Merge pull request #11654 from alalek:issue_11648 2018-06-04 10:22:44 +00:00
Vadim Pisarevsky 80709697e5 Merge pull request #11643 from savuor:fix/viz_const 2018-06-04 10:20:19 +00:00
Vadim Pisarevsky 3030594665 Merge pull request #11644 from alalek:docs_avoid_master_links_in_3.4-2 2018-06-04 10:19:44 +00:00
Vadim Pisarevsky e5991e91f9 Merge pull request #11670 from alalek:cmake_avoid_double_variable_expand 2018-06-04 10:15:07 +00:00
Vadim Pisarevsky 1ef3a84cd8 Merge pull request #11671 from alalek:cmake_enable_pch_with_msvc_crosscompiling 2018-06-04 10:13:59 +00:00
Vadim Pisarevsky 055f33ec46 Merge pull request #11657 from dkurt:dnn_ie_multiple_networks 2018-06-04 10:12:46 +00:00
Alexander Alekhin c7183775db Merge pull request #11678 from csukuangfj:fix-doc 2018-06-03 11:00:38 +00:00
Alexander Alekhin 0ddc49c313 Merge pull request #11674 from csukuangfj:fix-11673 2018-06-03 11:00:10 +00:00
Kuang Fangjun 9ae28415ec fix doc. 2018-06-03 17:44:24 +08:00
Kuang Fangjun ec42d87204 fix #11673. 2018-06-03 07:58:23 +08:00
Alexander Alekhin 40a61ec64e Merge pull request #11647 from sanchom:3.4 2018-06-02 20:52:17 +00:00
Alexander Alekhin 1b53a4fccc Merge pull request #11669 from csukuangfj:fix-11668 2018-06-02 20:48:46 +00:00
Alexander Alekhin e657e170eb cmake: ENABLE_PRECOMPILED_HEADERS for MSVC cross-compiling
MSVC ARM / WinRT builds
2018-06-02 08:27:34 +00:00
Fangjun Kuang 4bb220bb90 fix #11668. 2018-06-02 16:17:32 +08:00
Alexander Alekhin be8f5bb420 cmake: avoid double variable expand 2018-06-02 08:16:31 +00:00
Alexander Alekhin 6912c20380 Merge pull request #11659 from take1014:snippet_11597 2018-06-01 16:48:10 +00:00
Alexander Alekhin 993981428f Merge pull request #11656 from pauljurczak:patch-1 2018-06-01 16:39:54 +00:00
Alexander Alekhin b229107f8e Merge pull request #11641 from alalek:videoio_test_fixup 2018-06-01 16:39:11 +00:00
take1014 4ec9afac57 add imgproc snippets 2018-06-01 23:42:00 +09:00
Rostislav Vasilikhin e1b3cf5c14 Viz3d::getViewerPose() made const 2018-06-01 15:53:05 +03:00
Alexander Alekhin 1a872b2f61 Merge pull request #11651 from vladkraievskiy:master 2018-06-01 11:28:15 +00:00
Dmitry Kurtaev ab389142af Fix multiple networks with Intel's Inference Engine backend 2018-06-01 14:10:32 +03:00
Paul Jurczak bd7bad02a0 convertFp16 documentation edit (2)
If this seems too wordy, take into account a new user who tries to find out extent of FP16 support in OpenCV.
2018-06-01 04:15:21 -06:00
Vlad Kraevskiy 90ba69a403 Fixed a typo in android toolchain documentation. 2018-06-01 12:39:34 +03:00
Alexander Alekhin 03edddba47 core: drop unnecessary duplicate check 2018-06-01 12:31:48 +03:00
Sancho McCann dbab7ecac8 Refactored out a dead code path. 2018-05-31 21:09:26 +00:00
Alexander Alekhin 1822e85f4a Merge pull request #11642 from alalek:calib3d_chess_board_avoid_clone 2018-05-31 19:17:48 +00:00
Vadim Pisarevsky d734e83af0 Hsv2rgb univ intrin (#11637)
* add universal intrinsics for HSV2RGB_b

* rewritten HSV2RGB_b without using extra universal intrinsics

* removed unused variable

* undo changes in v_load_deinterleave
2018-05-31 21:59:45 +03:00
Alexander Alekhin 0349e8c9af Merge pull request #11608 from take1014:hist_11544 2018-05-31 16:44:02 +00:00
Vadim Pisarevsky 7d19bd6c19 Merge pull request #11634 from vpisarev:empty_mat_with_types_2
fixes handling of empty matrices in some functions (#11634)

* a part of PR #11416 by Yuki Takehara

* moved the empty mat check in Mat::copyTo()

* fixed some test failures
2018-05-31 16:36:39 +00:00
Alexander Alekhin da75e463a8 Merge pull request #11639 from alalek:fix_precomp_hpp 2018-05-31 16:35:21 +00:00
Alexander Alekhin 1bc96e3ed0 calib3d: cv::findContours() doesn't require to clone input 2018-05-31 19:34:23 +03:00
Alexander Alekhin f185802489 documentation: avoid links to 'master' branch from 3.4 maintenance branch (2)
Other links:
- https://raw.githubusercontent.com/opencv/opencv/master
- https://github.com/opencv/opencv/blob/master
2018-05-31 19:30:56 +03:00
Alexander Alekhin 46c508b84f Merge pull request #11638 from alalek:docs_avoid_master_links_in_3.4 2018-05-31 16:22:03 +00:00
Alexander Alekhin 5d68c8dbe7 videoio(test): fixup information dump 2018-05-31 18:54:43 +03:00
Alexander Alekhin b934702c7f cmake: support find_package(FFMPEG)
Use "OPENCV_FFMPEG_USE_FIND_PACKAGE" variable to specify find_package() parameters
2018-05-31 18:27:01 +03:00
Alexander Alekhin 58d47ae9c8 Merge pull request #11633 from alalek:issue_10546 2018-05-31 15:08:45 +00:00
Vadim Pisarevsky 9d91c63502 Merge pull request #11635 from dkurt:dnn_fix_ie_fused_layer_output 2018-05-31 14:52:57 +00:00
take1014 229e8b1b18 Correct handling when IPP is enabled 2018-05-31 22:54:32 +09:00
Alexander Alekhin 799b4f48e7 fix missing precomp.hpp 2018-05-31 16:53:44 +03:00
Alexander Alekhin 9ba9358ecb documentation: avoid links to 'master' branch from 3.4 maintenance branch 2018-05-31 16:45:18 +03:00
Dmitry Kurtaev 32bab45f81 Fix Inference Engine graphs with fused output layers 2018-05-31 16:21:08 +03:00
Alexander Alekhin c94fe0c7e7 videoio(v4l): eliminate global variable 2018-05-31 15:11:20 +03:00
Alexander Alekhin 83d915eca1 videoio(v4l): don't pre-scan or cache list of available cameras 2018-05-31 15:11:20 +03:00
Alexander Alekhin 22f435ff4d videoio(v4l): fix code indentation, tabs 2018-05-31 15:11:20 +03:00
Alexander Alekhin 49321a233c Merge pull request #11632 from alalek:videoio_fixes 2018-05-31 12:09:14 +00:00
Alexander Alekhin 1b27351f45 Merge pull request #11627 from alalek:fix_python_cast_method_with_kw 2018-05-31 11:38:39 +00:00
Vadim Pisarevsky c58cc4c2ff Merge pull request #11255 from dkurt:dnn_tf_faster_rcnn 2018-05-31 11:07:39 +00:00
Alexander Alekhin ddba772297 videoio: fix isOpened() method for legacy APIs, fix "index" API list 2018-05-31 14:07:22 +03:00
Dmitry Kurtaev f96f934426 Update Intel's Inference Engine deep learning backend (#11587)
* Update Intel's Inference Engine deep learning backend

* Remove cpu_extension dependency

* Update Darknet accuracy tests
2018-05-31 14:05:21 +03:00
Spark Echo 80770aacd7 Merge pull request #11631 from sparkecho:3.4
Typo fixes (#11631)
2018-05-31 07:23:19 +00:00
Alexander Alekhin 133e9f2012 Merge pull request #11618 from alalek:ffmpeg_debug_log 2018-05-30 15:36:42 +00:00
Alexander Alekhin 5c80763a71 Merge pull request #11601 from alalek:calib3d_replace_findContours 2018-05-30 15:35:49 +00:00
Alexander Alekhin c2d40b465d python: fix arg types of cv2_UMatWrapperObject functions 2018-05-30 18:07:03 +03:00
Alexander Alekhin 1207300e01 python: avoid direct cast PyCFunctionWithKeywords->PyCFunction 2018-05-30 17:24:43 +03:00
Dmitry Kurtaev bf87a43185 Faster-RCNN object detection models from TensorFlow 2018-05-30 17:12:36 +03:00
Alexander Alekhin 44572fac44 Merge pull request #11557 from tomoaki0705:relaxIntelOnlyOCL4DNN 2018-05-29 15:25:22 +00:00
Alexander Alekhin c27b1d93e3 Merge pull request #11614 from dkurt:dnn_fix_keras_dilated_conv 2018-05-29 15:21:30 +00:00
Alexander Alekhin 8f28817373 Merge pull request #11617 from alalek:ffmpeg_fix_time_base 2018-05-29 15:19:13 +00:00
Alexander Alekhin d738f56d83 Merge pull request #11598 from catree:add_tutorial_features2d_java_python 2018-05-29 15:18:44 +00:00
Alexander Alekhin c90e65ce4b Merge pull request #11596 from alalek:videoio_priority_list 2018-05-29 15:17:02 +00:00
Alexander Alekhin d70e01b635 calib3d: chess board - replace to cv::findContours() 2018-05-29 14:16:20 +00:00
Alexander Alekhin 83ec0f526c videoio(ffmpeg): add option to enable debug logs 2018-05-29 12:40:52 +00:00
Alexander Alekhin cd9e43704e videoio: backends priority list 2018-05-29 12:06:45 +00:00
Alexander Alekhin 5128c1ff1f videoio(ffmpeg): specify stream->time_base
Using codec->time_base is deprecated to specify muxer settings.
Resolves issue with FPS value for AVI files with FFmpeg 4.0.

Related FFmpeg commits:
- https://github.com/FFmpeg/FFmpeg/commit/194be1f43ea391eb986732707435176e579265aa
- https://github.com/FFmpeg/FFmpeg/commit/91736025b2807995e29bd0661807c1c84f515fef
2018-05-29 11:42:50 +00:00
Tomoaki Teshima 2e9e71ab9e make ocl4dnn available to run on other platform than Intel GPU 2018-05-29 19:18:10 +09:00
Dmitry Kurtaev 085be6a445 Fix dilated convolution from Keras 2018-05-29 12:15:47 +03:00
catree ade21f142e Add Java and Python code for the following features2d tutorials: Harris corner detector, Shi-Tomasi corner detector, Creating your own corner detector, Detecting corners location in subpixels, Feature Detection, Feature Description, Feature Matching with FLANN, Features2D + Homography to find a known object. Use Lowe's ratio test to filter the matches. 2018-05-29 10:35:57 +02:00
Alexander Alekhin 06c1890639 Merge pull request #11607 from dkurt:dnn_scale_shift_layer 2018-05-28 18:19:22 +00:00
Alexander Alekhin 89230fa45b Merge pull request #11605 from alalek:fix_build_10963 2018-05-28 18:18:40 +00:00
Dmitry Kurtaev 2c3c59d018 Remove Shift deep learning layer 2018-05-28 18:18:56 +03:00
Alexander Alekhin 549b5df225 build: workaround issues with C compilation mode
- cvdef.h + cvRound (double only)
- highgui_c.h
2018-05-28 18:07:23 +03:00
Alexander Alekhin 58d28061a4 Merge pull request #11591 from alalek:calib3d_chessboard_fix3 2018-05-28 12:48:11 +00:00
Alexander Alekhin faae5edf72 Merge pull request #11590 from alalek:calib3d_chessboard_fix2 2018-05-28 12:44:46 +00:00
Alexander Alekhin 0f298a4203 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-28 11:22:55 +00:00
Alexander Alekhin 29421d7def Merge pull request #11589 from alalek:calib3d_chessboard_fix 2018-05-28 10:13:43 +00:00
Alexander Alekhin 3c24e76018 Merge pull request #11592 from catree:remove_java_toBufferedImage 2018-05-26 17:29:48 +00:00
Alexander Alekhin 4384036108 Merge pull request #11576 from alalek:avoid_copyTo_with_getMat 2018-05-25 16:52:58 +00:00
catree adef31097d Use directly HighGui.toBufferedImage(). 2018-05-25 16:23:42 +02:00
Alexander Alekhin f3cbb0f941 calib3d: chess board - perform full range (with 0) histogram smooth 2018-05-25 15:35:36 +03:00
Alexander Alekhin ad57750d25 calib3d: chess board - properly detect/handle iCntMaxima=0 case 2018-05-25 15:32:07 +03:00
Alexander Alekhin 1dfc742f27 calib3d: chess board - avoid image modification via cvFindContours 2018-05-25 15:01:34 +03:00
Alexander Alekhin 0a6d190095 Merge pull request #11396 from terfendail:msmf_icapture 2018-05-24 18:30:09 +00:00
Alexander Alekhin 8a17ae29b9 Merge pull request #11580 from dkurt:dnn_fix_tf_ssd 2018-05-24 18:28:41 +00:00
Alexander Alekhin 6e4f82d9da Merge pull request #11583 from catree:add_tutorial_imgproc_java_python2 2018-05-24 18:28:14 +00:00
catree 4c1c3147d9 Add Java and Python code for the following imgproc tutorials: Affine Transformations, Histogram Equalization, Histogram Calculation, Histogram Comparison, Back Projection. 2018-05-24 01:11:28 +02:00
Alexander Alekhin 2db12e8986 Merge pull request #11582 from alalek:use_mat_empty_instead_of_size 2018-05-23 20:43:36 +00:00
yuki takehara ed207d79e7 Merge pull request #11108 from take1014:hough_4303
* Added accumulator value to the output of HoughLines and HoughCircles

* imgproc: refactor Hough patch

- eliminate code duplication
- fix type handling, fix OpenCL code
- fix test data generation
- re-generated test data in debug mode via plain CPU code path
2018-05-23 20:42:12 +00:00
yuki takehara 2d5d98ec0f Merge pull request #11551 from take1014:filter2d_10683
* Add arguments to dftFilter2D

* test: add expected test values
2018-05-23 20:25:11 +00:00
Alexander Alekhin 1923916929 Merge pull request #11581 from mdfirman:rectify3Collinear_bugfix 2018-05-23 20:19:12 +00:00
Alexander Alekhin 3654fb10d7 Merge pull request #11567 from alalek:code_quality 2018-05-23 15:47:11 +00:00
Alexander Alekhin cf4f6d412e interactive-calibration: use empty() method instead of checking dimension size 2018-05-23 18:26:21 +03:00
Michael Firman e8cb67572a Bugfix to allow adjust3rdMatrix to be run 2018-05-23 16:03:21 +01:00
Alexander Alekhin 5a706eee8a Merge pull request #11578 from alalek:build_warnings 2018-05-23 15:02:32 +00:00
Alexander Alekhin 9b173d317f Merge pull request #11573 from mshabunin:fix-gst-leak 2018-05-23 15:00:37 +00:00
Vitaly Tuzov 9622ca0e37 MSMF-based VideoCapture and VideoWriter backend changed to C++ interface 2018-05-23 17:54:08 +03:00
Dmitry Kurtaev 3346a7ac0a Fix batch normalization fusion from TensorFlow's SSDs 2018-05-23 16:49:31 +03:00
Alexander Alekhin 39b60f9b17 fix build warnings 2018-05-23 16:04:41 +03:00
Alexander Alekhin 8307e06c1a Merge pull request #11575 from mshabunin:fix-ie-win 2018-05-23 13:00:23 +00:00
Alexander Alekhin b3ff29fcf5 avoid copyTo(outputarray.getMat()) pattern
- leads to errors due 'const' modifier of getMat() method
- may be non-optimal with non-CPU data storage
2018-05-23 13:56:34 +03:00
Maksim Shabunin 895e10c317 dnn: fixed IE support on Windows 2018-05-23 12:46:14 +03:00
Alexander Alekhin 6c06fcee61 Merge pull request #11572 from nglee:dev_fixNppStreamHandlerDtor 2018-05-23 09:40:05 +00:00
Maksim Shabunin 1a15136536 GStreamer backend: fixed memory leak and version check 2018-05-23 10:48:13 +03:00
Namgoo Lee 79af0bfccf NPP : NppStreamHandler fix 2018-05-23 15:54:39 +09:00
Alexander Alekhin 5e68f35500 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-22 19:02:01 +03:00
Alexander Alekhin 2f9b4439af Merge pull request #11565 from alalek:issue_11545 2018-05-22 16:00:37 +00:00
Alexander Alekhin 099eb40ba1 Merge pull request #11564 from alalek:ts_run_py_passthrough_test_args 2018-05-22 15:58:51 +00:00
Alexander Enaldiev 84584002f2 Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats
* imgcodecs cmake: the option to customize supported formats list (WITH_IMGCODEC_HDR, WITH_IMGCODEC_SUNRASTER, WITH_IMGCODEC_PXM)

* imgcodecs: fixes

- fixed CMake scripts (=OFF doesn't really work)
- restore dropped GDCM block
- added _IMGCODEC_ prefix
- fixed tests
- include PAM format under WITH_IMGCODEC_PXM option
2018-05-22 15:10:15 +00:00
Alexander Alekhin 573e790107 Merge pull request #11558 from alalek:issue_11552 2018-05-22 14:19:13 +00:00
Alexander Alekhin 2fc713bb94 Merge pull request #11566 from mshabunin:allow-ie-force 2018-05-22 14:12:32 +00:00
Alexander Alekhin 471c17321f improve code quality
- eliminate rand() calls
- non initialized members/ variables
- unused return values
- missing/useless NULL checks
2018-05-22 17:08:31 +03:00
Alexander Alekhin e1b96b6d82 Merge pull request #11563 from alalek:dnn_text_test_threshold 2018-05-22 13:05:23 +00:00
Alexander Alekhin af5f40a80e Merge pull request #11543 from catree:add_tutorial_imgproc_java_python 2018-05-22 12:26:34 +00:00
Maksim Shabunin 53a68783a5 dnn: support later IE versions 2018-05-22 15:18:18 +03:00
Maksim Shabunin 020ad1ac76 dnn: allow setting IE paths via command line 2018-05-22 14:40:03 +03:00
Alexander Alekhin 35a4551609 imgcodecs: fix imwrite handling of different OutputArray types 2018-05-22 13:57:51 +03:00
Alexander Alekhin 76ac7ab4ef imgcodecs: added test for imwrite parameter types
issue 11545
2018-05-22 13:55:14 +03:00
Alexander Alekhin a00182db8e ts: run.py passthrough --test_* args "as is"
to allow pass `--test_bigdata` via run.py
2018-05-22 13:40:09 +03:00
Alexander Alekhin 58c8aefe03 dnn(text): update check threshols
- make green Linux debug/Linux32/Win32 builders
2018-05-22 13:29:31 +03:00
Alexander Alekhin ba1bd64bf9 Merge pull request #11532 from paroj:realsense 2018-05-21 15:59:46 +00:00
Alexander Alekhin d4a8a9ee96 cmake: filter NVCC compiler flags (Wimplicit-fallthrough, OPENCV_CUDA_NVCC_FILTEROUT_OPTIONS)
issue 11552
2018-05-21 17:54:11 +03:00
Alexander Alekhin db88cd1b25 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-21 16:20:14 +03:00
Alexander Alekhin 085b27fc3d Merge pull request #11390 from dkurt:east_text_detection 2018-05-21 13:02:29 +00:00
Alexander Alekhin 86e1f63193 Merge pull request #11555 from alalek:fix_videocapture_frame_lifetime 2018-05-21 10:35:36 +00:00
Alexander Alekhin e21c01708a videoio: fix lifetime management of data of input frames 2018-05-21 12:29:24 +03:00
Alexander Alekhin 0bebe553a8 Merge pull request #11536 from catree:add_tutorial_highgui_trackbar_python_java 2018-05-21 09:21:06 +00:00
Alexander Alekhin 59fc909d48 Merge pull request #11541 from lupustr3:pvlasov/icv_package_hotfix 2018-05-21 08:03:52 +00:00
Alexander Alekhin faafb3152a Merge pull request #11550 from tomoaki0705:fixCudaAsync 2018-05-20 20:59:34 +00:00
Alexander Alekhin b83bc8b3b0 Merge pull request #11546 from shengyu7697:tab_to_space 2018-05-20 20:58:51 +00:00
Tomoaki Teshima e2c787884d fix the test failure of CUDA_Arithm/MeanStdDev 2018-05-20 19:38:02 +09:00
shengyu 72d3e14e8f fix wrong indentation on github page (tab to space) 2018-05-19 11:23:51 +08:00
catree 9f6108ae7a Add Java and Python code for the following imgproc tutorials: Canny, Remap, threshold and threshold inRange. Use HSV colorspace instead of RGB for inRange threshold tutorial. 2018-05-18 20:11:53 +02:00
Dmitry Kurtaev 07dc6d2b45 Return a convex hull from rotatedRectangleIntersection 2018-05-18 14:20:17 +03:00
Alexander Alekhin ab2c21e7c1 Merge pull request #11531 from alalek:issue_11518 2018-05-18 10:59:27 +00:00
Alexander Alekhin 949067cfbe Merge pull request #11537 from alalek:build_warnings 2018-05-18 10:50:32 +00:00
Pavel Vlasov eaf70c7bb3 Hotfix packages with several fixes in IW code including:
__STDCALL macro change to support IPP 2018u3+ external packages
    Memory leak fix in Gaussian filter
    Improved checkers for OpenMP supported features
    Improved declarations for atomic operations.

ICV binary and package version are the same.
2018-05-18 12:52:27 +03:00
catree 9fc0cabdf5 Add Java and Python code for trackbar tutorial. 2018-05-18 11:29:41 +02:00
Alexander Alekhin d6279bfff8 fix build warnings 2018-05-17 18:29:21 +03:00
Alexander Alekhin 1ba25c5569 Merge pull request #11520 from terfendail:ffmpeg_icapture 2018-05-17 15:28:58 +00:00
Alexander Alekhin 45b92aebe5 Merge pull request #11523 from alalek:bigdata_tests 2018-05-17 14:53:19 +00:00
Alexander Alekhin 491e3627b6 photo: initialize cos() table with double type
This avoids MSVC 19.14.26428.1 to call vectorized __vdecl_cosf4() function with less precision.
2018-05-17 15:30:11 +03:00
Pavel Rojtberg 936d2963a2 videoio: add rudimentary librealsense 1.x support
it is reusing CAP_INTELPERC* enums as Intel PerC is deprecated and
librealsense replaces it.
2018-05-17 11:56:52 +02:00
Alexander Alekhin ba6b9fd261 Merge pull request #11529 from catree:add_tutorial_morphology_python_java 2018-05-16 19:40:02 +00:00
Alexander Alekhin f0a4ec90b1 Merge pull request #11397 from pengli:dnn_half 2018-05-16 18:40:12 +00:00
Alexander Alekhin 4378b4d03d Merge pull request #11516 from berak:java_features2d 2018-05-16 15:40:51 +00:00
Alexander Alekhin 1983991d2f photo(test): update test checks
- allow 5% of changed pixels with intensity difference <= 1
2018-05-16 17:58:46 +03:00
Li Peng 1b517a45ae add fp16 accuracy and perf test
Signed-off-by: Li Peng <peng.li@intel.com>
2018-05-16 22:45:07 +08:00
Li Peng ba5e8befa9 fp16 ocl support for more layers
Signed-off-by: Li Peng <peng.li@intel.com>
2018-05-16 22:45:04 +08:00
Li Peng 3dd916882a fp16 ocl support for googlenet
Signed-off-by: Li Peng <peng.li@intel.com>
2018-05-16 22:45:02 +08:00
Li Peng 329abb5b64 dnn fp16 support
Signed-off-by: Li Peng <peng.li@intel.com>
2018-05-16 22:44:39 +08:00
Vitaly Tuzov aeed43ec90 FFMPEG-based VideoCapture and VideoWriter backend changed to C++ interface 2018-05-16 17:19:18 +03:00
berak 6ddef3b7a9 features2d: remove deprecated java wrappers 2018-05-16 16:13:18 +02:00
Alexander Alekhin bb8ff2c463 Merge pull request #11494 from tomoaki0705:fixOpenCLDnn 2018-05-16 14:11:36 +00:00
catree 7e3490959a Add Java and Python code for morphology tutorials. 2018-05-16 14:19:48 +02:00
Alexander Alekhin f3e166c58b Merge pull request #11528 from tomoaki0705:fixTabSpaceLibTiff 2018-05-16 12:15:39 +00:00
Alexander Alekhin 336841fa1b Merge pull request #11525 from alalek:issue_11511 2018-05-16 12:14:11 +00:00
Tomoaki Teshima 3f5347dd7a work around of the test failure of opencv_test_dnn
* let OpenCL kernel run only on Intel GPU
  * brush up the workaround based on 9a2b028 from alalek
2018-05-16 19:23:19 +09:00
Tomoaki Teshima 85668cf5a4 remove Tab 2018-05-16 18:56:23 +09:00
Alexander Alekhin ea75e7f00b Merge pull request #11526 from nglee:dev_cudaMeanStdDevFix 2018-05-16 09:29:26 +00:00
Namgoo Lee 2c1ce8c0e9 cuda_meanStdDev : bug fix 2018-05-16 03:31:47 +09:00
Alexander Alekhin ed63c43cda Merge pull request #11519 from paroj:openni_color 2018-05-15 16:54:24 +00:00
Alexander Alekhin f42fca9f49 cuda: avoid unnecessary cudaStreamSynchronize() call
resolves #11511
2018-05-15 18:38:22 +03:00
Alexander Alekhin 703f79b757 tests: add "bigdata" tests 2018-05-15 15:56:26 +03:00
Alexander Alekhin 6582afcdbb ts: add BigData tests category (skipped by default)
Pass --test_bigdata to allow launching of "BigData" tests.
2018-05-15 15:55:56 +03:00
Pavel Rojtberg 9573644387 samples: openni_capture - use COLORMAP_JET for depth visualization
instead of an ad-hoc implementation of it
2018-05-15 11:31:14 +02:00
Alexander Alekhin 3104d2f738 Merge pull request #11482 from allnes:gst_remove_container 2018-05-14 16:14:10 +00:00
Alexander Nesterov 9bd5739125 Remove command line argument related to container 2018-05-14 16:32:12 -03:00
Vadim Pisarevsky e0dbe5cfcc handle huge matrices correctly (#11505)
* make sure that the matrix with more than INT_MAX elements is marked as non-continuous, and thus all the pixel-wise functions process it correctly (i.e. row-by-row, not as a single row, where integer overflow may occur when computing the total number of elements)
2018-05-14 15:29:14 +03:00
Alexander Alekhin 68c92908d5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-14 15:17:35 +03:00
Alexander Alekhin c6a9de812b Merge pull request #11497 from alalek:libjpeg-turbo 2018-05-14 12:17:10 +00:00
Alexander Alekhin b7a9d966d7 Merge pull request #11506 from catree:tutorial_euler_angles_doc 2018-05-13 17:36:13 +00:00
Alexander Alekhin f175a04014 Merge pull request #11504 from alalek:check_flake8 2018-05-12 08:58:08 +00:00
catree d02ecff881 Clarify the Euler angles convention chosen. Replace rotation inverse with matrix transpose. 2018-05-12 01:11:13 +02:00
Alexander Alekhin f8252702a8 3rdparty: integrate libjpeg-turbo build scripts into OpenCV 2018-05-11 18:29:57 +03:00
Alexander Alekhin 777953923e 3rdparty: added libjpeg-turbo source code (1.5.3)
Repo: https://github.com/libjpeg-turbo/libjpeg-turbo.git
Tag: 1.5.3

excluded libjpeg-turbo files:
- bmp.c
- bmp.h
- cderror.h
- cdjpeg.c
- cdjpeg.h
- cjpeg.c
- djpeg.c
- example.c
- jcstest.c
- jdatadst-tj.c
- jdatasrc-tj.c
- jpegtran.c
- rdbmp.c
- rdcolmap.c
- rdgif.c
- rdjpgcom.c
- rdppm.c
- rdrle.c
- rdswitch.c
- rdtarga.c
- tjbench.c
- tjunittest.c
- tjutil.c
- tjutil.h
- transupp.c
- transupp.h
- turbojpeg-jni.c
- turbojpeg.c
- turbojpeg.h
- wrbmp.c
- wrgif.c
- wrjpgcom.c
- wrppm.c
- wrrle.c
- wrtarga.c
2018-05-11 17:43:50 +03:00
Alexander Alekhin f8b75ce455 eliminate 'git diff ---check' false alarms for Markdown files 2018-05-11 17:43:50 +03:00
Alexander Alekhin 43177b1f6f cmake: added check_flake8 target 2018-05-11 17:32:22 +03:00
Alexander Alekhin 78f205ffa5 python: better Python 3 support 2018-05-11 17:32:04 +03:00
Alexander Alekhin df02fe0615 Merge pull request #11445 from cclauss:file-long-raw_input-xrange 2018-05-11 13:28:53 +00:00
Alexander Alekhin 24bb7b7679 Merge pull request #11444 from cclauss:patch-2 2018-05-11 13:28:27 +00:00
Alexander Alekhin b5423f3c7f Merge pull request #11443 from cclauss:fix-Python-string-format 2018-05-11 13:26:41 +00:00
Alexander Alekhin 8356a6b6ab Merge pull request #11442 from cclauss:print-function 2018-05-11 13:26:04 +00:00
Dmitry Kurtaev 8488f2e265 EAST: An Efficient and Accurate Scene Text Detector (https://arxiv.org/abs/1704.03155v2) 2018-05-11 14:55:42 +03:00
Alexander Alekhin d1d7408a20 Merge pull request #11502 from berak:fix_knearest 2018-05-11 11:47:13 +00:00
berak 9b0ef7bb17 ml: fix caching of internal state when changing the impl in KNearest 2018-05-11 12:20:17 +02:00
Alexander Alekhin 314246d396 Merge pull request #11459 from dkurt:dnn_mobilenet_v2 2018-05-11 09:48:05 +00:00
Alexander Alekhin ed150bd97a Merge pull request #11461 from dkurt:dnn_reduce_mem_consumption 2018-05-11 09:47:03 +00:00
Alexander Alekhin d9ddca04c1 Merge pull request #11498 from matech96:camshift_publication_date 2018-05-11 06:47:15 +00:00
matech96 e98da758cc Update py_meanshift.markdown
Fix publication date of "Computer Vision Face Tracking for Use in a Perceptual User Interface" from 1988 to 1998.
2018-05-10 22:07:50 +02:00
Dmitry Kurtaev c99c3e761e Fuse multipliers but not convolution layers weights 2018-05-10 19:24:38 +03:00
Alexander Alekhin 51e543050c Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-10 18:19:56 +03:00
Vadim Pisarevsky 9e3b6a228a Merge pull request #11418 from K-Shinotsuka:issue42 2018-05-10 15:15:04 +00:00
Vadim Pisarevsky 566cb5e3d8 Merge pull request #11430 from K-Shinotsuka:issue43 2018-05-10 15:14:39 +00:00
Alexander Alekhin 6f24b81079 Merge pull request #11490 from shengyu7697:tab_to_space 2018-05-10 14:41:07 +00:00
Alexander Alekhin d2bc7b5a95 Merge pull request #11489 from alalek:fix_arm_build 2018-05-10 14:37:51 +00:00
Alexander Alekhin 9dc2005251 Merge pull request #11476 from tomoaki0705:fixCudaSampleBuildError 2018-05-09 20:48:33 +00:00
Namgoo Lee ed86bd34b1 Merge pull request #11483 from nglee:dev_cudaCannyStreamIssue
cuda_canny : multi stream safety (#11483)

* CUDA_ImgProc/Canny Asynchronous test

* cuda_canny : multi stream safety (1/3)

- Convert global variable canny::counter to class local variable

* cuda_canny : multi stream safety (2/3)

- Use texture objects rather than texture reference for cc >= 3.0,
  since texture reference must be declared as a static global variable
  which results in race condition when ran concurrently

* cuda_canny : multi stream safety (3/3)

- Refrain from using global variable in row_filter and column_filter
  (converts column_filter::c_kernel and row_filter::c_kernel to local
  variables)

* Fixes #11193
2018-05-09 23:44:34 +03:00
Alexander Alekhin 352510cc19 core: fix ARM intrinsincs
'0' is specific case (make no sence as a standalone operation),
but it can be useful in template-based programming.

reverts commit: a58c9d4d63
2018-05-09 23:31:02 +03:00
Alexander Alekhin 959a12cbac Merge pull request #11478 from cabelo:select-device-dnn 2018-05-09 15:04:16 +00:00
cabelo 1b3e0783f4 select the device (video capture) 2018-05-09 17:20:02 +03:00
shengyu 70455a959d tab to space 2018-05-09 21:15:51 +08:00
Alexander Alekhin 2025650d50 Merge pull request #11481 from dapicard:11480-allow_to_force_video_codec_ffmpeg 2018-05-09 10:36:48 +00:00
Tomoaki Teshima f7ea6b12ea cuda: fix build error of sample 2018-05-09 00:23:49 +09:00
Damien Picard ba000bf8ea Fixes 11480 : allow to force the video codec used to read videos
with the ffmpeg backend
2018-05-08 15:02:01 +02:00
Maksim Shabunin 107b3f328b Merge pull request #11474 from tomoaki0705:fixNeonRotateLeft 2018-05-08 10:21:17 +00:00
Tomoaki Teshima a58c9d4d63 arm: fix build error of v_rotate_left
* remove meaningless tests
2018-05-08 00:35:18 +09:00
Alexander Alekhin 8a767689cf Merge pull request #11470 from seiko2plus:VSXImprovements_2 2018-05-06 19:14:05 +00:00
Alexander Alekhin 60e5e213fd Merge pull request #11454 from seiko2plus:issue11433_samples 2018-05-05 18:57:49 +00:00
Alexander Alekhin 527696ddf0 Merge pull request #11327 from cdcseacave:master 2018-05-05 18:56:27 +00:00
Alexander Alekhin 4fd17f8b54 Merge pull request #11463 from abhi-jha:master 2018-05-05 16:14:35 +00:00
Sayed Adel 115b10ed32 photo:ppc fix MergeRobertson test 2018-05-05 09:38:55 +00:00
cDc f2fbfd7a10 fix bug in Matx::inv() 2018-05-05 10:30:58 +03:00
abhi-jha a31aff452a fix spelling error 2018-05-05 10:08:16 +03:00
Sayed Adel ed19da21ab core:ppc Several improvements on VSX(2)
* add v_float64x2 support to v_rotate_*
* treat float vector in v_check_any, vec_any_lt as int vector
* add test case for v_rotate_left
2018-05-04 23:09:38 +00:00
Dmitry Kurtaev 777d77848c Free Convolution and MatMul weights after TensorFlow layers import 2018-05-04 11:20:14 +03:00
Dmitry Kurtaev 9ffe4694db Reduce memory consumption at Caffe importer 2018-05-04 09:24:13 +03:00
Dmitry Kurtaev d381948cee Update script to generate MobileNet-SSD V2 text graph 2018-05-04 07:55:18 +03:00
Sayed Adel e00a58a05f samples: add C++11 override to virtual methods 2018-05-03 20:12:24 +00:00
k-shinotsuka ecb4ea8f76 add universal intrinsics for RGB2HSV_f 2018-05-04 00:58:46 +09:00
k-shinotsuka a5f68e98f4 add universal intrinsics for HLS2RGB_f 2018-05-03 23:50:38 +09:00
Alexander Alekhin 000a13b6a3 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-05-03 14:30:38 +00:00
Alexander Alekhin 9fa01a7b70 Merge pull request #11436 from seiko2plus:issue11433 2018-05-03 10:37:40 +00:00
zuoshaobo 4ff6a1bc7b Merge pull request #11425 from zuoshaobo:relu_negative_slope
* FIX INF_ENGINE RELU ERROR

* set slope to variable

* tab in indentwq
2018-05-03 13:36:49 +03:00
cclauss 8a79b167b8 Define execfile, file, long, raw_input, xrange for Python 3 2018-05-03 09:19:05 +02:00
cclauss de99f53e94 Don't forget self in table_formatter.py
__ridx__ is an _undefined name_ in this context but __self.ridx__ is used three other times in this method and nine times in this class.  Undefined names may raise [NameError](https://docs.python.org/3/library/exceptions.html#NameError) at runtime.

flake8 testing of https://github.com/opencv/opencv

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./modules/ts/misc/table_formatter.py:50:23: F821 undefined name 'ridx'
            self.rows[ridx + 1].props = properties
                      ^
```
2018-05-03 08:24:24 +02:00
cclauss d4a966c7c4 Fix Python string formatting 2018-05-03 07:47:34 +02:00
cclauss 05c1a3d160 print() is a function in Python 3 2018-05-03 07:12:12 +02:00
Sayed Adel 788d6a7105 cmake: Disable -Wsuggest-override option in case of using PCH #11433 2018-05-02 09:12:55 +00:00
Alexander Alekhin 684cf43360 Merge pull request #11420 from alalek:git_tag_describe 2018-04-28 15:00:44 +00:00
Alexander Alekhin 083b08742d Merge pull request #11406 from alalek:core_matsize_dims 2018-04-28 14:38:42 +00:00
Alexander Alekhin 80934dc488 cmake: update 'git describe' information 2018-04-28 17:17:31 +03:00
Alexander Alekhin c67613e0fe Merge pull request #11419 from alalek:msvs2017_build_warning 2018-04-28 13:23:32 +00:00
Alexander Alekhin 65b0b319eb eliminate MSVS2017 build warning
modules\dnn\src\layers\prior_box_layer.cpp(208): warning C4834: discarding return value of function with 'nodiscard' attribute
2018-04-28 15:14:41 +03:00
yuki takehara 4934f7c5a4 Merge pull request #11285 from take1014:core_6125
* Resolves 6125

* Fix test code

* Delete unnecessary code
2018-04-28 14:14:10 +03:00
Alexander Alekhin e7adce851c Merge pull request #11314 from terfendail:msmf_camera 2018-04-27 19:34:29 +03:00
Alexander Alekhin 7e43a0c2b7 Merge pull request #11394 from dkurt:dnn_custom_layers_py 2018-04-27 15:19:46 +00:00
Alexander Alekhin 8c349ff8ff core: added MatSize::dims() method
to avoid accessing of 'p[-1]' (static code analysers dislike this)
2018-04-27 16:57:29 +03:00
Alexander Alekhin 8d7ccd29fe Merge pull request #11401 from exoson:livestitch 2018-04-27 13:47:42 +00:00
Tomoaki Teshima 87a4f4ab3a Merge pull request #11409 from tomoaki0705/fixCLAHEfailure
Arm: fix the test failure of OCL_Imgproc/CLAHETest.Accuracy on ODROID-XU4 (#11409)

* fix the test failure of OCL_Imgproc/CLAHETest.Accuracy on ODROID-XU4
  * avoid the race condition in the reduce

* imgproc(ocl): simplify CLAHE code

* remove unused class
2018-04-27 16:41:56 +03:00
Alexander Alekhin 71d406b40c Merge tag '3.4.1-cvsdk' into 3.4
OpenCV 3.4.1 for Intel Computer Vision SDK
2018-04-27 14:52:21 +03:00
Alexander Alekhin e785afd356 Merge pull request #11410 from alalek:ipp_norm_L1_16UC3_mask_AVX512 2018-04-27 10:57:37 +00:00
Alexander Alekhin 856a07711b core: disabled IPP AVX512 normL1(a, b, mask)
for cv::Mat with type=16UC3 and width < 16
2018-04-27 12:57:53 +03:00
exoson 058299cc66 Optimize MultiBandBlender to run faster 2018-04-27 10:48:13 +03:00
Alexander Alekhin 1031dfe4e8 Merge pull request #11402 from alalek:build_warnings 2018-04-26 19:04:37 +00:00
Alexander Alekhin 79d41aad64 Merge pull request #11403 from alalek:cmake_fix_cpu_baseline 2018-04-26 15:31:09 +00:00
Alexander Alekhin 33212633c0 Merge pull request #11404 from alalek:icc_fix_std_exception_ptr 2018-04-26 15:29:35 +00:00
Alexander Alekhin 39e2d64b84 core: fix icc std::exception_ptr detection
std::exception_ptr requires enabled C++11 mode
2018-04-26 17:46:25 +03:00
Alexander Alekhin 56222f35bb cmake: fix CPU_BASELINE_FINAL filling
- remove duplicates
- restore "always on" missing entries
- fix FP16 detection on MSVC
2018-04-26 17:13:42 +03:00
Vitaly Tuzov 1dc73281f8 Added precise seek to MSMF-based VideoCapture::set(CAP_PROP_POS_FRAMES) 2018-04-26 16:15:23 +03:00
Alexander Alekhin bf552fdb88 Merge pull request #11377 from Turim:master 2018-04-26 12:13:19 +00:00
Alexander Alekhin 2a330e3006 cuda: eliminate warnings 2018-04-26 15:06:59 +03:00
Alexander Alekhin ad3186edb3 Merge pull request #11400 from alalek:ipp_norm_L1_16UC3_mask 2018-04-26 11:39:52 +00:00
Alexander Alekhin 8e15c6fd78 videoio(openni2): fix CV_CAP_PROP_OPENNI2_SYNC property 2018-04-26 14:16:03 +03:00
Alexander Alekhin f708a11f0f build: fix warnings 2018-04-26 14:13:01 +03:00
Alexander Enaldiev 677dc802ae protobuf build documenting: move the WITH_PROTOBUF option to the top level 2018-04-26 13:58:13 +03:00
Alexander Alekhin 57dad685d1 core: disabled IPP AVX2 normL1(a, b, mask)
for cv::Mat with width < 16
2018-04-26 13:35:25 +03:00
Alexander Alekhin dfa04a11bb core: norm with mask 16UC3 regression test 2018-04-26 13:35:25 +03:00
Alexander Alekhin 331af82e6d Merge pull request #11395 from alalek:fix_fixedpoint_build 2018-04-26 10:31:31 +00:00
Dmitry Kurtaev d5b9563263 Custom deep learning layers in Python 2018-04-26 09:25:18 +03:00
Alexander Alekhin 84b3b5b4a4 Merge pull request #11392 from alalek:master_drop_errorNoReturn 2018-04-25 19:42:57 +00:00
Alexander Alekhin 637d6b4e36 Merge pull request #11391 from alalek:android_pack_fix_contrib 2018-04-25 19:42:13 +00:00
Alexander Alekhin 9166e6052b imgproc: fixed fixedpoint coding style
- fixed wrong condition (always true)
- replaced unnecessary shift operation: '>> 63' to '< 0'
- used CV_BIG_INT()/CV_BIG_UINT() macros
2018-04-25 17:33:57 +03:00
Alexander Alekhin 469dc6ac42 imgproc: fix fixed point build
avoid using of templated 'operator T ()'
2018-04-25 16:34:44 +03:00
Alexander Alekhin 4e83f4c579 core: drop cv::errorNoReturn()
replaced to cv::error()
2018-04-25 15:07:18 +03:00
Alexander Alekhin 0bd33c8d1c android: don't use relative paths to contrib modules 2018-04-25 14:31:35 +03:00
Alexander Alekhin cd2b188c9a Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-04-24 18:13:06 +03:00
Alexander Alekhin ca1975cada Merge pull request #11385 from shengyu7697:tab_to_space 2018-04-24 18:11:14 +03:00
Alexander Alekhin d72494d09d Merge pull request #11381 from alalek:replace_cv_errornoreturn 2018-04-24 15:06:59 +00:00
shengyu 7773b2b4d6 tab to space 2018-04-24 17:45:16 +03:00
Alexander Alekhin 84db82a329 build: fix warnings 2018-04-24 16:15:22 +03:00
Alexander Alekhin ef2548778c build: -Wimplicit-fallthrough warning for GCC 7+ only 2018-04-24 16:03:40 +03:00
Alexander Alekhin 6b581c4e51 build: unreachable code after CV_Error() (part 2) 2018-04-24 16:03:40 +03:00
Alexander Alekhin 576d2dbac0 refactor: don't use CV_ErrorNoReturn() internally 2018-04-24 15:38:42 +03:00
Alexander Alekhin 1e0a60be2a Merge pull request #11384 from berak:ml_virtual 2018-04-24 12:23:17 +00:00
Dmitry Kurtaev 4ec456f0a0 Custom layers for deep learning networks (#11129)
* Custom deep learning layers support

* Stack custom deep learning layers
2018-04-24 14:59:59 +03:00
Alexander Alekhin 909a25571e Merge pull request #11332 from alalek:v_select_x86 2018-04-24 11:44:33 +00:00
Vadim Pisarevsky 5c57e6bdb0 Merge pull request #11380 from vpisarev:faster_interleave_deinterleave 2018-04-24 11:30:18 +00:00
Vadim Pisarevsky 9be80d7b12 Merge pull request #11382 from alalek:cmake_macosx_cpu_baseline 2018-04-24 11:29:50 +00:00
berak fc5bba66af ml: refactor non-virtual methods 2018-04-24 13:23:27 +02:00
Vitaly Tuzov 80600e5cdc Added DXVA hardware acceleration to MSMF-based VideoCapture 2018-04-24 13:42:49 +03:00
Alexander Alekhin a2d6fc7ac0 cmake: fix popcnt detection
via GCC/Clang __POPCNT__ define
2018-04-24 12:40:25 +03:00
Vitaly Tuzov 916f094ce6 Integrated camera and file MSMF-based VideoCaptures and implemented configuration properties get/set 2018-04-24 12:13:20 +03:00
Vitaly Tuzov b0b2d8de44 Remove unused code 2018-04-24 12:13:19 +03:00
Maksim Shabunin 62513bf20d Merge pull request #11269 from allnes:gst_add_encoder_sample 2018-04-24 08:23:56 +00:00
Maksim Shabunin 5ae550c622 Merge pull request #11320 from mshabunin:gstreamer-cpp 2018-04-24 08:23:28 +00:00
Alexander Nesterov 1367a58b54 Added encode-pipeline to sample 2018-04-23 21:57:41 +03:00
Alexander Alekhin ff6ce6cd01 cmake: change CPU_BASELINE=DETECT for MacOSX 2018-04-23 19:42:49 +03:00
Alexander Alekhin 4d7d630e92 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-04-23 18:45:02 +03:00
Vadim Pisarevsky 4001e310f5 improved performance of v_load_deinterleave(8uC3) & v_store_interleave(8uC3) intrinsics when using SSSE3 instructions. 2018-04-23 18:06:06 +03:00
Alexander Alekhin e82af627ed Merge pull request #11376 from alalek:cv_error_set_terminate 2018-04-23 14:51:55 +00:00
Vitaly Tuzov 44848d3241 MSMF-based CameraCapture reworked to use SourceReader 2018-04-23 17:04:54 +03:00
Vitaly Tuzov 65c46d0cc6 Removed WINRT related code 2018-04-23 17:04:53 +03:00
Alexander Alekhin 643e4f37ba Merge pull request #11375 from alalek:warnings_unreachable_code 2018-04-23 14:01:17 +00:00
Alexander Alekhin 4cbec82ac1 build: unreachable code after CV_Error() 2018-04-23 15:45:57 +03:00
Alexander Alekhin 10c9227136 core: CV_Error with set_terminate() on Windows
To dump contents of the last OpenCV error
2018-04-23 15:09:41 +03:00
Maksim Shabunin 5309832308 VideoIO: prettier test console output, gstreamer capture backend changed to C++ interface 2018-04-23 13:21:37 +03:00
Alexander Alekhin 65726e4244 core(hal): improve v_select() SSE4.1+
v_select 'mask' is restricted to these values only: 0 or ~0 (0xff/0xffff/etc)
mask in accuracy test is updated.
2018-04-23 13:17:53 +03:00
Vadim Pisarevsky 9615f8c994 Merge pull request #11358 from mshabunin:enable-xine 2018-04-23 10:09:29 +00:00
Vadim Pisarevsky b8a6bfb54e Merge pull request #11350 from alalek:fix_11348 2018-04-23 10:08:10 +00:00
Vadim Pisarevsky a312380367 Merge pull request #11357 from alalek:disable_errors_dump 2018-04-23 10:06:43 +00:00
Alexander Alekhin dca9ca1cac Merge pull request #11363 from mshabunin:compat-vc2017 2018-04-23 09:24:39 +00:00
Alexander Alekhin 29b4fd2774 Merge pull request #11351 from dkurt:dnn_enable_inf_engine_tests 2018-04-23 09:16:39 +00:00
Alexander Alekhin f659f80c7f Merge pull request #11374 from lupustr3:pvlasov/morph_big_fix 2018-04-23 09:14:23 +00:00
Pavel Vlasov a42789f330 IPP morphology with big images hotfix. 2018-04-23 10:50:20 +03:00
Maksim Shabunin abce51fb7b cmake config: adding fallback to VS 2015 if distribution does not have VS 2017 binaries 2018-04-23 09:33:27 +03:00
Alexander Alekhin 7973a2ca1f Merge pull request #11367 from berak:core_fix_inrange 2018-04-21 19:11:21 +00:00
berak d89fb163c6 core: add a check for empty input in inRange() 2018-04-21 12:54:52 +02:00
Alexander Alekhin 7b36e57551 Merge pull request #11362 from dkurt:dnn_keras_deconv 2018-04-20 16:53:38 +00:00
Ryan Wong 6f675ae75b Merge pull request #11304 from kinchungwong:issue_11242_intrin_cv34x_nocpp11
* Issue 11242 intrinsics v_extract, v_rotate improvement, branch 3.4, without C++11 (remove type restrictions for SSE2, use PALIGNR on SSSE3, compile to no-op when imm is 0 or nlanes).

* fix whitespace

* Fix #11242 (NEON intrinsics v_rotate...) branch 3.4
Separate macro expansion OPENCV_HAL_IMPL_NEON_SHIFT_OP for bitwise shifts for integers, from macro expansion OPENCV_HAL_IMPL_NEON_ROTATE for lane rotations. Bitwise shifts do not apply to floats, but lane-rotations can apply to both.

* fix whitespace

* Fix #11242 compile error (VSX intrinsics v_rotate(a)) branch 3.4 no-c++11
2018-04-20 18:43:47 +03:00
Alexander Alekhin c8b515ea69 Merge pull request #11315 from tomoaki0705:featureComparePixelCount 2018-04-20 14:50:40 +00:00
Alexander Alekhin 52172e6f92 Merge pull request #11361 from alalek:ocl_use_host_mem_ptr_workaround 2018-04-20 14:49:37 +00:00
Dmitry Kurtaev d959d7b9f0 Fuse deconvolution layer subgraphs from Keras 2018-04-20 16:51:38 +03:00
Simon Que 705464258e Merge pull request #11353 from eecsninja:3.4
* Fix CV_Asserts with negation of strings

{!"string"} causes some compilers to throw a warning.

The value of the string is not that important -- it's only for printing
the assertion message.

Replace these calls with:

  CV_Error(Error::StsError, "string")

to suppress the warning.

* remove unnecessary 'break' after CV_Error()
2018-04-20 15:31:47 +03:00
Alexander Alekhin 2b4b946689 Merge pull request #11352 from alalek:build_implicit_fallthrough 2018-04-20 12:30:50 +00:00
Alexander Alekhin 4e063be421 Merge pull request #11349 from alalek:cv_error_no_return 2018-04-20 12:29:13 +00:00
Maksim Shabunin a9bdf75c5b videoio: refactored XINE backend 2018-04-20 15:20:46 +03:00
Alexander Alekhin d76b41b50e ocl: CL_MEM_USE_HOST_PTR workaround test 2018-04-20 14:58:42 +03:00
Alexander Alekhin 2f9cbc2e57 core: disable errors dump
Error messages are available via exceptions
2018-04-20 12:33:20 +03:00
Dmitry Kurtaev bd77d100e1 Enable some tests for clDNN plugin from Intel's Inference Engine 2018-04-20 10:47:46 +03:00
Alexander Alekhin 12e8e33144 build: enable -Wimplicit-fallthrough warning for OpenCV modules 2018-04-19 19:54:03 +03:00
Alexander Alekhin 21026bf7cd python: fix support of UI callbacks 2018-04-19 18:42:01 +03:00
Alexander Alekhin 647eb243ae core: CV_Error is marked as 'noreturn' 2018-04-19 18:04:12 +03:00
Vadim Pisarevsky 7ea5029ae5 Grabcut with frozen models (#11339)
* model is not learned when grabcut is called with GC_EVAL

* fixed test, was writing to wrong file.

* modified patch by Iwan Paolucci; added GC_EVAL_FREEZE_MODEL in addition to GC_EVAL (which semantics is retained)
2018-04-19 15:23:50 +03:00
Vadim Pisarevsky 64a6b12114 Merge pull request #11340 from dkurt:dnn_inf_engine_switch_target 2018-04-19 12:23:15 +00:00
Vadim Pisarevsky 4e31015715 Merge pull request #11341 from alalek:v_min_max_sse41 2018-04-19 12:21:50 +00:00
Alexander Alekhin ad2127765f Merge pull request #11309 from K-Shinotsuka:issue41 2018-04-19 10:58:00 +00:00
Tomoaki Teshima 98d9369a38 add new comparison to tolerate with rounding error
* restore resize of carotene
  * clean up the source code
  * remove unused member function (Near)
  * add strict test on the border
2018-04-19 17:31:42 +09:00
Dmitry Kurtaev 3b4a292ca9 Let switch CPU/OpenCL targets for models from Intel's Model Optimizer 2018-04-19 10:23:57 +03:00
Alexander Alekhin fa3cb03f62 core(hal): v_min()/v_max() use SSE4.1 intrinsics 2018-04-18 19:43:20 +03:00
Alexander Alekhin 0477284b0a Merge pull request #11338 from alalek:fix_fp16_with_disabled_optimizations 2018-04-18 13:34:34 +00:00
Vadim Pisarevsky b290bdafb9 Merge pull request #11322 from dkurt:dnn_yolov3 2018-04-18 12:11:13 +00:00
Alexander Alekhin 97882d03cc core: fix FP16 conversion with CV_DISABLE_OPTIMIZATION option
Reproducer:
    cmake -DCPU_BASELINE=AVX2 -DCV_DISABLE_OPTIMIZATION=ON ...
2018-04-18 14:13:03 +03:00
Alexander Alekhin 29dd115e9e Merge pull request #11333 from alalek:cmake_fix_native 2018-04-18 09:09:08 +00:00
Alexander Alekhin 28d4157ea7 Merge pull request #11331 from dkurt:fix_11318 2018-04-17 16:41:29 +00:00
Alexander Alekhin 5b867b6f1f cmake: fix CPU_BASELINE=NATIVE on MSVS 2018-04-17 19:34:35 +03:00
Dmitry Kurtaev 66ce8cd7ea Fix bugs found by valgrind 2018-04-17 17:53:51 +03:00
Vadim Pisarevsky b8b7ca7302 Rewite polar transforms (#11323)
* Rewrite polar transformations

- A new wrapPolar function encapsulate both linear and semi-log remap
- Destination size is a parameter or calculated automatically to keep objects size between remapping
- linearPolar and logPolar has been deprecated

* Fix build warning and error in accuracy test

* Fix function name to warpPolar

* Explicitly specify the mapping mode, so we retain all the parameters as non-optional.

Introduces WarpPolarMode enum to specify the mapping mode in flags

* resolves performance warning on windows build

* removed duplicated logPolar and linearPolar implementations
2018-04-17 15:50:52 +03:00
k-shinotsuka b3755ae670 add universal intrinsics for RGB2HLS_f 2018-04-17 19:37:36 +09:00
Dmitry Kurtaev 97fec07d96 Support YOLOv3 model from Darknet 2018-04-16 18:44:12 +03:00
Alexander Alekhin e0fef2bca1 Merge pull request #11319 from alalek:issue_11293 2018-04-16 15:39:22 +00:00
Alexander Alekhin 16d6502920 Merge pull request #11317 from alalek:issue_11303 2018-04-16 15:38:57 +00:00
Alexander Alekhin ee90a6cbde dnn(test): update error tolerance for RCNN/RFCN tests 2018-04-16 14:24:41 +03:00
Alexander Alekhin 59b413c8a1 imgproc(ipp): disable parallel GaussianBlur 2018-04-16 13:31:52 +03:00
Alexander Alekhin 4b2d1aaeea Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-04-16 12:41:47 +03:00
Alexander Alekhin 225c75e4a1 Merge pull request #11306 from alalek:opencl_trace_messages 2018-04-14 11:36:19 +00:00
Alexander Alekhin 7e5581cd86 Merge pull request #11286 from sturkmen72:update_rectangle 2018-04-13 13:38:50 +00:00
Alexander Alekhin cfaca4327b Merge pull request #11169 from tomoaki0705:universalRemap 2018-04-13 13:24:06 +00:00
Alexander Alekhin a2d6ee2d31 Merge pull request #11305 from tomoaki0705:typoNVIDIA 2018-04-13 12:56:42 +00:00
Tomoaki Teshima a82e70cd40 remove raw SSE2/NEON implementation from imgwarp.cpp
* use universal intrinsic instead of raw intrinsic
  * add 2 channels de-interleave on x86 platform
  * add v_int32x4 version of v_muladd
  * add accumulate version of v_dotprod based on the commit from seiko2plus on bf1852d
  * remove some verify check in performance test
  * avoid the out of boundary access and keep the performance
2018-04-13 21:19:16 +09:00
Alexander Alekhin 670ef403b0 ocl: improve trace messages of OpenCL calls 2018-04-13 14:54:27 +03:00
Alexander Alekhin 46d85fb558 Merge pull request #11302 from dkurt:dnn_inf_engine_extra_layers 2018-04-13 11:49:38 +00:00
Tomoaki Teshima a40354d16f use correct name for NVIDIA
* remove NVidia and Nvidia
  * replace Cuda with CUDA
  * keep the letters for API
2018-04-13 20:33:19 +09:00
Dmitry Kurtaev b92c3182ab Blank and L2-normalization layers from Intel's Inference Engine 2018-04-12 15:21:08 +03:00
Suleyman TURKMEN 8b6a6d4546 Update the function rectangle 2018-04-12 14:55:04 +03:00
Alexander Alekhin 2129db6e91 Merge pull request #11297 from seiko2plus:VSXImprovements_1 2018-04-12 10:57:39 +00:00
Sayed Adel 56ec10bfa2 core:ppc Several improvements on VSX(1)
* remove unnecessary defines from vsx_utils
 * fix v_load_expand, load lower 64bit
 * use vec_ld, vec_st with alignment load/store on all types except 64bit
 * map v_extract to v_rotate_right
 * update license header
 * enable VSX by default on clang since #11167
2018-04-11 19:21:22 +00:00
Vadim Pisarevsky 0b9d075958 Merge pull request #11295 from dkurt:dnn_repeated_conv_params 2018-04-11 15:25:24 +00:00
Vadim Pisarevsky 59221296c0 Merge pull request #10978 from alalek:cv_check_macros 2018-04-11 15:17:27 +00:00
Vadim Pisarevsky 533bb89800 Merge pull request #11236 from dkurt:dnn_fuse_l2_norm 2018-04-11 15:09:55 +00:00
Vitaly Tuzov c80a168d9d Updated warpAffine test to ensure bit-exactness for CV_8U (#10921)
* Updated warpAffine test to ensure bit-exactness for CV_8U

* Updated invertAffineTransform to bit-exact evaluation
2018-04-11 18:08:29 +03:00
Vitaly Tuzov 62cf71002e Bit-exact GaussianBlur performance update (#10898)
* Added custom implementation for NxN bit-exact GaussianBlur

* Reworked fixedpoint interface a bit

* Reworked horizontal line estimation for bit-exact GaussianBlur

* Reworked vertical line estimation for bit-exact GaussianBlur

* Updated range estimation for vectorized part of bit-exact GaussianBlur evaluation
2018-04-11 18:07:48 +03:00
Vadim Pisarevsky 30175594e9 Merge pull request #11062 from dkurt:dnn_inf_engine_cldnn 2018-04-11 15:06:18 +00:00
Alexander Alekhin 7ae83df8aa Merge pull request #11292 from tomoaki0705:fixCUDABuild40 2018-04-11 13:41:25 +00:00
Alexander Alekhin 47134fa1b4 Merge pull request #11294 from dkurt:fix_dldt_multiple_inputs 2018-04-11 12:41:31 +00:00
Dmitry Kurtaev 512632e574 Parse repeated values of ConvolutionParameter 2018-04-11 14:38:05 +03:00
Dmitry Kurtaev 4ef6c91583 Fix multiple inputs for models from Intel's Model Optimizer 2018-04-11 13:28:07 +03:00
Tomoaki Teshima 779a42678d fix CUDA build crash
* add --std=c++11 flag to nvcc definition
  * remove not used abs functions
2018-04-11 17:19:09 +09:00
Alexander Alekhin 10ba6a93a6 Merge pull request #11256 from alalek:prepare_next 2018-04-10 18:46:12 +00:00
Alexander Alekhin c917be2189 next(core): use C++11 classes for cv::Mutex/cv::AutoLock 2018-04-10 18:09:54 +03:00
Alexander Alekhin c6aa97c9aa next(android): java3 -> java4 2018-04-10 18:09:54 +03:00
Alexander Alekhin 250941bd47 next: drop WITH_CSTRIPES 2018-04-10 18:09:54 +03:00
Alexander Alekhin 5b17a60dde next: drop HAVE_TEGRA_OPTIMIZATION/TADP 2018-04-10 18:09:54 +03:00
Alexander Alekhin b07f772f36 android: enable C++11 in test sample 2018-04-10 18:09:54 +03:00
Alexander Alekhin d4688e6474 cmake: require C++11 and CMake 3.5.1+ 2018-04-10 18:09:54 +03:00
Vladislav Sovrasov e7e29cb63c cmake: add compilation test for VTK 2018-04-10 18:09:54 +03:00
Alexander Alekhin ca922443db next(calib3d): eliminate CirclesGridFinderParameters2 2018-04-10 18:09:54 +03:00
Alexander Alekhin 2385a5870e next(ml): eliminate dummy interface class ANN_MLP_ANNEAL 2018-04-10 18:09:54 +03:00
Alexander Alekhin e567135ed3 next: force C++11 features unconditionally: CV_CXX_MOVE_SEMANTICS/CV_CXX_STD_ARRAY 2018-04-10 18:09:54 +03:00
Alexander Alekhin 98c8584b88 next: drop CV_CXX11 conditions
define itself is still here for compatibility
2018-04-10 18:09:54 +03:00
Alexander Alekhin 2b2fa58f97 next: drop DISABLE_OPENCV_24_COMPATIBILITY 2018-04-10 18:09:53 +03:00
Alexander Alekhin 2d54fed3cc next: OPENCV_ABI_COMPATIBILITY
drop change:
    template<typename _Tp2> operator Vec<_Tp2, 3>() const;
because it break builds due ambiguous errors
2018-04-10 18:09:53 +03:00
Alexander Alekhin 964a4d75b4 next: version.hpp 2018-04-10 18:09:53 +03:00
Alexander Alekhin 070ec313f2 Merge pull request #11282 from alalek:fix_msvs_build_issues 2018-04-10 14:36:51 +00:00
Alexander Alekhin 73f4907dc0 Merge pull request #11280 from alalek:fix_cmake_warning_ninja_pylintrc 2018-04-10 14:36:12 +00:00
Alexander Alekhin 333973b846 Merge pull request #11276 from alalek:install_pdb 2018-04-10 14:35:32 +00:00
Alexander Alekhin d2d9fd6945 build: fix MSVS build problems
with 'CL=/permissive-'
2018-04-10 14:50:56 +03:00
Alexander Alekhin fa4b9e80e2 Merge pull request #11275 from alalek:issue_11274 2018-04-10 11:28:21 +00:00
Alexander Alekhin 5e03011496 cmake: fix Ninja generator warning about pylintrc
CMake generated files is a part of target depends list.
Details: `cmake --help-policy CMP0058`
2018-04-10 12:23:10 +03:00
Alexander Alekhin a68ffc81da Merge pull request #11279 from shimat:fix_LSD_test 2018-04-10 08:48:53 +00:00
Dmitry Kurtaev 1ba72ca0d3 Fuse tf.nn.l2_normalize layer 2018-04-10 10:12:44 +03:00
shimat 68db42e9be fix LSD test (wrong detector kind) 2018-04-10 11:38:35 +09:00
Alexander Alekhin 567ae61e78 core: add "check" macros 2018-04-09 21:24:02 +03:00
Alexander Alekhin 86488ac1bc Merge pull request #11130 from allnes:gst_test_pipeline 2018-04-09 18:21:11 +00:00
Alexander Nesterov c0d6f3d23e Added tests for gstreamer pipeline 2018-04-10 02:33:26 +03:00
Alexander Alekhin b76ce0e0a4 Merge pull request #11253 from mshabunin:decrease-tbb-dependency 2018-04-09 16:03:34 +00:00
Alexander Alekhin b82bec88d9 Merge pull request #11271 from alalek:tbb_build_warning 2018-04-09 15:53:26 +00:00
Alexander Alekhin 784c8436fd cmake: update PDB installation 2018-04-09 18:50:58 +03:00
Alexander Alekhin 7dc162cb42 core: fix mm_pause() for non-SSE i386 builds
replaced to safe binary compatible 'rep; nop' asm instruction
2018-04-09 18:37:35 +03:00
Vadim Pisarevsky 474a23bda5 Merge pull request #11170 from alalek:test_fixed_type 2018-04-09 14:53:43 +00:00
tlanclos a2c7afad77 V4L Buffer: Support CV_CAP_PROP_BUFFERSIZE in cap_v4l (#11047) 2018-04-09 17:34:00 +03:00
shimat e172935658 LSD: support vector<Vec4i> lines (#11042)
* add LSD supportsVec4iResult

* LineSegmentDetector.drawSegments: support vector<Vec4i>

* test_lsd.cpp: replace detect()

* test_lsd.cpp: add compareSegments tests

* lsd.cpp: LSD.compareSegments support Vec4i

* test_lsd.cpp: fix trailing whitespace
2018-04-09 17:31:56 +03:00
Dmitry Kurtaev 709cf5d038 OpenCL GPU target for Inference Engine deep learning backend
Enable FP16 GPU target for DL Inference Engine backend.
2018-04-09 17:21:35 +03:00
Vadim Pisarevsky 72cb06abf0 Merge pull request #11231 from saskatchewancatch:tiff-dpi-feature 2018-04-09 13:28:08 +00:00
Vadim Pisarevsky fa5a6bfa02 Merge pull request #11251 from mshabunin:add-runtime-version 2018-04-09 13:24:29 +00:00
Vladislav Sovrasov 0d9c63744e Add CPU default extensions loading in IE dnn backend (#11252)
* Add CPU default extensions loading in IE dnn backend

* Load cpu_extensions for the future Intel's Inference Engine
2018-04-09 16:22:19 +03:00
Vadim Pisarevsky 20334e3f09 Merge pull request #11264 from K-Shinotsuka:issue39 2018-04-09 13:20:48 +00:00
Vadim Pisarevsky 19de675a4e Merge pull request #11270 from alalek:parallel_for_exception_fix_android 2018-04-09 13:18:39 +00:00
Vadim Pisarevsky 8ceb6f2279 Merge pull request #11272 from alalek:gdal_test_exclude_rle8 2018-04-09 13:17:14 +00:00
Alexander Alekhin a22ee76b45 imgcodecs: exclude rle8.bmp from GDAL tests
GDAL message:
- ERROR 1: The BMP file is probably corrupted or too large. Image width = 480
2018-04-09 13:18:33 +03:00
Alexander Alekhin 854ab48de0 tbb: fix build warnings -Wshadow 2018-04-09 12:58:09 +03:00
Alexander Alekhin 8dacbe7584 android: std::exception_ptr is not available on some platforms (even with enabled C++11) 2018-04-09 12:54:57 +03:00
Vadim Pisarevsky 6a15910f0f Merge pull request #11208 from terfendail:seamless_1 2018-04-09 09:52:28 +00:00
Vadim Pisarevsky 29869c5b91 Merge pull request #11243 from alalek:with_cuda_default_off 2018-04-09 09:46:34 +00:00
Vadim Pisarevsky b6d45b9743 Merge pull request #11244 from alalek:cuda_samples_drop_performance 2018-04-09 09:44:29 +00:00
Vadim Pisarevsky 569011a121 Merge pull request #11245 from alalek:cuda_samples_drop_low_level_api 2018-04-09 09:41:47 +00:00
Vadim Pisarevsky 4617758053 Merge pull request #11247 from lopespt:fix_issue_10506 2018-04-09 09:39:17 +00:00
Vadim Pisarevsky f0d22dabea Merge pull request #11254 from terfendail:msmf_sourcereader 2018-04-09 09:34:15 +00:00
Vadim Pisarevsky 26a8ab5719 Merge pull request #11262 from alalek:fix_houghCircles_sync 2018-04-09 09:32:37 +00:00
Maksim Shabunin d2cff38db6 Added interface to check library version during runtime 2018-04-09 12:30:39 +03:00
Alexander Alekhin 3c936ddcf9 Merge pull request #11259 from dkurt:fix_10965 2018-04-09 08:39:41 +00:00
Alexander Alekhin 47e476c9cd Merge pull request #11217 from dan-masek:fix_issue_11206 2018-04-08 15:12:12 +00:00
Alexander Alekhin 814b78dad8 Merge pull request #11230 from tkonolige:master 2018-04-08 15:11:17 +00:00
Alexander Alekhin 02eab9ed72 Merge pull request #11265 from severus-tux:patch-1 2018-04-08 15:08:24 +00:00
Vishwa Prakash H V 6b4fcd5f73 Avoiding Divide By Zero Error
In line 104 `if ( full_neg_lst[i].cols >= box.width && full_neg_lst[i].rows >= box.height )` removed '=' as it causes divide By Zero Error in line 106 and 107 `box.x = rand() % ( full_neg_lst[i].cols - size_x );` when  full_neg_lst[i].cols = size_x or full_neg_lst[i].rows - size_y
2018-04-08 02:57:26 +05:30
k-shinotsuka fbdcc0e8e4 add universal intrinsics for HSV2RGB_f 2018-04-08 01:47:22 +09:00
y0umu ade29fc6c9 Merge pull request #11260 from y0umu:patch-1
Correct a mistake in {js,py}_table_of_contents_histograms.markdown (#11260)

* Update py_table_of_contents_histograms.markdown

"Learn to find and draw Contours" => "Learn the basics of histograms"

* Update js_table_of_contents_histograms.markdown

Corrected a seemlingly wronged line of copy in the python documention js_table_of_contents_histograms.markdown

"Learn to find and draw Contours" => "Learn the basics of histograms"
2018-04-07 19:39:37 +03:00
Alexander Alekhin 15837b43ca imgproc: don't call .unlock() on non-holded mutex in houghCircles() 2018-04-07 13:00:17 +00:00
Dmitry Kurtaev 73ca194313 Fix convertFp16 in JavaScript build 2018-04-07 09:44:43 +03:00
Alexander Alekhin 23d866ad40 Merge pull request #11237 from alalek:cuda_refactor_memorypool 2018-04-06 15:37:37 +00:00
Vitaly Tuzov 24bd44f088 MSMF-based VideoCapture reworked to use SourceReader 2018-04-06 17:39:56 +03:00
Maksim Shabunin b88609a921 Reduced direct TBB dependencies 2018-04-06 14:21:15 +03:00
lopespt c17ce1a0af Solves issue #10506 2018-04-05 20:25:32 -03:00
Alexander Alekhin 875b4e212a Merge pull request #11200 from alalek:android_refactor_sdk_detection 2018-04-05 20:44:59 +00:00
Alexander Alekhin a87a5dfdb3 Merge pull request #11192 from terfendail:setto_fix 2018-04-05 20:25:34 +00:00
Alexander Alekhin e20fb7f429 Merge pull request #11197 from alalek:parallel_propagate_exception 2018-04-05 20:24:22 +00:00
Alexander Alekhin e27ae6483a Merge pull request #11221 from dkurt:dnn_fix_proposal_layer 2018-04-05 20:23:49 +00:00
Alexander Alekhin 5b79e5b130 Merge pull request #11235 from alalek:cuda_fix_build_warnings 2018-04-05 20:12:03 +00:00
Alexander Alekhin 0093eb4768 cuda: drop samples for low-level CUDA API
Also these samples require TBB, so they are not tested during default OpenCV builds
2018-04-05 19:35:46 +00:00
Alexander Alekhin dd243067e5 cuda: drop performance sample
Regular OpenCV perf tests should be used instead
2018-04-05 19:28:17 +00:00
Alexander Alekhin 4990506948 cuda: WITH_CUDA=OFF by default (need to enable it explicitly) 2018-04-05 19:23:58 +00:00
Alexander Alekhin 6abfc6761e android: refactor Android SDK detection
- properly detect Android SDK support of Ant/Gradle projects
- divide processing of And/Gradle based projects
2018-04-05 19:19:31 +00:00
Alexander Alekhin 7818071ba2 cuda: eliminate part of build warnings 2018-04-05 17:53:22 +03:00
Alexander Alekhin 82ba3ac894 cuda: refactor MemoryPool
- make non-copyable (aligns inner mutex semantic to std::mutex)
- getMemoryPool() returns reference instead of pointer (NULL is not expected here)
2018-04-05 16:04:37 +03:00
Alexander Alekhin f93c1b942a Merge pull request #11222 from lopespt:add_binary_search_knearest 2018-04-05 11:00:00 +00:00
Vitaly Tuzov 628f04ae96 Merge pull request #11092 from terfendail:msmf_videocapture
Update for MSMF-based VideoCapture and VideoWriter (#11092)

* MSMF based VideoCapture updated to handle video stream formats different from RGB24

* MSMF based VideoWriter updated to handle video frame top-bottom line ordering regardless of output format

* Fixed race condition in MSMF based VideoCapture

* Refactored MSMF based VideoCapture and VideoWriter

* Disabled frame rate estimation for MP43

* Removed test for unsupported avi container from MSMF VideoWriter tests

* Enabled MSMF-based VideoIO by default
2018-04-05 13:55:42 +03:00
Alexander Alekhin c2fb4debc5 Merge pull request #11224 from alalek:fix_core_min_avx2 2018-04-05 10:37:31 +00:00
Alexander Alekhin 9ca3dec127 Merge pull request #11228 from alalek:gitignore_dnn_models 2018-04-05 13:17:09 +03:00
Alexander Alekhin 8f7e7cd343 Merge pull request #11071 from alalek:issue_11061_fix_error_message 2018-04-05 10:15:04 +00:00
Rajkiran Natarajan 4668836071 Support for setting TIFF DPI info in imwrite 2018-04-04 21:20:16 -07:00
Tristan Konolige 9d589379ec don't reset camera in setViewerPose 2018-04-04 13:00:50 -06:00
Alexander Alekhin 3870891d2d update samples/dnn/face_detector/.gitignore 2018-04-04 19:12:50 +03:00
Alexander Alekhin d294e9d62a Merge pull request #11216 from dan-masek:fix_issue_11205 2018-04-04 15:37:57 +00:00
yuki takehara d57e5c31c0 Merge pull request #11214 from take1014:core_9720
* fix #9720

* Add regression test

* Fix calculation method for scale
2018-04-04 18:36:02 +03:00
Alexander Alekhin 45a69ebec8 core: fix AVX2 min implementation 2018-04-04 17:38:58 +03:00
Vitaly Tuzov eb2c9f1519 Fixed mask reduction in seamless_clone 2018-04-04 16:33:28 +03:00
Vitaly Tuzov ccd16f107d Fixed IPP based implementation of setTo() for infinity value 2018-04-04 16:05:22 +03:00
lopespt 65d816c3b5 Adds efficient sort algorithm to KNearest 2018-04-04 09:35:58 -03:00
Dmitry Kurtaev ef1aaf12c9 Fix Proposal deep learning layer 2018-04-04 14:48:29 +03:00
Alexander Alekhin 7bc980edaf Merge pull request #10983 from dkurt:dnn_face_detection_uint8 2018-04-03 18:19:43 +00:00
Dan Mašek 8c1d8eccdd Merge pull request #11207 from dan-masek:add_redirect_error
* Add Python support for error message handlers.

* Move the static variable to the only function that uses it.

* Remove the optional param (user data), since this can already be handled by closures.

* Correct the help string.

* python: added redirectError test
2018-04-03 21:16:34 +03:00
Alexander Alekhin f95e91e2bc Merge pull request #11199 from dkurt:update_torch_testdata 2018-04-03 18:02:58 +00:00
Alexander Alekhin 3c4f1b0a8f Merge pull request #11211 from alalek:build_sample_viz 2018-04-03 17:53:15 +00:00
Alexander Alekhin 4cd21a26f6 Merge pull request #11212 from alalek:cleanup_biicode 2018-04-03 17:52:10 +00:00
Alexander Alekhin 82d2a0873d cleanup: biicode
project is not active anymore
2018-04-03 16:44:15 +03:00
Alexander Alekhin 53944cbebb samples: avoid using of legacy code constructions in viz sample 2018-04-03 16:05:43 +03:00
Maksim Shabunin 9558a35cde Merge pull request #11055 from allnes:gst_streamer 2018-04-03 11:04:22 +00:00
Dan Mašek f6e299b58b Fix #11206 2018-04-03 03:24:49 +02:00
Dan Mašek eae3ed0c08 Fix a leak described in issue #11205 2018-04-03 03:02:21 +02:00
Dmitry Kurtaev 8d8f3bca6f Update links to OpenCV's face detection network 2018-04-02 13:02:56 +03:00
Alexander Alekhin d5afa8943b Merge pull request #11202 from ArkadiuszRaj:Aravis-patch-1 2018-04-01 17:21:21 +00:00
Arkadiusz Raj 619e4c94d5 Protection to not run Eth config when USB camera is connected 2018-04-01 15:37:10 +02:00
Alexander Alekhin 099a16bd86 Merge pull request #11198 from dkurt:torch_embedded_residuals 2018-04-01 08:27:18 +00:00
Dmitry Kurtaev 818a91f4f7 Update Torch testdata 2018-03-31 12:04:44 +03:00
Dmitry Kurtaev 598039c0ed Fix embedded Torch's nn.ConcatTable 2018-03-31 11:11:10 +03:00
Alexander Alekhin dbcb454917 Merge pull request #11195 from alalek:fix_qt_build 2018-03-30 14:52:11 +00:00
Alexander Alekhin 6f69800d0c core: propagate parallel_for() exceptions 2018-03-30 16:24:31 +03:00
Alexander Alekhin e8a67de0d2 Merge pull request #11182 from dkurt:fix_11102_part_2 2018-03-30 13:11:01 +00:00
Alexander Alekhin 82fd00af99 fix build issues with QT/OpenGL 2018-03-30 12:49:09 +03:00
Vadim Pisarevsky 8fce25d788 Merge pull request #11187 from alalek:respect_threading_settings 2018-03-30 09:39:04 +00:00
Alexander Alekhin 2fb4812f6d Merge pull request #11194 from ltqusst:fix_10557 2018-03-30 09:30:43 +00:00
ltqusst 0d646490f5 Fix #10557
Fix overflow bugs in conversion from NV12 VA-surface/D3D11texture2D to OpenCL UMat
2018-03-30 16:32:15 +08:00
Alexander Nesterov 7252319966 Added gstreamer pipeline sample 2018-03-29 23:44:42 +03:00
Alexander Alekhin 5195a738ac Merge pull request #11191 from catree:remove_temp_file_test_read_write.cpp 2018-03-29 20:11:46 +00:00
catree a885480c9e Remove temporary file used for test. 2018-03-29 18:34:30 +02:00
Alexander Alekhin d3aeb45400 Merge pull request #11189 from alalek:samples_avoid_legacy_api_2 2018-03-29 16:30:36 +00:00
Alexander Alekhin 1b7aa92eb6 Merge pull request #11188 from mshabunin:fix-clang-warnings 2018-03-29 14:34:30 +00:00
Alexander Alekhin 8c4b5b6a70 core(test): parallel_for test with exception 2018-03-29 16:59:51 +03:00
Alexander Alekhin 177be2adda Merge pull request #11174 from corleypc:master 2018-03-29 13:50:44 +00:00
RAJKIRAN NATARAJAN 6d83a80385 Merge pull request #11176 from saskatchewancatch:issue-11165
* fix cv::imwrite to allow cv::UMat and vectors of it to be written

* cv::imwrite failure handling improvements

* Unit test for regression testing imwrite support for and fix whitespace
2018-03-29 16:47:31 +03:00
Alexander Alekhin e28cc973bf samples: avoid using of legacy C-like API (part 2) 2018-03-29 14:17:23 +03:00
Alexander Alekhin 3b15f3e3b9 avoid calling of setNumThreads() to respect user settings 2018-03-29 13:48:37 +03:00
Maksim Shabunin 439072a2a6 Fixed two warnings produced by clang 2018-03-29 13:24:04 +03:00
Alexander Alekhin 7f63b31ca8 avoid calling of setNumThreads() to respect user settings 2018-03-29 13:04:26 +03:00
Alexander Alekhin 7dc88f26f2 Merge pull request #11093 from alalek:cv_override_final 2018-03-28 20:09:51 +00:00
Alexander Alekhin 87498bc6d4 cmake: workaround CPATH ipp_iw issue
CPATH entries are processed before any -isystem:
https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
2018-03-28 18:43:28 +03:00
Alexander Alekhin 8a0cc5009e build: eliminate MSVC warning 2018-03-28 18:43:28 +03:00
Alexander Alekhin 0ede1b5b22 cmake: enable override warnings (requires C++11 compilation mode) 2018-03-28 18:43:28 +03:00
Alexander Alekhin d800a0bd32 samples: suppress vtk warnings 2018-03-28 18:43:28 +03:00
Alexander Alekhin cfdffdd519 samples: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:28 +03:00
Alexander Alekhin 25be4186bc python: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:28 +03:00
Alexander Alekhin 39f15be59e apps: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:28 +03:00
Alexander Alekhin 6c8014e7d1 cmake: disable checks for protobuf generated files 2018-03-28 18:43:28 +03:00
Alexander Alekhin d7e9201434 misc: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:28 +03:00
Alexander Alekhin 2bd4f2c3a6 videostab: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:28 +03:00
Alexander Alekhin a8eb3e1b29 superres: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 4a0fa57614 shape: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 4df4a37b11 flann: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 1ca7ae9630 video: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin e741b71dac photo: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 225bae1387 stitching: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 4d0dd3e509 ml: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 3314966acb objdetect: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin 1060c0f439 dnn: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Alexander Alekhin bdbd0129af calib3d: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin 0854dc3320 features2d: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin 8f0669c300 videoio: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin a91953b15c imgcodecs: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin 5d36ee2fe7 imgproc: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin 9111538bfb core: apply CV_OVERRIDE/CV_FINAL 2018-03-28 17:57:59 +03:00
Alexander Alekhin 0587f92d96 cmake: disable override warnings in 3rdparty code and viz 2018-03-28 17:57:59 +03:00
Alexander Alekhin 773877cd12 ts: apply CV_OVERRIDE/CV_FINAL
- disable "-Wsuggest-override" in tests
2018-03-28 17:57:59 +03:00
Alexander Alekhin 6bd80ba71b cmake: use SYSTEM include directories 2018-03-28 17:57:58 +03:00
Alexander Alekhin 84980741a8 core: add CV_OVERRIDE/CV_FINAL macros 2018-03-28 17:57:58 +03:00
Alexander Alekhin 167034fb04 Merge pull request #11098 from dkurt:dnn_native_inf_engine 2018-03-28 14:52:08 +00:00
Dmitry Kurtaev e039fc3a63 Replace protobuf's ReleaseLast to RemoveLast to deallocate memory.
Change an order of PriorBox layer operations.
2018-03-28 17:27:36 +03:00
Dmitry Kurtaev 2f3a9ba1d4 Update OpenCVDetectInferenceEngine.cmake 2018-03-28 16:34:37 +03:00
Vadim Pisarevsky 1097d0e810 Merge pull request #11072 from alalek:explicit_autobuffer 2018-03-28 12:57:25 +00:00
Vadim Pisarevsky 284e5231c5 Merge pull request #11171 from codingforfun:fix_11143 2018-03-28 12:47:37 +00:00
Vadim Pisarevsky 6b041c8aeb Merge pull request #11137 from alalek:core_fix_mat_ctor 2018-03-28 12:39:49 +00:00
Alexander Alekhin 8388b630ac Merge pull request #11167 from alalek:cmake_compiler_vars 2018-03-28 12:38:31 +00:00
LaurentBerger 03eb463f1c Solves #11156 (#11160)
* Solves #11156

* Check file size for all file format. Disable APPEND if file is empty

* Add test for APPEND mode
2018-03-28 15:35:38 +03:00
Alexander Alekhin 75b5e3fa64 Merge pull request #11175 from collenjones:hotfix/coreLinkFix 2018-03-28 12:21:11 +00:00
Alexander Alekhin c37d9573fc Merge pull request #11180 from dkurt:fix_dnn_tf_ssd 2018-03-28 11:45:52 +00:00
Alexander Alekhin 3a5f431236 Merge pull request #11179 from tomoaki0705:fixBuildCudaStereo 2018-03-28 10:23:21 +00:00
Dmitry Kurtaev f87a0dd6a7 Fix minimal aspect ratio scale for SSDs from TensorFlow 2018-03-28 12:57:06 +03:00
Tomoaki Teshima c14578649d fix build error on Jetson 2018-03-28 18:21:53 +09:00
Collen Jones 687ccdf8db Fix link to Hershey fonts 2018-03-27 20:11:48 -07:00
corley a4b9ce764c Fixed silent failures in getting and setting properties 2018-03-28 00:05:54 +03:00
Alexander Alekhin e9b033ef3a Merge pull request #11173 from alalek:issue_11172 2018-03-27 18:01:25 +03:00
Alexander Alekhin 5da7805623 cmake: add module/src include dir in case of enabled precompiled headers 2018-03-27 17:38:54 +03:00
Alexander Alekhin 7d8f1dde26 core(persistence): disable checks for base64 streams 2018-03-27 17:02:04 +03:00
codingforfun 24e2e0d3f9 #11143 [FIX] Normalize node risk with sample weight sum
In case of regression trees, node risk is computed as sum of squared
error. To get a meaningfull value to compare with it needs to be
normalized to the number of samples in the node (or more generally to
the sum of sample weights in this node). Otherwise the sum of squared
error is highly dependend on the number of samples in the node and
comparision with `regressionAccuracy` parameter is not very meaningful.

After normalization `node_risk` means in fact sample variance for all
samples in the node, which makes much more sence and seams to be what
was originaly intended by the code given that node risk is later used as
a split termination criteria by
```
sqrt(node.node_risk) < params.getRegressionAccuracy()
```
2018-03-27 15:39:36 +02:00
Alexander Alekhin 017c217bb0 Merge pull request #11162 from kinchungwong:master 2018-03-27 13:27:43 +00:00
Alexander Alekhin f4c4b01455 core: added checks and "fixit" items for persistence parsers
To raise errors with proper messages of the problems.
2018-03-27 16:19:43 +03:00
Alexander Alekhin 08941b7890 cmake: avoid amending of CMAKE_COMPILER_IS_[GNUCXX|CLANGCXX|CCACHE] vars
- Recommended compiler checks:
  - GCC: CV_GCC
  - Clang: CV_CLANG
- fixed problem with CMAKE_CXX_COMPILER_ID=Clang/AppleClang mess on MacOSX
  Details: cmake --help-policy CMP0025
- do not declare Clang as GCC compiler
2018-03-27 16:16:59 +03:00
Alexander Alekhin 7ee217285b Merge pull request #11089 from terfendail:stereocalibrate_f32 2018-03-27 13:08:06 +00:00
Alexander Alekhin 9e0dee1259 Merge pull request #11112 from alalek:cmake_src_include_fix 2018-03-27 13:06:48 +00:00
Alexander Alekhin d1311518a3 core: test-sample for FIXED_TYPE demonstration
with implementation of functions with multiple output formats
2018-03-27 15:41:41 +03:00
Vadim Pisarevsky 6e13ffe162 Merge pull request #11159 from alalek:samples_avoid_legacy_api 2018-03-27 10:05:35 +00:00
Vadim Pisarevsky 00fff3a85d Merge pull request #11164 from corleypc:master 2018-03-27 10:04:20 +00:00
corley f441515357 Fixed a couple of memory leaks in videoInput::getDevice() when multiple devices are present in the system 2018-03-27 00:54:48 +03:00
kinchungwong 333e53eee8 Minor improvement to SSE code in HOGDescriptor::computeGradient, replace emulation of _mm_mullo_epi32 with constant multiplicand 3 with two _mm_add_epi32. OpenCV issue #11161 2018-03-26 09:24:03 -07:00
Alexander Alekhin 7f9253ea0a samples: avoid using of legacy C-like API
- CV_RGB() macro is moved into opencv2/imgproc.hpp from imgproc_c.h
- samples/cpp/filestorage_base64.cpp is dropped
2018-03-26 13:42:35 +03:00
Alexander Alekhin 24acbecd33 Merge pull request #11151 from AndreiCostinescu:patch-1 2018-03-26 10:22:38 +00:00
Alexander Alekhin 70607ce311 Merge pull request #11155 from nglee:dev_docGpuMatDownloadUpload 2018-03-26 10:21:05 +00:00
Dmitry Kurtaev 7972f47ed4 Load networks from intermediate representation of Intel's Deep learning deployment toolkit. 2018-03-26 07:24:21 +03:00
Namgoo Lee a8f86af633 Update GpuMat, GpuMat::download, GpuMat::upload documentation 2018-03-26 10:59:05 +09:00
Andrei Costinescu 38d73123c1 #include <math.h> in cv2.cpp
My build fails with the error:
"C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/cmath:1136:11: error: '::hypot' has not been declared".
I have tried to fix it by adding "#include <cmath>" before the line "#include <Python.h>" but then the build has failed with the error:
"C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0/include/c++/math.h:91:12:: error: 'std::_hypot' has not been declared".
Adding "#include <math.h>" allowed me to build opencv.
2018-03-25 20:39:29 +02:00
Alexander Alekhin e06d1e8083 Merge pull request #11141 from dkurt:dnn_no_aspect_ratios 2018-03-24 20:38:55 +00:00
Alexander Alekhin 300797d4a3 Merge pull request #11146 from anthonytw:master 2018-03-24 06:35:21 +00:00
Anthony Wertz c6cf7f8080 Sets a higher limit on videoio's AVI container's maximum chunk size, and adds an explanation of the assertion. Closes #11126 2018-03-23 12:03:46 -04:00
Alexander Alekhin cd4b748b44 Merge pull request #11064 from tomoaki0705:fixCudaStreamAsync 2018-03-23 13:04:18 +00:00
Alexander Alekhin fdd83e5027 Merge pull request #11113 from tomoaki0705:fixTinkerBoardOpenCL 2018-03-23 10:57:59 +00:00
Alexander Alekhin d9f720a679 Merge pull request #11134 from not522:fix-rotation-center 2018-03-23 09:37:45 +00:00
Dmitry Kurtaev e8fe6ee4e3 Fix prior box generation in case of squared proposals.
Fix batch norm in training phase.
2018-03-23 09:44:59 +03:00
Naoto Mizuno ddf6bc86a7 Update rotated image 2018-03-22 22:09:19 +09:00
Alexander Alekhin 4378e8fcc0 core: fix cv::Mat constructor 2018-03-22 15:35:54 +03:00
Tomoaki Teshima 06babf90a5 let the test OCL_ImgprocWarp/Resize.Mat pass on ARM/Aarch64
* disable carotenete when calling resize on ARM/Aarch64
  * loosen eps on Aarch64
2018-03-22 21:35:34 +09:00
Tomoaki Teshima f4e5d777e8 follow histogram 2018-03-22 21:33:51 +09:00
Tomoaki Teshima 6c25351049 make the asynchronous call to NPP safe
* Stop calling nppSetStream
2018-03-22 21:33:51 +09:00
Naoto Mizuno e1b66ffd01 Fix center of rotation 2018-03-22 19:38:39 +09:00
Alexander Alekhin 2dff9f4c6d Merge pull request #11136 from tomoaki0705:fixCalib3dClang 2018-03-22 10:24:36 +00:00
Alexander Alekhin b390e86b12 Merge pull request #11124 from terfendail:minenctriangle_fix 2018-03-22 10:23:10 +00:00
Tomoaki Teshima 08e0c69dbf apply the workaround to correct range 2018-03-22 18:28:47 +09:00
Vitaly Tuzov 91c35a7d01 Updated handling of collinear edges while searching for intersection. 2018-03-21 19:15:34 +03:00
Alexander Alekhin 0366c1b093 Merge pull request #11105 from dkurt:issue_11102 2018-03-21 09:18:14 +00:00
Alexander Alekhin fed22f2f5c Merge pull request #11074 from alalek:android_log_messages 2018-03-20 20:40:54 +00:00
Alexander Alekhin 9fd32ca5ac Merge pull request #11110 from nglee:dev_addSyncAfterAsyncCopyTestBufferPool 2018-03-19 19:51:37 +00:00
Alexander Alekhin 176fe6e50e Merge pull request #11095 from jmartens:patch-2 2018-03-19 14:33:34 +00:00
Alexander Alekhin 6c051a55e5 cmake: don't add include <module>/src directory to avoid conflicts
during opencv_world builds
2018-03-19 11:14:15 +03:00
Namgoo Lee 90e1e41f5a test_buffer_pool: synchronize after async copy 2018-03-19 09:30:06 +09:00
Aleksandr Tischenko 22ecdd16ef Merge pull request #11101 from lamantine:fix_11100
* fixed bug #11100 Integer overflow in kmeans

* fixed integer overflow in other divUp-s in kmeans code
fixed warning about size_t to double conversion
2018-03-18 15:11:42 +03:00
Alexander Alekhin 2dac35a97d Merge pull request #11091 from berak:openpose_sample 2018-03-18 09:18:40 +00:00
Dmitry Kurtaev 069f9add80 Fix an issue https://github.com/opencv/opencv/issues/11102 2018-03-18 10:49:12 +03:00
Alexander Alekhin 74c2f8cecf Merge pull request #11046 from catree:update_calibration_images 2018-03-16 19:33:48 +00:00
Alexander Alekhin 70b6c1f29e Merge pull request #11069 from berak:fix_samples_beta 2018-03-16 19:30:20 +00:00
Alexander Alekhin b6d3657f82 Merge pull request #11078 from atinfinity:pullreq/180315-fixed-openpose-sample 2018-03-16 19:29:57 +00:00
Jonathan Martens 1949412979 Update URL to Timing and Profiling in IPython
Apparently the blog has been updated and the URL has changed, it is still there though.
2018-03-16 19:37:08 +01:00
berak 4f597f6c06 dnn: add an openpose.cpp sample 2018-03-16 19:36:45 +01:00
Alexander Alekhin 47dea29e4e Merge pull request #11081 from alalek:cmake_fix_android_examples_dependencies 2018-03-16 16:32:49 +00:00
yuki takehara 41f8e788b2 Merge pull request #11083 from take1014:lsd_#9363
* Fix #9363

* Renamed the structure and added a new function to the LineSegmentDetectorImpl class as a static member

* Added a new function to the LineSegmentDetectorImpl class as a static member
2018-03-16 19:31:55 +03:00
Vitaly Tuzov 7afaaef0eb Allow CV_32FC3 objPoints in cv::fisheye::stereoCalibrate 2018-03-16 13:05:40 +03:00
Alexander Alekhin dd259503c1 Merge pull request #11073 from geordi:qt-window-pixel-values 2018-03-15 14:35:29 +00:00
catree 5a79b90ade Update chessboard pattern image to remove squares overlap. Update also asymmetric pattern image. 2018-03-15 13:22:56 +01:00
berak 182b52d23d fix some samples colliding with std::beta
also add comments explaining the change
2018-03-15 12:40:49 +01:00
Alexander Alekhin 85db11b70d Merge pull request #11080 from sonnyky:fix/cmake-for-openni 2018-03-15 11:18:31 +00:00
Alexander Alekhin 1e808a495d cmake: fix android examples dependencies
add_dependencies(${target}) doesn't control regeneration of .apk file,
because "${target}" is dummy target.
2018-03-15 14:17:02 +03:00
Rostislav Vasilikhin 64916d3d83 Merge pull request #10869 from savuor:color_cpp_split
color.cpp split (#10869)

* initial split is done

* files renamed (these names are excluded during compilation)

* IPP code moved to corresponding files

* splineBuild, splineInterpolate -> color_lab.cpp

* Lab, Luv: little refactored

* it compiles (didn't check work); Lab OCL code moved to color_lab.cpp

* cvtcolor.cl: Lab/Luv part moved to color_lab.cl

* cvtcolor.cl: color_rgb.cl extracted

* cvtcolor.cl: color_yuv.cl separated

* cvtcolor.cl: color_hsv.cl extracted

* cvtcolor.cl: extracted to color_lab.cl and color_rgb.cl

* helper functions moved to hpp file

* Lab, Luv: moved to color_lab.cpp

* CPU XYZ: to color_lab.cpp

* OCL XYZ: to color_lab.cpp

* warning fixed

* CvtHelper added

* CPU YUV: to color_yuv.cpp, helpers to color.hpp

* CPU HLS/HSV: to color_hsv.cpp

* CPU BGR2BGR: to color_rgb.cpp

* CPU RGB: to color_rgb.cpp

* extra arg removed

* CPU YUV: to color_yuv.cpp

* color code decoded

* OclHelper added, some funcs rewritten

* color_lab.cpp: refactored to use OclHelper

* OCL RGB: to color_rgb.cpp

* OCL HLS/HSV: to color_hsv.cpp

* OCL YUV: to color_yuv.cpp

* OCL YUV planes: to color_yuv.cpp

* OCL: color code reduced

* licence to demosaicing.cpp

* IPP func tables to color_rgb.cpp

* code cleanup

* HAVE_OPENCL ifdefs added

* helpers made more common

* fixed two plane YUV with separate mats

* fixed warning in gcc7.2.0

* precomp header fixed

* color space classification functions fixed

* helpers fixed

* rename: isSRGB -> is_sRGB
2018-03-15 14:10:40 +03:00
Alexander Alekhin c727e8a4d0 Merge pull request #11075 from iluxave:master 2018-03-15 09:58:04 +00:00
Sonny Kurniawan c11eaeec49 Help Cmake find OpenNI2 include path
When compiling with OpenNI2 flag active, CMake will not be able to find OpenNI.h due to the environment path not set in OpenCVFindOpenNI2.cmake. This PR rectifies this issue.
2018-03-15 18:39:07 +09:00
atinfinity 8a8523d4f3 fixed samples/dnn/openpose.py 2018-03-15 05:17:57 +09:00
Ilya A. Volynets-Evenbakh 9749afb116 Fix crash on exit in opencv_annotation
destroyWindow was called twice during completion of the
annotation procedure, resulting in a crash, and failure to write
an output file
2018-03-14 09:40:45 -07:00
Alexander Alekhin d68466bb6a Merge pull request #10940 from dkurt:dnn_tf_graph_optim 2018-03-14 14:36:25 +00:00
Alexander Alekhin ab110c0ad1 Merge pull request #10979 from dkurt:unite_dnn_samples 2018-03-14 14:33:49 +00:00
Alexander Alekhin 8781ee971c core: write log messages via __android_log_print (logcat) too 2018-03-14 17:24:29 +03:00
Alexander Alekhin cc06935a10 Merge pull request #11065 from vasiliev-vb:BUGFIX_KAZE_orientation 2018-03-14 14:15:47 +00:00
miqlas f3a9f13cb4 Merge pull request #10984 from extrowerk:advanced_haiku_patches
* Haiku supporting patches

* Revert uneeded changes

* Whitespace cleanup
2018-03-14 17:09:10 +03:00
Jan Gaura eb3969e244 Better text contrast of pixel brightness values in Qt window
This offsets text brightness of pixel brightness values
by offsetting it by 127 to the curent pixel value.
The text is now readable even if pixels are black.
2018-03-14 13:27:11 +01:00
Alexander Alekhin ee1ac1140d core: use explicit for cv::AutoBuffer
To avoid compilation of this code:
- buf = 0;

This code can be received after refactoring of 1D cv::Mat to cv::AutoBuffer.
- "cv_mat = 0" calls setTo().
- cv::AutoBuffer calls "allocate(0)" - this is wrong.
2018-03-14 14:17:52 +03:00
vasiliev-vb 94c8e59bbe Fixed bug in KAZE features orientation.
Bug was added in f6ceeaa commit, different angle computation functions have different parameter order.
2018-03-13 15:09:36 +00:00
Alexander Alekhin 7e9578789b Merge pull request #11057 from tomoaki0705:fixClangComplexCalib3d 2018-03-13 13:43:21 +00:00
Ben John 2f0060e399 Merge pull request #10923 from Preventis:patch-ios
Fixed dynamic build script for iOS (#10923)

* Readded UIDeviceFamily (was removed in beec247)

* Added correct bitcode flag to python build script for iOS

* Missed the bitcodedisabled check

* Corrected the syntax in my proposed changes
2018-03-13 16:09:26 +03:00
Tomoaki Teshima 7fd53f6ca2 avoid clang weird behavior in calib3d
* add ifdef to apply on specific situation
2018-03-13 21:51:20 +09:00
Dmitry Kurtaev 538fd42363 Add test for Scalar arguments at CommandLineParser 2018-03-13 11:01:07 +03:00
yuki takehara 0792ef8789 Merge pull request #11049 from take1014:#10948
* Fix #10948

* Add test code

* Fixed build error

* Add value zero

* eigen: test cleanup
2018-03-12 21:49:10 +03:00
shimat 5bf7f09ac1 Merge pull request #11035 from shimat:refactoring_decolor
Refactor decolor (#11035)

* decolor: modernize deprecated headers (math.h -> cmath)

* refactor contrast_preserve.cpp

* refactor contrast_preserve.hpp (add static/const)

* refactor contrast_preserve.hpp (join assignment and declaration)

* refactor contrast_preserve.hpp (format)

* refactor test_decolor.cpp (indent)

* refactor contrast_preserve.hpp (const)

* contrast_preserve.hpp : optimize by minMaxLoc

* fix trailing-whitespace

* fix warning C4267 on VC++ x64
(conversion from 'size_t' to 'int', possible loss of data)

* use cvRound instead of round_num

* decrease indentation of test_decolor.cpp

* remove pow() to optimize

* remove redundant Mat initialization
2018-03-12 17:22:06 +03:00
Alexander Alekhin 2244f1722c Merge pull request #11052 from adamrankin:patch-1 2018-03-12 14:06:35 +00:00
Dmitry Kurtaev ab20d2a3fc Update assertions in batch norm layer 2018-03-12 10:53:06 +03:00
Dmitry Kurtaev 69a8f110b6 Fuse subgraphs from Keras 2018-03-12 10:53:06 +03:00
Dmitry Kurtaev 9457bf10ab Fuse batch normalization and flatten TensorFlow subgraphs in runtime 2018-03-12 10:51:35 +03:00
Adam Rankin d810c73396 Update precomp.hpp
Enabling build of visualization module when using VTK 9 (current HEAD of d5bbb9e99bbc6d11d2196c48bfd8f33508554551)
2018-03-11 22:28:18 -04:00
Alexander Alekhin 5b868ccd82 Merge pull request #10992 from dkurt:dnn_opencl_tests 2018-03-09 10:06:40 +00:00
Alexander Alekhin 687394fa07 Merge pull request #11030 from jchazalon:patch-1 2018-03-08 17:54:14 +00:00
Alexander Alekhin 5b6ee79cd6 Merge pull request #11033 from adamrankin:patch-1 2018-03-08 17:49:10 +00:00
Alexander Alekhin 8bb787cdf8 Merge pull request #11027 from tomoaki0705:fixImgprocPerfFailureVS2013 2018-03-08 14:28:14 +00:00
Dmitry Kurtaev 130546e1d9 Semantic segmentation sample. 2018-03-08 11:02:26 +03:00
Adam Rankin f8061ba3c8 Enabling build of stitching when CUDA is available
Without proposed change, module throws build error regarding missing `opencv2/cudaimgproc.hpp`
2018-03-07 20:07:48 -05:00
jchazalon bf5f7380cf Update OpenCVDownload.cmake to fix log crash
This suppresses the interpretation of string literals by switching the ocv_download_log from a macro to a function.
This avoid crashes when the string to log contains escape characters.

More details about the problem this PR fixes are available at: https://github.com/opencv/opencv_contrib/issues/1131
2018-03-07 15:35:37 +01:00
Dmitry Kurtaev 0f01b40dd5 Reset OpenCL kernels if batch size changes 2018-03-07 17:06:59 +03:00
Alexander Alekhin 8edc2e5aaf Merge pull request #10928 from Mehanik:fix_timeout 2018-03-07 12:34:09 +00:00
shimat 21d9c47bd0 Optimize decolor in photo (#10997)
* optimized cv::decolor by removing vector.push_back

* restored CV_INSTRUMENT_REGION() and original indent

* fix build warnings in contrast_preserve.hpp

* undo refactoring contrast_preserve.cpp/hpp
2018-03-07 14:20:45 +03:00
Eugene Mikhantiev c790299906 Fix return code in case of timeout 2018-03-07 17:26:34 +07:00
Alexander Alekhin 514f4193db Merge pull request #10959 from alalek:cmake_ocl4dnn 2018-03-07 10:26:14 +00:00
Dmitry Kurtaev 0a61ebdd66 Replace DNNTarget and DNNBackend in tests 2018-03-07 12:59:38 +03:00
Tomoaki Teshima 640d77be25 let the performance tests of WarpPerspective pass
* avoid misuse of vzeroupper on Visual Studio 2013 Update 5
  * add ifdef to avoid unattended optimization
2018-03-07 18:55:27 +09:00
Maksim Shabunin 49dd0305f2 Merge pull request #10946 from mshabunin:add-license-install 2018-03-07 07:15:50 +00:00
Alexander Alekhin 1393fd9e8e Merge pull request #10989 from tomoaki0705:fixOldGstreamerTest 2018-03-06 16:26:08 +00:00
Alexander Alekhin 3202062e77 Merge pull request #11005 from tomoaki0705:fixOclTestFailureVS2012 2018-03-06 15:49:08 +00:00
Maksim Shabunin 265f335dae Add install component for 3rdparty libraries licenses 2018-03-06 16:55:08 +03:00
Maksim Shabunin e283a75a19 Minor refactoring in several C++ samples:
- bgfg_segm
- peopledetect
- opencv_version
- dnn/colorization
- tapi/opencl_custom_kernel
- tapi/dense_optical_flow (renamed tvl1_optical_flow)
2018-03-06 16:51:03 +03:00
Maksim Shabunin 7bbe002a2f Add install component for 3rdparty libraries licenses 2018-03-06 16:32:30 +03:00
Maksim Shabunin 09f0ecdf7a Merge pull request #10999 from mshabunin:do-more-samples 2018-03-06 13:31:34 +00:00
Maksim Shabunin 1ae02c0cc4 Minor refactoring in several C++ samples:
- bgfg_segm
- peopledetect
- opencv_version
- dnn/colorization
- tapi/opencl_custom_kernel
- tapi/dense_optical_flow (renamed tvl1_optical_flow)
2018-03-06 14:23:20 +03:00
Tomoaki Teshima 9079d9ce17 let the test OCL_Filter/Bilateral pass
* avoid aggressive optimization on Visual Studio 2012 Update 5
  * add code branch to avoid unattended optimization (keep the old code)
2018-03-06 19:48:04 +09:00
native-api dc1d9ae973 Include error code description into the message (#10982) 2018-03-06 09:58:19 +03:00
Namgoo Lee c219f97f48 SSE2 : use _mm_cvtpd_epi32 when converting from CV_64F to CV_32S (#10987)
* SSE2 : use _mm_cvtpd_epi32 when converting from CV_64F to CV_32S

* No need to define a new universal intrinsic
2018-03-06 09:50:53 +03:00
Dmitry Kurtaev e1c3237532 Parametric OpenCL deep learning tests 2018-03-05 20:53:18 +03:00
Alexander Alekhin ee180d5b41 Merge pull request #10980 from sturkmen72:update_doc 2018-03-05 15:41:05 +00:00
Tomoaki Teshima a9f3a7de39 add workaround of old gstreamer 2018-03-05 19:27:49 +09:00
Suleyman TURKMEN 5e1a656bbb Update core.hpp 2018-03-04 23:02:47 +03:00
Dmitry Kurtaev f2440ceae6 Update tutorials. A new cv::dnn::readNet function 2018-03-04 20:30:22 +03:00
Dmitry Kurtaev 8e4fe30db6 Unite deep learning image classification samples 2018-03-03 16:43:21 +03:00
Dmitry Kurtaev e8d94ea87c Unite deep learning object detection samples 2018-03-03 14:47:13 +03:00
cDc 667f5b655a Merge pull request #10933 from cdcseacave:clean_npr
* clean npr functions of useless initializations (speed-up)

* photo: remove unnecessary code
2018-03-02 14:42:28 +03:00
Alexander Alekhin 0d2cee45e8 Merge pull request #10971 from alalek:ocl_error_code_string 2018-03-02 11:41:01 +00:00
Alexander Alekhin d1cecb0f0f Merge pull request #10968 from sergiomb2:master 2018-03-02 11:39:54 +00:00
Alexander Alekhin f2ec7eeb37 Merge pull request #10966 from alalek:verbose_features2d_test 2018-03-02 11:39:14 +00:00
Alexander Alekhin e869bb6b05 Merge pull request #10964 from alalek:fix_10956 2018-03-02 11:38:52 +00:00
Alexander Alekhin fe97dc67dc Merge pull request #10962 from alalek:dnn_precomp_hpp 2018-03-02 11:38:16 +00:00
Alexander Alekhin 560ca8c5aa Merge pull request #10961 from alalek:fix_clang_avx512 2018-03-02 11:36:57 +00:00
Alexander Alekhin d59a520c9a Merge pull request #10960 from alalek:fix_protobuf_readme 2018-03-02 11:36:39 +00:00
Alexander Alekhin 97c1f09961 Merge pull request #10955 from pengli:dnn 2018-03-02 11:35:59 +00:00
Alexander Alekhin ec0bb66e5e Merge pull request #10954 from whizzzkid:master 2018-03-02 11:35:41 +00:00
Alexander Alekhin fda7bb95d0 Merge pull request #10938 from mshabunin:fix-static-issues-9 2018-03-02 11:34:53 +00:00
Alexander Alekhin 546f1d9f15 Merge pull request #10936 from mshabunin:fix-mingw-avx512 2018-03-02 11:34:00 +00:00
Alexander Alekhin 90ff900387 Merge pull request #10926 from tomoaki0705:fixTinkerBoardOpenCL 2018-03-02 11:32:51 +00:00
Alexander Alekhin ed96279920 ocl: update getOpenCLErrorString() code 2018-03-01 14:01:44 +03:00
Alexander Alekhin b1fc7d46a5 ocl: update getOpenCLErrorString() code 2018-03-01 13:52:43 +03:00
Alexander Alekhin e79be78ef4 dnn(workaround): switch to CPU target if compiled without OpenCL 2018-03-01 12:18:40 +03:00
Alexander Alekhin 4a6d582f2e dnn: make OpenCL DNN code optional 2018-03-01 12:18:39 +03:00
Alexander Alekhin e969f184e1 3rdparty: fix protobuf version in README file 2018-03-01 12:18:32 +03:00
Alexander Alekhin a9ebc61f2a dnn(workaround): switch to CPU target if compiled without OpenCL 2018-03-01 12:12:40 +03:00
Alexander Alekhin 1b83bc48a1 dnn: make OpenCL DNN code optional 2018-03-01 12:12:40 +03:00
whizzzkid 5c66ce7f29 cuda: fixes gpu samples build (issue 10953) 2018-02-28 13:22:58 -07:00
Alexander Alekhin da6dc6774b features2d: add verbose messages into tests
To investigate sporadic failures of Features2d_FLANN_Auto.regression test.
2018-02-28 19:47:16 +00:00
Sérgio M. Basto 20f5fa8e3e Fix build with VA
This commit readd ${VA_LIBRARIES} ${VA_INTEL_LIBRARIES}
that was missed in commit 2200e13c71

    diff --git a/samples/va_intel/CMakeLists.txt b/samples/va_intel/CMakeLists.txt
    -    ocv_target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_VA_INTEL_SAMPLES_REQUIRED_DEPS} ${VA_LIBRARIES} ${VA_INTEL_LIBRARIES})
    +  ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_VA_INTEL_SAMPLES_REQUIRED_DEPS})
2018-02-28 19:26:54 +00:00
Alexander Alekhin 76c40e8f0d java: fix copy_java_files() in gen_java.py
- missing 'module'
- fixed '\r\n' EOL handling (blocked by '$' regex)
2018-02-28 17:58:31 +03:00
Alexander Alekhin a838a97092 dnn: fix precomp.hpp usage 2018-02-28 17:06:26 +03:00
Wu Zhiwen ef937dd676 ocl4dnn: Fix SAME padding mode for convolve
Signed-off-by: Wu, Zhiwen <zhiwen.wu@intel.com>
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-28 21:02:41 +08:00
Alexander Alekhin 586625f8ba 3rdparty: fix protobuf version in README file 2018-02-27 15:48:19 +03:00
Alexander Alekhin 0b4428e92f cmake: AVX512 with clang 2018-02-27 15:46:09 +03:00
Tomoaki Teshima 8fd1bbde76 fix test error on Tinker Board (OpenCL on Arm platform)
* loosen some test threshold mainly for integer types
  * use relative error for floating points result
  * avoid division by zero by following the comment
  * fix the indentation
2018-02-26 22:55:06 +09:00
Alexander Alekhin ca9af20179 OpenCV version '-cvsdk' 2018-02-26 13:27:49 +03:00
Maksim Shabunin 0f1e193193 Fixed two issues found by static analysis 2018-02-26 13:27:49 +03:00
Maksim Shabunin 7c855aa3e1 Fixed two issues found by static analysis 2018-02-26 00:16:02 +03:00
Alexander Alekhin 24bed38c2b Merge tag '3.4.1' 2018-02-25 16:56:57 +00:00
Maksim Shabunin f0c0e0c6fa CPU dispatching: additional AVX-512 check for mingw-w64 2018-02-25 15:12:53 +03:00
Alexander Alekhin 6ffc48769a OpenCV version++
OpenCV 3.4.1
2018-02-23 11:38:33 +03:00
Alexander Alekhin 4a74408eee experimental version++ 2018-02-23 11:38:33 +03:00
Alexander Alekhin c729fbd652 Merge pull request #10925 from pengli:dnn 2018-02-23 08:38:03 +00:00
Li Peng 608968aa83 Deconvolution ocl fix
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-23 18:31:30 +08:00
Li, Peng 5caf6244a3 Merge pull request #10922 from pengli:dnn
* ave pooling ocl fix

support the padded area control in ave pooling

Signed-off-by: Li Peng <peng.li@intel.com>

* warning fix: ununitialized field
2018-02-22 21:01:12 +03:00
Maksim Shabunin eaaba6462e Merge pull request #10919 from mshabunin:fix-static-9 2018-02-22 15:05:25 +00:00
Maksim Shabunin 92e9d4ec3a Fixed several issues detected by static analysis 2018-02-22 17:11:33 +03:00
Maksim Shabunin fbb2cabe77 Use fixed size types in AVIContainer structs 2018-02-22 17:11:25 +03:00
Maksim Shabunin 3fd2384b81 Fixed mingw compilation on Windows 2018-02-22 17:11:18 +03:00
Alexander Alekhin e851a41d78 Merge pull request #10909 from alalek:ffmpeg_update 2018-02-22 14:05:37 +00:00
Vadim Pisarevsky 5e0f95b948 Merge pull request #9708 from dkurt:tf_face_detector 2018-02-22 12:04:26 +00:00
Alexander Alekhin f7aa2e0d44 ffmpeg: update wrapper
FFmpeg: 3.3.4 -> 3.4.2
LibVPX: 1.6.1 -> 1.7.0
OpenH264: 1.6.0 -> 1.7.0
2018-02-22 15:04:06 +03:00
Vadim Pisarevsky a11b7a8293 Merge pull request #10916 from alalek:videoio_sample_aspect_ratio 2018-02-22 12:03:39 +00:00
Alexander Alekhin e6062532fa Merge pull request #10918 from pengli:dnn 2018-02-22 10:30:00 +00:00
Li Peng e7d35d51fa Fix for opencv face detector ocl test
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-22 23:37:54 +08:00
Li Peng c524f669c7 Fallback for "SAME" padMode in ocl convolution and pooling
It fixes tensorflow ocl testcase of MobileNetSSD and Inception_v2_SSD

Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-22 21:17:59 +08:00
Alexander Alekhin 203ac0f818 Merge pull request #10914 from alalek:issue_10815 2018-02-21 18:26:15 +00:00
Dmitry Kurtaev eab556e1e0 OpenCV face detection network in TensorFlow 2018-02-21 19:58:24 +03:00
Alexander Alekhin 9819ebc095 videoio: add missing CAP_PROP_SAR_NUM/DEN propepties into .hpp file
reuse av_guess_sample_aspect_ratio() if available in ffmpeg
2018-02-21 19:14:04 +03:00
Alexander Alekhin fb6db3dcfc Merge pull request #10915 from alalek:issue_10910 2018-02-21 15:55:03 +00:00
Alexander Alekhin 7601c21612 Merge pull request #10912 from alalek:fix_imgcodecs_hang 2018-02-21 13:39:35 +00:00
Alexander Alekhin cb9b08eca1 createsamples: fix ROI in icvGetBackgroundImage() 2018-02-21 14:40:35 +03:00
Alexander Alekhin 48b8aa51cd core: eliminate redundant cv::format() declarations
Existed includes sequence:
- utility.hpp -> core.hpp -> operations.hpp
2018-02-21 14:22:16 +03:00
Alexander Alekhin 6e8241b78d imgcodecs: fix RBaseStream hang on truncated inputs 2018-02-21 13:17:18 +03:00
Vadim Pisarevsky f61076a5d8 Merge pull request #10367 from savuor:multiwrite_tiff_renew 2018-02-20 23:13:55 +00:00
Alexander Alekhin 5f5fcef962 Merge pull request #10907 from alalek:cmake_ninja_fix 2018-02-20 18:54:43 +00:00
Namgoo Lee 12ce6b5c15 Merge pull request #10906 from nglee:dev_cudaFastMultiStreamSafety
cuda_fast : multi stream safety (#10906)

* CUDA_Features2D/FAST Asynchronous test

* cuda_fast : multi stream safety

* Use parallel_for instead of OpenMP
2018-02-20 20:55:57 +03:00
Rostislav Vasilikhin 27b1f8f446 imwrite for multipage images implemented 2018-02-20 19:08:45 +03:00
Vadim Pisarevsky c6e1e3acdc Merge pull request #10892 from alalek:android_sdk_build_gradle 2018-02-20 14:59:32 +00:00
Vadim Pisarevsky 53661d55ae Merge pull request #10406 from seiko2plus:coreUnvintrinCopy 2018-02-20 14:50:17 +00:00
Vadim Pisarevsky 120b7a61c3 Merge pull request #10745 from terfendail:tiff_fix 2018-02-20 14:47:13 +00:00
PalkoNazar 470d34ddbb make tmpRow proper size before copyTo to avoid reallocated tmpCol (#10860)
* make tmpRow proper size before copyTo to avoid reallocated tmpCol

* do the transposition without creating temporary array; replace TAB with spaces.

* revert the previous commit
2018-02-20 16:55:25 +03:00
Vadim Pisarevsky a0c2718adb Merge pull request #10902 from alalek:port_10695 2018-02-20 13:26:59 +00:00
Vadim Pisarevsky a836892edb Merge pull request #10903 from alalek:ml_ann_test 2018-02-20 13:25:58 +00:00
Vadim Pisarevsky 25518a12f1 Merge pull request #10908 from alalek:fix_ffmpeg_uchar 2018-02-20 12:22:09 +00:00
Alexander Alekhin 2aa15ab3ff ffmpeg: fix 'uchar' error
> cap_ffmpeg_impl.hpp:1710:11: error: 'uchar' does not name a type
2018-02-20 13:15:41 +03:00
Alexander Alekhin 807ec00b85 cmake: fix Ninja warning
about BYPRODUCTS bin/opencv-340.jar
2018-02-20 13:13:31 +03:00
Alexander Alekhin 53305d4a7e Merge pull request #10891 from pengli:dnn 2018-02-20 08:59:07 +00:00
Li Peng 2863f950d6 ReLU6 layer ocl support
include relu6 ocl kernel and layer fusion support

Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-20 15:11:09 +08:00
Alexander Alekhin 12d2bd4adb ml: refactor ML_ANN test 2018-02-19 21:35:48 +03:00
Vitaly Tuzov 24ee7b5080 Fix for vertically flipped tiff files reading 2018-02-19 18:49:19 +03:00
mworchel aab390c51d Add mask support to SimpleBlobDetector 2018-02-19 17:54:27 +03:00
Dmitry Kurtaev 8b4871a28d Use only absolute prior boxes explicit sizes. Remove scales attributes. (#10874)
* Use only absolute prior boxes explicit sizes. Remove scales attributes.

* Simplified PriorBox layer forward pass
2018-02-19 17:25:18 +03:00
Alexander Alekhin cf31243c74 android: add build.grade into Android SDK
For using 'OpenCV for Android SDK' with Android Studio projects.
2018-02-19 17:19:26 +03:00
Vadim Pisarevsky 88b689bcf1 Merge pull request #10876 from alalek:android_static_libs 2018-02-19 14:16:06 +00:00
Vadim Pisarevsky f589237e23 Merge pull request #10880 from StevenPuttemans:fix_10594 2018-02-19 14:13:43 +00:00
Vadim Pisarevsky 7da6e9086c Merge pull request #10893 from alalek:fix_cpu_disable_flags 2018-02-19 14:11:11 +00:00
Vadim Pisarevsky 68043f4de9 Merge pull request #10896 from dkurt:tensorflow_tests_generator 2018-02-19 14:08:58 +00:00
Alexander Alekhin c0eaff3608 Merge pull request #10900 from tomoaki0705:fixPerfVideoioGstreamer 2018-02-19 13:59:20 +00:00
Tomoaki Teshima bcce25900b read in gray scale mode when writing a gray scale video 2018-02-19 18:33:05 +09:00
Dmitry Kurtaev 34ba32ff27 Fix DNN flatten test 2018-02-18 12:45:43 +03:00
Alexander Alekhin 857007372d Merge pull request #10895 from tomoaki0705:fixBuildVS2013sprintf 2018-02-18 07:45:01 +00:00
Tomoaki Teshima 6a661e1e28 fix test error on VS2013 2018-02-18 09:29:38 +09:00
Alexander Alekhin cc5a6f3b86 core: remove '-' from separators list of disabled CPU flags
To allow runtime disabling of AVX512-SKX via 'OPENCV_CPU_DISABLE' parameter
2018-02-18 00:03:04 +00:00
Maksim Shabunin aa7a964139 Merge pull request #10868 from mshabunin:sample-bgsegm
* Samples: reworked bgfg_bgsegm

* fixup! Samples: reworked bgfg_bgsegm
2018-02-17 15:04:14 +03:00
Alexander Alekhin 73a8369631 Merge pull request #10890 from Reputeless:patch-1 2018-02-17 12:02:48 +00:00
Florian Echtler 6a8f57e5d7 Merge pull request #10081 from floe:java-camera2-view
* add (untested) JavaCamera2View class

* initial fixes

* minor cleanup

* exclude JavaCamera2View from build for older SDK version

* fix method name typo

* add asserts + sanity checks

* fix preview format checks

* fix the memory leak

* export cvtTwoPlaneYUVtoBGR for Java usage

* add handling for two-plane YUV frames (C wrapper still missing)

* add two-plane cvtColor helper function

* fix warnings

* actually use the new cvtColorTwoPlane helper func

* fix wrong output matrix size

* fix wrong conversion type

* simplify method signature, add error condition

* minor fixes to Mat types

* remove leftover semaphore from camera api 1

* android: JavaCamera2View minor refactoring

- re-apply Java code style
- imports cleanup
- dump exceptions information

* android: JavaCamera2View: pause/resume fixes

* android: JavaCamera2View: fix mScale
2018-02-17 15:01:24 +03:00
Alexander Alekhin eb94dfb442 Merge pull request #10885 from alalek:issue_10881 2018-02-17 11:58:51 +00:00
Patrik Huber 7be0c78533 Merge pull request #10589 from patrikhuber:patch-1
* Make <array> #ifdef true for MSVC

I think MSVC had `std::array` for quite a while (possibly going back as far as VS 2012, but it's definitely there in 2015 and 2017. So I think `_MSC_VER` `1900` is a safe bet. Probably `1800` and maybe even `1700` could work as well but I can't test that locally.

* fix test
2018-02-17 14:53:30 +03:00
Ryo Suzuki 97d9ea00fe Fix typo in core/base.hpp 2018-02-17 19:35:25 +09:00
Alexander Alekhin 491502a349 core: fix parallel_for data race 2018-02-16 21:13:48 +03:00
Alexander Alekhin 0e4eed0ba1 Merge pull request #10867 from dkurt:dnn_fix_ave_pooling_area 2018-02-16 11:17:32 +00:00
Alexander Alekhin 8ffcc76011 Merge pull request #10883 from alalek:portable_stdint 2018-02-16 10:29:39 +00:00
Alexander Alekhin c020a7bb67 build: portable integer types 2018-02-15 23:43:02 +03:00
Alexander Alekhin e268fdc0ed Merge pull request #10793 from denmatfoton:master 2018-02-15 15:52:52 +00:00
Alexander Alekhin bb925fe488 Merge pull request #10879 from StevenPuttemans:fix_10650 2018-02-15 15:48:12 +00:00
Alexander Alekhin 1dbdb1cfc9 Merge pull request #10727 from alalek:cmake_hook_system 2018-02-15 15:46:12 +00:00
Alexander Alekhin 30b33a4413 Merge pull request #10145 from allnes:vedeoio_avi_container 2018-02-15 15:14:03 +00:00
Steven 945ad277ea add missing DNN header to opencv2/opencv.hpp 2018-02-15 15:59:14 +01:00
Steven 6f4e35cc0e fix tutorial on real time pose estimation 2018-02-15 15:48:52 +01:00
Alexander Nesterov df8f61877e Added avi-container with tests 2018-02-15 17:34:49 +03:00
Alexander Alekhin ddb482b14a android: move .a files into 'staticlibs' directory
to reduce overhead of gradle builds
2018-02-15 16:31:49 +03:00
Alexander Alekhin f378f1d585 calib3d: add regression test for stereoCalibrate 2018-02-15 15:24:09 +03:00
Alexander Alekhin 36f11a54e1 cmake: customize OpenCV build via CMake script hooks 2018-02-15 14:03:38 +03:00
Dmitry Kurtaev f8d0d6365e Add a flag to manage average pooling with padding 2018-02-14 16:56:31 +03:00
Alexander Alekhin cff79609c8 Merge pull request #10854 from pengli:dnn 2018-02-14 12:49:53 +00:00
Alexander Alekhin c434198ee5 Merge pull request #10864 from alalek:cmake_update_debug_info 2018-02-14 12:47:43 +00:00
Vadim Pisarevsky ef70b0baa4 Merge pull request #10865 from dkurt:dnn_inf_engine_getInputsInfo 2018-02-14 12:25:18 +00:00
Vadim Pisarevsky b4ddf3d8c5 Merge pull request #10678 from terfendail:OutputArray_recreate 2018-02-14 11:36:51 +00:00
Vadim Pisarevsky 42b25d747b Merge pull request #10856 from tomoaki0705:fixVisualStudioFixedWidthInt 2018-02-14 11:33:15 +00:00
Dmitry Kurtaev a66b5e2c13 Add const getInputsInfo 2018-02-14 14:17:44 +03:00
Vadim Pisarevsky 8f0b72be9e Merge pull request #10861 from nglee:dev_cudaDftAlgorithmTest 2018-02-14 10:50:05 +00:00
Vadim Pisarevsky 15dc6f70dc Merge pull request #10863 from mshabunin:fix-viz-samples-build 2018-02-14 10:49:05 +00:00
Alexander Alekhin 95014f311d cmake: debug info 2018-02-14 13:44:10 +03:00
Vadim Pisarevsky 6dfd7e3da2 Merge pull request #10850 from dkurt:dnn_tf_deconv_tests 2018-02-14 10:35:14 +00:00
Alexander Alekhin cfe84b953c Merge pull request #10859 from luzpaz:misc-modules-typos-cont-2 2018-02-14 09:56:11 +00:00
Maksim Shabunin f78b9468dd Samples: fixed samples build in case the viz module is disabled 2018-02-14 12:45:10 +03:00
Namgoo Lee 034dc3b0dd Fix for CUDA_Arithm/Dft.Algorithm/0 test 2018-02-14 09:54:13 +09:00
Li Peng 80d1f2ddfa re-enable tensor flow mobilenet ssd ocl test
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-14 01:04:58 +08:00
luz.paz d05714995c Misc. modules/ cont. pt2
Found via `codespell`
2018-02-13 11:28:11 -05:00
Alexander Alekhin 252e871a8b Merge pull request #10846 from luzpaz:misc-modules-typos-cont 2018-02-13 16:12:28 +00:00
Alexander Alekhin 59b91d6c31 Merge pull request #10821 from dkurt:dnn_layers_fusion 2018-02-13 16:08:48 +00:00
Li Peng 5992c46606 add fallback case for ocl convolution
The ocl convolution doesn't support tensorflow padMode well.
Add fallback check if we meet this situation, it could fix the
tensorflow MobileNet SSD failure.

Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-14 00:04:38 +08:00
Li Peng 00d2f34888 ocl fix for detection_output and prior_box layer
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-13 23:09:14 +08:00
Alexander Alekhin a91a11e533 Merge pull request #10818 from mshabunin:install-samples-src 2018-02-13 14:37:38 +00:00
Alexander Alekhin 2423cddb00 Merge pull request #10852 from alalek:fix_cpuid 2018-02-13 13:56:22 +00:00
Alexander Alekhin eb54e5c55c core: generalize and fix x86 'cpuid' calls 2018-02-13 15:35:04 +03:00
Dmitry Kurtaev 514e6df460 Refactored deep learning layers fusion 2018-02-13 14:35:58 +03:00
Tomoaki Teshima 94253e8b83 fix build error on Visual Studio 2013 and earlier 2018-02-13 18:30:02 +09:00
Dmitry Kurtaev a6baedd02c Fix deconvolution layer. Add batch norm layer with mean-variance normalization from TensorFlow. 2018-02-13 11:00:27 +03:00
Maksim Shabunin c63092781a Samples: fixed viz tutorials building with enabled opencv_world 2018-02-12 18:42:36 +03:00
Maksim Shabunin 2d1350a9d6 Added group targets for samples (opencv_samples, opencv_samples_<group>), install samples/data inseparate component 'samples_data' 2018-02-12 18:42:36 +03:00
Maksim Shabunin 2200e13c71 cmake: refactored scripts with samples building:
- allow installing samples sources on all platforms
  even if BUILD_EXAMPLES is disabled,  fixed minor
  issues in sources installation process
- use 'example_<group>_<name>' scheme for target and binary file naming
- use single function for sample executable creation
2018-02-12 18:42:36 +03:00
Maksim Shabunin 633b0e56a5 Fixed compilation warnings in samples:
- use per-module includes instead of "opencv.hpp"
- unused function warnings
- undefined macro warning
2018-02-12 18:42:36 +03:00
Maksim Shabunin 8393d755f6 Fixed OpenGL-specific compilation warning (unused function) 2018-02-12 18:42:36 +03:00
Alexander Alekhin 7474ad81d9 Merge pull request #10845 from alalek:cpu_dispatch_fix_file_generation 2018-02-12 15:39:24 +00:00
luz.paz e805a55a5b Misc. modules/ typos (cont.)
Found via `codespell`
2018-02-12 10:15:36 -05:00
Alexander Alekhin 14032c6653 cmake: reset __content variable if file doesn't exist
Resolves CMake error after relaunch with updated source code:
Cannot find source file:
    modules/dnn/layers/layers_common.avx512_skx.cpp
2018-02-12 17:30:53 +03:00
Alexander Alekhin 17233c687e Merge pull request #10797 from mshabunin:split-convert 2018-02-12 13:49:53 +00:00
Alexander Alekhin 57cbde3393 Merge pull request #10798 from mshabunin:split-stat 2018-02-12 13:49:41 +00:00
Alexander Alekhin 579781e35e Merge pull request #10822 from alalek:ocl_fix_imgproc_amd 2018-02-12 13:48:06 +00:00
Alexander Alekhin 66f3c1ae79 Merge pull request #10843 from luzpaz:misc-modules-typos 2018-02-12 13:47:12 +00:00
Sui Libin 1ad814a191 fix faster_rcnn sample crashed at PoolingInvoker on Windows7(x64). (#10724)
* fix faster_rcnn sample crashed at PoolingInvoker operator() of pooling_layer.

* find_odj onmouse bug about find matched point status.

* reverted AutoBuffer back to std::vector
2018-02-12 16:07:56 +03:00
Maksim Shabunin 221342fb25 Split convert.cpp into smaller pieces 2018-02-12 15:17:19 +03:00
luz.paz 5718d09e39 Misc. modules/ typos
Found via `codespell`
2018-02-12 07:09:43 -05:00
Rémi Ratajczak b67523550f dnn : Added an imagesFromBlob method to the dnn module (#10607)
* Added the imagesFromBlob method to the dnn module.

* Rewritten imagesFromBlob based on first dkurt comments

* Updated code with getPlane()

* Modify comment of imagesFromBlob() in dnn module

* modified comments, removed useless assertions & added OutputArrayOfArray

* replaced tabs with whitespaces & put vectorOfChannels instantiation outside the loop

* Changed pre-commit.sample to pre-commit in .git/hooks/

* Added a test for imagesFromBlob in test_misc.cpp (dnn)

* Changed nbOfImages, robustified test with cv::randu, modified assertion
2018-02-12 14:51:07 +03:00
Alexander Alekhin 5a791e6e06 cmake: update reporting of excluded dispatching files (#10711)
* cmake: add ocv_get_smart_file_name() macro

* cmake: avoid adding files for unavailable dispatch modes
2018-02-12 14:48:20 +03:00
Namgoo Lee 61e76e767d Update BufferReader documentation with some example code (#10803)
* Update BufferReader documentation with some example code

* Add warning to BufferPool doc regarding deallocation of StackAllocator

* Added a sample code that satisfies LIFO rule for StackAllocator
2018-02-12 14:41:23 +03:00
Vadim Pisarevsky 51b5fdba25 Merge pull request #10805 from dkurt:dnn_inf_engine_tf_ssd 2018-02-12 11:40:00 +00:00
yuki takehara 379ea15d16 Add new Mat constructor (#10808)
* Add new Mat constructor

* Fix build error

* Fix build error

* Fixed the code about 4 comments

* Fixed three comments

* delete previous local declaration

* fix build error
2018-02-12 14:36:54 +03:00
Maksim Shabunin 4437e0c3b9 Split stat.cpp into smaller pieces 2018-02-12 14:14:08 +03:00
Alexander Alekhin fad3a6bf15 ocl: disable Laplacian5 and sepFilter2D_SinglePass kernels for AMD OpenCL 2018-02-12 14:06:57 +03:00
Alexander Alekhin ab0f0f26a1 Merge pull request #10839 from csukuangfj:fix-9486 2018-02-12 09:24:29 +00:00
Alexander Alekhin b7ad95beaa Merge pull request #10836 from csukuangfj:fix-10826 2018-02-12 09:23:55 +00:00
Alexander Alekhin 2c8da29f3a Merge pull request #10835 from csukuangfj:fix-10827 2018-02-12 09:19:52 +00:00
Alexander Alekhin efd3fafa25 Merge pull request #10834 from csukuangfj:fix-issue-9387 2018-02-12 09:19:25 +00:00
Alexander Alekhin d61528b2d5 Merge pull request #10833 from csukuangfj:improve-viz3d 2018-02-12 09:12:39 +00:00
Fangjun Kuang e8b2c5682e fix issue #9387 and #9575. 2018-02-11 21:04:20 +08:00
Fangjun Kuang ce2a65db85 fix issue #9486. 2018-02-11 20:08:53 +08:00
Fangjun Kuang 2f3d4df2f2 improve the doc for the viz module. 2018-02-11 16:14:09 +08:00
Fangjun Kuang 6205981235 Fix issue 10826. 2018-02-11 16:01:21 +08:00
Fangjun Kuang 28a78003f0 Fix issue 10827. 2018-02-11 15:54:36 +08:00
Alexander Alekhin e2a99d24ec Merge pull request #10813 from alalek:cmake_cxx_flags 2018-02-10 12:27:00 +00:00
Alexander Alekhin 601e3aaf98 Merge pull request #10820 from alalek:python_isystem 2018-02-09 15:32:50 +00:00
Alexander Alekhin dd2fd39c05 Merge pull request #10819 from alalek:ocl_fix_dgpu_locks 2018-02-09 15:24:33 +00:00
Alexander Alekhin 84887d3011 cmake: use -isystem for Python/numpy include directories 2018-02-09 17:10:02 +03:00
Alexander Alekhin 9e298ea1bb build: eliminate c++17 Python build warning 2018-02-09 17:09:36 +03:00
Alexander Alekhin 65ba2e0adf cmake: update adding of extra compiler flags
Read flags from 'cache' instead of resetting them
2018-02-09 17:09:35 +03:00
Alexander Alekhin 42e1fe301c ocl: allow recursive UMatData lock() calls with the same objects
OpenCLAllocator::copy() may call upload()/download() methods
2018-02-09 14:19:10 +03:00
Dmitry Kurtaev 7fe97376c2 MobileNet-SSD from TensorFlow 1.3 and Inception-V2-SSD using Inference Engine backend 2018-02-09 13:45:45 +03:00
take1014 03407a9da0 Merge pull request #10646 from take1014:master
* Add a new interface for hough transform

* Fixed warning code

* Fix HoughLinesUsingSetOfPoints based on HoughLinesStandard

* Delete memset

* Rename HoughLinesUsingSetOfPoints and add common function

* Fix test error

* Change static function name

* Change using CV_Assert instead of if-block and add integer test case

* I solve the conflict and delete 'std :: tr1' and changed it to use 'tuple'

* I deleted std::tr1::get and changed int to use 'get'

* Fixed sample code

* revert test_main.cpp

* Delete sample code in comment and add snippets

* Change file name

* Delete static function

* Fixed build error
2018-02-08 22:54:43 +03:00
Alexander Alekhin d56b2b56fb Merge pull request #10814 from luzpaz:opencv-misc-apps-docs-platforms-typos 2018-02-08 19:14:30 +00:00
luz.paz d47b1f3b70 Misc. ./apps ./doc ./platoforms typos
Found via `codespell -q 3 --skip="./3rdparty" -I ../opencv-whitelist.txt`
2018-02-08 13:04:34 -05:00
Alexander Alekhin 090ee46f4a Merge pull request #10812 from luzpaz:opencv-misc-samples-dir-typos 2018-02-08 12:07:14 +00:00
luz.paz dbb57cd0ae Misc. ./samples typos
Found via `codespell -q 3 --skip="./3rdparty" -I ../opencv-whitelist.txt`
2018-02-08 05:52:08 -05:00
Vadim Pisarevsky 0c07836fba Merge pull request #10807 from luzpaz:misc-typos 2018-02-07 13:43:10 +00:00
Vadim Pisarevsky 835acd3f31 Merge pull request #10799 from dkurt:dnn_inference_engine_face_detection 2018-02-07 13:42:08 +00:00
Vadim Pisarevsky f8b03d4a4b Merge pull request #10806 from alalek:build_cxx17 2018-02-07 13:28:22 +00:00
luz.paz 413fba14ab Some mist. typo fixes
Found via `codespell -i 3 -w --skip="./3rdparty" -I ../opencv-whitelist.txt`
2018-02-07 06:59:15 -05:00
Alexander Alekhin 44d7435a48 build: eliminate calls of removed functionality from C++17
Most part is deprecated since C++11
2018-02-07 12:00:33 +03:00
Alexander Alekhin f77f2876ff Merge pull request #10800 from alalek:parallel_for_update 2018-02-06 17:56:33 +00:00
Alexander Alekhin 914f57f28d core(parallel_for): fix data race 2018-02-06 18:19:50 +03:00
Dmitry Kurtaev ed94136548 OpenCV face detection network using Inference Engine backend 2018-02-06 17:53:24 +03:00
Alexander Alekhin c973aaabc5 Merge pull request #10787 from dkurt:dnn_tutorial_face_detection 2018-02-06 14:37:09 +00:00
Vitaly Tuzov 3267fb90c6 Updated check on OutputArray to allow recreation of fixed_size for 1-d sizes array 2018-02-06 17:07:36 +03:00
Alexander Alekhin b10fedde56 core(parallel_for): cleanup
remove 'dont_wait' (can be replaced with has_wake_signal)
2018-02-06 16:10:41 +03:00
Dmitry Kurtaev 8817907647 Test for FP16 version of OpenCV face detection network 2018-02-06 13:16:07 +03:00
Alexander Alekhin 398ebbac98 Merge pull request #10795 from pengli:dnn 2018-02-06 10:04:29 +00:00
Li Peng c43498c6ad check vector emptiness before access it
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-06 22:59:51 +08:00
Li Peng 389fa5d38e slice layer ocl update
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-06 22:59:47 +08:00
Alexander Alekhin 2a1f46c42d Merge pull request #9770 from alalek:refactor_test_files 2018-02-06 09:33:58 +00:00
Maksim Shabunin e225850cc6 Split persistence.cpp into smaller pieces (#10788)
* Extracted base64 persistence functionality

* Extracted YML persistence functionality

* Extracted JSON persistence functionality

* Extracted XML persistence functionality

* Extracted public C and C++ interfaces implementation in persistence

* Persistence: cleanup and fixes

* fixup! Persistence: cleanup and fixes
2018-02-06 11:59:32 +03:00
Dmitry Kurtaev 10e1de74d2 Intel Inference Engine deep learning backend (#10608)
* Intel Inference Engine deep learning backend.

* OpenFace network using Inference Engine backend
2018-02-06 11:57:35 +03:00
Vadim Pisarevsky 292dfc2d72 Merge pull request #10789 from mshabunin:split-matrix 2018-02-06 08:54:16 +00:00
denmatfoton b085158d59 Fix unstable work of stereoRectify function. Issue description: https://github.com/opencv/opencv/issues/10791 2018-02-05 15:30:26 -05:00
Maksim Shabunin 904640c9ae Split matrix.cpp into smaller pieces 2018-02-05 19:16:33 +03:00
Alexander Alekhin 06455fc0cd Merge pull request #10764 from sturkmen72:update_cmake 2018-02-05 14:07:40 +00:00
Suleyman TURKMEN 3b191bf2dd update CMakeList.txt 2018-02-05 16:23:52 +03:00
berak 56bcdfd7d9 Merge pull request #10777 from berak:dnn_colorize_cpp
* dnn: add colorization.cpp

* Update arguments of dnn/colorization.py
2018-02-05 15:07:40 +03:00
Vadim Pisarevsky 14089b1e7c Merge pull request #10782 from csukuangfj:patch-1 2018-02-05 10:10:16 +00:00
Dmitry Kurtaev 5f6077bc62 Tool to generate text graphs for SSD models from TensorFlow (#10723)
* Added tool to generate text graph for SSD models from TensorFlow

* Update tf_text_graph_ssd.py
2018-02-05 13:00:43 +03:00
Alexander Alekhin 19a914be16 Merge pull request #10759 from mshabunin:fix-msvc-lto-debug 2018-02-05 09:33:03 +00:00
csukuangfj f1c91a8d34 Fix issue #10781
Fix issue #10781.
2018-02-05 11:26:25 +08:00
Alexander Alekhin 5a71f4a0ca Merge pull request #10775 from alalek:update_valgrind_suppression 2018-02-04 13:52:09 +00:00
Alexander Alekhin a449731a57 valgrind: update suppression rules 2018-02-03 22:59:45 +00:00
Alexander Alekhin e801e336ed Merge pull request #10769 from mshabunin:add-tbb-cmake-support 2018-02-03 19:48:19 +00:00
Alexander Alekhin 0d01b97b75 cuda: don't use std::numeric_limits
CUDA code uses own implementation in cuda/limits.hpp
2018-02-03 19:43:05 +00:00
Alexander Alekhin 7fedfa0380 cudev(test): avoid namespace check 2018-02-03 19:39:47 +00:00
Alexander Alekhin 4a297a2443 ts: refactor OpenCV tests
- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
2018-02-03 19:39:47 +00:00
Maksim Shabunin 108d07c655 TBB: added workaround for linking issue with conflicting system and custom libraries 2018-02-03 14:27:46 +03:00
Maksim Shabunin 34a9ce6eb3 cmake: support searching for TBB via cmake package mechanism 2018-02-03 13:51:54 +03:00
Alexander Alekhin f1e50ecab3 ts: fix missing std::tr1 (C++17) 2018-02-02 20:02:45 +00:00
Alexander Alekhin a0ce12f8ba Merge pull request #10767 from alalek:fix_cmake 2018-02-02 19:26:49 +00:00
Alexander Alekhin 3d6659112f cmake: fix includes processing 2018-02-02 21:52:54 +03:00
Rostislav Vasilikhin 1055f9d208 Merge pull request #10757 from savuor:test_hist_renew
* old types removed

* QueryHist tests: new types

* ThreshHist tests: new types

* CalcHist tests: new types

* CalcBackProject tests: new types

* CalcBackProjectPatch tests: new types

* const ref added
2018-02-02 21:35:44 +03:00
Alexander Alekhin 403c3c3d03 Merge pull request #10766 from mshabunin:fix-world-interface-include 2018-02-02 16:25:17 +00:00
Alexander Alekhin 877b175565 Merge pull request #10758 from mshabunin:allow-many-contrib 2018-02-02 16:07:48 +00:00
Alexander Alekhin 82f889d9b8 Merge pull request #10765 from BelBES:sb/findContours_fix 2018-02-02 16:03:15 +00:00
Maksim Shabunin 7eb37bd1dd Fixed components INTERFACE_INCLUDE_DIRECTORY property in "world" builds 2018-02-02 18:14:25 +03:00
Harshal Nishar 384fa95680 Fix in Canny when Sobel apertureSize is 7 (#10743)
* Fixing a bug in Canny implemetation when Sobel aperture size is 7.

* Fixing the bug in Canny accross variants and in test_canny.cpp

* Replacing a tab with white space
2018-02-02 17:00:11 +03:00
sergeybe 2266a8c85f fix FindContours default offset for CV_LINK_RUNS method 2018-02-02 16:46:05 +03:00
Vadim Pisarevsky 83761d5f8e Merge pull request #10761 from seiko2plus:issue10753 2018-02-02 11:27:26 +00:00
Alexander Alekhin ecbd5b0574 Merge pull request #10751 from nglee:dev 2018-02-02 10:48:50 +00:00
Ya-Chiu Wu c8d8b1fbcd Merge pull request #10553 from GlueCrow:bgfg_knn_opencl
Add ocl version BackgroundSubtractorKNN (#10553)

* Add ocl version bgfg_knn

* Add ocl KNN perf test

* ocl KNN: Avoid unnecessary initializing when non-UMat parameters are used

* video: turn off OpenCL for color KNN on Intel devices

due performance degradation

* video: turn off KNN OpenCL on Apple devices with Intel iGPU

due process freeze during clBuildProgram() call
2018-02-02 13:20:46 +03:00
Alexander Alekhin 92fb3fb33f Merge pull request #10763 from alalek:issue_10760 2018-02-02 12:34:59 +03:00
Alexander Alekhin 02bc17be6f js: filterout OpenCL headers 2018-02-02 12:26:22 +03:00
Sayed Adel 534dcbe017 core:ppc Fix compile issue with Eigen 2018-02-02 03:31:25 +00:00
Alexander Alekhin 12cd3b55ec Merge pull request #10756 from terfendail:orb_firstlevel 2018-02-01 18:34:57 +00:00
Alexander Alekhin bbfa239036 Merge pull request #10706 from alalek:exception_opencv_version 2018-02-01 18:32:13 +00:00
Alexander Alekhin c96630c9f0 Merge pull request #10705 from alalek:opencv_version_update 2018-02-01 18:31:52 +00:00
Maksim Shabunin 60f1c9dcdf Do not enable LTO flags for MSVC debug configuration 2018-02-01 19:22:48 +03:00
Maksim Shabunin 82aff110b7 cmake: allow providing list of extra modules paths 2018-02-01 19:02:02 +03:00
Vitaly Tuzov 26321795f7 Fixed assertion in ORB::setFirstLevel() 2018-02-01 16:58:35 +03:00
Vadim Pisarevsky f780ee12a0 Merge pull request #10690 from terfendail:orb_firstlevel 2018-02-01 13:41:29 +00:00
Maksim Shabunin e56d6054aa Do not build protobuf without dnn (#10689)
* Do not build protobuf if dnn is disabled

* Added BUILD_LIST cmake option to the cache

* Moved protobuf to the top level

* Fixed static build

* Fixed world build

* fixup! Fixed world build
2018-02-01 16:30:23 +03:00
Vadim Pisarevsky 36222c9eed Merge pull request #10730 from dkurt:dnn_faster_rcnn_rfcn_tests 2018-02-01 13:28:10 +00:00
Vadim Pisarevsky 8436dac090 Merge pull request #10742 from alalek:fix_winrt_fs_build 2018-02-01 13:23:49 +00:00
Vadim Pisarevsky 713ec7be45 Merge pull request #10746 from dkurt:dnn_batch_norm_from_nvidia_caffe 2018-02-01 13:22:09 +00:00
Alexander Alekhin 42569cfd61 Merge pull request #10748 from dkurt:fix_dnn_slice_layer 2018-02-01 13:21:17 +00:00
Alexander Alekhin 7c8a3da0ac Merge pull request #10709 from alalek:cleanup_2018 2018-02-01 13:08:36 +00:00
Alexander Alekhin 9d25bd583f Merge pull request #10754 from dkurt:dnn_ocl_gemv_min_globalsize 2018-02-01 12:39:27 +00:00
Vadim Pisarevsky 85af8735ab Merge pull request #10749 from alalek:issue_10736 2018-02-01 12:26:50 +00:00
Aditya Rohan ccea0a831a Merge pull request #10732 from Riyuzakii:10598
* Introduces error throw for line drawn with THICKNESS=0
2018-02-01 15:21:00 +03:00
Dmitry Kurtaev 65a6674c6e ocl4dnnGEMV in case of row_size < 4 2018-02-01 14:06:47 +03:00
Alexander Alekhin 9698b93d10 Merge pull request #10717 from pengli:dnn 2018-02-01 10:49:54 +00:00
Alexander Alekhin 78ce5b815d Merge pull request #10733 from alalek:issue_10654 2018-02-01 10:31:48 +00:00
Li Peng 6aec71d7ee mvn layer ocl update
it fuse ocl kernels to reduce kernel enqueue

Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-01 17:48:12 +08:00
Li Peng 83b16ab7b7 fix extra spaces in build option
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-01 17:46:11 +08:00
Li Peng 54c81cbde4 eltwise layer SUM op update
Signed-off-by: Li Peng <peng.li@intel.com>
2018-02-01 17:46:06 +08:00
Namgoo Lee 3cf535926a cuda_stream: do not allocate GPU memory by default (fixes #8725) 2018-02-01 03:55:52 +09:00
Alexander Alekhin 35738bcadd samples: remove orphan documentation snippet: SBM_Sample.cpp 2018-01-31 18:54:08 +00:00
Dmitry Kurtaev 184862582c Fix slice layer from TensorFlow 2018-01-31 19:12:37 +03:00
Alexander Alekhin c4f9ff0285 cmake: avoid using of pkg-config in cross-compilation mode unconditionally
- specify PKG_CONFIG_LIBDIR environment variable to new target SYSROOT
2018-01-31 16:56:24 +03:00
Arjan van de Ven a75840d19c Merge pull request #10468 from fenrus75:avx512-2
* Add a 512 bit codepath to the AVX512 fastConv function

this patch adds a 512 wide codepath to the fastConv() function for
AVX512 use.
The basic idea is to process the first N * 16 elements of the vector
with avx512, and then run the rest of the vector using the traditional
AVX2 codepath.

* dnn: use unaligned AVX512 load (OpenCV aligns data on 32-byte boundary)

* dnn: change "vecsize" condition for AVX512

* dnn: fix indentation
2018-01-31 16:34:12 +03:00
Alexander Alekhin f06c44f1f1 Merge pull request #10701 from dkurt:tf_ave_pooling 2018-01-31 13:28:09 +00:00
Dmitry Kurtaev 844f1d0281 Fix Batch Normalization layer imported from NVIDIA Caffe. 2018-01-31 16:25:45 +03:00
Dmitry Kurtaev a2e9bfbaf4 Fix padding for average pooling from TensorFlow 2018-01-31 15:54:30 +03:00
Alexander Alekhin 2e45095e8d winrt: fix build 2018-01-31 15:00:45 +03:00
Alexander Alekhin 027da35c33 Merge pull request #10738 from tomoaki0705:fixBuildVisualStudio 2018-01-31 09:57:29 +00:00
Alexander Alekhin 2c1161a6f9 Merge pull request #10735 from seiko2plus:coreYieldPPC 2018-01-31 09:41:37 +00:00
Tomoaki Teshima 5f4b48da34 fix build error on Visual Studio 2013 and earlier 2018-01-31 18:22:09 +09:00
Sayed Adel 4e1d396ce1 core:ppc Add yield support 2018-01-31 04:03:35 +00:00
Alexander Alekhin 98bd0a06dc cmake: fix gnu.toolchain
- CMAKE_FIND_ROOT_PATH_MODE_PROGRAM: ONLY => NEVER
- update handling of CMAKE_FIND_ROOT_PATH_MODE_* variables
2018-01-30 18:29:18 +00:00
Alexander Alekhin f57630d92b Merge pull request #10691 from alalek:parallel_for_2018 2018-01-30 14:13:29 +00:00
Dmitry Kurtaev ae2e4af4a1 Faster-RCNN and RFCN tests
https://github.com/rbgirshick/py-faster-rcnn
https://github.com/YuwenXiong/py-R-FCN
2018-01-30 13:17:35 +03:00
Vadim Pisarevsky cb66f82c1d Merge pull request #10707 from alalek:update_reports 2018-01-30 09:22:46 +00:00
Vadim Pisarevsky 1389fd67ab Merge pull request #10721 from alalek:ocl_force_clBuildProgram 2018-01-30 09:20:58 +00:00
Li Peng 7a4c5e9421 slice layer ocl support
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-29 22:34:32 +08:00
Alexander Alekhin cf1ba0c4e1 Merge pull request #10719 from alisentas:master
Fix cv::CommandLineParser::check() documentation
2018-01-29 16:24:59 +03:00
Alexander Alekhin ebdb0eb0c1 ocl: force clBuildProgram() call after clCreateProgramWithBinary() 2018-01-29 15:51:07 +03:00
Ali Sentas 4d80419f29 Fix cv::CommandLineParser::check() documentation 2018-01-29 15:14:21 +03:00
Alexander Alekhin 32d71cf85f Merge pull request #10713 from alalek:issue_10710 2018-01-29 09:03:36 +00:00
Alexander Alekhin 2876670de3 dnn(ocl): fix build options for Apple OpenCL 2018-01-28 01:54:25 +00:00
Alexander Alekhin 36d4c29b11 cleanup unused/outdated files/scripts/links 2018-01-27 23:22:44 +00:00
Alexander Alekhin c8930cc279 opencv_version: dump detected HW features 2018-01-27 17:08:29 +00:00
Alexander Alekhin 01f4a173ab opencv_version: dump OpenCL information via opencv_version
fix missing "opencv2/core/opencl" headers from core module (updated install list)
2018-01-27 17:08:28 +00:00
Alexander Alekhin daf3368d2e perf reports: remove units from table cells
- moved to table title
- can be restored via '--show_units' option
- fix microseconds: mks -> us
2018-01-27 14:38:40 +00:00
Alexander Alekhin f6fd3abd31 core: add OpenCV version information into Exception messages 2018-01-27 13:51:16 +00:00
Woody Chow f1c52e426b Merge pull request #10697 from woodychow:tbb_task_arena
* Use Intel TBB's task arena if possible
2018-01-27 08:46:54 +03:00
Pavel Rojtberg 203dc3bb48 Merge pull request #10667 from paroj:stereo_calib_ex
calib3d: add stereoCalibrateExtended (#10667)

* cvCalibrateCamera2Internal: simplify per view error computation

* calib3d: add stereoCalibrateExtended

- allow CALIB_USE_EXTRINSIC_GUESS
- returns per view errors

* calib3d: add stereoCalibrateExtended test
2018-01-26 22:05:13 +03:00
Alexander Alekhin 7b8ab4e5c6 Merge pull request #10688 from LaurentBerger:calcback 2018-01-26 19:01:48 +00:00
Alexander Alekhin 73891d619a Merge pull request #10700 from alalek:cpu_dispatch_axv512
* cmake: enable CPU dispatching for AVX512 (SKX)

* cmake: update handling of unsupported flags/modes
2018-01-26 21:59:47 +03:00
Alexander Alekhin fe4fbc2c3b Merge pull request #10693 from travbid:IntrinsicParams_fix 2018-01-26 16:22:38 +00:00
LaurentBerger 2ebf4e084a solve issue #10687 2018-01-26 17:01:02 +01:00
Alexander Alekhin df22bafe6d Merge pull request #10681 from hmaarrfk:python_stitching_scans 2018-01-26 10:04:41 +00:00
Alexander Alekhin c49d5d5252 core: fix pthreads performance
OpenCV pthreads-based implementation changes:
- rework worker threads pool, allow to execute job by the main thread too
- rework synchronization scheme (wait for job completion, threads 'pong' answer is not required)
- allow "active wait" (spin) by worker threads and by the main thread
- use _mm_pause() during active wait (support for Hyper-Threading technology)
- use sched_yield() to avoid preemption of still working other workers
- don't use getTickCount()
- optional builtin thread pool profiler (disabled by compilation flag)
2018-01-26 04:09:11 +00:00
Alexander Alekhin 104502c5be Merge pull request #10676 from dkurt:dnn_for_newer_mobilenet_ssd 2018-01-26 04:02:21 +00:00
Travers 7d6cf66303 IntrinsicParams operator+ fix 2018-01-26 14:04:45 +13:00
Maksim Shabunin d1b08486ae Merge pull request #10619 from mshabunin:fix-run-py-without-java 2018-01-25 13:47:47 +00:00
Vitaly Tuzov 205022ceee Fixed issue in ORB detection if firstLevel property is set above 0 2018-01-25 16:14:16 +03:00
Alexander Alekhin 47998c03f8 perf: update message 2018-01-25 13:18:47 +03:00
Alexander Alekhin 27cddfb8e9 Merge pull request #10661 from alalek:parallel_kmeans 2018-01-25 10:18:37 +00:00
Maksim Shabunin 3f116468c6 Merge pull request #10679 from mshabunin:vs-defense-flags 2018-01-25 09:57:43 +00:00
Alexander Alekhin 8c2563be41 Merge pull request #10672 from pengli:dnn 2018-01-25 07:18:25 +00:00
Li Peng 2493083935 mvn, batch_norm and relu layer fusion
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-25 18:57:05 +08:00
Li Peng e15928b49e convolution and tanh layer fusion
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-25 17:45:33 +08:00
Mark Harfouche df434298b8 Exported a high level stitcher the DLL
allows Stitcher to be used for scans from within python.
I had to use very strange notation because I couldn't export the `enum`
`Mode` making the Cpython generated code unable to compile.

```c++
class Stitcher {
public:
enum Mode
    {
        PANORAMA = 0,
        SCANS = 1,
    };
...
```

Also removed duplicate code from the `createStitcher` function making
use of the `Stitcher::create` function
2018-01-24 12:43:00 -08:00
Alexander Alekhin c401168bea Merge pull request #10675 from LaurentBerger:tutopy_arithm 2018-01-24 17:49:20 +00:00
Alexander Alekhin 0b1f626efd Merge pull request #10677 from alalek:issue_10668 2018-01-24 17:48:11 +00:00
Maksim Shabunin 74367093c8 VS with hardening: added guard flag, moved dynamicbase and safeseh to linker flags 2018-01-24 17:59:10 +03:00
Jozef Mlich 7a472d85ef Merge pull request #10663 from jmlich:master
* hogsvm compatibility with python3
2018-01-24 17:03:23 +03:00
Alexander Alekhin 81c5fae56f core(lapack): fix build issues related to 'extern "C"' 2018-01-24 14:53:04 +03:00
Dmitry Kurtaev 9e9926a2f0 PriorBox layer with explicit normalized sizes 2018-01-24 14:01:42 +03:00
LaurentBerger 6e5da9dbe3 bad image file 2018-01-24 09:09:49 +01:00
Elena Gvozdeva b97b650ab3 add HAL for FAST (#10362)
* add HAL for FAST

* add new interface
2018-01-24 01:48:06 +03:00
Vadim Pisarevsky a1d2258ac3 Merge pull request #10635 from csukuangfj:doc-checkVector 2018-01-23 10:42:05 +00:00
Vadim Pisarevsky 8f04c8b16c Merge pull request #10644 from csukuangfj:doc-fundamental-matrix 2018-01-23 10:38:14 +00:00
Pavel Rojtberg 2d674fc151 persistence: replace arbitrary limit of cn to 4 by CV_CN_MAX (#10636)
* persistence: replace arbitrary limit of cn to 4 by CV_CN_MAX

* python: added persistence test, remove temp files

* fixup! python: added persistence test, remove temp files

* fixup! python: added persistence test, remove temp files
2018-01-23 13:36:30 +03:00
Alexander Alekhin 479179638e Merge pull request #10655 from dkurt:dnn_tests 2018-01-23 10:16:55 +00:00
Dmitry Kurtaev a3d74704e5 OpenCV face detection network test 2018-01-23 09:27:58 +03:00
Alexander Alekhin 90aac764dd core: kmeans refactoring
- reduce scope of i,k,j variables
- use cv::AutoBuffer
- template<bool onlyDistance> class KMeansDistanceComputer
- eliminate manual unrolling: CV_ENABLE_UNROLLED
2018-01-22 14:26:41 +03:00
Alexander Alekhin 46470d92a0 core: fix kmeans multi-threaded performance 2018-01-22 14:26:41 +03:00
Alexander Alekhin a5cd62f7bf core(perf): refactor kmeans test
- don't use RNG for "task size" parameters (N, K, dims)
- add "good" kmeans test data (without singularities: K > unique points)
2018-01-22 14:25:29 +03:00
Vitaly Tuzov 12ea8477a3 bitexact gaussianblur implementation (#10345)
* Bit-exact implementation of GaussianBlur smoothing

* Added universal intrinsics based implementation for bit-exact CV_8U GaussianBlur smoothing.

* Added parallel_for to evaluation of bit-exact GaussianBlur

* Added custom implementations for 3x3 and 5x5 bit-exact GaussianBlur
2018-01-22 13:26:32 +03:00
Alexander Alekhin 87db636c61 Merge pull request #10657 from GlueCrow:mog2_init_fix 2018-01-21 17:25:37 +00:00
Glue Crow c5c620bab0 ocl: Avoid unnecessary initializing when non-UMat parameters are used 2018-01-21 23:02:05 +08:00
Gregory Morse d84c7e5143 Merge pull request #10649 from GregoryMorse:patch-3
* Fix for QT image window rectangle

* Update window_QT.h

* Update window_QT.cpp

* trailing whitespace

* highgui: fix QT getWindowImageRect()
2018-01-21 09:26:48 +03:00
Maksim Shabunin 8ba88892d7 run.py: simplified scripts, fixed most of PEP8 warnings 2018-01-19 17:05:40 +03:00
Fangjun Kuang eb2901bd69 Improve the doc for fundamental matrix. 2018-01-19 13:41:47 +01:00
Vadim Pisarevsky c89ae6e537 Merge pull request #10629 from GlueCrow:ocl_mog2_test_fix 2018-01-19 11:12:19 +00:00
Namgoo Lee 25c36fb05f cv::cuda::cvtColor bug fix (#10640)
* cuda::cvtColor bug fix

Fixed bug in conversion formula between RGB space and LUV space.
Testing with opencv_test_cudaimgproc.exe, this commit reduces the number
of failed tests from 191 to 95. (96 more tests pass)

* Rename variables
2018-01-19 14:06:05 +03:00
Vadim Pisarevsky 71ba54b2f4 Merge pull request #10637 from catree:fix_perf_build_cuda_9 2018-01-19 11:02:14 +00:00
Alexander Alekhin 18ce529256 Merge pull request #10633 from csukuangfj:doc-estimateAffine 2018-01-19 10:11:56 +00:00
Alexander Alekhin 26e0f408f0 Merge pull request #10639 from pengli:dnn 2018-01-19 10:01:41 +00:00
Li Peng fe494297e4 more update on MVN layer ocl implementation
cut one ocl kernel if normVariance is disabled,
also use native_powr for performance reason.

Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-19 22:54:04 +08:00
Alexander Alekhin c3569211d5 Merge pull request #10591 from drkoller:master 2018-01-19 09:44:21 +00:00
catree dcc5a2cb22 Fix perf build with CUDA 9. 2018-01-19 00:23:02 +01:00
Fangjun Kuang 67842df9e2 Improve the documentation for affine transform estimation. 2018-01-18 19:54:18 +01:00
Alexander Alekhin 8226bd25c4 Merge pull request #10625 from pengli:dnn 2018-01-18 18:26:30 +00:00
Fangjun Kuang 8efe7bafaa Improve the doc for cv::Mat::checkVector. 2018-01-18 16:48:59 +01:00
Li Peng 2124361ff7 ocl support for Deconvolution layer
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-18 23:40:22 +08:00
Vadim Pisarevsky 42459cad02 Merge pull request #10634 from sturkmen72:update_samples 2018-01-18 13:46:27 +00:00
Alexander Alekhin 0def2dbb73 Merge pull request #10605 from alalek:ocl_fix_deadlock 2018-01-18 13:39:36 +00:00
Maksim Shabunin 1b0ff57562 Merge pull request #10621 from mshabunin:disable-docs
Documentation generation refactoring (#10621)

* Documentation build updates:

- disable documentation by default, do not add to ALL target
- combine Doxygen and Javadoc
- optimize Doxygen html

* javadoc: fix path in build directory

* cmake: fix "Documentation" status line
2018-01-18 16:37:19 +03:00
Glue Crow 95ce21d407 Fix #10525 2018-01-18 18:49:29 +08:00
Gregory Morse ec353dbdda Merge pull request #10412 from GregoryMorse:patch-2
Update to add window position and size retrieval to HighGUI (#10412)

* Update highgui.hpp

Add read only property retrieval for enhanced rendering capabilities and more sophisticated research tools

* Update window.cpp

* Update window_w32.cpp

* Update window_QT.cpp

* Update window_QT.h

* Update window_QT.h

* Update window_gtk.cpp

* Update precomp.hpp

* Update highgui_c.h

* Update highgui_c.h

* Update window_w32.cpp

* Update precomp.hpp

* Update window_QT.cpp

* Update window_QT.h

* Update window_gtk.cpp

* Update window_gtk.cpp

* Update window_w32.cpp

* Update window_QT.cpp

* Update window_carbon.cpp

* Update window_cocoa.mm

* Update precomp.hpp

* Update window_cocoa.mm

* Update window_w32.cpp

* Update window_gtk.cpp

* Update window_QT.cpp

* Update window_gtk.cpp

* Update window_QT.cpp

* Update window_cocoa.mm

* Update window_carbon.cpp

* Update window_w32.cpp

* Update window_cocoa.mm

* Update window_gtk.cpp

* Update window_cocoa.mm

* Update window_gtk.cpp

* Update window_cocoa.mm

* Update window_cocoa.mm

* Update window.cpp

* Update test_gui.cpp

* Update test_gui.cpp

* Update test_gui.cpp

* Update highgui_c.h

* Update highgui.hpp

* Update window.cpp

* Update highgui_c.h

* Update test_gui.cpp

* Update highgui.hpp

* Update window.cpp

* Update window.cpp

* Update window.cpp

* Update window.cpp

* Update window.cpp
2018-01-18 07:49:47 +03:00
Alexander Alekhin f056e713c3 Merge pull request #10512 from sturkmen72:update_documentation 2018-01-18 04:44:59 +00:00
Suleyman TURKMEN 4046d9f850 Update samples 2018-01-18 07:04:42 +03:00
Alexander Alekhin aa55cdb735 Merge pull request #10622 from alalek:fix_build_js
Re-apply protobuf fix for JavaScript builds
2018-01-17 23:52:26 +03:00
Dmitry Kurtaev ec8d39d059 Re-apply protobuf fix for JavaScript builds
original commit: f503515082
JavaScript bindings for dnn module
2018-01-17 20:20:00 +00:00
David Koller d1a3b530be Make DNN Crop layer match Caffe default offset behavior
and add parametric unit test for crop layer.
2018-01-17 10:52:36 -05:00
Alexander Alekhin a55aed5f42 Merge pull request #10593 from alalek:android_build_sdk_configuration 2018-01-17 11:34:03 +00:00
Alexander Alekhin b067e0ca5d Merge pull request #10613 from csukuangfj:fix-10612 2018-01-17 09:58:34 +00:00
Alexander Alekhin 85e133a051 Merge pull request #10604 from aimotive:master 2018-01-17 09:40:42 +00:00
Alexander Alekhin 4a086cf517 Merge pull request #10609 from csukuangfj:patch-1 2018-01-17 09:02:50 +00:00
razerhell fb22028be3 Merge pull request #10574 from razerhell:patch-1
* Newton's method can be more efficient

when we get the result of function distortPoint with a point (0, 0) and then undistortPoint with  the result, we get the point not (0, 0). and then we discovered that the old method is not convergence sometimes. finally we have gotten the right values by Newton's method.

* modify by advice  Newton's method...#10574

* calib3d(fisheye): fix codestyle, update theta before exit EPS check
2018-01-17 12:05:13 +03:00
Alexander Alekhin 6728b40ad3 Merge pull request #10602 from pengli:dnn 2018-01-17 08:58:25 +00:00
Li Peng e77af4ae33 MVN layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-17 17:11:32 +08:00
Li Peng 7bc017601f Power, Tanh and Channels ReLU layer ocl support
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-17 17:11:27 +08:00
csukuangfj decf6cab5e Improve the documentation for cv::completeSymm and cv::RANSACUpdateNumIters. 2018-01-17 08:05:39 +01:00
Fangjun Kuang 2b635edce6 fix issue #10612. 2018-01-16 23:47:15 +01:00
Csaba Keszegh 2aa18ca3e9 fix: use CXX_STANDARD when extracting compiler flags for PCH with GNUCXX
When compiling with cmake using -DCMAKE_CXX_STANDARD=11 use `-std=gnu++11`
for PCH compiler flags, otherwise it triggers an error:

   opencv_core_Release.gch: not used because `__cplusplus' defined as ` 201103L' not ` 199711L' [-Winvalid-pch]

Use CXX_EXTENSIONS property to select `gnu++11` or `c++11`.
Trying to mimic cmake logic here: https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmLocalGenerator.cxx#L1527-1557
2018-01-16 20:32:21 +01:00
Alexander Alekhin 4dc788ff84 Merge pull request #10606 from alalek:update_copyright_2018 2018-01-16 17:47:30 +00:00
Alexander Alekhin cec700525c core(ocl): fix deadlock in UMatDataAutoLock
UMatData locks are not mapped on real locks (they are mapped to some "pre-initialized" pool).

Concurrent execution of these statements may lead to deadlock:
- a.copyTo(b) from thread 1
- c.copyTo(d) from thread 2
where:
- 'a' and 'd' are mapped to single lock "A".
- 'b' and 'c' are mapped to single lock "B".

Workaround is to process locks with strict order.
2018-01-16 17:33:06 +03:00
Woody Chow 20b3261204 Propagate calculated Gaussian kernel size(ref). Otherwise, ipp_GaussianBlur will fail if user doesn't specify a kernel size. (#10579) 2018-01-16 17:15:23 +03:00
Alexander Alekhin ab8cf31ae9 Merge pull request #10581 from mshabunin:minor-issues-fixes 2018-01-16 13:19:32 +00:00
Maksim Shabunin c0ae812aa2 Add ThinLTO support for clang 2018-01-16 15:26:28 +03:00
Maksim Shabunin 8b87c4b96a Fixed several warnings produced by clang 6 and static analyzers 2018-01-16 15:26:28 +03:00
Alexander Alekhin cbb21f3cf2 Merge pull request #10595 from oqtvs:updateProtobuf 2018-01-16 12:18:18 +00:00
Li Peng 4189214d04 batch_norm layer ocl update
use a batch_norm ocl kernel to do the work

Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-16 19:01:58 +08:00
Alexander Alekhin e6ed853905 copyright: 2018 2018-01-16 13:55:42 +03:00
Vadim Pisarevsky 59915a3fc9 Merge pull request #10575 from ioxp:getFontScale 2018-01-16 10:51:04 +00:00
Alexander Alekhin 22816a4c43 protobuf: drop unused files 2018-01-15 21:15:23 +00:00
Alexander Alekhin 4d84999452 dnn: protobuf build warnings 2018-01-15 21:15:23 +00:00
oqtvs 6d4b778303 dnn: Updated protobuf files (3.5.1) 2018-01-15 15:51:38 +00:00
oqtvs df0b83332d Updated protobuf version to 3.5.1 2018-01-15 13:51:37 -02:00
Alexander Alekhin be1207e5e4 Merge pull request #10580 from woodychow:parallel_initUndistortRectifyMap 2018-01-15 15:05:32 +00:00
Alexander Alekhin 1255bd8d4b Merge pull request #10585 from dkurt:dnn_weightless_scale 2018-01-15 06:07:50 +00:00
woody.chow f5d9a2a9c1 Parallelize initUndistortRectifyMap 2018-01-15 09:20:35 +09:00
Alexander Alekhin edcbbee979 android: update build_sdk.py
- configuration files for ABIs configuration
- use builtin Android NDK's toolchain by default (force flag to use OpenCV's toolchain)
- default values for 'work_dir' and 'opencv_dir'
2018-01-14 16:05:48 +00:00
Alexander Alekhin 70ff4af4fa Merge pull request #10588 from dkurt:dnn_blobFromImage_ext 2018-01-14 08:12:29 +00:00
Dmitry Kurtaev 6a395d88ff dnn::blobFromImage with OutputArray 2018-01-13 18:20:24 +03:00
Dmitry Kurtaev 1f4fdfd599 Untrainable version of Scale layer from Caffe 2018-01-13 10:35:29 +03:00
Alexander Alekhin 0c00652f6b Merge pull request #10495 from alalek:cmake_java 2018-01-13 04:31:10 +00:00
Alexander Alekhin 91e10a3105 cmake: ocv_target_include_directories() handle SYSTEM directories 2018-01-13 02:12:39 +00:00
Alexander Alekhin 08086178bd android: fix SDK build
- fix Javadoc:
  - generate Javadoc after gather step to process all Java files (including Android 21)
  - generate into 'OpenCV-android-sdk' directly without additional copy step
- use smart copy/move utility functions ('shutil' doesn't well with existed destination)
- by default move files to reduce pressure on storage I/O (> 800Mb)
2018-01-13 02:12:39 +00:00
Alexander Alekhin 839cffdefe java: fix MacOS Java problem 2018-01-13 02:12:39 +00:00
Alexander Alekhin a362fd80df java: fix bindings generator
- fix imports override.
  Problem is observed with BoostDesc.

- add Ptr<> handling (constructor is protected from other packages).
  Observed in ximgproc:
      Ptr<StereoMatcher> createRightMatcher(Ptr<StereoMatcher> matcher_left)"
  where, "StereoMather" is from another package (calib3d)
2018-01-13 02:12:39 +00:00
Alexander Alekhin 1237faef80 java: disable highgui wrapped code 2018-01-13 02:12:39 +00:00
Alexander Alekhin a0d9d6db5b fixes for old CMake (2.8.12.2) 2018-01-13 02:12:39 +00:00
Alexander Alekhin 8533b45ce9 cmake: Java/Android SDK refactoring 2018-01-13 02:12:39 +00:00
Suleyman TURKMEN dcd4f8f5db Update documentation 2018-01-12 22:21:14 +03:00
Alexander Alekhin 0cad2d2a83 java: files rename
intermediate commit (to simplify code review)
2018-01-12 19:14:00 +00:00
Alexander Alekhin 73316e10a0 java(test): fix test names 2018-01-12 19:14:00 +00:00
Alexander Alekhin 69cd9cc1a6 Merge pull request #10582 from mshabunin:fix-ocl-concurrent-cache-name 2018-01-12 18:43:08 +00:00
Maksim Shabunin 594a93316c Fixed concurrent OpenCL cache folder name generation 2018-01-12 19:03:16 +03:00
SarenT c6d9ce8fd3 Merge pull request #10489 from SarenT:offset-mat_put
Adding capability to parse subsections of a byte array in Java bindings (#10489)

* Adding capability to parse subsections of a byte array in Java bindings. (Because Java lacks pointers. Therefore, reading images within a subsection of a byte array is impossible by Java's nature and limitations. Because of this, many IO functions in Java require additional parameters offset and length to define, which section of an array to be read.)

* Corrected according to the review. Previous interfaces were restored, instead internal interfaces were modified to provide subsampling of java byte arrays.

* Adding tests and test related files.

* Adding missing files for the test.

* Simplified the test

* Check was corrected according to discussion. An OutOfRangeException will be thrown instead of returning.

* java: update MatOfByte implementation checks / tests
2018-01-12 18:00:58 +03:00
Alexander Alekhin 9deaddcdff Merge pull request #10490 from alalek:cmake_android_refactor_copy_project_files 2018-01-12 12:23:37 +00:00
Alexander Alekhin 98b6e1d5fe Merge pull request #10515 from alalek:android_ndk16 2018-01-12 12:22:40 +00:00
Alexander Alekhin 57dc28fe99 Merge pull request #10504 from opentrack:fork 2018-01-11 18:47:27 +00:00
Stanislaw Halik c8794c89c7 modules/videoio: fix PS3Eye camera property window
v2: fix stray trailing whitespace

v3: only allow for up to one property window at the time

Opening multiple windows in the same process will just confuse
the camera filter or outright crash.

Suggested-by: @alalek

Also return whether a dialog was opened at the time.
2018-01-11 16:37:02 +01:00
Alexander Alekhin 18edd917e3 Merge pull request #10391 from ElenaGvozdeva:HAL_minMaxIdx 2018-01-11 14:15:40 +00:00
Philipp Hasper 6032d86e23 Added getFontScaleFromHeight() 2018-01-11 14:00:27 +01:00
Dmitry Kurtaev 64a9e92390 Merge pull request #10466 from dkurt:reduce_umat_try_2
* UMat blobs are wrapped

* Replace getUMat and getMat at OpenCLBackendWrapper
2018-01-10 21:50:54 +03:00
Alexander Alekhin b6075e11b8 Merge pull request #10549 from Sahloul:bug_fix/FLANN 2018-01-10 11:39:47 +00:00
Alexander Alekhin c19764e557 Merge pull request #10568 from alalek:fix_10565 2018-01-10 11:35:25 +00:00
Alexander Alekhin 71768de939 Merge pull request #10567 from terfendail:createsample_fix 2018-01-10 10:22:19 +00:00
Alexander Alekhin f943261847 Merge pull request #10566 from alalek:jasper_checks 2018-01-10 10:15:41 +00:00
Alexander Alekhin 7763b58a60 Merge pull request #10563 from alalek:issue_10540 2018-01-10 10:15:10 +00:00
Aaron Bray 6f8be3f693 Merge pull request #10497 from aaron-bray:msvc2017-findcuda
* Update to properly find the compiler tools for MSVC 2017

* FindCUDA: Fix the MSVC 2017 compiler tool locations
2018-01-10 12:32:34 +03:00
Alexander Alekhin 6113dc1b99 core: fix unresolved symbols from utils::fs 2018-01-09 19:29:50 +00:00
Alexander Alekhin 4d4f291553 Merge pull request #10513 from pengli:dnn 2018-01-09 19:24:28 +00:00
Vitaly Tuzov 29faf164b9 Fixed exception when ROI for generated sample is evaluated out of image borders 2018-01-09 20:30:39 +03:00
Alexander Alekhin 435a3e337b imgcodecs: add more Jasper checks for supported and tested cases 2018-01-09 19:06:03 +03:00
Alexander Alekhin f92e880d3d Merge pull request #10544 from alalek:issue_10535 2018-01-09 15:32:42 +00:00
Alexander Alekhin 8a76fadaa3 imgcodecs: add overflow checks 2018-01-09 18:05:24 +03:00
Alexander Alekhin be5247921d imgcodecs: remove assert() usage 2018-01-09 17:49:38 +03:00
Li Peng e3b42bf93b batch_norm and blank layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-09 21:58:46 +08:00
tobycollins f34a0a874a Merge pull request #10522 from tobycollins:issue10519 2018-01-09 15:54:36 +03:00
Alessandro de Oliveira Faria (A.K.A.CABELO) c71dc78cd4 Merge pull request #10502 from cabelo/save-dnn-yolo
Save video file (#10502)
2018-01-08 22:30:28 +03:00
Alexander Alekhin f3dde79ed6 cmake: allow BUILD_FAT_JAVA_LIB for non-Android targets too 2018-01-08 19:24:39 +00:00
Alexander Alekhin da0904df2d Merge pull request #10550 from dkurt:replace_psroi_pooling_tag 2018-01-08 19:19:00 +00:00
Alexander Alekhin c08a0edea1 Merge pull request #10545 from alalek:dnn_blob_manager_runtime_option 2018-01-08 13:22:44 +00:00
Dmitry Kurtaev 27b55ea761 Replace Caffe's psroi_pooling_param tag from 10001 to 10002 2018-01-08 13:29:20 +03:00
Hamdi Sahloul 8943441115 resolves #10548 - FLANN::knnSearch garbage bug (when kNN is larger than the dataset size) 2018-01-08 18:58:55 +09:00
Alexander Alekhin 6674a024fc dnn: add OPENCV_DNN_DISABLE_MEMORY_OPTIMIZATIONS runtime option
replaces REUSE_DNN_MEMORY compile-time option
2018-01-07 18:38:14 +00:00
Alexander Alekhin ee35263e48 Merge pull request #10537 from pnemonic78:master_false 2018-01-07 12:53:22 +00:00
Moshe 84596bff09 Bitwise "and false"
Bitwise "and false" is always false.
2018-01-07 10:12:53 +02:00
Alexander Alekhin e3a6d74945 Merge pull request #10536 from Sahloul:bug_fix/BLOB 2018-01-07 06:50:49 +00:00
Alexander Alekhin dd3c1d3b8c Merge pull request #10534 from ericrwx:videoio-psnr-typo-fix 2018-01-07 06:48:05 +00:00
Alexander Alekhin 3a5cd12dee Merge pull request #10527 from csukuangfj:local 2018-01-07 06:46:45 +00:00
Hamdi Sahloul 2d2499f610 BLOB - Support RGBA 2018-01-07 14:30:40 +09:00
Eric Wang c11895f529 Fix typo in video_input_psnr_ssim 2018-01-06 16:15:43 -08:00
LaurentBerger 004a1cd64a Merge pull request #10529 from LaurentBerger:ExampleGoogleNet
* Add a parameter labels to command line

* default value

* samples: caffe_googlenet.cpp minor refactoring
2018-01-06 23:44:47 +03:00
Alexander Alekhin d0b2e60edc Merge pull request #10514 from alalek:build_warnings 2018-01-05 20:54:01 +00:00
Alexander Alekhin 8e1f31f543 Merge pull request #10521 from DabatoIsCool:master 2018-01-05 23:56:07 +03:00
Fangjun Kuang a2869109f0 Improve the documentation for cv::Affine3. 2018-01-05 19:35:38 +01:00
Alexander Alekhin 431b3b4323 cmake(android): refactor copying of Android samples project files 2018-01-05 17:32:27 +00:00
Alexander Alekhin 9966903ae1 cmake(android): fix non-idempotent INSTALL scripts 2018-01-05 17:19:37 +00:00
Arthur Williams 8a67858068 Fixed missing #include "../precomp.hpp" 2018-01-05 15:10:39 +00:00
Alexander Alekhin f5862dacb6 Merge pull request #10432 from GlueCrow:bgfg_knn_fix 2018-01-05 14:16:17 +00:00
Li Peng 67f9406cbe add normalize_bbox layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-05 19:38:36 +08:00
Li Peng f99a135eda add eltwise layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-05 19:38:30 +08:00
Alexander Alekhin e1ec45c948 Merge pull request #10517 from alalek:perf_video_bgfg 2018-01-05 10:27:24 +00:00
Alexander Alekhin 8acd05f12a Merge pull request #10421 from cezheng:patch-1 2018-01-05 09:24:33 +00:00
Alexander Alekhin be01ea734d video(perf): add Mog2/KNN tests, fixed bug in prepareData()
prepareData() bug feeds the same image (the latest)
OCL perf test doesn't pass accuracy(!) check now, so this check is disabled.
2018-01-05 08:50:38 +00:00
Alexander Alekhin d01a2038ae cmake(android): update CMAKE_FIND_ROOT_PATH_MODE_* handling
Avoids this error message with CMake 3.10:
CMake Error: CMake was unable to find a build program corresponding to "Ninja".
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

Related changes is that pkg-config tool is found (/usr/bin/pkg-config).
2018-01-05 05:59:08 +00:00
Alexander Alekhin 0e6dd32858 cmake(android): update zlib alias condition
To use 'z' in Android.mk instead of absolute path from the build machine.
2018-01-05 04:52:17 +00:00
Alexander Alekhin bc7923e382 cmake(android): fix ccache detection (native Android toolchain with NDK_CCACHE)
To prevent this result:
    /usr/bin/ccache ccache <android-ndk-r16.1>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc ...
with:
    ccache: error: Recursive invocation (the name of the ccache binary must be "ccache")
2018-01-05 04:52:17 +00:00
Alexander Alekhin c608c232a2 3rdparty(libtiff): fix build with Android NDK 16
Compiler message:
tif_unix.c:170:12: error: call to 'mmap' declared with attribute error:
mmap is not available with _FILE_OFFSET_BITS=64 when using GCC until android-21.
Either raise your minSdkVersion, disable _FILE_OFFSET_BITS=64, or switch to Clang.
2018-01-05 04:52:17 +00:00
Alexander Alekhin 5f9bb6249e android: IPPICV static libraries workarounds for NDK 16 2018-01-05 04:52:17 +00:00
Alexander Alekhin b76a691bcf 3rdparty(protobuf): fix build with Android NDK 16 2018-01-05 04:52:17 +00:00
Alexander Alekhin bc6a355370 android(toolchain): fix find_path() behavior (zlib search problem) 2018-01-05 04:52:17 +00:00
Erik Man 37911e60d8 Allow compilation with unified include directory
This makes it possible to compile OpenCV with for instance ndk-r16
2018-01-05 04:52:17 +00:00
Alexander Alekhin c92aa95726 android(toolchain): detailed error message 2018-01-05 04:52:17 +00:00
Alexander Alekhin 59c6661db0 cmake: eliminate ninja generator warning (CMake 3.10), refactor code 2018-01-05 04:42:24 +00:00
Alexander Alekhin f0453bd853 build: eliminate warning
warning: 'layout.channel_layout::gchan' may be used uninitialized in this function [-Wmaybe-uninitialized]
2018-01-05 04:33:30 +00:00
Alexander Alekhin 116c8d0ddf build: eliminate warnings
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2018-01-05 04:30:08 +00:00
Coralie RACHEX 16821b877c Merge pull request #10493 from RachexCoralie:tiff32FC1Codec
* Load and save tiff images in CV_32FC1 format (1 channel of floats).

* Add test

* Fix error handling and resources leak. Improve test.
2018-01-04 15:51:58 +03:00
Alexander Alekhin 45c5f0a549 Merge pull request #10488 from alalek:cmake_simplify_configure_macro 2018-01-04 08:22:27 +00:00
Alexander Alekhin f46eff4eb0 Merge pull request #10492 from pengli:dnn 2018-01-04 04:40:02 +00:00
Li Peng 1073175c77 add opencl option for resnet_ssd_face sample
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-04 18:40:56 +08:00
Li Peng 34bfd7ef51 add ocl implementation of proposal layer
Signed-off-by: Li Peng <peng.li@intel.com>
2018-01-04 18:40:51 +08:00
Alexander Alekhin 94b236872c cmake: avoid unnecessary files creation in ocv_cmake_configure() 2018-01-02 19:16:51 +00:00
Alessandro de Oliveira Faria (A.K.A.CABELO) 7abaae39ec Merge pull request #10446 from cabelo:style-dnn-yolo
* add style draw in yolo

* fix sintaxe whitespace

* fix conversion from float to int

* sample refactoring

- minor code style fixes
- avoid confusing "bottom" names
- use cv::format
- always draw object detection/roi
2018-01-02 17:26:29 +03:00
Alexander Alekhin 940a90130d Merge pull request #10477 from berak:fix_bg_sub_tutorial 2018-01-02 03:21:16 +00:00
Alexander Alekhin a42ca2eeb3 Merge pull request #10483 from dkurt:fix_dnn_ssd_cpp_sample 2018-01-02 03:18:39 +00:00
Alexander Alekhin bf80c94125 Merge pull request #10481 from alalek:fix_10474 2018-01-02 03:17:59 +00:00
Dmitry Kurtaev d0580df339 Update C++ MobileNet-SSD object detection sample 2018-01-01 23:01:23 +03:00
Alexander Alekhin ea5a3e557f python: filter modules headers (from <module>/include directory) 2018-01-01 15:56:14 +00:00
Alexander Alekhin 22576f4dfe Merge pull request #10480 from alalek:fix_10479 2018-01-01 15:40:12 +00:00
Alexander Alekhin 4ca89db22d imgproc(hdr): fix bounds check in HdrDecoder::checkSignature() 2018-01-01 13:12:21 +00:00
berak dc88a2bcf2 video: clean up bg subtraction tutorial 2017-12-31 12:23:02 +01:00
Alexander Alekhin 71f4281080 Merge pull request #10473 from alalek:cmake_version_string_timestamp 2017-12-31 10:47:33 +00:00
Alexander Alekhin 4bd1e3dcbd cmake: avoid timestamp change of version_string.inc file 2017-12-30 20:26:15 +00:00
Alexander Alekhin 30373d2566 Merge pull request #10470 from victor-ludorum:caliper 2017-12-30 18:19:39 +00:00
victor-ludorum 914d9662d3 Merge pull request #10469 from victor-ludorum:stichingbranch
Updating stiching.cpp to resolve new line issue #10461 (#10469)
2017-12-30 21:22:02 +03:00
victor-ludorum ad23c10600 Updating rotcalipers.cpp to resolve issue #10096
Updating the documentation of the rotcalipers.cpp to resolve issue #10096
2017-12-30 10:21:46 +05:30
Alexander Alekhin a50a355e63 Merge pull request #10463 from alalek:avx512skx 2017-12-29 15:57:57 +00:00
Alexander Alekhin 7d67d60fb1 cmake(opt): AVX512_SKX 2017-12-29 07:18:11 +00:00
Alexander Alekhin fc1d85bf59 Merge pull request #10329 from jasjuang:master 2017-12-28 16:45:16 +00:00
Alexander Alekhin 125f9f0be1 Merge pull request #10410 from GlueCrow:master 2017-12-28 16:43:17 +00:00
Alexander Alekhin 8e7af7f089 Merge pull request #10456 from dkurt:dnn_allocate_mem_for_optimized_concat 2017-12-28 16:04:51 +00:00
Alexander Alekhin a65b5df5da Merge pull request #10416 from fenrus75:avx512 2017-12-28 15:56:56 +00:00
Alexander Alekhin 2370c8a058 Merge pull request #10429 from wxzs5:fix-documentation 2017-12-28 18:30:43 +03:00
Alexander Alekhin 2b3c140f04 Merge pull request #10436 from alalek:test_threads 2017-12-28 18:29:30 +03:00
Alexander Alekhin ec32022bdf Merge pull request #10444 from alalek:fix_asan_imgcodecs 2017-12-28 18:28:29 +03:00
Alexander Alekhin 898ca38257 cmake: AVX512 -> AVX_512F 2017-12-28 15:20:27 +00:00
Vinay Sharma 5aac909046 Merge pull request #10352 from vinay0410:write_pbm
* added write as pbm

* add tests for pbm

* imgcodecs: PBM support

- drop additional PBM parameters
- write: fix P1/P4 mode (no maxval 255 value after width/height)
- write: invert values for P1/P4
- write: P1: compact ASCII mode (no spaces)
- simplify pbm test
- drop .pxm extension (http://netpbm.sourceforge.net/doc/ doesn't know such extension)
2017-12-28 17:28:34 +03:00
Tom Becker 592f8d8c1b Merge pull request #10232 from TomBecker-BD:hough-many-circles
Hough many circles (#10232)

* Add Hui's optimization. Merge with latest changes in OpenCV.

* Use conditional compilation instead of a runtime flag.

* Whitespace.

* Create the sequence for the nonzero edge pixels only if using that approach.

* Improve performance for finding very large numbers of circles

* Return the circles with the larger accumulator values first, as per API documentation.
Use a separate step to check distance between circles. Allows circles to be sorted by strength first. Avoids locking in EstimateRadius which was slowing it down.
Return centers only if maxRadius == 0 as per API documentation.

* Sort the circles so results are deterministic. Otherwise the order of circles with the same strength depends on parallel processing completion order.

* Add test for HoughCircles.

* Add beads test.

* Wrap the non-zero points structure in a common interface so the code can use either a vector or a matrix.

* Remove the special case for skipping the radius search if maxRadius==0.

* Add performance tests.

* Use NULL instead of nullptr.
OpenCV should compile with C++98 compiler.

* Put test suite name first.
Use different test suite names for each test to avoid an error from the test runner.

* Address build bot errors and warnings.

* Skip radius search if maxRadius < 0.

* Dynamically switch to NZPointList when it will be faster than NZPointSet.

* Fix compile error: missing 'typename' prior to dependent type name.

* Fix compile error: missing 'typename' prior to dependent type name.
This time fix it the non C++ 11 way.

* Fix compile error: no type named 'const_reference' in 'class cv::NZPointList'

* Disable ManySmallCircles tests. Failing on Mac.

* Change beads image to JPEG for smaller file size.
Try enabling the ManySmallCircles tests again.

* Remove ManySmallCircles tests. They are failing on the Mac build.

* Fix expectations to check all circles.

* Changing case on a case-insensitive file system
Step 1: remove the old file names

* Changing case on a case-insensitive file system
Step 2: add them back with the new names

* Fix cmpAccum function to be strictly weak ordered.

* Add tests for many small circles.

* imgproc(perf): fix HoughCircles tests

* imgproc(houghCircles): refactor code

- simplify NZPointList
- drop broken (de-synchronization of 'current'/'mi' fields) NZPointSet iterator
- NZPointSet iterator is replaced to direct area scan
- use SIMD intrinsics
- avoid std exceptions (build for embedded systems)
2017-12-28 17:23:11 +03:00
Dmitry Kurtaev a9807d8f54 Allocate new memory for optimized concat to prevent collisions.
Add a flag to disable memory reusing in dnn module.
2017-12-28 16:45:53 +03:00
Alexander Alekhin d9c0231475 Merge pull request #10452 from mshabunin:mediasdk-device 2017-12-28 12:48:26 +00:00
Maksim Shabunin f0b606ff77 Changed VA device in MediaSDK session initialization 2017-12-28 14:10:36 +03:00
Alexander Alekhin 3542c98d45 Merge pull request #10445 from pengli:dnn 2017-12-28 04:43:41 +00:00
Li Peng 00f03c5739 Add ocl version FasterRCNN accuracy test
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-28 19:15:15 +08:00
Alexander Alekhin 4f6c493b87 imgcodecs(png): resolve ASAN issue with vars scope and setjmp() call 2017-12-28 02:43:07 +00:00
Alexander Alekhin 73c2a12449 Merge pull request #10435 from DabatoIsCool:master 2017-12-28 05:30:59 +03:00
Alexander Alekhin 99a9c10b57 Merge pull request #10424 from dkurt:fix_concat_optim 2017-12-28 01:26:14 +00:00
Alexander Alekhin 9b131b5f7e dnn(test): avoid calling of cv::setNumThreads() in tests directly
It is not necessary by default.
Also it breaks test system command-line parameters: --perf_threads / --test_threads
2017-12-27 15:16:41 +00:00
Alexander Alekhin 5232ea1ee6 ts(feature): add "--test_threads=<N>" command-line option 2017-12-27 15:16:41 +00:00
Arthur Williams d8d4ea857a Fixed #10433 2017-12-27 14:09:25 +00:00
Alexander Alekhin f3880c60a6 Merge pull request #10428 from pengli:dnn 2017-12-27 13:18:10 +00:00
Glue Crow 6045608330 Parallelization of BackgroundSubtractorKNN 2017-12-27 19:28:09 +08:00
wxzs5 0a4b1b8d68 Use class' method to set attribute value 2017-12-27 11:57:58 +08:00
wxzs5 25c17b107e Fix functions‘ class attribution error 2017-12-27 11:57:17 +08:00
Arjan van de Ven 2938860b3f Provide a few AVX512 optimized functions for the DNN module
This patch adds AVX512 optimized fastConv as well as the hookups
needed to get these called in the convolution_layer.

AVX512 fastConv is code-identical on a C level to the AVX2 one,
but is measurably faster due to AVX512 having more registers available
to cache results in.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
2017-12-26 16:00:17 +00:00
Alexander Alekhin 2e33844f0d Merge pull request #10419 from shortcipher3:master 2017-12-26 17:26:58 +03:00
Alexander Alekhin 1e4395a8e1 Merge pull request #10418 from mypopydev:master 2017-12-26 14:21:59 +00:00
Dmitry Kurtaev 70c605a03d Limit Concat layer optimization 2017-12-26 16:49:33 +03:00
Li Peng 84e2fa79a0 dnn(ocl4dnn): update pre-tuned kernel config
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-26 20:14:41 +08:00
Alexander Alekhin a8844de7b5 Merge pull request #10404 from alalek:build_fix_msvs2010 2017-12-26 05:51:16 +00:00
Jun Zhao 0369431ebd opencl/cvtclr_dx: fix not compile-time constants issue.
fix the "initializing global variables with values that are not
compile-time constants" issue in Intel SDK for OpenCL. The root cause
is when initializing global variables with value, the variable need is
compile-time constants.

Thanks Zheng, Yang <yang.zheng@intel.com>,
Chodor, Jaroslaw <jaroslaw.chodor@intel.com> give a help.

Signed-off-by: Liu,Kaixuan <kaixuan.liu@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
2017-12-26 13:44:37 +08:00
Chris Hall 50e8f91064 JS examples - FFT didn't work for non-square images because rows/cols were switched, Histogram example misspelled point 2017-12-25 22:01:48 -07:00
Sayed Adel fd0ac962fb core: replace raw intrinsics with universal intrinsics in copy.cpp
- use universal intrinsic instead of raw intrinsic
- add performance check for Mat::copyTo/setTo with mask
2017-12-26 05:30:32 +02:00
Arjan van de Ven fc8e848a54 Add basic plumbing for AVX512 support
The opencv infrastructure mostly has the basics for supporting avx512 math functions,
but it wasn't hooked up (likely due to lack of users)

In order to compile the DNN functions for AVX512, a few things need to be hooked up
and this patch does that

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
2017-12-25 21:06:52 +00:00
GlueCrow 26d288bd11 Optimize OpenCL BackgroundSubstractionMOG2 2017-12-23 21:57:17 +08:00
Alexander Alekhin adf43e7d2a build: fix MSVS2010 build error 2017-12-23 00:06:34 +00:00
Alexander Alekhin 047764f476 Merge tag '3.4.0' 2017-12-22 23:22:50 +00:00
Alexander Alekhin 6d4f66472e OpenCV version++
3.4.0
2017-12-22 19:46:21 +00:00
Alexander Alekhin eba176c299 Merge pull request #10398 from alalek:ml_simplify_simulated_annealing 2017-12-22 22:43:59 +03:00
Alexander Alekhin 00e43a9022 ml(ANN_MLP): ensure that train() call is always successful 2017-12-22 18:50:04 +00:00
Alexander Alekhin 9148a37624 Merge pull request #10401 from terfendail:resize_linear_revert 2017-12-22 16:18:50 +00:00
Alexander Alekhin 019b7c5a66 Merge pull request #10402 from dkurt:dnn_tf_quantized 2017-12-22 15:58:56 +00:00
Alexander Alekhin 59e825ee02 Merge pull request #10385 from pengli:dnn 2017-12-22 15:48:40 +00:00
Dmitry Kurtaev bcc669f3f7 TensorFlow weights dequantization 2017-12-22 17:25:10 +03:00
Vitaly Tuzov e5313246a7 Reverted calls to linear resize back to generic version for floating point matrices 2017-12-22 17:10:03 +03:00
Alexander Alekhin 97af608030 Merge pull request #10397 from mshabunin:fix-incorrect-assert 2017-12-22 14:07:02 +00:00
Li Peng 181b448c4d add one more convolution kernel tuning candidate
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-22 21:37:00 +08:00
Alexander Alekhin 289a8da39e ml: simplify interfaces of SimulatedAnnealingSolver 2017-12-22 16:35:48 +03:00
Vadim Pisarevsky b85c77283b Merge pull request #10396 from berak:fix_superres_sample 2017-12-22 13:35:36 +00:00
Vadim Pisarevsky 0742e12f0b Merge pull request #10265 from dkurt:nms_for_region_layer 2017-12-22 13:29:37 +00:00
Vadim Pisarevsky 9b659736da Merge pull request #10394 from alalek:cmake_fix_pch_pic_pie 2017-12-22 13:26:32 +00:00
Vadim Pisarevsky 69a6765bf7 Merge pull request #10387 from terfendail:resize23_perftest 2017-12-22 13:26:05 +00:00
Vadim Pisarevsky 3f68d6d8a7 Merge pull request #10392 from terfendail:bitexact_fallback 2017-12-22 13:23:55 +00:00
Alexander Alekhin 83b8cd0152 Merge pull request #10375 from tomoaki0705:buildWarningMSVC 2017-12-22 13:17:12 +00:00
Alexander Alekhin 4e542a65a3 Merge pull request #10390 from alalek:ocl_option_buffer_rect 2017-12-22 12:52:56 +00:00
Maksim Shabunin aa46e31c6d Replaced incorrect CV_Assert calls with CV_Error 2017-12-22 15:20:13 +03:00
berak ddbd074678 samples: check for valid input in gpu/super_resolution.cpp 2017-12-22 12:34:25 +01:00
Vitaly Tuzov 5fdb42a7c9 Added fallback to generic linear resize in case bit-exact resize of provided matrix isn't supported 2017-12-22 14:29:50 +03:00
Alexander Alekhin 6c252d8cdc cmake: fix -fPIC/-fPIE handling in precompiled headers (PCH) 2017-12-22 13:57:06 +03:00
Vadim Pisarevsky 636b7ec0c4 Merge pull request #10386 from terfendail:resizeexact_c3 2017-12-22 10:54:49 +00:00
Alexander Alekhin 534645a12f ocl: workaround option to disable usage of buffer "Rect" operations 2017-12-22 13:05:03 +03:00
Alexander Alekhin 09c84a0164 Merge pull request #10389 from wxzs5:yangli 2017-12-22 10:04:05 +00:00
elenagvo cd1c8693d8 HAL for minMaxIdx 2017-12-22 12:56:52 +03:00
Vadim Pisarevsky 325cbd7c84 Merge pull request #10364 from dkurt:dnn_smooth_tf_data_layout 2017-12-22 09:56:45 +00:00
wxzs5 b19cd93738 Remove redundant return variable 2017-12-22 17:13:57 +08:00
Ce Zheng 602b08d9c7 Update resize inline comments
Reading through the implementation, I feel this line of comment is not consistent with the actually code, so this is for correcting it.
2017-12-22 16:03:12 +08:00
Vitaly Tuzov 019162486c Disabled universal intrinsic based implementation for bit-exact resize of 3-channel images 2017-12-22 10:08:30 +03:00
Tomoaki Teshima fe7b3f1228 clean up the code
* disable the warning in CMake, not int the code using pragma
2017-12-22 08:42:21 +09:00
Alexander Alekhin 1bc1f3d311 Merge pull request #10374 from tomoaki0705:removeGstreamerTest 2017-12-21 19:02:13 +00:00
Vadim Pisarevsky a8a51db42b Merge pull request #10316 from terfendail:bitexact_c234 2017-12-21 18:56:54 +00:00
Vadim Pisarevsky 70d49446e9 Merge pull request #10369 from alalek:issue_10351 2017-12-21 18:48:38 +00:00
Alexander Alekhin a2620f72c7 Merge pull request #10370 from pengli:dnn 2017-12-21 15:36:23 +00:00
Tomoaki Teshima 50d44e06e3 avoid the test which is too strict
* confirmed test failure on Jetson TX1 and TX2
  * show the performance but not bit exact result
2017-12-22 00:14:10 +09:00
Li Peng c5fc8e03ff cleanup unnecessary macros in convolution ocl kernel
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-21 20:32:36 +08:00
Li Peng 0aa5e43a14 refactor candidate generation of convolution auto-tuning
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-21 23:05:54 +08:00
jasjuang 235889ddbb handle legacy VTK functions 2017-12-21 01:33:25 -08:00
Dmitry Kurtaev c67e75b68f Refactor NMS procedure at RegionLayer 2017-12-21 12:21:45 +03:00
Vadim Pisarevsky 047ad4ff71 Merge pull request #10366 from alalek:ocl_fix_cvtcolor_read 2017-12-21 08:33:59 +00:00
Vadim Pisarevsky ae8bb718cd Merge pull request #10340 from alalek:log_level_option 2017-12-21 08:33:18 +00:00
Alexander Alekhin 7bbe1a53cf imgcodecs(pxm): fix memcpy size 2017-12-21 01:10:24 +00:00
Vitaly Tuzov b6fe4cc807 Added performance tests for linear resize of 2 and 3-channel images 2017-12-20 18:11:21 +03:00
Vadim Pisarevsky eecb64a973 Merge pull request #10331 from arrybn:python_dnn_net 2017-12-20 14:30:27 +00:00
Vadim Pisarevsky e72a053cca Merge pull request #10354 from catree:add_python_sample_show_extrinsics 2017-12-20 14:23:01 +00:00
LaurentBerger e43997dbb5 Calcerror uses now weighted samples (#10346)
* Calcerror uses now sample weights

* catree comment in #10319
2017-12-20 17:24:46 +03:00
Alexander Alekhin 813ff37967 imgproc(ocl): fix RGB2RGBA kernel out of range access 2017-12-20 14:19:46 +00:00
Vadim Pisarevsky b8a24b36ce Merge pull request #10356 from dkurt:dnn_rfcn 2017-12-20 14:19:46 +00:00
Vadim Pisarevsky d2f13a8259 Merge pull request #10360 from sturkmen72:update_links 2017-12-20 14:19:17 +00:00
Vadim Pisarevsky 94d84c5fad Merge pull request #10358 from catree:add_tutorial_homography_panorama_stitching 2017-12-20 14:18:41 +00:00
Vitaly Tuzov 1eb2fa9efb Added universal intrinsics based implementations for CV_8UC2, CV_8UC3, CV_8UC4 bit-exact resizes. 2017-12-20 17:17:10 +03:00
Dmitry Kurtaev 7e48fa58eb Manage TensorFlow's NHWC data layout is smoother 2017-12-20 14:13:40 +03:00
catree 59ec224009 Update left_intrinsics.yml file with chessboard square_size=0.025 and with extrinsic parameters. Add camera_calibration_show_extrinsics.py, a Python sample that allows to display the extrinsics saved during the camera calibration process (cpp-example-calibration). 2017-12-20 12:06:08 +01:00
Dmitry Kurtaev 0ed2cbc931 R-FCN models support 2017-12-20 10:43:22 +03:00
Suleyman TURKMEN 1ff33e6e4d Update links 2017-12-20 02:55:29 +03:00
Alexander Alekhin b450811e4b core(logger): add log level configuration option 2017-12-19 22:57:07 +00:00
catree 87160cb297 Add Demo 5: Basic panorama stitching from a rotating camera in the homography tutorial. 2017-12-19 22:45:35 +01:00
Alexander Alekhin dcdd6af5a8 Merge pull request #10341 from pengli:dnn 2017-12-19 14:04:55 +00:00
Alexander Alekhin badc3bd312 Merge pull request #10348 from ElenaGvozdeva:Canny_HAL 2017-12-19 13:07:59 +00:00
Vadim Pisarevsky b1ed8bc0d1 Merge pull request #10347 from dkurt:dnn_remove_deprecated_importer 2017-12-19 11:03:06 +00:00
Li Peng 3b84acfc48 add ocl accuracy test for tf mobilenet ssd
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-19 18:38:55 +08:00
Li Peng 436d7e4eaf add depthwise convolution kernel
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-19 17:59:13 +08:00
Li Peng 910d7dab1f prior box layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-19 17:44:10 +08:00
elenagvo b0e9d76ced HAL for canny 2017-12-19 11:03:10 +03:00
Alexander Alekhin 05b259fe2e Merge pull request #10344 from tomoaki0705:fixBuildLibtiff 2017-12-18 17:00:45 +00:00
Dmitry Kurtaev 6aabd6cc7a Remove cv::dnn::Importer 2017-12-18 18:08:28 +03:00
Alexander Rybnikov 19c914db51 Changed wrapping mode for cv::dnn::Net::forward 2017-12-18 15:56:09 +03:00
Tomoaki Teshima c057d29192 fix compilation error on Visual Studio 2013 and earlier
- fix compilation error about "inline"
  - fix linker error about "_TIFF_snprintf_f"
2017-12-18 21:51:33 +09:00
Vadim Pisarevsky e29de5dd2b Merge pull request #10343 from tomoaki0705:suppressWarningEncoding 2017-12-18 10:53:24 +00:00
Suleyman TURKMEN 1654dfe3a9 Update samples (#10333)
* Update samples

* Update calib3d.hpp

* Update calib3d.hpp

* Update calib3d.hpp

* Update calib3d.hpp
2017-12-18 13:44:11 +03:00
Vadim Pisarevsky d3a124c820 Merge pull request #10339 from catree:add_doc_solvepnp_figure_desc 2017-12-18 09:13:06 +00:00
Vadim Pisarevsky 86cc4f3aa4 Merge pull request #10337 from dkurt:fix_pooling_layer 2017-12-18 09:11:54 +00:00
Alexander Alekhin 9de87d96cc Merge pull request #10338 from hrnr:fix-build 2017-12-18 06:52:08 +00:00
Tomoaki Teshima 65f502bc99 suppress warning on Visual Studio
* remove non ASCII character from the comment
2017-12-18 15:32:06 +09:00
catree fcb537bacd Add a figure and some formulas to illustrate the PnP pose estimation principle. 2017-12-17 21:38:22 +01:00
Jiri Horner 3dbf392d48 fix build with intrinsics enabled
* since #10231 opencv with instrumentation does not build
2017-12-17 20:23:15 +01:00
Dmitry Kurtaev 2b43d4f477 Fix default pooling layer type 2017-12-17 16:46:40 +03:00
Alexander Alekhin cac4a7e5b5 OpenCV version++
OpenCV 3.4.0-rc
2017-12-16 01:30:43 +03:00
Alexander Alekhin 3fddce67c6 experimental version++ 2017-12-16 01:30:36 +03:00
Alexander Alekhin a5c04baec1 Merge pull request #10326 from alalek:cmake_fixes 2017-12-15 22:26:00 +00:00
Alexander Alekhin 361bb1197f cmake: fix opencv_world build with contrib 2017-12-15 21:36:22 +00:00
Alexander Alekhin 0b33eb0929 cmake: fix ocv_target_compile_definitions() for world builds
fixes CUDA build
2017-12-15 23:30:53 +03:00
Alexander Alekhin 8ed1a274e1 cmake: fix missed include in libtiff 2017-12-15 23:28:09 +03:00
Alexander Alekhin 70e1b4ddf0 Merge pull request #10319 from catree:move_SimulatedAnnealingSolver_Impl_cpp
Move SimulatedAnnealingSolver::Impl in cpp file
2017-12-15 23:06:48 +03:00
Rostislav Vasilikhin bab86d65cb Merge pull request #10258 from savuor:fix/kmeans_channels
* kmeans: number of channels in _centers fixed

* fixedType() is checked now
2017-12-15 21:48:48 +03:00
Alexander Alekhin aef3019152 ml: fix SimulatedAnnealingSolver interface 2017-12-15 21:44:32 +03:00
Alexander Alekhin 28b19d6e3e Merge pull request #10313 from alalek:rename_fix
Fix file names
2017-12-15 21:40:22 +03:00
Alexander Alekhin e728ffd5bf Merge pull request #10320 from mshabunin:static-analysis-1 2017-12-15 16:53:34 +00:00
Alexander Alekhin 4b1455579f Merge pull request #10317 from alalek:cmake_pic_configure 2017-12-15 16:12:13 +00:00
Maksim Shabunin 1033f2b1bd Fixed 3 issues found by static analysis 2017-12-15 17:29:26 +03:00
catree 0a439570a0 Move SimulatedAnnealingSolver::Impl in cpp file. Fix some typos. 2017-12-15 14:09:59 +01:00
Alexander Alekhin 50365b7741 cmake: update CMAKE_POSITION_INDEPENDENT_CODE 2017-12-15 15:56:19 +03:00
Vadim Pisarevsky 62359f70ff Merge pull request #10306 from dkurt:faster_rcnn 2017-12-15 12:23:53 +00:00
Suleyman TURKMEN c5ed507737 Merge pull request #10287 from sturkmen72:update_createsamples_cpp
* update createsamples

adds command-line option -rngseed
replaces rand() -> theRNG()

* Update utility.cpp

* apps(createsamples): fix warpPerspective pixels access bug
2017-12-15 15:05:18 +03:00
Alexander Alekhin 7d4a67f2a8 Merge pull request #10315 from alalek:issue_10147_debug
dnn: more debug information
2017-12-15 15:01:12 +03:00
Alexander Alekhin d5f152494b fix file names 2017-12-15 14:59:35 +03:00
Sayed Adel 1b8acd662f core:ppc Fix several issues for VSX (#10303)
- fix conversion intrinsics compatibility with xlc
- implement odd-elements 2 to 4 conversion intrinsics
- improve implementation of universal intrinsic v_popcount
- rename FORCE_INLINE to VSX_FINLINE in vsx_utils.hpp
2017-12-15 14:03:46 +03:00
LaurentBerger 7ad308ea47 Simulated Annealing for ANN_MLP training method (#10213)
* Simulated Annealing for ANN_MLP training method

* EXPECT_LT

* just to test new data

* manage RNG

* Try again

* Just run buildbot with new data

* try to understand

* Test layer

* New data- new test

* Force RNG in backprop

* Use Impl to avoid virtual method

* reset all weights

* try to solve ABI

* retry

* ABI solved?

* till problem with dynamic_cast

* Something is wrong

* Solved?

* disable backprop test

* remove ANN_MLP_ANNEALImpl

* Disable weight in varmap

* Add example for SimulatedAnnealing
2017-12-15 13:57:39 +03:00
zhijackchen 6df8ac0342 Merge pull request #10283 from zhijackchen:exr_export
* Fix issue #10114
Convert table change
From:
CV_8U -> HALF
CV_8S -> HALF
CV_16U -> UINT
CV_16S -> UINT
CV_32S -> UINT
CV_32F -> FLOAT
To:
CV_8U -> HALF
CV_8S -> HALF
CV_16U -> UINT
CV_16S -> FLOAT
CV_32S -> FLOAT loss precision
CV_32F -> FLOAT
Signed integer can't be presented well with UINT. Even adjust bias, CV16S and CV32S will be confused when load from exr file.
Also fix CV_8S negative value incorrect bug

* EXR import and export
imread() from EXR returns CV_32F only
imwrite() accepts CV_32 cv::Mat only and stores FLOAT images by default. Add imwrite() flag to store in HALF format.

* fix compiling error

* clean up

* fix EXR import issues
2017-12-15 12:23:44 +03:00
Dmitry Kurtaev 08112f3821 Faster-RCNN models support 2017-12-15 12:16:21 +03:00
Alexander Alekhin 18ff806d5b Merge pull request #10304 from catree:add_tutorial_homography 2017-12-15 08:53:35 +00:00
Alexander Alekhin d0684ac139 Merge pull request #10309 from seiko2plus:issue10308 2017-12-15 08:43:10 +00:00
Sayed Adel a8ae9cab08 3rdparty:libpng[1.6.34] Add missing support for PowerPC/VSX 2017-12-15 03:00:07 +00:00
Vadim Pisarevsky 84535a60f2 Merge pull request #10307 from savuor:fix/expect_softfloat 2017-12-14 21:00:46 +00:00
Tomoaki Teshima ca1a0a1108 core: remove raw SSE2/NEON implementation from convert.cpp (#9831)
* remove raw SSE2/NEON implementation from convert.cpp
  * remove raw implementation from Cvt_SIMD
  * remove raw implementation from cvtScale_SIMD
  * remove raw implementation from cvtScaleAbs_SIMD
  * remove duplicated implementation cvt_<float, short>
  * remove duplicated implementation cvtScale_<short, short, float>
  * add "from double" version of Cvt_SIMD
  * modify the condition of test ConvertScaleAbs

* Update convert.cpp

fixed crash in cvtScaleAbs(8s=>8u)

* fixed compile error on Win32

* fixed several test failures because of accuracy loss in cvtScale(int=>int)

* fixed NEON implementation of v_cvt_f64(int=>double) intrinsic

* another attempt to fix test failures

* keep trying to fix the test failures and just introduced compile warnings

* fixed one remaining test (subtractScalar)
2017-12-15 00:00:35 +03:00
Rostislav Vasilikhin 7d18f49a49 SoftFloat tests: assert => expect 2017-12-14 21:03:25 +03:00
Alexander Alekhin 0da947e6b3 dnn: more debug information 2017-12-14 19:21:17 +03:00
Alexander Alekhin 6cedc82799 Merge pull request #10274 from alalek:update_3rdparty 2017-12-14 15:10:32 +00:00
catree b417fb0939 Add tutorial and codes for the homography tutorial. 2017-12-14 15:40:10 +01:00
Alexander Alekhin cd4176104d 3rdparty: update libwebp 0.6.1 2017-12-14 14:49:31 +03:00
Alexander Alekhin 5c709f4aaa 3rdparty: update libtiff 4.0.9 2017-12-14 14:49:31 +03:00
Alexander Alekhin ae5e1f8ece 3rdparty: eliminate jasper build warning 2017-12-14 14:49:31 +03:00
Alexander Alekhin a9de6900e5 cmake(3rdparty): BUILD_ options before WITH_ options 2017-12-14 14:49:31 +03:00
Suleyman TURKMEN 83b5b86f7d 3rdparty: update libjpeg 9b 2017-12-14 14:49:31 +03:00
Alexander Alekhin ca46171246 3rdparty: libpng patch 2017-12-14 14:49:31 +03:00
Suleyman TURKMEN d4e2e6279c 3rdparty: update libpng 1.6.34 2017-12-14 14:49:30 +03:00
Suleyman TURKMEN 197078e331 3rdparty: update zlib 1.2.11 2017-12-14 14:49:30 +03:00
Vadim Pisarevsky d0d2faf551 Merge pull request #10294 from alalek:fix_copyToMask_dst_initialization 2017-12-14 11:05:09 +00:00
Vadim Pisarevsky a4b5eabccf Merge pull request #10299 from alalek:cmake_imported_configuration_remap 2017-12-14 11:01:02 +00:00
Vadim Pisarevsky 7b701fee60 Merge pull request #10302 from alalek:issue_10254 2017-12-13 17:31:40 +00:00
Vadim Pisarevsky 99183e98d3 Merge pull request #10293 from alalek:fix_persistence_with_deprecated_traits 2017-12-13 17:30:23 +00:00
Alexander Alekhin c231472ad6 Merge pull request #10290 from tomoaki0705:fixVS2012Round 2017-12-13 15:30:21 +00:00
Alexander Alekhin 9930076dc5 core(test): avoid filename duplicates in tests 2017-12-13 18:21:55 +03:00
Tomoaki Teshima ecb6bcf2e0 fix build error on Visual Studio 2012
* round doesn't exists in standard library of Visual Studio 2012
  * apply the correct computation of ROI
2017-12-13 17:40:07 +03:00
Alexander Alekhin 74f1295756 Merge pull request #10295 from alalek:cmake_workaround_download_log_issue 2017-12-13 13:52:31 +00:00
Alexander Alekhin 3966595f9a Merge pull request #10300 from alalek:cmake_timestamp_update 2017-12-13 13:51:09 +00:00
Alexander Alekhin 0fcc6f5d60 Merge pull request #10282 from alalek:cmake_tbb_version 2017-12-13 13:50:24 +00:00
Alexander Alekhin 3e45795232 cmake: update timestamp status
- avoid unnecessary rebuilding of OpenCV libraries
- use timestamp of the first launch of CMake
- to return to previous behavior use `-UOPENCV_TIMESTAMP` CMake option
2017-12-13 15:31:36 +03:00
Vitaly Tuzov 51cb56ef2c Implementation of bit-exact resize. Internal calls to linear resize updated to use bit-exact version. (#9468) 2017-12-13 15:00:38 +03:00
Alexander Alekhin f39ee9c6a1 cmake: rework MAP_IMPORTED_CONFIG to prevent unintended build failures
Introduce CMake variable OPENCV_MAP_IMPORTED_CONFIG which controls this behaviour
Added defaults for MSVS targets
2017-12-13 14:30:27 +03:00
Vadim Pisarevsky 84ee4d701a Merge pull request #10297 from tomoaki0705:suppressOclWarning 2017-12-13 07:56:35 +00:00
Tomoaki Teshima 267c5a747b suppress warnings on OpenCL build
* stop re-enabling the warning C4127
  * disabling is done in CMakeLists.txt
2017-12-13 15:07:51 +09:00
Alexander Alekhin edadcfa7d9 cmake: add option to workaround issue observed with old CMake
CMake message contains this: "Invalid escape sequence \"
2017-12-12 19:00:42 +03:00
Alexander Alekhin 62ed6cdc74 core: fix copyTo(with mask) dst initialization 2017-12-12 18:40:13 +03:00
Alexander Alekhin ce20efb8e7 Merge pull request #9804 from woodychow:optimize_cveigen 2017-12-12 14:58:04 +00:00
Alexander Alekhin 825b14278e core: fix persistence with deprecated traits 2017-12-12 17:07:36 +03:00
Alexander Alekhin 8d4777c81d cmake: generate tbb version file 2017-12-12 16:12:32 +03:00
Alexander Alekhin c0b6061a5e core(test): Core_Eigen.vector_32 use relative norm 2017-12-12 15:07:31 +03:00
Alexander Alekhin 2324674dfb core(test): update eps in testEigen<float>: 1e-6 => 1e-4 2017-12-12 15:07:31 +03:00
Alexander Alekhin 53b5afbba9 core(test): refactor Java Eigenvalues/PCA tests 2017-12-12 15:07:31 +03:00
Alexander Alekhin d48d2d7fe2 core(test): refactor PCA test
- CV_L2 -> relative NORM_L2
- eigenEps: 1e-6 ==> 1e-4
- evalEps: 1e-6 ==> 1e-5
- evecEps: 1e-3 ==> 5e-3
- RNG seed: 12345
- drop non-informative legacy test code (ts->printf, etc)
2017-12-12 15:07:27 +03:00
Alexander Alekhin b0bce60c16 Merge pull request #10284 from alalek:dnn_debug_error 2017-12-12 09:33:50 +00:00
Alexander Alekhin eff42f6387 dnn: more debug info 2017-12-12 12:04:10 +03:00
Alexander Alekhin 5404930112 Merge pull request #9260 from Cartucho:add_python_signatures 2017-12-12 08:58:14 +00:00
Alexander Alekhin e49febb70f Merge pull request #10269 from terfendail:softdouble_round 2017-12-11 12:48:03 +00:00
Vadim Pisarevsky 7e680bd9ff Merge pull request #10215 from dkurt:dnn_js 2017-12-11 12:47:52 +00:00
Vadim Pisarevsky 766a0c0f25 Merge pull request #10277 from pengli:dnn 2017-12-11 12:44:21 +00:00
Vadim Pisarevsky 9fa505027a Merge pull request #10263 from mshabunin:embedded-build 2017-12-11 12:42:45 +00:00
Vadim Pisarevsky 61c2f094b9 Merge pull request #10280 from alalek:python_cv2_to_cv 2017-12-11 12:39:00 +00:00
Vadim Pisarevsky 558b17dede Merge pull request #10231 from alalek:ocl_refactor_program_api 2017-12-11 12:34:22 +00:00
Vitaly Tuzov 86b128dbb3 Added implementation of softdouble rounding to int64_t 2017-12-11 14:29:32 +03:00
Alexander Alekhin 5560db73bf python: 'cv2.' -> 'cv.' via 'import cv2 as cv' 2017-12-11 13:46:55 +03:00
Maksim Shabunin 7349b8f5ce Build for embedded systems 2017-12-11 13:27:37 +03:00
Li Peng 88507fa051 add command parser to caffe googlenet sample
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-11 17:54:50 +08:00
Alexander Alekhin 9665dde678 Merge pull request #10112 from haritha1313:bugfix_doc1 2017-12-10 20:54:29 +00:00
Alexander Alekhin 768f4cb7bc python: 'sub-module' for binding sources and documentation meta information 2017-12-09 21:01:46 +00:00
Alexander Alekhin b15bc194ef doc: finalize Python signatures injection 2017-12-09 21:01:46 +00:00
Haritha be4fa03fac crop parameter usage in blobFromImage() calls 2017-12-09 17:13:35 +05:30
tribta 164a77e7ad add methods 2017-12-09 02:56:19 +00:00
tribta 6174f62710 Sample for functions 2017-12-09 02:56:19 +00:00
Alexander Alekhin d715badbde doc: update Python signatures generation
- drop dependency on 'import cv2', use pyopencv_signatures.json instead
- try to make generator idempotent
2017-12-09 02:56:19 +00:00
tribta 912de363f4 Using __doc__ to add Python signatures to the docs. 2017-12-09 02:56:19 +00:00
Alexander Alekhin 66e09bc9a4 Merge pull request #10260 from native-api:ffmpeg_load_from_package 2017-12-08 20:58:17 +00:00
Vadim Pisarevsky cd7526c973 Merge pull request #10266 from ChristofKaufmann:warp_documentation 2017-12-08 18:48:48 +00:00
Vadim Pisarevsky c24f10d647 Merge pull request #10268 from dkurt:fix_scale_layer 2017-12-08 18:46:50 +00:00
Ivan Pozdeev 4bee238cf8 GetModuleFileName() doesn't reset last error on success 2017-12-08 21:11:41 +03:00
Dmitry Kurtaev f503515082 JavaScript bindings for dnn module 2017-12-08 18:33:48 +03:00
Dmitry Kurtaev e307065c8e Scale layer in case of 2D inputs 2017-12-08 17:34:59 +03:00
Elena Gvozdeva 6185f7209e Merge pull request #10172 from ElenaGvozdeva:eg/HAL_sobel
* add HAL for SobelFilter
* add HAL for pyrDown
* add HAL for Scharr
2017-12-08 16:36:24 +03:00
Alexander Alekhin a2811d93dd Merge pull request #10253 from alalek:cmake_disable_optimization 2017-12-08 11:35:11 +00:00
Christof Kaufmann 9c5b231b2d doc: Add type restriction note for geometric transformations
This is added according to #7862.
2017-12-08 12:33:51 +01:00
Alexander Alekhin f2070c9f5d Merge pull request #10255 from dkurt:dnn_roi_pooling 2017-12-08 11:20:07 +00:00
Alexander Alekhin 34e414dc31 Merge pull request #10264 from terfendail:createsamples 2017-12-08 11:02:49 +00:00
Vitaly Tuzov 92d23fb1a8 updated createsamples app utility functions to new c++ API from old c 2017-12-08 12:23:44 +03:00
Alexander Alekhin f8b14a1612 Merge pull request #10262 from Riyuzakii:10209 2017-12-08 08:49:10 +00:00
Riyuzakii 8f1345091e Remove typo/repeated code block 2017-12-08 12:10:00 +05:30
Dmitry Kurtaev 17dcf0e82d ROIPooling layer 2017-12-07 19:04:38 +03:00
Alexander Alekhin d329674f68 Merge pull request #8198 from mshabunin:cmakeex 2017-12-07 15:02:41 +00:00
Alexander Alekhin cadd1a0074 cmake: CV_DISABLE_OPTIMIZATION disables IPP, OpenCL, Eigen and LAPACK too 2017-12-07 17:54:37 +03:00
Alexander Alekhin 1625ffa2cf ocl: opencl_custom_kernel.cpp example 2017-12-07 16:50:07 +03:00
Alexander Alekhin 72de03d749 Merge pull request #10243 from berak:dnn_fix_mobilenet_sample 2017-12-07 09:54:18 +00:00
Alexander Alekhin 0be1bf551b Merge pull request #10244 from dkurt:issue_10239 2017-12-07 09:43:16 +00:00
Dmitry Kurtaev ef0650179b Fix conv/deconv/fc layers FLOPS computation 2017-12-07 11:42:04 +03:00
Maksim Shabunin 38c62f6461 Added option to disable gc-sections flag 2017-12-07 10:28:58 +03:00
Pavel Rojtberg 6fb9d42c3f Hid symbols in static builds, added LTO flags, removed exports from ts 2017-12-07 10:26:48 +03:00
Alexander Alekhin ef04ca9e0f Merge pull request #10241 from alalek:ios_fix_build_warnings 2017-12-06 16:26:51 +00:00
Alexander Alekhin 6074f92d48 Merge pull request #10228 from pengli:dnn_new 2017-12-06 15:50:12 +00:00
Alexander Alekhin 0b688cd23f Merge pull request #10240 from alalek:dnn_perf_ssd 2017-12-06 15:41:18 +00:00
Li Peng 59cbaca4d3 detection_output layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-06 22:35:59 +08:00
Li Peng 66feea6cac region layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-07 02:26:46 +08:00
Li Peng 7707c9bfba reorg layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-07 02:26:46 +08:00
Li Peng 85b1c4060c support axis in concat layer ocl path
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-07 02:26:46 +08:00
Li Peng 07bec6bdcd reshape layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-07 02:26:40 +08:00
berak 159ea22b6b dnn: add a check for webcam properties in ssd_mobilenet sample 2017-12-06 14:55:37 +01:00
Alexander Alekhin 682bd2eedf Merge pull request #10236 from alalek:ocl_skip_unstable_tests 2017-12-06 13:48:51 +00:00
Alexander Alekhin d8a737b4b0 dnn: SSD performance test 2017-12-06 15:55:18 +03:00
Alexander Alekhin af1ea1f7ac build: fix iOS warnings with armv7s, switch precommit armv7 -> armv7s 2017-12-06 15:49:45 +03:00
Alexander Alekhin 3a8a73ef6c ocl: skip unstable tests
during pre-commit testing
2017-12-06 12:58:35 +03:00
Vadim Pisarevsky 4781f0a337 Merge pull request #10024 from iago-suarez:bugfix-lsd-multiple-imgs-issue#10023 2017-12-06 09:01:37 +00:00
Vadim Pisarevsky 4b8275061e Merge pull request #10058 from ElenaGvozdeva:eg/HAL 2017-12-05 20:56:24 +00:00
Vadim Pisarevsky 7933fff0dd Merge pull request #10226 from vermashresth:bugfix 2017-12-05 20:53:53 +00:00
Vadim Pisarevsky 2c4d3d92c7 Merge pull request #10221 from dkurt:non_spatial_torch_layers 2017-12-05 20:52:00 +00:00
Alexander Alekhin 15b909e80b ocl: add SPIR Program loading test
SPIR kernels are located in opencv_extra
2017-12-05 22:25:14 +03:00
Alexander Alekhin a82d2363f4 ocl: refactor Program API
- don't store ProgramSource in compiled Programs (resolved problem with "source" buffers lifetime)
- completelly remove Program::read/write methods implementation:
  - replaced with method to query RAW OpenCL binary without any "custom" data
- deprecate Program::getPrefix() methods
2017-12-05 22:25:14 +03:00
Alexander Alekhin 13c4a02157 ocl: low-level API to support OpenCL binary programs 2017-12-05 22:25:14 +03:00
Alexander Alekhin 0042bacd88 Merge pull request #10207 from cabelo:cabelo-opencv
Repair: incorrect display of class in DNN
2017-12-05 21:23:23 +03:00
Shresth Verma ffe49bdebe fixed createsamples info message 2017-12-05 23:24:22 +05:30
Alexander Alekhin 4d721e368a Merge pull request #10218 from catree:fix_cuda_integral 2017-12-05 15:10:00 +00:00
Li Peng 7b7033ac60 permute layer ocl implementation
Signed-off-by: Li Peng <peng.li@intel.com>
2017-12-05 22:10:05 +08:00
Alexander Alekhin 552c3ba869 Merge pull request #10230 from vpisarev:macos_detect_lapack 2017-12-05 13:48:23 +00:00
Juha Reunanen 5b41599911 Fix pointPolygonTest for large coordinate values (#10222)
* Add test that fails

* Fix integer pointPolygonTest for large coordinate values

* Review fixes:
- change type from long long to int64
- move test code to test_contours.cpp, and make it C++98 compliant

* Hopefully fix compiler error by using push_back instead of emplace_back
2017-12-05 15:49:44 +03:00
Vadim Pisarevsky b833d512ec fixed native Lapack detection script on Mac/iOS (where native Lapack is a part of Accelerate framework) 2017-12-05 15:45:37 +03:00
Vadim Pisarevsky 5ce38e516e Merge pull request #10223 from vpisarev:ocl_mac_fixes
* fixed OpenCL functions on Mac, so that the tests pass

* fixed compile warnings; temporarily disabled OCL branch of TV L1 optical flow on mac

* fixed other few warnings on macos
2017-12-05 13:32:28 +03:00
woody.chow 611cf8d86f Use Eigen::SelfAdjointEigenSolver in cv::eigen 2017-12-05 02:40:55 +03:00
alessandro faria df5ec54fb8 Repair: incorrect display of class name 2017-12-04 22:00:54 +03:00
Alexander Alekhin a3ec2ac3c5 Merge pull request #10176 from sturkmen72:update_train_hog 2017-12-04 16:24:42 +00:00
Vadim Pisarevsky 69830b1851 Merge pull request #10216 from dkurt:dnn_face_detector_extra_paddings 2017-12-04 13:14:51 +00:00
Dmitry Kurtaev bbbec300a6 nn.BatchNormalization and nn.Dropout layers from Torch 2017-12-04 12:57:21 +03:00
catree 6d06fcb414 Fix CUDA integral. 2017-12-04 02:22:52 +01:00
Suleyman TURKMEN 2aa380752c Update train_HOG.cpp 2017-12-03 23:47:54 +03:00
Dmitry Kurtaev 03850008b9 Extra paddings for face detector layers 2017-12-03 17:04:53 +03:00
Alexander Alekhin fc9e031454 Merge pull request #10212 from alalek:ocl_cache_with_address_bits 2017-12-01 15:42:28 +00:00
Alexander Alekhin 74d321d901 Merge pull request #10199 from alalek:fix_calib3d_fisheye_rectify_test 2017-12-01 15:26:50 +00:00
elenagvo 7bfb38055c remove matrix release 2017-12-01 14:38:00 +03:00
elenagvo 81519537ae fix the parameters order 2017-12-01 14:38:00 +03:00
elenagvo 0f12351a41 fix accelerators order 2017-12-01 14:38:00 +03:00
elenagvo 7aadbc9607 remove complex data structs 2017-12-01 14:38:00 +03:00
elenagvo ce65975625 call HAL for GaussianBlur is fixed 2017-12-01 14:38:00 +03:00
elenagvo a25c443d1f add perf test for boxFilter CV8U to CV16U 2017-12-01 14:38:00 +03:00
elenagvo c2c7333107 add hal for GaussianBlur 2017-12-01 14:38:00 +03:00
elenagvo cb9e110adb add HAL for BoxFilter 2017-12-01 14:38:00 +03:00
Alexander Alekhin 0595ab3eef ocl: fix usage of invalid OpenCL cache on mixed 64/32-bit platforms
Observed during launch of 32/64-bit applications on Windows.
Added '32-bit' prefix for 32-bit OpenCL devices. No prefix on 64-bit configurations.
2017-12-01 14:20:18 +03:00
Maksim Shabunin 800294ad4b Merge pull request #10060 from allnes:videoio_tests_backend 2017-12-01 09:38:19 +00:00
Alexander Alekhin ac58405a71 calib3d: fix fisheye stereoRectify test
- don't write into testdata directory
- check matrices instead of result images
2017-11-30 15:50:29 +03:00
Alexander Alekhin 9bf6ec6fe1 Revert "Adapted estimateNewCameraMatrix to make it work with pincushion-like distortion."
This reverts commit 5384a2205a.
2017-11-30 15:47:48 +03:00
Vadim Pisarevsky 7ae19467b5 Merge pull request #10171 from ElenaGvozdeva:Threshold 2017-11-30 10:02:47 +00:00
Vadim Pisarevsky fe95d5a720 Merge pull request #10200 from alalek:cmake_fix_dependencies 2017-11-30 10:00:51 +00:00
Alexander Alekhin 0105518422 Merge pull request #10190 from seiko2plus:issue10189 2017-11-30 07:16:12 +00:00
Alexander Alekhin 22c0bb7dc9 cmake: fix WITH_VTK usage
'WITH_' variables is intended to enable CMake scripts with some autodetection logic.
'WITH_' can be off, but components is really enabled via command-line options
with proper variables setup (including 'HAVE_').
2017-11-29 21:43:09 +03:00
Alexander Alekhin b19f81b35b cmake: update BUILD_DOCS / ENABLE_PYLINT options, add BUILD_JAVA 2017-11-29 21:43:09 +03:00
Alexander Alekhin 28717d0437 cmake: don't try to detect Python libraries for iOS builds
Python executable is not used to generate code for iOS builds
2017-11-29 21:43:09 +03:00
Alexander Alekhin 5ea50d1e8d cmake: don't use Eigen auto-detection in cross-compiling modes
Sometimes it tries to use host '/usr/include' directory and garbages
compiler flags with invalid '-I /usr/include'
2017-11-29 21:43:09 +03:00
Alexander Alekhin e703c3090a Merge pull request #10184 from catree:solvePnP_iterative_guess_3_pts 2017-11-29 18:24:04 +00:00
Alexander Alekhin a79d0e19ad Merge pull request #10194 from mshabunin:fix-gcc7-warnings 2017-11-29 18:22:40 +00:00
Alexander Alekhin 872500c4a5 Merge pull request #10193 from alalek:fix_ios_cmake_3.10 2017-11-29 16:32:31 +00:00
Maksim Shabunin 7eb1065944 Fixed/disabled warnings produced by GCC 7 2017-11-29 17:21:22 +03:00
Alexander Alekhin cdc2aca2cc cmake: fix iOS build with CMake 3.10 2017-11-29 15:57:32 +03:00
Alexander Alekhin cc2ee923e4 Merge pull request #10164 from pengli:dnn 2017-11-29 12:05:10 +00:00
Vadim Pisarevsky f5dba12762 Merge pull request #10180 from alalek:ocl_avoid_unnecessary_initialization 2017-11-29 11:42:22 +00:00
Vadim Pisarevsky 86ff4a1ccf Merge pull request #10182 from romanc:fix/divByZeroSimdDouble 2017-11-29 10:01:58 +00:00
Vadim Pisarevsky 614e254331 Merge pull request #10170 from LaurentBerger:Issue10166 2017-11-29 09:51:20 +00:00
Sayed Adel 6fe6436162 core:ppc Fixed compilation with xlc, clang.
- Use EXPECT_TRUE instead of EXPECT_EQ for comparing NULL in xlc
- Added support for int64 to vec_promote in xlc, clang
- Fixed v_rotate_right in xlc
2017-11-29 07:48:26 +00:00
Alexander Alekhin 29e4a4940d Merge pull request #10185 from alalek:fix_build_xcode_9.1 2017-11-28 18:42:18 +00:00
Alexander Alekhin f7913e2c84 build: eliminate Xcode 9.1 warnings
- 3rdparty/libjasper/jas_getopt.c:129:25: warning: this function declaration is not a prototype [-Wstrict-prototypes]
- clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
2017-11-28 17:48:40 +03:00
elenagvo 73ac5321f5 fix threshold HAL 2017-11-28 17:42:29 +03:00
catree 2e56a47f8c Allow to use 3 points in SolvePnP if SOLVEPNP_ITERATIVE and useExtrinsicGuess==true. Add bibtex citations for P3P. Update SolvPnP tests. 2017-11-28 15:04:59 +01:00
Vadim Pisarevsky 666fc0ba69 Merge pull request #9986 from terfendail:drawcontours_docfix 2017-11-28 13:19:06 +00:00
Vadim Pisarevsky cfd845ac07 Merge pull request #10141 from LaurentBerger:MLP_ReLU 2017-11-28 13:17:43 +00:00
Vadim Pisarevsky 2a8344f75b Merge pull request #10149 from mshabunin:fix-saturate-intrin 2017-11-28 13:17:10 +00:00
elenagvo 762138e77e define adaptiveMethod and thresholdType for HAL 2017-11-28 16:02:06 +03:00
Roman Cattaneo d381e499ea Fixes Issue #10181
This PR fixes incorrect division by zero handling in template
specialization of `Div_SIMD` for type `double`.
2017-11-28 13:48:40 +01:00
Alexander Alekhin 0ed3209b00 ocl: avoid unnecessary loading/initializing OpenCL subsystem
If there are no OpenCL/UMat methods calls from application.

OpenCL subsystem is initialized:
- haveOpenCL() is called from application
- useOpenCL() is called from application
- access to OpenCL allocator: UMat is created (empty UMat is ignored) or UMat <-> Mat conversions are called

Don't call OpenCL functions if OPENCV_OPENCL_RUNTIME=disabled
(independent from OpenCL linkage type)
2017-11-28 14:02:42 +03:00
Vadim Pisarevsky bc547c4290 Merge pull request #10124 from zhongwuzw:master 2017-11-28 10:53:00 +00:00
Vadim Pisarevsky 9e4a8a31e1 Merge pull request #10173 from dkurt:update_priorbox_layer 2017-11-28 10:51:06 +00:00
Vadim Pisarevsky b900496c40 Merge pull request #10152 from alalek:py_fix_isalgorithm 2017-11-28 10:46:41 +00:00
Alexander Alekhin abad8977b6 Merge pull request #9247 from paroj:wrap_alog_rw 2017-11-28 10:35:33 +00:00
Maksim Shabunin 6c135261b2 Universal Intrinsics: aligned v_pack behavior on different platforms, fixed 64-bit register on ARM, added more saturate_cast variants 2017-11-28 13:31:56 +03:00
LaurentBerger a44573c43b Add ReLU and LeakyReLU activation function in ml module 2017-11-28 11:02:05 +01:00
Alexander Alekhin cd689c640d Merge pull request #10177 from alalek:cmake_update_optimization_filter 2017-11-28 09:17:42 +00:00
Alexander Alekhin 378e05c16b Merge pull request #10178 from alalek:ts_message 2017-11-28 05:39:29 +00:00
Alexander Alekhin 486cfd1040 ts: detailed message 2017-11-27 19:22:39 +03:00
Pavel Rojtberg 3c795a0dab add test_algorithm_rw using AKAZE 2017-11-27 17:04:56 +01:00
Pavel Rojtberg 6fbf0758bc Python: wrap Algorithm::read and Algorithm::write 2017-11-27 17:04:56 +01:00
Alexander Alekhin 89d855c0b7 cmake: update optimization filter 2017-11-27 18:18:19 +03:00
Wu Zhiwen 1f465a0ef9 dnn(ocl4dnn): fuseLayer() use umat_input/outputBlobs for OpenCL target
Also, fix bug when use OPENCL target but no OpenCL runtime

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-11-27 22:25:53 +08:00
Li Peng a47fbd2610 Add ocl accuracy test for a few dnn nets
They are alexnet, mobilenet-ssd, resnet50, squeezeNet_v1_1,
yolo and fast_neural_style.

Signed-off-by: Li Peng <peng.li@intel.com>
2017-11-27 23:33:21 +08:00
Dmitry Kurtaev 99ed085752 Update PriorBox layer 2017-11-27 16:47:20 +03:00
elenagvo c95bc0c7fd add HAL for threshold 2017-11-27 15:35:02 +03:00
elenagvo 11ddb9332c add HAL for adaptiveThreshold 2017-11-27 15:35:02 +03:00
LaurentBerger 606a5fd537 Try to solve issue 10166 2017-11-27 13:13:05 +01:00
Alexander Alekhin c4b158ff91 Merge pull request #10167 from alalek:ocl_fix_issue_contrib1467 2017-11-27 11:05:07 +00:00
Vadim Pisarevsky ec076bfba3 Update imgproc.hpp
rewrote the added note in perhaps a cleaner way
2017-11-27 13:42:10 +03:00
Vadim Pisarevsky 92be112388 Merge pull request #10107 from ElenaGvozdeva:medianBlur_HAL 2017-11-27 10:12:16 +00:00
Vadim Pisarevsky a83c12c3d5 Merge pull request #10154 from alalek:ocl_cleanup_obsolete_cache 2017-11-27 10:04:04 +00:00
Vadim Pisarevsky 7f554f3cc4 Merge pull request #10155 from alalek:ocl_update_loader 2017-11-27 10:03:31 +00:00
Alexander Alekhin 92b35e6758 ocl: fix null pointer access crash 2017-11-27 12:43:29 +03:00
Alexander Alekhin 91c1d7697f Merge pull request #10156 from dkurt:refresh_torch_enet_sample 2017-11-27 09:24:50 +00:00
Alexander Alekhin 5b27fb506a Merge pull request #10163 from windhw:patch-1 2017-11-27 07:56:06 +00:00
Wei Hao f2b3e5f517 Update houghlines.py
Fix a code indent bug:   cv2.imshow("detected lines", cdst)
2017-11-27 14:36:51 +08:00
Alexander Alekhin 807f5e33ad Merge pull request #10055 from mabdullahrafique:patch-1 2017-11-26 12:00:16 +00:00
Alexander Alekhin 11330b9253 Merge pull request #10095 from alalek:fix_canny_intrinsics 2017-11-25 12:31:47 +00:00
Dmitry Kurtaev 2af6f68452 Update Torch ENet sample 2017-11-24 21:20:18 +03:00
Alexander Alekhin c38620e966 ocl: update OpenCL runtime loader
- fix compilation on Apple (undefined 'oclpath')
- don't warn on OPENCV_OPENCL_RUNTIME=disabled
2017-11-24 19:18:22 +03:00
Alexander Alekhin 8254169cf5 Merge pull request #10153 from dkurt:specify_mobilenet_version 2017-11-24 16:17:28 +00:00
Alexander Alekhin b6abf0d3f9 ocl: drop obsolete cache directories after upgrade of OpenCL driver
Entries with the same platform name, the same device name and with different driver versions
are assumed obsolete.
2017-11-24 17:02:28 +03:00
Vadim Pisarevsky bd6a6690f2 Merge pull request #10150 from alalek:dnn_ocl_refactor_pooling 2017-11-24 11:51:03 +00:00
Dmitry Kurtaev cdbbccbef8 Specific version of MobileNet-SSD from TensorFlow 2017-11-24 13:40:35 +03:00
Alexander Alekhin cbf2b51e40 bindings(py): fix handling of 'isalgorithm' 2017-11-24 09:54:44 +03:00
Alexander Alekhin 13f374660f dnn(ocl4dnn): drop unused batch_size_ in pooling 2017-11-23 20:46:56 +00:00
Alexander Alekhin e34b64c979 dnn(ocl4dnn): refactor pooling OpenCL calls 2017-11-23 20:46:44 +00:00
Muhammad Abdullah c180047bc1 update digits_video.py
Following were the errors in the digits_video.py
     1 ) The code was not working because data type of x was float however in "cv2.rectangle" we require integer .
     2 ) After pressing the "esc" button the image windows did not destroy
So I amended following things:
     1 ) ~converted data type of x to int.~ Used Python integer division (//)
     2 ) used cv2.destroyAllWindows() to close all windows after the press of "esc" by user.
2017-11-23 19:20:37 +00:00
Alexander Alekhin f071a48ec7 Merge pull request #10143 from pengli:ocl4dnn 2017-11-23 18:47:14 +00:00
Maksim Shabunin a1479cc2c1 Merge pull request #10148 from alalek:fix_ffmpeg_sws_scale_crash 2017-11-23 18:35:00 +00:00
Arthur Pastel 2feb0c2f61 Merge pull request #9895 from art049:parrallel_calibration_py
* Adding threading in calibrate.py

* samples: update calibrate.py
2017-11-23 21:27:11 +03:00
Alexander Alekhin 107582c767 Merge pull request #9996 from dkurt:dnn_multiple_inputs 2017-11-23 18:22:37 +00:00
Li Peng 636d6368ee use OutputArrayOfArrays in net forward interface
It allows umat buffers used in net forward interface

Signed-off-by: Li Peng <peng.li@intel.com>
2017-11-24 02:19:10 +08:00
Wu, Zhiwen 04edc8fe3a cleanup ocl4dnn spatial convolution kernels
remove unused macros and half definition macros,
also remove unused ocl::Queue

Signed-off-by: Li Peng <peng.li@intel.com>
2017-11-24 02:19:10 +08:00
Alexander Alekhin 559235ac74 videoio(ffmpeg): more workarounds for sws_scale() crash
Prevents access data after the end of input buffer near 4K page boundaries
2017-11-23 18:56:19 +03:00
Alexander Alekhin 5d369afe27 Merge pull request #9893 from mshabunin:add-modules-whitelist 2017-11-23 15:09:35 +00:00
Alexander Alekhin 49a5280198 Merge pull request #10139 from alalek:dnn_rename_caffe_proto_package 2017-11-23 14:10:42 +00:00
Alexander Alekhin e5d1790b7b Merge pull request #10018 from alalek:ocl_binary_cache 2017-11-23 13:37:32 +00:00
Maksim Shabunin 5b17410f7c Added BUILD_LIST feature 2017-11-23 16:06:21 +03:00
Vadim Pisarevsky fed2a277e0 Merge pull request #10142 from alalek:pytests_update 2017-11-23 12:51:55 +00:00
Vadim Pisarevsky d59472bf40 Merge pull request #10144 from mshabunin:fix-videocapture-open-order 2017-11-23 12:50:25 +00:00
Maksim Shabunin 6f48dc2482 Fixed GStreamer pipeline building on Ubuntu 17 2017-11-23 15:03:20 +03:00
Alexander Nesterov 8082011546 Update videoio tests 2017-11-23 14:57:38 +03:00
Maksim Shabunin 7628c143f4 videoio: fixed capture open order, added apiPrefernce to FFMPEG tests 2017-11-23 13:33:48 +03:00
elenagvo 5d0a8d2aaf fix the parameters order 2017-11-23 13:30:00 +03:00
Alexander Alekhin 019de554a0 python(test): don't write bytecode
Tests are usually lauched from source directory, so additional unnecessary
files should be eliminated.

Alternative ways (command line):
- python -B ...
- PYTHONDONTWRITEBYTECODE=1 python ...
2017-11-23 13:13:11 +03:00
Alexander Alekhin 3ee8079f35 python(test): add tests filter
Usage example (bash):
$ OPENCV_PYTEST_FILTER=test_digits python test.py -v
2017-11-23 12:16:59 +03:00
Alexander Alekhin e4aa2ccd66 Merge pull request #10136 from alalek:issue_10134 2017-11-22 18:39:47 +00:00
Alexander Alekhin f37f4cf3b4 Merge pull request #9994 from r2d3:dnn_memory_load 2017-11-22 18:15:00 +00:00
Alexander Alekhin e7d62d6ef3 Merge pull request #10126 from alalek:dnn_issue_10125 2017-11-22 18:03:51 +00:00
Alexander Alekhin b29893b938 dnn: autogenerated files 2017-11-22 18:34:07 +03:00
Alexander Alekhin 1c88a566e0 dnn: rename caffe protobuf package 2017-11-22 18:34:07 +03:00
Alexander Alekhin 3f37be5a30 core: fix compilation of intrinsic code 2017-11-22 17:28:50 +03:00
Alexander Alekhin 9db5cbf9a4 dnn: sync output/internals blobs back 2017-11-22 14:00:58 +03:00
Alexander Alekhin 8e6280fc8e ocl: binary program cache 2017-11-22 12:56:38 +03:00
Vadim Pisarevsky f8ad289311 Merge pull request #10092 from alalek:dnn_rename_caffe_proto 2017-11-22 08:16:20 +00:00
Vadim Pisarevsky a9b5233f67 Merge pull request #9931 from mshabunin:bss-cleanup 2017-11-22 08:13:35 +00:00
Maksim Shabunin e57f22a386 Fixed allocSingleton 2017-11-21 18:07:30 +03:00
Maksim Shabunin 12662e064b align singleton malloc 2017-11-21 17:55:23 +03:00
Maksim Shabunin 1c46034166 Other buffers 2017-11-21 17:55:23 +03:00
Maksim Shabunin 2178c5e95e init ABtoXZ 2017-11-21 17:55:23 +03:00
Maksim Shabunin b3018ba89e LUV tables 2017-11-21 17:55:23 +03:00
Maksim Shabunin e75056a084 static init 2017-11-21 17:55:23 +03:00
Maksim Shabunin 51fc891a5c cvtColor: fixed tables init, moved some tables to heap 2017-11-21 17:55:23 +03:00
Alexander Alekhin 0f34628af7 dnn: drop OpenCL code path for DetectionOutputLayer
getUMat()/getMat() calls are scope based. Results of these calls can't be
stored somewhere for future usage.
2017-11-21 17:28:42 +03:00
Vadim Pisarevsky c3cced0f89 Merge pull request #10121 from alalek:ocl_syntax_fix 2017-11-21 12:40:19 +00:00
Rostislav Vasilikhin 397b57dd72 Merge pull request #10041 from savuor:RevHoughWorks
HoughCircles rewritten (PR #7434 updated) (#10041)

* initial version of renewed HoughCircles done

* fixed compilation

* fixed SIMD ability & compilation warning

* fixed accumulator nonmax comparison

* common Mutex for all invokers

* nzLocal is std::vector

* nz is std::vector

* SSE2 -> SIMD128

* centers is now std::vector

* circles is std::vector

* estimateRadius updated

* accum calculation w/o mutex

* less deprecated code

* several bugs fixed

* back to mutex, TLS gathering doesn't work

* extra code removed

* little refactoring

* docs note updated

* a little speedup

* warning fixed
2017-11-21 14:18:47 +03:00
zhongwuzw 01b581048d Fix customPreviewLayer layout issue when rotateVideo is NO in iOS 2017-11-21 12:56:23 +08:00
Alexander Alekhin 438e456ce9 Merge pull request #10113 from wzw-intel:fusion 2017-11-20 18:13:33 +00:00
Alexander Alekhin b389c1cfe7 core(ocl): syntax fix 2017-11-20 19:19:35 +03:00
Alexander Alekhin f19f2bbcde dnn: autogenerated files
rename caffe.proto => opencv-caffe.proto
2017-11-20 19:04:02 +03:00
Alexander Alekhin f6d927ef3b dnn: avoid conflicts with original caffe.proto
rename caffe.proto => opencv-caffe.proto
2017-11-20 19:04:00 +03:00
Alexander Alekhin 75b980ac64 Merge pull request #10120 from dkurt:remove_caffe_header_from_layer 2017-11-20 15:59:56 +00:00
David Geldreich f723cede2e add loading TensorFlow/Caffe net from memory buffer
add a corresponding test
2017-11-20 16:28:22 +01:00
Dmitry Kurtaev 6c5dd5cf6d Replace caffe::NormalizedBBox to local structure 2017-11-20 18:03:31 +03:00
elenagvo 3a09da71d8 add HAL for medianBlur 2017-11-20 17:09:22 +03:00
Tomoaki Teshima 3cbe60cca2 Merge pull request #9753 from tomoaki0705:universalMatmul
* add accuracy test and performance check for matmul
  * add performance tests for transform and dotProduct
  * add test Core_TransformLargeTest for 8u version of transform

* remove raw SSE2/NEON implementation from matmul.cpp
  * use universal intrinsic instead of raw intrinsic
  * remove unused templated function
  * add v_matmuladd which multiply 3x3 matrix and add 3x1 vector
  * add v_rotate_left/right in universal intrinsic
  * suppress intrinsic on some function and platform
  * add pure SW implementation of new universal intrinsics
  * add test for new universal intrinsics

* core: prevent memory access after the end of buffer

* fix perf tests
2017-11-20 15:56:53 +03:00
gdkessler 2674c6b5e0 Merge pull request #10093 from gdkessler/gdal_image_read_fix_10089
Fix GDAL image decoding color problems identified by issue #10089, by: (#10093)

* Fix GDAL image decoding color problems identified by issue #10089, by:

Fixing CV_8UC1 symbol, which should be CV_8UC3 for RGB GDAL color table images.

Fixing image.ptr<VecX>(row,col)[] to be (*image.ptr<VecX>(row,col))[] to correctly access VecX array elements, as ptr<VecX>() returns a pointer to the VecX, not the first element of VecX. This fixes the color problem with color table gif images, and avoids out-of-bounds memory access.

Respecting the color identification of raster bands provided by the GDAL image driver, and produce BGR or BGRA images. Note that color bands of images using the HSL, CMY, CMYK, or YCbCr color space are ignored, rather than converting them to BGR.

* When reading image files using the GDAL decoder, exit with an error if a color band is encountered that isn't used (eg. from CMYK or YCbCbr), rather than silently ignoring the band's data.
2017-11-20 15:07:24 +03:00
Wu Zhiwen 45d11dde57 dnn(ocl4dnn): add fusion support for Power activation and eltwise add
Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-11-20 14:58:53 +08:00
Alexander Alekhin c7f1843584 Merge pull request #10087 from mshabunin:small-cmake-fixes 2017-11-18 18:07:14 +00:00
Jonathan Viney b1d208891b Merge pull request #10011 from jviney:master
Fix build with FFmpeg master. Some deprecated APIs have been removed. (#10011)

* Fix build with FFmpeg master.

* ffmpeg: update AVFMT_RAWPICTURE support removal
2017-11-18 21:08:41 +03:00
Alexander Alekhin 017a38a54e Merge pull request #10108 from mshabunin:fix-eigen-stride 2017-11-17 20:09:08 +00:00
Alexander Alekhin b45403ed75 Merge pull request #10102 from seiko2plus:coreVsxPacksFix 2017-11-17 19:01:38 +00:00
Maksim Shabunin f50ec229de Eigen: fix Mat construction stride 2017-11-17 18:27:09 +03:00
Alexander Alekhin 3e33820ee5 Merge pull request #10104 from wzw-intel:fusion_debug 2017-11-17 13:57:36 +00:00
Maksim Shabunin 73d4f12c14 Merge pull request #9997 from ElenaGvozdeva:GaussianBlur_bug 2017-11-17 13:37:28 +00:00
elenagvo 20c08eab73 change border type for medianBlur to BORDER_ISOLATED 2017-11-17 15:13:04 +03:00
Maksim Shabunin eb136ebba6 Do not reset step for single-row Mat created on user data 2017-11-17 13:15:15 +03:00
elenagvo 1a9d8e9447 test for GaussianBlur with border 2017-11-17 13:15:15 +03:00
Alexander Alekhin 0eb1bfa874 Merge pull request #10099 from alalek:fix_js_tests 2017-11-17 09:16:34 +00:00
Maksim Shabunin 5ebb234746 cmake: simplified configuration output 2017-11-17 11:57:49 +03:00
Wu Zhiwen 394101d6ed dnn(ocl4dnn): Fix relu fusion bug
Incorrect type of negative_slope result in this bug.

Also and OCL test for darknet to validate this patch.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-11-17 16:21:56 +08:00
Alexander Alekhin 3c6983a2bd Merge pull request #10008 from Smorodov:master 2017-11-17 05:41:18 +00:00
Sayed Adel 56bda8917d core:vsx Fix vec_packs in gcc-5 2017-11-16 21:54:56 +00:00
Alexander Alekhin 6936ec7dbd Merge pull request #10094 from amroamroamro:mingw-pkgconfig-fix 2017-11-16 19:39:33 +00:00
Maksim Shabunin e730048f69 Merge pull request #10078 from justdoitqd:master 2017-11-16 15:20:44 +00:00
Maksim Shabunin 751cee8e67 Merge pull request #9907 from seiko2plus:vsxFixesImproves 2017-11-16 15:20:16 +00:00
Jcrist99 0608227e10 Merge pull request #9698 from abratchik:parse.doxygen
Support @deprecated tag in java wrappers (#9698)
2017-11-16 16:48:12 +03:00
Alexander Alekhin 2210ed4fdd js: fix tests (qunit -> node-qunit) 2017-11-16 15:00:33 +03:00
Alexander Alekhin 65061948af Merge pull request #10091 from alalek:build_python_reduce_global_symbols 2017-11-16 10:17:39 +00:00
Alexander Alekhin 55dabd2858 Merge pull request #10097 from wzw-intel:tuning_time 2017-11-16 09:34:42 +00:00
Wu Zhiwen 88e6daa315 dnn(ocl4dnn): Fix wrong measurement for tuning time
convolution kernel use default queue to run, so that ocl::Timer
, to measure the kernel run time, should use the default queue too.
Also remove useless parameter for convolve()

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-11-16 13:09:57 +08:00
Alexander Alekhin baff521b63 imgproc(Canny): eliminate unnecessary operations
drop manual loop unrolling:
- don't block compiler optimizations
- no effect on i5
2017-11-15 19:29:59 +00:00
Amro bbba9ac121 fix pkg-config generation for mingw 2017-11-15 18:54:46 +02:00
Alexander Alekhin 1fbdca83f5 Merge pull request #10083 from alalek:core_intrinsics_load_low 2017-11-15 16:08:56 +00:00
Alexander Alekhin 3a0039d204 core(intrinsics): v_load_low 2017-11-15 16:04:18 +03:00
Alexander Alekhin aa70199ce1 build: avoid exporting of unnecessary symbols from Python bindings 2017-11-15 13:21:35 +03:00
Akhilesh Kumar fcdd833059 Merge pull request #10056 from akhilesh-k:master
Added Python setup docs for Ubuntu Machines (#10056)
2017-11-14 13:44:01 +03:00
Alexander Alekhin ba940dec38 Merge pull request #10073 from alalek:cmake_fix_overiding_compile_options 2017-11-13 11:26:13 +00:00
Alexander Alekhin 42f449880c Merge pull request #10068 from paroj:fs_doc 2017-11-13 09:18:42 +00:00
Simon Guo 2610a47c89 core:ppc Fix 2 interleave logic errors in vsx_utils.hpp
When elements are 64 bits, the vec_st_interleave()/vec_ld_deinterleave()
doesn't interleave 4 elements correctly.

For vec_st_interleave(), following is saved into mem:
	a0 b0 a1 b1 c0 d0 c1 d1
     -> we expected:
	a0 b0 c0 d0 a1 b1 c1 d1

for vec_ld_deinterleave(), following is loaded into a b c d for memory
string { 1 2 3 4 5 6 7 8 }:
	a: 1 3
	b: 2 4
	c: 5 7
	d: 6 8
   -> we expected:
   	a: 1 5
	b: 2 6
	c: 3 7
	d: 4 8

This patch corrects this behavior.

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
2017-11-13 12:47:10 +08:00
Li Peng 55260a8d3c reshape mat before doing computation in fc layer
Signed-off-by: Li Peng <peng.li@intel.com>
2017-11-13 09:29:50 +08:00
Alexander Alekhin 43e4e1b624 cmake: drop amending of compilation options
Allow to specify optimization level via CMake.
2017-11-12 11:12:27 +03:00
Alexander Alekhin e89501a3ad Merge pull request #10072 from sturkmen72:upd_lsd_cpp 2017-11-12 07:11:34 +00:00
Suleyman TURKMEN 992a81dcaa Update lsd.cpp 2017-11-11 22:26:44 +03:00
Florian Echtler 2e772510ea Merge pull request #10050 from floe/android-studio-3.3.1
Add Android Mat constructor with support for native buffer (#10050)
2017-11-10 19:35:32 +00:00
Alexander Alekhin c6fb99357c Merge pull request #10057 from LaurentBerger:ParaCalcError 2017-11-10 19:04:36 +00:00
Pavel Rojtberg 7190028b23 FileStorage: use copydoc to add base64 info to constructor 2017-11-10 13:06:36 +01:00
Alexander Alekhin bafdc44d37 Merge pull request #10061 from Sahloul:dnn_torch_fix 2017-11-10 05:05:52 +00:00
Alexander Alekhin 1af16afb89 Merge pull request #10062 from alalek:gtest_show_params 2017-11-10 05:04:55 +00:00
LaurentBerger b9cf65e905 Parallel version of calcError in statmodel 2017-11-09 21:29:06 +01:00
Alexander Alekhin 8a3a75cc16 Merge pull request #9882 from pengli:ocl4dnn 2017-11-09 18:54:43 +00:00
Alexander Alekhin fbe18e80f6 ts: dump test parameters value 2017-11-09 19:11:49 +03:00
Hamdi Sahloul 06bda58a2c DNN Torch - workaround when torch importer is disabled 2017-11-10 00:44:06 +09:00
Alexander Alekhin e89ae986fa Merge pull request #10053 from terfendail:intersectconvex_fix 2017-11-09 11:05:56 +00:00
Li Peng 8f99083726 Add new layer forward interface
Add layer forward interface with InputArrayOfArrays and
OutputArrayOfArrays parameters, it allows UMat buffer to be
processed and transferred in the layers.

Signed-off-by: Li Peng <peng.li@intel.com>
2017-11-09 15:59:39 +08:00
Alexander Alekhin 51cef2651e Merge pull request #10048 from alalek:fix_macos_pkg_config 2017-11-08 19:01:06 +00:00
Vitaly Tuzov 0205238dca Fix for intersectConvexConvex nested contours check 2017-11-08 20:27:07 +03:00
Fakabbir Amin a0c658b012 Merge pull request #9979 from fakabbir:ImproveDoc
* Improve Documentation
Fixes Spelling Mistakes.
2017-11-08 16:55:48 +00:00
Alexander Alekhin 22dfc1daf1 Merge pull request #10051 from sturkmen72:upd_grfmt_gdal_cpp 2017-11-08 16:48:04 +00:00
Suleyman TURKMEN e51a8e047c update grfmt_gdal.cpp 2017-11-08 17:47:43 +03:00
Alexander Alekhin 0a7c60b439 Merge pull request #10047 from meganetaaan:master
Fix sample code in js_tutorials
2017-11-08 14:13:23 +00:00
Alexander Alekhin a0e1def83b cmake: fix pkg-config generation for MacOSX 2017-11-08 16:06:48 +03:00
Shinya Ishikawa 2fc1edfc96 Fix sample code in js_tutorials 2017-11-08 21:57:00 +09:00
Alexander Alekhin 3921fab285 Merge pull request #10037 from alalek:update_gitignore
git: .gitignore update
2017-11-07 19:59:53 +00:00
Alexander Alekhin 48ed769b18 Merge pull request #10036 from alalek:fix_ocl4dnn_invalid_kernel 2017-11-07 19:17:21 +00:00
Alexander Alekhin bffe254a81 Merge pull request #10003 from sturkmen72:documentation_updates 2017-11-07 16:52:15 +00:00
Suleyman TURKMEN 63fb79b519 updates documentation and samples 2017-11-07 19:21:21 +03:00
Alexander Alekhin c51567ae45 git: .gitignore update
ignore all "dot" files/directories by default.
'ignored' files can be added via 'git add -f' command if necessary.
2017-11-07 17:24:48 +03:00
Alexander Alekhin 97181a90ba dnn(ocl4dnn/conv): bailout on missing kernel configuration 2017-11-07 17:02:17 +03:00
Alexander Alekhin 981009ac1f Merge pull request #9999 from mshabunin:fix-gcc72-warnings 2017-11-07 13:37:25 +00:00
Alexander Alekhin 96aebbe7f9 Merge pull request #9970 from mshabunin:media-sdk-convert 2017-11-07 13:37:07 +00:00
Alexander Alekhin ed71f62181 Merge pull request #10002 from alalek:cmake_ios_disable_ipp 2017-11-07 13:35:16 +00:00
Alexander Alekhin 888d0cda40 Merge pull request #10001 from alalek:cmake_exclude_java_from_cpp_modules 2017-11-07 13:35:00 +00:00
Alexander Alekhin 4085bbf758 Merge pull request #10025 from Mixaill:msvs-2017u5 2017-11-07 13:26:04 +00:00
Alexander Alekhin 49f214b275 Merge pull request #10031 from meganetaaan:doc-typo-js
Fix typo in js_tutorials
2017-11-07 11:00:47 +00:00
Alexander Alekhin 8e21f808be cmake: allow custom OpenCV_ARCH / OpenCV_RUNTIME values 2017-11-07 13:55:13 +03:00
Alexander Alekhin ac22d3c817 cmake: MSVC_VERSION use pattern matching 2017-11-07 13:52:06 +03:00
Shinya Ishikawa afa633b7bc Fix typo in js_tutorials 2017-11-06 21:30:33 +09:00
Mikhail Paulyshka 62737c777c cmake: add support for MSVS 2017 update 5 2017-11-04 23:52:37 +03:00
Iago Suárez 42d942e19c Clearing data into the detect method of the class cv::LineSegmentDetectorImpl 2017-11-04 17:12:20 +01:00
Cartucho 7267e94be7 Merge pull request #9736 from Cartucho/const_and_class_to_json
* Adding constants to json file

* adding sub-module to constants name

* adding namespace to functions

* adding namespace to classes

* remove namespace from methods

* static methods

* python signatures generation

* python: more fixes for signatures generation

Python names existence can be checked via command:

    python -c "import cv2 as cv; print(repr(<py_name>))"
2017-11-04 06:38:18 +03:00
Maksim Shabunin 184daa155f Fixed minor issues reported by GCC 7.2 2017-11-03 18:06:39 +03:00
Alexander Alekhin d7a1d2230f Merge pull request #9988 from alalek:ocl_verbose_api_errors 2017-11-03 15:05:46 +00:00
Alexander Alekhin 9c4f0a984f ocl: drop CV_OclDbgAssert 2017-11-03 13:31:37 +03:00
Alexander Alekhin 8fb48c09f7 ocl: improve debug information 2017-11-03 13:31:37 +03:00
Alexander Alekhin 6e4f9433d0 Merge pull request #9998 from alalek:ocl_fix_dnn_softmax_9991 2017-11-03 09:16:39 +00:00
Alexander Alekhin c624967049 Merge pull request #10007 from alalek:videoio_gst_mjpeg_fix 2017-11-02 18:27:00 +00:00
Dmitry Kurtaev 20a2dc6ac5 Fix multiple inputs models from Caffe.
Fixed Concat optimization.
2017-11-02 18:55:08 +03:00
Alexander Alekhin b1b2528e50 videoio: improve condition for MJPEG gstreamer sink 2017-11-02 18:27:30 +03:00
Alexander Alekhin 1bd865120c cmake: disable IPP on iOS
IPP is used on iPhoneSimulator only.
2017-11-02 17:36:53 +03:00
Alexander Alekhin bacc96f4e8 dnn(ocl): fix softmax global/local size consistency 2017-11-02 17:08:40 +03:00
Alexander Alekhin cc3f9323bb cmake: exclude opencv_java (JNI) from OpenCV C++ modules list
for non-ANDROID platforms
2017-11-02 17:06:12 +03:00
Andrey Smorodov c964aa3333 Matrices in colorizeSegmentation were not initialized. 2017-11-02 15:47:45 +03:00
Alexander Alekhin f9ac1665b6 Merge pull request #9983 from dkurt:fix_halide_copy_to_device 2017-11-02 12:01:39 +00:00
Alexander Alekhin 942672ad91 Merge pull request #9995 from alalek:ocl_fix_moments_9990 2017-11-02 11:45:09 +00:00
Alexander Alekhin 9cceccd645 Merge pull request #9993 from alalek:ocl_fix_gemm_9989 2017-11-02 11:44:41 +00:00
Alexander Alekhin 47ae5197a9 test: extract OpenCL Moments tests, drop 'coi' parameter 2017-11-02 13:37:58 +03:00
Alexander Alekhin c9c759f700 ocl: fix moments global_size (should be >= local_size) 2017-11-02 13:37:57 +03:00
Alexander Alekhin 7db612a545 core(ocl): fix parameters for 'intelblas_gemm_buffer_NT' kernel 2017-11-02 12:50:32 +03:00
Alexander Alekhin 18a4ced07a Merge tag '3.3.1-cvsdk' 2017-11-01 16:06:00 +03:00
Vitaly Tuzov b9b553b8bc Add more details to drawContour description 2017-11-01 16:01:12 +03:00
Maksim Shabunin 0c79f4a00f MediaSDK: fixed Linux build, improved BGR<->NV12 conversions 2017-11-01 14:14:45 +03:00
Vadim Pisarevsky cc626a3b5a Merge pull request #9627 from dtmoodie:pyrlk_bugfix 2017-11-01 11:03:09 +00:00
Dmitry Kurtaev 14af2a0c0c Fixed Halide's copy_to_device invocation 2017-11-01 14:01:54 +03:00
Vadim Pisarevsky bc348eb8ab Merge pull request #9963 from dkurt:fix_caffe_shrinker 2017-10-31 12:27:19 +00:00
Alexander Alekhin 6e4dacc0b3 Merge pull request #9971 from csukuangfj:fix-doc 2017-10-31 10:03:54 +00:00
Dmitry Kurtaev e1ebc4e991 Specify layer types for Caffe FP32->FP16 weights converter 2017-10-31 12:31:40 +03:00
KUANG Fangjun 67acfc6e25 improve doc. 2017-10-31 10:30:01 +01:00
Vadim Pisarevsky 87984f2c6a Merge pull request #9854 from opalmirror:test_stereo_min_disparity_master 2017-10-31 09:28:54 +00:00
Vadim Pisarevsky 15df161b22 Merge pull request #9959 from dkurt:reset_detection_outputs 2017-10-31 09:26:42 +00:00
Vadim Pisarevsky 988a5626f6 Merge pull request #9969 from mshabunin:dispatch-vs-folders 2017-10-31 09:20:52 +00:00
Alexander Alekhin 22496742b4 Merge pull request #9864 from mapreri:multiarch 2017-10-30 15:43:42 +00:00
Alexander Alekhin bc9c9abab0 Merge pull request #9877 from mapreri:non-linux 2017-10-30 15:41:36 +00:00
Alexander Alekhin c6fc7ccb5e Merge pull request #9968 from alalek:fix_9960 2017-10-30 15:33:46 +00:00
Maksim Shabunin 93813fec6e VisualStudio: Added solution folders for dispatched optimization targets 2017-10-30 18:30:20 +03:00
Alexander Alekhin 7809c4156f core(ocl): workaround CL_OUT_OF_RESOURCES error
Flush deallocation queue before calling map/unmap
2017-10-30 17:54:56 +03:00
Alexander Alekhin 37d99201ca Merge pull request #9961 from pushkalkatara:patch-1 2017-10-30 14:15:19 +00:00
Pushkal Katara 5feb1c94a7 Documentation Update
Resolves - https://github.com/opencv/opencv/issues/9928
2017-10-30 17:55:40 +05:30
Vadim Pisarevsky fd1eb63fee Merge pull request #9703 from Ajacmac:patch1 2017-10-30 10:03:03 +00:00
Fakabbir Amin cd428fb798 Error in the documentation for cv::getRectSubPix. #9788 (#9871)
* Error in the documentation for cv::getRectSubPix. #9788
The function name is corrected to GetRectSubPix since, it uses the notation
of src, dst and center. Also added the number of channel assertion criteria.

* Error in the documentation for cv::getRectSubPix. #9788
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.

* Error in the documentation for cv::getRectSubPix. #9788
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.
2017-10-30 13:04:20 +03:00
Vadim Pisarevsky 476c513447 Merge pull request #9955 from alalek:cmake_openblas_support 2017-10-30 09:59:12 +00:00
Vadim Pisarevsky 639b800787 Merge pull request #9941 from catree:improve_dnn_samples 2017-10-30 09:58:18 +00:00
Vadim Pisarevsky 712689e81a Merge pull request #9865 from ryanfox:patch-4 2017-10-30 09:54:48 +00:00
Dmitry Kurtaev 03cefa7bfe Set zero confidences in case of no detections 2017-10-30 10:17:57 +03:00
Sayed Adel 2dc76d5009 cmake: Added Power toolchain 2017-10-28 17:50:43 +00:00
Sayed Adel def444d99f core: Several improvements to Power/VSX
- changed behavior of vec_ctf, vec_ctu, vec_cts
  in gcc and clang to make them compatible with XLC
- implemented most of missing conversion intrinsics in gcc and clang
- implemented conversions intrinsics of odd-numbered elements
- ignored gcc bug warning that caused by -Wunused-but-set-variable in rare cases
- replaced right shift with algebraic right shift for signed vectors
  to shift in the sign bit.
- added new universal intrinsics v_matmuladd, v_rotate_left/right
- avoid using floating multiply-add in RNG
2017-10-28 17:46:12 +00:00
Alexander Alekhin 5f80e42dac cmake: update OpenBLAS support
- reorder path HINTS to avoid conflicts with other LAPACK libraries
- add extern "C" { } to avoid generation of C++ symbols
2017-10-28 10:17:37 +03:00
Alexander Alekhin 7b0d2d189f Merge pull request #9951 from alalek:fix_bilateral_f32_simd 2017-10-27 16:43:20 +00:00
Vadim Pisarevsky e0e40405ed Merge pull request #9847 from wzw-intel:ocl4dnn_fusion 2017-10-27 13:59:46 +00:00
Vadim Pisarevsky ff037ebe5f Merge pull request #9845 from dkurt:fast_neural_style_models 2017-10-27 13:59:02 +00:00
Alexander Alekhin 91c0b13743 Merge pull request #9922 from alalek:ts_markdown_table
ts(misc): support tables exporting in markdown format
2017-10-27 17:01:18 +03:00
Vadim Pisarevsky eb9fcf4f08 Update windows_visual_studio_Opencv.markdown 2017-10-27 16:26:42 +03:00
Vadim Pisarevsky 1f214d232d Merge pull request #9952 from catree:add_resnet_ssd_face.cpp 2017-10-27 13:19:41 +00:00
Vadim Pisarevsky ede39b85f6 Merge pull request #9947 from sovrasov:floodfill_docs 2017-10-27 13:06:11 +00:00
Vadim Pisarevsky ff190b1ef4 Merge pull request #9802 from Nickolays:Fix#9797 2017-10-27 13:00:34 +00:00
Vadim Pisarevsky 1a495a5817 Merge pull request #9875 from terfendail:fast_avx 2017-10-27 12:53:59 +00:00
Vadim Pisarevsky 09d283a39d Merge pull request #9897 from Bhanudutta:bugfix_1 2017-10-27 12:50:44 +00:00
Vadim Pisarevsky 8b1b126e3e Merge pull request #9892 from terfendail:v4l_custom 2017-10-27 11:57:18 +00:00
Vadim Pisarevsky 5384d2f090 Merge pull request #9880 from dkurt:caffe_ceil_mode 2017-10-27 11:51:46 +00:00
catree b4813e6bdf Add C++ DNN face detection sample: resnet_ssd_face.cpp 2017-10-27 13:30:01 +02:00
Dmitry Kurtaev 4b52b8df34 Layers for fast-neural-style models: https://github.com/jcjohnson/fast-neural-style 2017-10-27 14:26:45 +03:00
Alexander Alekhin 60cbc46da1 Merge pull request #9886 from mshabunin:remove-cmake-submodules 2017-10-27 11:23:19 +00:00
Vadim Pisarevsky 9e6ef99422 Merge pull request #9850 from klchang:master 2017-10-27 11:22:28 +00:00
Vadim Pisarevsky 58a83e99c0 Merge pull request #9839 from terfendail:features/python_wrapper/surface_matching_cleanup 2017-10-27 11:22:10 +00:00
Alexander Alekhin cc9ab7e582 imgproc: fix bilateral filter SIMD 32f optimization 2017-10-27 14:20:13 +03:00
Vadim Pisarevsky bc93775385 Merge pull request #9862 from sovrasov:dnn_nms 2017-10-27 11:19:57 +00:00
Vadim Pisarevsky b4367c92f3 Merge pull request #9889 from IgWod:add-const-getviewerpose 2017-10-27 11:16:19 +00:00
Vadim Pisarevsky 825c0ffdb4 Merge pull request #9874 from dkurt:fix_identity_permute_layer 2017-10-27 11:11:48 +00:00
Vadim Pisarevsky 69f2590359 Merge pull request #9921 from dkurt:fix_prelu_after_fully_connected 2017-10-27 11:10:59 +00:00
Vadim Pisarevsky 7060ee4d00 Merge pull request #9923 from savuor:fitellipse_enable_tests 2017-10-27 11:09:41 +00:00
Vadim Pisarevsky 390be6d5b5 Merge pull request #9936 from ryanfox:patch-5 2017-10-27 11:08:44 +00:00
Vladislav Sovrasov a385fff3bf imgproc: clarify usage of the mask in floodfill 2017-10-27 14:06:24 +03:00
Vadim Pisarevsky 7b8fb64f21 Merge pull request #9939 from alalek:fix_dnn_getUMat_crash 2017-10-27 11:06:22 +00:00
Vadim Pisarevsky 0c291c7768 Merge pull request #9940 from catree:fix_issue_9925 2017-10-27 11:05:07 +00:00
Vladislav Sovrasov 5bf39ceb5d dnn: handle 4-channel images in blobFromImage (#9944) 2017-10-27 14:06:53 +03:00
catree 48e07437f0 Add camera/video/image input for C++ DNN object detection samples. Add nice display and computation time. 2017-10-27 11:57:06 +02:00
Alexander Alekhin e5766513a4 Merge pull request #9946 from alalek:fix_stitching_suft_test 2017-10-26 15:37:53 +00:00
Alexander Alekhin 9cdeb6dfbf ocl: increase SURF stitching test tolerance
OpenCL SURF implementation is unstable
2017-10-26 13:03:44 +03:00
catree f9aa411c92 Fix double definitions, correct comment. 2017-10-25 18:11:31 +02:00
Alexander Alekhin 436a1f72a5 dnn: fix sporadic crashes in getUMat()
Incorrect "total" buffer size calculated in StdMatAllocator::allocate() due wrong step values.
2017-10-25 18:07:05 +03:00
Vladislav Sovrasov 7e3e9144de dnn: add an accuracy test for NMS 2017-10-25 13:40:56 +03:00
Vladislav Sovrasov c704942b8a dnn: add a documentation for NMS, fix missing experimantal namespace 2017-10-25 13:35:49 +03:00
Vladislav Sovrasov acedb4a579 dnn: make NMS function public 2017-10-25 13:35:49 +03:00
Ryan Fox db0a159229 copyediting on python object detection tutorial
clarify some passages, fix grammar errors
2017-10-24 21:17:39 -05:00
Vitaly Tuzov 2eb61a4a99 AVX2 optimized implementation of FAST corner tracking migrated to separate file 2017-10-24 20:00:48 +03:00
Vitaly Tuzov 868ad16041 Python wrappers for Vec and Matx 2017-10-23 18:50:49 +03:00
Alexander Alekhin 21c8e6d02d Merge tag '3.3.1' 2017-10-23 18:42:41 +03:00
Alexander Alekhin a871f9e4f7 Merge branch 'update_version' into release 2017-10-23 18:41:12 +03:00
Rostislav Vasilikhin fb5cd42c6b enabled tests for fitEllipse since the issue is fixed 2017-10-23 16:28:49 +03:00
Dmitry Kurtaev a36ebaecdc PReLU layer for multidimensional input 2017-10-23 16:13:03 +03:00
Maksim Shabunin bf418ba342 Merge pull request #9917 from alalek:ocl_cache_program_failures 2017-10-23 12:25:25 +00:00
Maksim Shabunin be9767e014 Merge pull request #9919 from alalek:ocl_fix_macosx_invalid_options 2017-10-23 12:24:42 +00:00
Maksim Shabunin ab5e09e428 Merge pull request #9913 from alalek:fix_fvisibility_regression 2017-10-23 12:22:16 +00:00
Maksim Shabunin 607231641f Merge pull request #9914 from alalek:fix_cmake_xcode 2017-10-23 12:21:35 +00:00
Maksim Shabunin 91323549f4 Merge pull request #9906 from sturkmen72:fix_grfmt_gdal 2017-10-23 12:20:08 +00:00
Alexander Alekhin 9e9881aacc ts(misc): support tables exporting in markdown format
basic support only (no symbol escapes/sanitizing)
2017-10-23 14:57:45 +03:00
Alexander Alekhin 734ea77c9a ocl(macosx): fix CL_INVALID_BUILD_OPTIONS for gemm programs
MacOSX OpenCL compiler is very strict to whitespace issues
2017-10-23 13:56:11 +03:00
Alexander Alekhin d96cac1341 ocl: cache program build failures
To prevent unnecessary compiler invocations
2017-10-23 13:46:56 +03:00
Alexander Alekhin 0622146a93 cmake: disable generation of pkg-config file during Xcode build 2017-10-23 12:31:20 +03:00
Alexander Alekhin db980b0eca cmake: fix '-fvisibility' options regression
CMAKE_COMPILER_ID => CMAKE_CXX_COMPILER_ID
2017-10-23 12:18:52 +03:00
Suleyman TURKMEN d1c5e79ec3 Update grfmt_gdal.cpp 2017-10-22 19:01:34 +03:00
Alexander Alekhin cca99bf824 Merge pull request #9903 from blendin:oob_write_1 2017-10-22 07:27:15 +00:00
Bhanudutta dcaad315e7 Edit spelling mistake in my previous pull request 2017-10-22 12:37:19 +05:30
blendin 08a5fe3661 Fix out of bounds write 2017-10-21 12:12:53 -07:00
Bhanudutta c95f3eff6e Added a couple of comments to the interface of traincascade.cpp in order to tell user about the usage of traincascade.cpp file and to learn how Github submitting works 2017-10-21 10:19:38 +05:30
Alexander Alekhin 9ae86a922c Merge pull request #9887 from mshabunin:upgrade-tbb 2017-10-20 11:44:00 +00:00
Alexander Alekhin 276459e57e Merge pull request #9890 from dkurt:fix_torch_test 2017-10-20 11:43:16 +00:00
Maksim Shabunin 223830a5ee Updated TBB package to 2018.1 2017-10-20 12:16:06 +03:00
Dmitry Kurtaev 410d44d67d Binary data for batch normalization test from Torch 2017-10-20 12:01:42 +03:00
Igor Wodiany d7cbe6e947 Add const to getViewerPose()
getViewerPose() doesn't modify an object of the class so it can be
made const. It also makes this method consistent with other getters
in the class as they are defined as const.
2017-10-19 22:05:49 +01:00
Vitaly Tuzov ad051cdd99 Fixed CAP_PROP_FORMAT evaluation in case CvCaptureCAM_V4L returns CV_16U image 2017-10-19 20:51:00 +03:00
Maksim Shabunin b1fe298764 Removed cmake submodules and contrib_world references 2017-10-19 17:34:59 +03:00
Maksim Shabunin a6c02af099 Merge pull request #9878 from alalek:doc_cleanup 2017-10-18 14:50:12 +00:00
Maksim Shabunin c97c1a2454 Merge pull request #9879 from alalek:fix_build 2017-10-18 14:49:44 +00:00
Maksim Shabunin 9b1b281c7b Merge pull request #9881 from alalek:ocl_timer_simplify 2017-10-18 14:49:21 +00:00
Alexander Alekhin 185faf99bd ocl: simplify ocl::Timer interface 2017-10-18 16:01:21 +03:00
Dmitry Kurtaev b903ff8992 Ceil mode from experimental version of Caffe, https://github.com/BVLC/caffe/pull/3057 2017-10-18 14:04:53 +03:00
Alexander Alekhin face2ea612 3rdparty: suppress warnings 2017-10-18 13:08:01 +03:00
Alexander Alekhin 3fd03964a3 fix code style 2017-10-18 13:08:01 +03:00
Alexander Alekhin ccea108806 doc: filter out OpenCL auto-generated runtime headers 2017-10-18 09:38:22 +03:00
Vitaly Tuzov 8d5a5d5ceb AVX2 optimizations for FAST corner tracking provided by Victoria Zhislina 2017-10-17 18:53:15 +03:00
Dmitry Kurtaev a3a446c197 Output blobs shapes initialization in case of identity permutation (NCHW->NCHW) 2017-10-17 17:15:25 +03:00
Alexander Alekhin c63b4433f4 Merge pull request #9872 from alalek:fix_documentation 2017-10-17 13:25:42 +00:00
Alexander Alekhin 505c90e104 Merge pull request #9866 from mapreri:support-dynamic-mathjax 2017-10-17 13:23:40 +00:00
Mattia Rizzolo 97b8a089c7 doc: Make MATHJAX_RELPATH configurable through cmake
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2017-10-17 13:08:49 +02:00
Alexander Alekhin 69e5ac6f02 doc: fix youtube videos handling 2017-10-17 13:50:56 +03:00
Ryan Fox 3da9598add fix and clarify several grammar issues 2017-10-16 19:07:17 -05:00
Mattia Rizzolo 437da0a3d9 Use CMake's ${CMAKE_INSTALL_LIBDIR} variable to decide where to place the built libraries
The typical situation where the usual, plain 'lib' is not wanted is in a
multiarch system, that allows installation of the same library built for
multiple architectures.
Use the standard ${CMAKE_INSTALL_LIBDIR} variable (coming from the
GNUInstallDirs module) to figure where to put the built libraries.

Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2017-10-17 00:55:08 +02:00
Mattia Rizzolo d026d7dcfb Fix build for non-linux architectures but still glibc-based
Exampls of these are gnu/kfreebsd and gnu/hurd, both available as
unofficial Debian ports.

They don't define __linux__ (as they are non-linux…) but still define
__GLIBC__, so check on that.

Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2017-10-17 00:45:27 +02:00
Alexander Alekhin 110af09bf9 Merge pull request #9853 from catree:fix_dnn_samples_python3 2017-10-16 16:18:22 +00:00
Alexander Alekhin 73af899b7c Merge pull request #9860 from mshabunin:fix-static-9 2017-10-16 14:39:08 +00:00
Wu Zhiwen 2d8f2c2aea dnn(ocl4dnn): add fusion support
ocl4dnn supports following fusion styles:
Conv + [BN] + [Scale] + [ReLU/PReLU]

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-10-16 19:18:36 +08:00
Maksim Shabunin b066dd36ff Fixed uninitialized class fields 2017-10-16 13:47:43 +03:00
Vadim Pisarevsky 1563300197 Merge pull request #9833 from tomoaki0705:universalMathFuncs 2017-10-16 10:46:56 +00:00
Vadim Pisarevsky 2914443685 Merge pull request #9848 from jet47:features2d-optional-flann-dep 2017-10-16 10:45:16 +00:00
Vadim Pisarevsky fef1f9b0a7 Merge pull request #9859 from ryanfox:patch-3 2017-10-16 10:44:07 +00:00
Vadim Pisarevsky 2808bea7fa Merge pull request #9857 from americast:mat_fix 2017-10-16 10:43:37 +00:00
Gregory Morse d30a0c6f03 Merge pull request #9856 from GregoryMorse:patch-1
* Update OpenCVCompilerOptimizations.cmake

Neon not supported on MSVC ARM breaking build fix

* Update OpenCVCompilerOptimizations.cmake

Whitespace

* Update intrin.hpp

Many problems in MSVC ARM builds (at least on VS2017) being fixed in this PR now.

C:\Users\Gregory\DOCUME~1\MYLIBR~1\OPENCV~3\opencv\sources\modules\core\include\opencv2/core/hal/intrin.hpp(444): error C3861: '_tzcnt_u32': identifier not found

* Update hal_replacement.hpp

Passing variadic expansion in a macro to another macro does not work properly in MSVC and a famous known workaround is hereby applied.  Discussion of it: https://stackoverflow.com/questions/5134523/msvc-doesnt-expand-va-args-correctly
Only needed the fix for ARM builds: TEGRA_ macros are used for cv_hal_ functions in the carotene library.

C:\Users\Gregory\Documents\My Libraries\opencv330\opencv\sources\modules\core\src\arithm.cpp(2378): warning C4003: not enough actual parameters for macro 'TEGRA_ADD'
C:\Users\Gregory\Documents\My Libraries\opencv330\opencv\sources\modules\core\src\arithm.cpp(2378): error C2143: syntax error: missing ')' before ','
C:\Users\Gregory\Documents\My Libraries\opencv330\opencv\sources\modules\core\src\arithm.cpp(2378): error C2059: syntax error: ')'

* Update hal_replacement.hpp

All hal_replacement's using carotene\hal\tegra_hal.hpp TEGRA_ functions as macros preprocessed by variadic macros should be changed, identical as was done in core.
C:\Users\Gregory\Documents\My Libraries\opencv330\opencv\sources\modules\imgproc\src\color.cpp(9604): warning C4003: not enough actual parameters for macro 'TEGRA_CVTBGRTOBGR'
C:\Users\Gregory\Documents\My Libraries\opencv330\opencv\sources\modules\imgproc\src\color.cpp(9604): error C2059: syntax error: '=='

* Update OpenCVCompilerOptimizations.cmake

* Update hal_replacement.hpp

* Update hal_replacement.hpp
2017-10-16 12:12:35 +03:00
Ryan Fox 0246cffc34 Fix up grammatical errors in python tutorial 2017-10-15 22:59:48 -05:00
catree 22dece8146 Fix DNN samples for compatibility with Python 3.
Add PyInt_Check in pyopencv_dnn.hpp.
2017-10-15 20:24:56 +02:00
dtmoodie 4566105578 fixed non c++11 warnings. 2017-10-15 12:12:00 -04:00
Alexander Alekhin fee2049642 Merge pull request #9855 from IgWod:extract-vector-typedefs 2017-10-15 14:29:21 +00:00
Igor Wodiany e2499e5b2f Move vector_size_t and vector_vector_Mat
These two typdefs are not compiled when BUILD_opencv_dnn is set to
false, however there are other modules that uses these typedef so
it may cause build errors. Moving typedef to the python module
ensures they are always defined.
2017-10-14 19:06:15 +01:00
Sayan Sinha 60bcb16ca8 Fix typo in mat.hpp 2017-10-14 21:46:11 +05:30
Tomoaki Teshima 2a781bb616 remove raw SSE2/NEON implementation from mathfuncs.cpp
* replace the implementation by universal intrinsic
  * make sure no degradation happens on ARM platform
2017-10-15 00:24:31 +09:00
James Perkins 4eb9f175a4 test_stereomatching.cpp: validate min disparity affect on valid ROI 2017-10-13 13:36:33 -07:00
Nickola b2b56b6896 Fix Issue #9797 minEnclosingCircle from three points
and add test for only 3 pts
2017-10-13 19:26:54 +03:00
Alexander Alekhin 5ed354221c Merge pull request #9851 from alalek:cmake_fix_lapack_mkl_detection 2017-10-13 15:33:36 +00:00
Alexander Alekhin 827c7515c9 Merge pull request #9842 from alalek:fix_dnn_experimental 2017-10-13 15:25:07 +00:00
Alexander Alekhin 23f26fb4a8 cmake: fix LAPACK/MKL detection 2017-10-13 15:40:37 +03:00
klchang d4ef5bc16a fix the possible bug for key mapping in Linux GTK library 2017-10-13 20:05:55 +08:00
Vladislav Vinogradov 26fe8bd4f2 made flann dependency for features2d optional
it will allow to build features2d even if flann module is not available
2017-10-13 14:59:39 +03:00
Alexander Alekhin 4857cae6ed dnn: don't use "experimental_dnn_v1" namespace directly 2017-10-12 18:16:53 +03:00
Maksim Shabunin 1ba29cc95d Merge pull request #9834 from mshabunin:mediasdk-win-support 2017-10-12 12:08:54 +00:00
Alexander Alekhin df5b2224d7 Merge pull request #9829 from pengli:ocl4dnn 2017-10-12 11:26:20 +00:00
Alexander Alekhin f1fe873375 Merge pull request #9841 from alalek:naming_issue 2017-10-12 11:22:54 +00:00
Alexander Alekhin b0c6bd0a5b build: resolve naming issue 2017-10-12 13:28:30 +03:00
Alexander Alekhin 4ae30ecdd9 Merge pull request #9838 from alalek:fix_ocl_world_build 2017-10-12 09:40:32 +00:00
Li Peng 937b8e4277 dnn(ocl4dnn): support log softmax in ocl4dnn
Signed-off-by: Li Peng <peng.li@intel.com>
2017-10-12 09:51:13 +08:00
Vadim Pisarevsky e356ca2369 Merge pull request #9835 from sovrasov:blob_from_img_crop_opt 2017-10-11 17:18:40 +00:00
Vadim Pisarevsky e955bcb872 Merge pull request #9824 from sturkmen72:upd_minEnclosingTriangle 2017-10-11 17:11:15 +00:00
Alexander Alekhin 88225eb65e ocl: fix world compilation on Windows 2017-10-11 19:04:42 +03:00
Alexander Alekhin ec24091578 Merge pull request #9836 from lupustr3:pvlasov/external_ipp-iw_fix 2017-10-11 15:21:05 +00:00
Alexander Alekhin 024be9b8c9 Merge pull request #9818 from tz70s:issue#9570 2017-10-11 15:19:17 +00:00
Suleyman TURKMEN af9c8377eb Update minarea.cpp 2017-10-11 17:52:23 +03:00
Suleyman TURKMEN 29c186a022 Update min_enclosing_triangle.cpp 2017-10-11 17:48:19 +03:00
Suleyman TURKMEN baf9e32af3 Update imgproc.hpp 2017-10-11 17:37:38 +03:00
Vadim Pisarevsky 8b168175ec Merge pull request #9636 from dkurt:duplicate_lp_norm_layer 2017-10-11 13:36:14 +00:00
Maksim Shabunin 83655ba9be MediaSDK video backend: Windows support 2017-10-11 16:33:37 +03:00
Vadim Pisarevsky 0873ebb9b0 Merge pull request #9820 from sovrasov:text_detector_dnn 2017-10-11 13:31:46 +00:00
Vadim Pisarevsky 5e82c98a9f Merge pull request #9828 from berak:fix_c++17_9572 2017-10-11 13:31:18 +00:00
Vadim Pisarevsky babd21c764 Merge pull request #9823 from alalek:dnn_halide_bypass_tbb_threads 2017-10-11 13:28:38 +00:00
Vladislav Sovrasov 47e1133e71 dnn: add crop flag to blobFromImage 2017-10-11 15:46:20 +03:00
Pavel Vlasov a972f0d4ea Standalone IPP with IW fix; 2017-10-11 15:30:01 +03:00
Vladislav Sovrasov f7175f5050 dnn: fix additional text boxes handling after the latest adaptations for TF 2017-10-11 14:04:48 +03:00
Alexander Alekhin 1ea1ff197d Merge pull request #9827 from ryanfox:patch-2 2017-10-11 10:58:05 +00:00
Alexander Alekhin 5ea8ea440b Merge pull request #9826 from p0wdrdotcom:master 2017-10-11 08:55:15 +00:00
Vladislav Sovrasov 050916fd6b dnn: modify priorBox layer 2017-10-11 11:43:50 +03:00
berak ada753a54c fix c++17 namsespace issues 2017-10-11 09:50:22 +02:00
Ryan Fox a96c5b5d90 fix some grammatical errors 2017-10-10 21:37:26 -05:00
Geoff McIver b2d8e8c508 This statement was keeping HAAR cascades from leveraging opencl on nvidia devices. "localSize" on the featureEvaluator remains Size(0, 0) which sets the bool "use_ocl" to false. Adding this allows NVidia GPUs to leverage opencl HAAR Cascades 2017-10-11 09:32:38 +13:00
Suleyman TURKMEN b2673a19cf Updates min_enclosing_triangle.cpp 2017-10-10 23:23:36 +03:00
Dmitry Kurtaev 905a9dada2 Removed LPNormalize layer. 2017-10-10 20:38:55 +03:00
Alexander Alekhin 3935e13603 dnn(halide): don't compile Halide via parallel_for_()
To avoid problem with reduced stack size of inner threads.
2017-10-10 18:06:03 +03:00
Vadim Pisarevsky af8ed9d09f Merge pull request #9816 from opalmirror:fix_stereobm_mindisp_truncation_1 2017-10-10 14:23:02 +00:00
Vadim Pisarevsky 638a91f92f Merge pull request #9822 from alalek:fix_tbb_search 2017-10-10 14:22:00 +00:00
Vadim Pisarevsky 3562a05d90 Merge pull request #8940 from 678098:nonblocking_haar_detector_parallel_for 2017-10-10 13:51:40 +00:00
tz70s 6c1247b38c fix#9570: implement mat ptr for generic types
The original template based mat ptr for indexing is not implemented,
add the similar implementation as uchar type, but cast to
user-defined type from the uchar pointer.
2017-10-10 21:46:49 +08:00
Vadim Pisarevsky b7ff9ddcdd Merge pull request #9705 from AlexeyAB:dnn_darknet_yolo_v2 2017-10-10 12:02:03 +00:00
Alexander Alekhin 25161fc56f tbb: don't search library in ENV{LD_LIBRARY_PATH}
ENV{LIBRARY_PATH} is enough
2017-10-10 14:18:28 +03:00
Vadim Pisarevsky 0739f28e56 Merge pull request #9786 from LaurentBerger:Histo3d 2017-10-10 10:58:34 +00:00
Vadim Pisarevsky 046045239c Merge pull request #9750 from dkurt:feature_dnn_tf_text_graph 2017-10-10 10:06:24 +00:00
Vadim Pisarevsky 7d55c09a9f Merge pull request #9763 from seiko2plus:addVsxCore 2017-10-10 10:00:31 +00:00
Vadim Pisarevsky 0be1f4a573 Merge pull request #9811 from dkurt:prelu_with_shared_channels 2017-10-10 09:57:51 +00:00
Alexander Alekhin af4d6f34d8 OpenCV version '-cvsdk' 2017-10-10 12:29:57 +03:00
Alexander Alekhin bd6fb497bc OpenCV version++
OpenCV 3.3.1
2017-10-10 12:29:57 +03:00
Alexander Alekhin 949ec486c5 experimental version++ 2017-10-10 12:29:57 +03:00
Maksim Shabunin 556768ead1 Merge pull request #9805 from alalek:ffmpeg_update 2017-10-10 09:02:02 +00:00
James Perkins 2cfe29276e fix StereoBM disparity map right margin truncation when minDisparities > 0 2017-10-09 14:51:36 -07:00
LaurentBerger 752f232335 It's done 2017-10-09 22:25:57 +02:00
Alexander Alekhin 92a0808379 Merge pull request #9815 from alalek:issue_9813 2017-10-09 20:08:00 +00:00
Alexander Alekhin 3ae7515955 qt: fix non-world builds 2017-10-09 22:23:05 +03:00
AlexeyAB ecc34dc521 Added DNN Darknet Yolo v2 for object detection 2017-10-09 21:08:44 +03:00
Dmitry Kurtaev eabf728682 PReLU layer from Caffe 2017-10-09 20:30:37 +03:00
Alexander Alekhin 29b0ef44aa Merge pull request #9810 from alalek:fix_js_build 2017-10-09 16:19:09 +00:00
Alexander Alekhin 3010cc5971 js: skip 'utils' headers 2017-10-09 16:14:01 +03:00
Vadim Pisarevsky bfb12acde6 Merge pull request #9792 from alalek:port_9776 2017-10-09 12:46:06 +00:00
Vadim Pisarevsky 44699c59b3 Merge pull request #9799 from alalek:ocl_program 2017-10-09 12:43:46 +00:00
Vadim Pisarevsky fee87ea3f7 Merge pull request #9800 from alalek:fix_build_msvs2010 2017-10-09 12:33:08 +00:00
Vadim Pisarevsky 6a80834ed4 Merge pull request #9803 from wzw-intel:ocl_timer 2017-10-09 12:11:22 +00:00
Vadim Pisarevsky 593329401a Merge pull request #9806 from mshabunin:fix-static-7 2017-10-09 12:09:55 +00:00
Maksim Shabunin ef332dc550 Fixed and suppressed warnings produced by GCC 6.3.0 2017-10-09 13:52:07 +03:00
Alexander Alekhin 746d5f5021 Merge pull request #9790 from mevatron:patch-1 2017-10-09 10:46:50 +00:00
Alexander Alekhin cb5bc1832b ffmpeg: update 3.3.4 2017-10-09 13:42:09 +03:00
Maksim Shabunin 5a22d81fe5 Fixed warnings produced by static analyzer 2017-10-09 13:37:18 +03:00
LaurentBerger 0a19b07055 Use @snippet 2017-10-09 10:59:30 +02:00
Wu Zhiwen dbe9ee0924 ocl: simplify ocl::Timer
Use clFinish to gurantee commands completed, instead of waiting for events.

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
2017-10-09 13:48:38 +08:00
Sayed Adel 4b968d1fe2 Added universal intrinsic for VSX 2017-10-09 00:32:41 +00:00
Sayed Adel d077778074 Added support for VSX 2017-10-09 00:32:29 +00:00
Alexander Alekhin e615fafe2d build: fix MSVS2010 2017-10-08 23:32:22 +03:00
Dmitry Kurtaev e4aa39f9e5 Text TensorFlow graphs parsing. MobileNet-SSD for 90 classes. 2017-10-08 22:25:29 +03:00
Alexander Alekhin 8ac2c5d620 Merge pull request #9796 from lzx1413:patch-1 2017-10-08 17:32:49 +00:00
Alexander Alekhin 6be25727ec ocl: refactor program compilation 2017-10-08 19:55:01 +03:00
Alexander Alekhin 04b4495493 ocl: define ProgramSource before program
no changes in code
2017-10-08 19:55:01 +03:00
Alexander Alekhin 9661d60f74 dnn(samples): fix python syntax (false -> False) 2017-10-08 19:17:40 +03:00
lzx1413 8a05c195f7 in python, false should be False 2017-10-08 21:10:25 +08:00
Alexander Alekhin 2c1b4f5711 Merge pull request #9795 from IgWod:refactor-scalar-to-raw-data 2017-10-08 09:48:46 +00:00
Igor Wodiany ffb9554787 Extract code from scalarToRawData
The same code was repeated several time for different data types, so
it was extracted as a templated function to improve maintability and
make a code more clear.
2017-10-07 19:46:45 +01:00
Igor Wodiany b638aa74d7 Fix a memory leak in the Mat copying constructor
Exception may be rasied inside the body of a copying constructor after
refcount has been increased, and beacause in the case of the exception
destrcutor is never called what causes memory leak. This commit adds a
workaround that calls the release() function before the exception is
thrown outside the contructor.
2017-10-07 10:50:17 +03:00
mevatron fdc4344acb Small fix for using Qt 5.x with opencv_world 2017-10-06 16:03:39 -05:00
LaurentBerger 421c5dee12 3D histogram 2017-10-06 18:10:38 +02:00
Vadim Pisarevsky d25ee8a273 Merge pull request #9761 from Jazmann:ellipseFitAMS&Direct 2017-10-06 14:35:42 +00:00
Vadim Pisarevsky 6c6900a6cd Merge pull request #9424 from Cartucho:update_imgproc_tutorials 2017-10-06 14:02:58 +00:00
Vadim Pisarevsky 21bd834a59 Merge pull request #9772 from dkurt:fix_caffe_eltwise_and_fc_layers 2017-10-06 13:47:54 +00:00
Vadim Pisarevsky b969d86415 Merge pull request #9787 from dkurt:feature_dnn_resize_nearest_neighbor 2017-10-06 13:46:50 +00:00
Vadim Pisarevsky fe58b58937 Merge pull request #9778 from dkurt:dnn_colorization 2017-10-06 11:48:05 +00:00
Vadim Pisarevsky 87595a6b3a Merge pull request #9779 from Lightricks:feature/assetslibrary-remove-link 2017-10-06 11:45:36 +00:00
Dmitry Kurtaev b9f94c9315 Nearest neighbor resize layer 2017-10-06 14:33:26 +03:00
Maksim Shabunin 56fe2dc1ed Merge pull request #9773 from shoeffner:feature/doxygen-tag-file 2017-10-06 10:44:58 +00:00
Dmitry Kurtaev e268606e26 Grayscale colorization model (https://github.com/richzhang/colorization) test. 2017-10-06 09:33:41 +03:00
Yaron Inger 0d979a741b videoio: remove AssetsLibrary dependency.
The entire AssetsLibrary framework is deprecated since iOS 8.0. The code
used in the camera example code can use UIKit to save videos to the
camera instead, which allows to avoid linking with PhotoKit instead to
prevent increasing the iOS deployment target.
2017-10-05 20:22:56 +03:00
tribta 9a2317e063 Tutorial Hough Lines 2017-10-05 14:17:38 +03:00
tribta d99ced6ec8 Tutorial Hough Circles 2017-10-05 14:17:38 +03:00
tribta 9ff33dacfc Tutorial Make Border 2017-10-05 14:17:38 +03:00
tribta a6f5e1f0ca Tutorial Filter2D 2017-10-05 14:17:38 +03:00
tribta 08515281b9 Tutorial Image Pyramids 2017-10-05 14:17:38 +03:00
tribta f7d85bfed8 Tutorial Sobel Derivatives 2017-10-05 14:17:36 +03:00
tribta 3250f11f0c Tutorial Laplace Operator 2017-10-05 14:14:04 +03:00
tribta d068e27420 Tutorial Morph Lines Detection 2017-10-05 14:14:04 +03:00
tribta 18bc4db75c Tutorial Hit-or-Miss 2017-10-05 14:14:04 +03:00
tribta bc18fb481f Tutorial Smoothing Images 2017-10-05 14:14:03 +03:00
Vadim Pisarevsky 5f6ce6f4b0 Merge pull request #9762 from dkurt:fix_tensorflow_split_layer 2017-10-05 10:51:49 +00:00
Vadim Pisarevsky 558e4d9c2d Merge pull request #9771 from Bisaloo:patch-1 2017-10-05 10:48:20 +00:00
Sebastian Höffner 440e8d4efa Configuring Doxygen to generate a tag file.
Additionally adds a tutorial on how to use the tag file in other
projects to link back to the OpenCV documentation.

The tutorial is also the only place which links to the tag file as of
now.

For more information on tag files and external documentation, check
https://www.stack.nl/~dimitri/doxygen/manual/external.html
2017-10-04 15:52:12 +02:00
Alexander Alekhin bc7f649d68 Merge pull request #9769 from pstieber:FixPrivateIncludeInSaturateCast 2017-10-04 12:49:45 +00:00
Dmitry Kurtaev ad8bbaf008 Multidimensional eltwise layer.
Fixed fully-connected layer axis.
2017-10-04 14:01:44 +03:00
Bisaloo ed397cfbea Fix 404 url in canny edge detection tutorial 2017-10-04 11:16:06 +02:00
Peter J. Stieber 5669ee815b Replace private.cuda.hpp with conditional include of cuda_fp16.h. 2017-10-03 17:47:52 -07:00
Dmitry Kurtaev 2a21c10837 Fix TensorFlow split layer 2017-10-02 22:44:42 +03:00
Jasper Shemilt 800da724a3 Fix Transposed eigenvals and vecs. Didn't notice at first 2017-10-02 17:56:08 +01:00
Jasper Shemilt 0136711cf4 Adds fitEllipseAMS to imgproc: The Approximate Mean Square (AMS) proposed by Taubin 1991.
Adds fitEllipseDirect to imgproc: The Direct least square (Direct) method by Fitzgibbon1999.

New Tests are included for the methods.
fitEllipseAMS Tests
fitEllipseDirect Tests

Comparative examples are added to fitEllipse.cpp in Samples.
2017-10-02 16:38:41 +01:00
Alexander Alekhin 2a2537725a Merge pull request #9754 from sturkmen72:patch-1 2017-10-02 15:26:37 +00:00
Vadim Pisarevsky 49afb28738 Merge pull request #9744 from sturkmen72:Update_HOGDescriptor_Documentation 2017-10-02 14:50:46 +00:00
Alexander Alekhin ab748188b1 Merge pull request #9596 from paroj:circle_board_params 2017-10-02 14:47:21 +00:00
pengli e340ff9c3a Merge pull request #9114 from pengli:dnn_rebase
add libdnn acceleration to dnn module  (#9114)

* import libdnn code

Signed-off-by: Li Peng <peng.li@intel.com>

* add convolution layer ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* add pooling layer ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* add softmax layer ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* add lrn layer ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* add innerproduct layer ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* add HAVE_OPENCL macro

Signed-off-by: Li Peng <peng.li@intel.com>

* fix for convolution ocl

Signed-off-by: Li Peng <peng.li@intel.com>

* enable getUMat() for multi-dimension Mat

Signed-off-by: Li Peng <peng.li@intel.com>

* use getUMat for ocl acceleration

Signed-off-by: Li Peng <peng.li@intel.com>

* use CV_OCL_RUN macro

Signed-off-by: Li Peng <peng.li@intel.com>

* set OPENCL target when it is available

and disable fuseLayer for OCL target for the time being

Signed-off-by: Li Peng <peng.li@intel.com>

* fix innerproduct accuracy test

Signed-off-by: Li Peng <peng.li@intel.com>

* remove trailing space

Signed-off-by: Li Peng <peng.li@intel.com>

* Fixed tensorflow demo bug.

Root cause is that tensorflow has different algorithm with libdnn
to calculate convolution output dimension.

libdnn don't calculate output dimension anymore and just use one
passed in by config.

* split gemm ocl file

split it into gemm_buffer.cl and gemm_image.cl

Signed-off-by: Li Peng <peng.li@intel.com>

* Fix compile failure

Signed-off-by: Li Peng <peng.li@intel.com>

* check env flag for auto tuning

Signed-off-by: Li Peng <peng.li@intel.com>

* switch to new ocl kernels for softmax layer

Signed-off-by: Li Peng <peng.li@intel.com>

* update softmax layer

on some platform subgroup extension may not work well,
fallback to non subgroup ocl acceleration.

Signed-off-by: Li Peng <peng.li@intel.com>

* fallback to cpu path for fc layer with multi output

Signed-off-by: Li Peng <peng.li@intel.com>

* update output message

Signed-off-by: Li Peng <peng.li@intel.com>

* update fully connected layer

fallback to gemm API if libdnn return false

Signed-off-by: Li Peng <peng.li@intel.com>

* Add ReLU OCL implementation

* disable layer fusion for now

Signed-off-by: Li Peng <peng.li@intel.com>

* Add OCL implementation for concat layer

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>

* libdnn: update license and copyrights

Also refine libdnn coding style

Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com>
Signed-off-by: Li Peng <peng.li@intel.com>

* DNN: Don't link OpenCL library explicitly

* DNN: Make default preferableTarget to DNN_TARGET_CPU

User should set it to DNN_TARGET_OPENCL explicitly if want to
use OpenCL acceleration.

Also don't fusion when using DNN_TARGET_OPENCL

* DNN: refine coding style

* Add getOpenCLErrorString

* DNN: Use int32_t/uint32_t instread of alias

* Use namespace ocl4dnn to include libdnn things

* remove extra copyTo in softmax ocl path

Signed-off-by: Li Peng <peng.li@intel.com>

* update ReLU layer ocl path

Signed-off-by: Li Peng <peng.li@intel.com>

* Add prefer target property for layer class

It is used to indicate the target for layer forwarding,
either the default CPU target or OCL target.

Signed-off-by: Li Peng <peng.li@intel.com>

* Add cl_event based timer for cv::ocl

* Rename libdnn to ocl4dnn

Signed-off-by: Li Peng <peng.li@intel.com>
Signed-off-by: wzw <zhiwen.wu@intel.com>

* use UMat for ocl4dnn internal buffer

Remove allocateMemory which use clCreateBuffer directly

Signed-off-by: Li Peng <peng.li@intel.com>
Signed-off-by: wzw <zhiwen.wu@intel.com>

* enable buffer gemm in ocl4dnn innerproduct

Signed-off-by: Li Peng <peng.li@intel.com>

* replace int_tp globally for ocl4dnn kernels.

Signed-off-by: wzw <zhiwen.wu@intel.com>
Signed-off-by: Li Peng <peng.li@intel.com>

* create UMat for layer params

Signed-off-by: Li Peng <peng.li@intel.com>

* update sign ocl kernel

Signed-off-by: Li Peng <peng.li@intel.com>

* update image based gemm of inner product layer

Signed-off-by: Li Peng <peng.li@intel.com>

* remove buffer gemm of inner product layer

call cv::gemm API instead

Signed-off-by: Li Peng <peng.li@intel.com>

* change ocl4dnn forward parameter to UMat

Signed-off-by: Li Peng <peng.li@intel.com>

* Refine auto-tuning mechanism.

- Use OPENCV_OCL4DNN_KERNEL_CONFIG_PATH to set cache directory
  for fine-tuned kernel configuration.
  e.g. export OPENCV_OCL4DNN_KERNEL_CONFIG_PATH=/home/tmp,
  the cache directory will be /home/tmp/spatialkernels/ on Linux.

- Define environment OPENCV_OCL4DNN_ENABLE_AUTO_TUNING to enable
  auto-tuning.

- OPENCV_OPENCL_ENABLE_PROFILING is only used to enable profiling
  for OpenCL command queue. This fix basic kernel get wrong running
  time, i.e. 0ms.

- If creating cache directory failed, disable auto-tuning.

* Detect and create cache dir on windows

Signed-off-by: Li Peng <peng.li@intel.com>

* Refine gemm like convolution kernel.

Signed-off-by: Li Peng <peng.li@intel.com>

* Fix redundant swizzleWeights calling when use cached kernel config.

* Fix "out of resource" bug when auto-tuning too many kernels.

* replace cl_mem with UMat in ocl4dnnConvSpatial class

* OCL4DNN: reduce the tuning kernel candidate.

This patch could reduce 75% of the tuning candidates with less
than 2% performance impact for the final result.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>

* replace cl_mem with umat in ocl4dnn convolution

Signed-off-by: Li Peng <peng.li@intel.com>

* remove weight_image_ of ocl4dnn inner product

Actually it is unused in the computation

Signed-off-by: Li Peng <peng.li@intel.com>

* Various fixes for ocl4dnn

1. OCL_PERFORMANCE_CHECK(ocl::Device::getDefault().isIntel())
2. Ptr<OCL4DNNInnerProduct<float> > innerProductOp
3. Code comments cleanup
4. ignore check on OCL cpu device

Signed-off-by: Li Peng <peng.li@intel.com>

* add build option for log softmax

Signed-off-by: Li Peng <peng.li@intel.com>

* remove unused ocl kernels in ocl4dnn

Signed-off-by: Li Peng <peng.li@intel.com>

* replace ocl4dnnSet with opencv setTo

Signed-off-by: Li Peng <peng.li@intel.com>

* replace ALIGN with cv::alignSize

Signed-off-by: Li Peng <peng.li@intel.com>

* check kernel build options

Signed-off-by: Li Peng <peng.li@intel.com>

* Handle program compilation fail properly.

* Use std::numeric_limits<float>::infinity() for large float number

* check ocl4dnn kernel compilation result

Signed-off-by: Li Peng <peng.li@intel.com>

* remove unused ctx_id

Signed-off-by: Li Peng <peng.li@intel.com>

* change clEnqueueNDRangeKernel to kernel.run()

Signed-off-by: Li Peng <peng.li@intel.com>

* change cl_mem to UMat in image based gemm

Signed-off-by: Li Peng <peng.li@intel.com>

* check intel subgroup support for lrn and pooling layer

Signed-off-by: Li Peng <peng.li@intel.com>

* Fix convolution bug if group is greater than 1

Signed-off-by: Li Peng <peng.li@intel.com>

* Set default layer preferableTarget to be DNN_TARGET_CPU

Signed-off-by: Li Peng <peng.li@intel.com>

* Add ocl perf test for convolution

Signed-off-by: Li Peng <peng.li@intel.com>

* Add more ocl accuracy test

Signed-off-by: Li Peng <peng.li@intel.com>

* replace cl_image with ocl::Image2D

Signed-off-by: Li Peng <peng.li@intel.com>

* Fix build failure in elementwise layer

Signed-off-by: Li Peng <peng.li@intel.com>

* use getUMat() to get blob data

Signed-off-by: Li Peng <peng.li@intel.com>

* replace cl_mem handle with ocl::KernelArg

Signed-off-by: Li Peng <peng.li@intel.com>

* dnn(build): don't use C++11, OPENCL_LIBRARIES fix

* dnn(ocl4dnn): remove unused OpenCL kernels

* dnn(ocl4dnn): extract OpenCL code into .cl files

* dnn(ocl4dnn): refine auto-tuning

Defaultly disable auto-tuning, set OPENCV_OCL4DNN_ENABLE_AUTO_TUNING
environment variable to enable it.

Use a set of pre-tuned configs as default config if auto-tuning is disabled.
These configs are tuned for Intel GPU with 48/72 EUs, and for googlenet,
AlexNet, ResNet-50

If default config is not suitable, use the first available kernel config
from the candidates. Candidate priority from high to low is gemm like kernel,
IDLF kernel, basick kernel.

* dnn(ocl4dnn): pooling doesn't use OpenCL subgroups

* dnn(ocl4dnn): fix perf test

OpenCV has default 3sec time limit for each performance test.
Warmup OpenCL backend outside of perf measurement loop.

* use ocl::KernelArg as much as possible

Signed-off-by: Li Peng <peng.li@intel.com>

* dnn(ocl4dnn): fix bias bug for gemm like kernel

* dnn(ocl4dnn): wrap cl_mem into UMat

Signed-off-by: Li Peng <peng.li@intel.com>

* dnn(ocl4dnn): Refine signature of kernel config

- Use more readable string as signture of kernel config
- Don't count device name and vendor in signature string
- Default kernel configurations are tuned for Intel GPU with
  24/48/72 EUs, and for googlenet, AlexNet, ResNet-50 net model.

* dnn(ocl4dnn): swap width/height in configuration

* dnn(ocl4dnn): enable configs for Intel OpenCL runtime only

* core: make configuration helper functions accessible from non-core modules

* dnn(ocl4dnn): update kernel auto-tuning behavior

Avoid unwanted creation of directories

* dnn(ocl4dnn): simplify kernel to workaround OpenCL compiler crash

* dnn(ocl4dnn): remove redundant code

* dnn(ocl4dnn): Add more clear message for simd size dismatch.

* dnn(ocl4dnn): add const to const argument

Signed-off-by: Li Peng <peng.li@intel.com>

* dnn(ocl4dnn): force compiler use a specific SIMD size for IDLF kernel

* dnn(ocl4dnn): drop unused tuneLocalSize()

* dnn(ocl4dnn): specify OpenCL queue for Timer and convolve() method

* dnn(ocl4dnn): sanitize file names used for cache

* dnn(perf): enable Network tests with OpenCL

* dnn(ocl4dnn/conv): drop computeGlobalSize()

* dnn(ocl4dnn/conv): drop unused fields

* dnn(ocl4dnn/conv): simplify ctor

* dnn(ocl4dnn/conv): refactor kernelConfig localSize=NULL

* dnn(ocl4dnn/conv): drop unsupported double / untested half types

* dnn(ocl4dnn/conv): drop unused variable

* dnn(ocl4dnn/conv): alignSize/divUp

* dnn(ocl4dnn/conv): use enum values

* dnn(ocl4dnn): drop unused innerproduct variable

Signed-off-by: Li Peng <peng.li@intel.com>

* dnn(ocl4dnn): add an generic function to check cl option support

* dnn(ocl4dnn): run softmax subgroup version kernel first

Signed-off-by: Li Peng <peng.li@intel.com>
2017-10-02 15:38:00 +03:00
Pavel Rojtberg 629a06d9b6 calib3d: export parameters of CALIB_CB_CLUSTERING 2017-10-02 14:27:32 +02:00
Vadim Pisarevsky f646f61dad Merge pull request #9752 from alalek:eigenNonSymmetric 2017-10-02 11:51:13 +00:00
Alexander Alekhin ca9a3af704 Merge pull request #9756 from pranitbauva1997:doc-typo-faster
doc: fix typo in py_tutorials
2017-10-02 14:26:07 +03:00
Vadim Pisarevsky eca5906a75 Merge pull request #9746 from alalek:fix_msvs2017_warning 2017-10-02 11:15:48 +00:00
Alexander Alekhin b872d14376 Merge pull request #9757 from berak:imgcodecs_4chan_bmp 2017-10-02 10:27:59 +00:00
Pranit Bauva d3e3d0996c doc: fix typo in py_tutorials 2017-10-02 15:54:00 +05:30
Suleyman TURKMEN 20c11d3b7b Update HOGDescriptor documentation 2017-10-02 07:14:35 +03:00
berak 089aac61f3 imgcodecs: fix 4 reading channel bmp images 2017-10-01 15:32:55 +02:00
Alexander Alekhin 1f18282f04 build: fix MSVS2017 warning 2017-10-01 10:48:35 +00:00
Alexander Alekhin 529632f8d0 core: cv::eigenNonSymmetric() via EigenvalueDecomposition 2017-10-01 07:45:32 +00:00
Suleyman TURKMEN a13cbced2e Update OpenCVFindLibsGrfmt.cmake 2017-09-30 21:39:50 +03:00
Alexander Alekhin a9effeeb35 Merge pull request #9743 from DensityCo:tbb-debug 2017-09-29 14:17:55 +00:00
Alexander Alekhin 69103a9fab Merge pull request #9740 from tomoaki0705:universalArithm 2017-09-29 14:17:01 +00:00
Alexander Alekhin a729f985fd Merge pull request #9726 from blendin:fix_oob 2017-09-29 14:16:40 +00:00
Alexander Alekhin d43087cafe Merge pull request #9741 from alalek:stitching_test_update 2017-09-29 13:10:53 +00:00
Alexander Alekhin 0bf823e1eb stitching(perf): update condition threshold 2017-09-29 14:33:13 +03:00
Alexander Alekhin 39ee07b8f6 test: clarify fail messages 2017-09-29 14:33:00 +03:00
Tomoaki Teshima e187219699 use universal intrinsic in arithm.cpp
* remove raw NEON/SSE2 implementation as much as possible
  * replace them to universal intrinsic in InRange/Compare/AddWeighted
2017-09-29 08:33:15 +09:00
bradford barr a56d7592f0 TBB Debug Release
OpenCV fails to detect tbb on a debug build if the platform has only installed
debug libraries.  This PR adds an additional check to the tbb detect logic for
systems that only install tbb debug and not both tbb debug and release.
2017-09-28 17:31:41 -04:00
Vadim Pisarevsky 5e93c82023 Merge pull request #9491 from dkurt:tf_lstm 2017-09-28 21:04:06 +00:00
Vadim Pisarevsky a6d634b5b8 Merge pull request #9683 from terfendail:grects_weights 2017-09-28 14:02:12 +00:00
Vadim Pisarevsky af8fc3e209 Merge pull request #9604 from alalek:ocl_kernel_profiling 2017-09-28 13:48:34 +00:00
Vadim Pisarevsky 22467599c4 Merge pull request #9692 from alalek:dnn_perf_net 2017-09-28 13:44:24 +00:00
Vadim Pisarevsky 68cc2e292d Merge pull request #9734 from dkurt:fix_deconv_layer_kernel_layout 2017-09-28 11:42:57 +00:00
Vadim Pisarevsky 45365e4df1 Merge pull request #9691 from dkurt:padding_layer_refactoring 2017-09-28 11:34:28 +00:00
Tomoaki Teshima 139b32734e Merge pull request #9714 from tomoaki0705:universalBilateral
imgproc: use universal intrinsic as much as possible (#9714)

* use universal intrinsic as much as possible
  * make SSE3 part as common as possible with universal intrinsic implementation
  * put the reducing part out of the main loop

* follow the comment
  * fix the typo
  * use v_reduce_sum4

* follow the comment again
  * remove all CV_SSE3 part from smooth.cpp
2017-09-28 12:30:22 +03:00
Alexander Alekhin 488d4df520 Merge pull request #9710 from savuor:ovx_harris_build_fix 2017-09-28 09:27:09 +00:00
Alexander Alekhin 5f6fb16fda Merge pull request #9737 from huningxin:fix_9729 2017-09-28 08:57:19 +00:00
Ningxin Hu 06d22af2bf Use horizontal input/output images layout in OpenCV.js tutorials 2017-09-28 09:49:34 +08:00
Dmitry Kurtaev 6e593cd1f0 Swap dimensions of deconvolution kernel 2017-09-27 22:38:34 +03:00
Alexander Alekhin 386f402e0c Merge pull request #9735 from alalek:fix_docs
doc: fix documentation generation with JavaScript bindings
2017-09-27 22:11:38 +03:00
Alexander Alekhin 9efb24943e doc: fix documentation generation with JavaScript bindings 2017-09-27 19:24:24 +03:00
Alexander Alekhin 55b7073aae Merge pull request #9730 from yanlend:patch-1 2017-09-27 16:02:09 +00:00
Alexander Alekhin bf6548dc1a Merge pull request #9716 from alalek:fix_ipp_build 2017-09-27 16:00:28 +00:00
Alexander Alekhin 0f0f5652fb Merge pull request #9717 from alalek:fix_fma 2017-09-27 13:48:09 +00:00
Alexander Alekhin d4c905bf77 Merge pull request #9728 from huningxin:fix_9727 2017-09-27 12:05:55 +00:00
Alexander Alekhin 7ff294dbe6 Merge pull request #9725 from dericcrago:fixed_boundary_spelling_in_comments 2017-09-27 12:04:23 +00:00
Peter Fischer 332588fcee Fix bug: non-maximum suppression for hough circle
The non-maximum suppression in the Hough accumulator incorrectly ignores maxima that extend over more than one cell, i.e. two neighboring cells both have the same accumulator value. This maximum is dropped completely instead of picking at least one of the entries. This frequently results in obvious circles being missed.

The behavior is now changed to be the same as for hough_lines.

See also https://github.com/opencv/opencv/issues/4440
2017-09-27 11:47:30 +02:00
Ningxin Hu 2fd0229493 Check files uploaded by user 2017-09-27 16:48:18 +08:00
Ningxin Hu 18c1e32047 Fix image uploading failure for OpenCV.js tutorials 2017-09-27 14:46:21 +08:00
Ningxin Hu 315dac4878 Only accept images to upload for OpenCV.js tutorials 2017-09-27 14:45:33 +08:00
blendin c58152d94b Fix out of bounds write 2017-09-26 23:04:01 -07:00
Deric Crago a0d7cf89f2 Fixed 'boundary' spelling 2017-09-26 23:42:48 -04:00
Alexander Alekhin 7475d23fec Merge pull request #9707 from woodychow:fix_undistortrectifymap_avx2 2017-09-26 16:42:47 +00:00
Alexander Alekhin 3dee92ec50 fix usage of CV_FMA3 macro 2017-09-26 17:23:54 +03:00
Alexander Alekhin 587df6d942 cmake: fix typo 2017-09-26 17:19:27 +03:00
Alexander Alekhin 513c2b92a4 Merge pull request #9709 from savuor:softfloat_r3d 2017-09-26 11:16:42 +00:00
Dmitry Kurtaev 84cec17913 LSTM layer for TensorFlow importer 2017-09-26 12:59:36 +03:00
Alexander Alekhin e8ee284710 Merge pull request #9713 from huningxin:fix_9712 2017-09-26 09:03:34 +00:00
Ningxin Hu ea2c13c91e Improve cascade file loading and error handling for js tutorials 2017-09-26 13:01:45 +08:00
Ningxin Hu f57106b00a Add haar cascade files as js_assets 2017-09-26 13:00:36 +08:00
woody.chow ef8c919e3f Minor optimization of initUndistortRectifyMapLine_AVX 2017-09-26 09:12:22 +09:00
Alexander Alekhin d9107601c3 Merge pull request #9690 from tomoaki0705:universalSmooth 2017-09-25 19:42:06 +00:00
Alexander Alekhin a08044d6f2 Merge pull request #8833 from terfendail:resizenn_perftest 2017-09-25 16:42:07 +00:00
Alexander Alekhin aea25e7f90 Merge pull request #9676 from jrobble:fix_caffe_swaprb 2017-09-25 16:05:11 +00:00
Congxiang Pan 89b6e68e1e Merge pull request #9466 from huningxin:js
GSoC 2017: Improve and Extend the JavaScript Bindings for OpenCV (#9466)

* Initial support for build with emscripten

mkdir build_js
cd build_js
cmake -D CMAKE_TOOLCHAIN_FILE=/path/to/emsdk/emsdk-portable/emscripten/master/cmake/Modules/Platform/Emscripten.cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

* Add js module

The output is build/bin/opencv_js.js

* Fix opencv2/calib3d.hpp not found issue

* Add module name

Usage:
var cv = cv();

* Add total memory as 128MB and allow growth

* Add compilation flags for emscripten

* Use EMSCRIPTEN build target

* Disable js module for non emscripten build

* Bind the preload file path to root

Usage:
face_cascade.load('haarcascade_frontalface_default.xml');

* add test folder

* fix test files

* Copy js module test to bin

* Support to run tests on Node.js

Fix tests to import cv Module when runtime is node.
Add tests.js to use qunit to auto run tests.
Modify umd wrapper to support Module is not defined.

Usage:
node tests.js

* Support UMD and file system

Wrap the opencv_js.js to opencv.js by UMD wrapper

Use emscripten file system API to load files instead of generating data file or
embedding them. It supports both browser and node.js usages.

* Fix incorrect module name in tests

* Add package.json to add dependence of qunit

* Add js_tutorials folder and a intro page of opencv.js

Enable BUILD_DOCS in CMakeLists.txt.
Add new folder of js_tutorials in folder opencv/doc.
Imitate the tutorials of OpenCV-Python to create a intro page of opencv.js and a setup guide

* Import and use binding gen from opencvjs project

* Modify the embindgen.py to pass the build and test

* Add classes and functions white list

* Consolidate hdr_parser.py (#31)

Use hdr_parser.py of python module

Add js flag to support js binding generator.

* Use emscripten::vecFromJSArray for input vector param

Fix part of #23

* Fix test cases after #34

Fix #39

* Expose groupRectangles and CascadeClassifier.empty

* Add js highgui tutorials

add tutorials of imread&imshow and createTrackbar in doc/js_tutorials/js_gui folder
add interactive tutorial webpage for imread&imshow and createTrackbar in doc/js_tutorials/js_interactive_tutorials folder, and some images needed.
change doc/CMakeLists.txt to copy the interactive tutorial webpage and opencv.js to the tutorials' destination folder

* rm useless annotation in doc/CMakeLists.txt

* fix some nonstandard indentation and space

* add check if canvas is valid

* Expose BackgroundSubtractorMOG2

Fix #43

* Fix build of js doc

Limit copy_js_interactive_tutorials for doxygen build
Add dep to opencv.js

Fix #53

* Implement cv.imread & cv.imshow and insert interactive pages in tutorials (#55)

* add helper.js

* delete ALL in add target copy_js_interactive_tutorials to avoid dependence error

* Insert interactive pages in tutorials

insert the old interactive pages in markdown by using \htmlonly and \endhtmlonly command.
delete the useless interactive page
rename js_interactive_tutorials to js_assets to put some images needed in

* fix the depends of the target doxygen

add opencv.js to depends and delete the useless target of copy_js_assets

* change filename helper.js to helpers.js

* disable button or trankbar before opencv.js is ready

* Expose CV_64F

Fix #65

* improve cv.imshow to display different types as native imshow

* add utils.js to reuse functions and update tutorials

* Make doxygen depend on bin/opencv.js

* Fix memory issue of matFromArray

Fix #37

* Merge pull request from ganwenyao/tutorial_18

* Add notes for ganwenyao/tutorial_18

* Modifying for ganwenyao/tutorial_18

* Change Mat constructor with data to 5 parameters

* Mat supports constructor with Scalar

Fix #60

* update cv.imread cause the memory issue of matFromArray has been fixed

* fix canvas name and default input image

* Expose cv::Moments

Fix #85

* Add -Wno-missing-prototypes for emscripten build

* fix canvas name

* add tutorial of video input and output

* Expose enums as emscripten consts

Fix #72

* update the tutorial to use Mat constructor with Scalar and change lena.jpg

* Exclude cv::Mat for vecFromJSArray

Fix #82

* Add unit tests for cv.moments

* Fix the unit tests.

* add checkbox and stop button

* add adapter.js to make sure compatibility fo video tutorials

* Support default parameters with function overloading

* modify enums to constants

* Use https URL for MathJax.js

Fix #109

* Comment out the debug print in embindgen.py

* Expose RotatedRect

Fix #96

* replace enum with constants and improve onload function

* delete some useless paras cause #105 fixed this

* Modify const name

* Modify Contour Properties

* tutorials for imgprc2 and objdec

* Expose more functions for img proc tutorials

Fix #76

* Expose polylines for video analysis tutorial

Fix #121

* Expose constants for default parameters of img proc tutorials

Fix #122

* Fix wrong parameter types of Mat.copyTo

Fix #87

* Support default parameters of mat.convertTo

Fix #123

* Support default parameters for external constructors

Fix #131

* Revert "Expose polylines for video analysis tutorial"

This reverts commit 3ce7615652e510d30e3c0014706ac38c98883189.

Fix #121

* Support cv.minMaxLoc

Fix #127

* Expose cv.minEnclosingCircle

Fix #126

* Add video analysis tutorials

add three video tutorials, Meanshift and Camshift, Optical Flow Background Subtraction
add cup.mp4 and box.mp4 for demo in tutorials

* improve image processing tutorials

* repalce console.warn with throw to throw exception

* add try-catch to throw exception in code demo

* Change mat.size() return value to JS Array object

Fix #140

* add a note about different channels order between canvas and native opencv

* add a note about how to capture video from video files

* Binding cv.Scalar to JS array

Fix #147

* Add JS cv.Scalar object into helpers.js

* Update Install OpenCV-JavaScript tutorial page

Fix #44

* Update the OpenCV-JavaScript introduction page

Fix #44

* add cv.VideoCapture and read() function

* set the size of the hidden canvas same as the video

* Add Using OpenCV-JavaScript tutorial page

Fix #44

* fix some bad code style

* Update tutorials after 8/2 sync meeting

Changes include:
- Use OpenCV.js name instead of OpenCV-JavaScript
- Put using OpenCV.js ahead of build OpenCV.js
- Refine usage and introduction page
- Muted the video in tutorials

* Fix a typo in introduction page

* use cv.VideoCapture and its read() function to read video

* replace OpenCV-JavaScript with OpenCV.js

* Use onload of async script in js_usage tutorial

* add more info about mat.data

* Change Size to value_object

* Integrate Moh and Sajjad's editing into introduction page

* Change Point to value_object

* Change Rect to value_object with helper object

* Add helper objects for Point and Size

* Change RotatedRect to value_object with helpers

* Change MinMaxLoc and Circle to value_object

* Change TermCriteria to value_object

* Fix core_bindings.cpp for MinMaxLoc and Circle

* Remove unused types

* Change meanShift and CamShift to return Rect

* Change methods of RotatedRect to static

* Change mat.data from methods to property

Fix #75 and #77

* support img id and element in cv.imread

* Change mat.size to property and add mat.step

Fix #163

* Add matFromArray and matFromImageData as JS helpers

Fix #79, #78

* Lower camel case for Mat element getters

Fix #81

* Mat.getRoiRect and tests

Fix #86

* Support type for Mat.ptr

Fix #83

* Name changing of Mat element getters

'getUcharAt` -> 'ucharAt'

* fix code style and args names

* Fix helpers.js due to cv.Mat API update

* Fix opencv.js usage tutorial

* Fix a typo of js_setup

* Change Moments to value_object

* Add Range as value_object

Fix #171

* Support Mat.diag and Mat.isContinous

Fix #84 and #89

* Support Mat.setTo

Fix #88

* Apply edits to js_intro

* Apply edits to js_usage

* Apply edits to js_setup

* update tutorials to apply data type change

* Modify tutorials

* add core tutorials

* delete MatVector elements and delete useless set operation

* add tutorials_objdec_camera

* Add instructions for WebAssembly

* apply tech writer's feedbacks into tutorials

* Organize white list by modules

* Change size to method and bind to MatExpr.size()

Fix #177

* improve tutorials

* Modify core tutorials

* add params list and explanations for OpenCV.js functions

* remove face_profile from Face Detection in Video Capture

* Add demos link

* Change Gui to GUI

* Update js_intro based on Moh and Sajjad's edits

* Fixup for 3.3.0 rebase

* Update js_intro per Moh's suggestion

* Update contributors list per Moh's idea

* add adapter.js in video_display tutorial

* Change Mat.getRoiRect to Mat.roi

Fix #194

* Remove unnecessary files for test

Fix #192

* Licenses updated to UC BSD 3-Clause

* Apply OpenCV coding style for C++ files

* Add OpenCV license for python and js files

* Fix coding style issue in helpers.js

* Remove unused test_commons.js

* Fix coding style of test_imgproc.js

* Fix coding style of test_mat.js

* Fix space before semicolon

* Fix coding style of test_objdetect.js

* Fix coding style of tests.js

* Fix coding style of test_utils.js

* Fix coding style of test_video.js

* Fix failures of node.js tests

* Add eslint rule config and fix eslint errors

* Add eslint config for js/src and fix eslint errors

* Clean up the opencv.js dependencies

Fix #186

* Fix build issue for python generator

* Fix doxygen buildbot failure

* delete trailing whitespace, blank line at EOF and replace tab with space

* Fix tutorial_js_root reference issue for non opencv.js build

* replace the file with small size

* Initial commit of build_js.py

* Move the js build configurations to build script

* Add wasm build support

* Update OpenCV.js build tutorial by using script

* Fix global var issue in tests

* Add a README.md for build_js.py

* Copy the haar cascade files from data dir for tutorials

* Not use memory init file

* Disable debug print for modules/js/CMakeLists.txt

* Check files when build done

* Fix image name in js_gradients tutorial

* Fix image load issue in js_trackbar tutorial

* Find the opencv source directory via relative path by default

* Make the cmake args based on build_doc option

* Fix a typo in js_setup.markdown

* Fix make failure issue on config generated by build_js.py

* Eliminate js branch of hdr_parser.py

* Extract examples from js_basic_ops tutorial

* Fix coding style of utils.js

* Improve examples error handling

Handle:
1. opencv.js loading errors
2. script errors (Error)
3. cv::Exception

Fix #217

* Add enable_exception option into build_js.py

* Support print exception for exception catching disabled build

* Extract example from js_usage tutorial

* Avoid copying .eslintrc.json when building doc

Fix #223

* Revert to use onload as opencv.js ready event

* Use 4 spaces indention for js examples

* embed html in tutorials with iframe tag

* Revert to use onload as opencv.js ready event

* Extract examples from js_video_display tutorial

* Implement Utils object

* modify core imgprc and face_detection tutorials

* Fix examples of js_gui tutorials

* Fix coding style of utils.js

* Modify tutorials

* Extract example from js_face_detection_camera tutorial

* Disable new-cap check in eslint

* Extract examples from js_meanshift tutorial

* Extract examples from video tutorials

* Remove new-cap declaration and update grammer in comments

* Change textarea width to 100 to align with eslint config

* Fix printError issue when opencv.js loading fails

* Remove BUILD_opencv_js dependency for doc build

Fix #213

* Expose cv::getBuildInformation

* Dump opencv build info when opencv.js loaded for live examples

* Make the button to stand out in js live examples

Fix #235

* Style for disabled button

* Add js_imgproc_camera.html example

* Fix coding style of imgproc_camera example

* Add js_imgproc_camera tutorial

* Remove link to opencv.js demos

* doc: copy opencv.js on build, use absolute paths for assets

* doc: reuse existed file box.mp4
2017-09-25 16:52:07 +03:00
Rostislav Vasilikhin 62c4cf3ac6 fixed build of OpenVX Harris 2017-09-25 15:58:09 +03:00
Rostislav Vasilikhin 945706a8e8 softfloat f64_sqrt bug fix 2017-09-25 15:52:56 +03:00
Alexander Alekhin 78788e1efb dnn(perf): update perf tests 2017-09-25 15:32:37 +03:00
Alexander Alekhin b143f7100a Merge pull request #9505 from cbalint13:cuda
Enable CUDA_NVCC_FLAGS at arch detect step.
2017-09-25 14:05:41 +03:00
Vadim Pisarevsky 5a9461056b Merge pull request #9706 from alalek:imgcodecs_tiff_drop_legacy_code 2017-09-25 10:18:37 +00:00
Alexander Alekhin 08b5dc64af imgcodecs(tiff): drop legacy code
Drop code under *undefined* HAVE_TIFF
(violates several policies, like a way to turn off tiff support)
2017-09-24 22:36:17 +00:00
Jacob MacRitchie 8f05af8d05 Fixed my additions. For real this time. I think.
Oops. Hopefully it works this time.
2017-09-24 05:58:22 -03:00
Tomoaki Teshima e932160a8d replace raw SSE2/NEON implementation with universal intrinsic 2017-09-22 23:43:05 +09:00
vipinanand4 39e742765a Merge pull request #9618 from vipinanand4:goodFeaturesToTrack_added_gradiantSize
Added gradiantSize param into goodFeaturesToTrack API (#9618)

* Added gradiantSize param into goodFeaturesToTrack API

Removed hardcode value 3 in goodFeaturesToTrack API, and
added new param 'gradinatSize' in this API so that user can
pass any gradiant size as 3, 5 or 7.

Signed-off-by: Vipin Anand <anand.vipin@gmail.com>
Signed-off-by: Nilaykumar Patel<nilay.nilpat@gmail.com>
Signed-off-by: Prashanth Voora <prashanthx85@gmail.com>

* fixed compilation error for java test

Signed-off-by: Vipin Anand <anand.vipin@gmail.com>

* Modifying code for previous binary compatibility and fixing other warnings

fixed ABI break issue

resolved merged conflict

compilation error fix

Signed-off-by: Vipin Anand <anand.vipin@gmail.com>
Signed-off-by: Patel, Nilaykumar K <nilay.nilpat@gmail.com>
2017-09-22 14:04:43 +00:00
Suleyman TURKMEN 50aa4f8887 Merge pull request #9686 from sturkmen72:patch-1
Update planar_tracking.cpp (#9686)
2017-09-22 14:02:12 +00:00
jrobble c67ad49378 Set swapRB to false in Caffe tests and examples. 2017-09-22 09:58:48 -04:00
Alexander Alekhin b8af7c5f86 ts: update perf test
- use GTest tuple definitions instead of std::tr1
- use "const static" for cv::Size contants to reduce generated binary code
- PERF_TEST_P() violates TEST_P() original semantic. Added PERF_TEST_P_() macro
2017-09-22 14:43:27 +03:00
Vadim Pisarevsky 3f794cd951 Merge pull request #9147 from sovrasov:phase_corr_fix 2017-09-22 10:32:16 +00:00
Dmitry Kurtaev 222149b9c6 Refactored Padding layer 2017-09-22 12:39:00 +03:00
Vitaly Tuzov 22fcbaed64 Added performance test for nearest neighbor resize 2017-09-22 12:34:58 +03:00
Vadim Pisarevsky a0d3d11470 Merge pull request #9649 from dkurt:dnn_reshape_transpose 2017-09-21 19:25:58 +00:00
Vadim Pisarevsky f1695bdc38 Merge pull request #9678 from tomoaki0705:universalFastScore 2017-09-21 19:12:30 +00:00
Alexander Alekhin c39b4b8be1 Merge pull request #9681 from jodrescher:master
Update OpenCVDownload.cmake unpack option
2017-09-21 15:58:48 +00:00
Alexander Alekhin 242cf538b4 Merge pull request #9684 from RaymondKirk:patch-1
Fix 'directory does not exist' in windows tutorial
2017-09-21 15:57:44 +00:00
Raymond Kirk 4059f8b3a3 Fix 'directory does not exist' in windows tutorial 2017-09-21 16:46:58 +01:00
Vitaly Tuzov 9a70fd0123 Disabling reset of 'weights' array for reject level mode of groupRectangles function. 2017-09-21 18:21:50 +03:00
Dmitry Kurtaev 17a85b16fc Remove reorder_dims attribute of Reshape layer 2017-09-21 16:42:03 +03:00
jodrescher 50b651655d Update OpenCVDownload.cmake unpack
Added new "f" flag to the tar unpack, because without it doesn't complete, an compile fails
2017-09-21 14:00:43 +02:00
Rostislav Vasilikhin cc547e8260 Bit-exact version of Luv2RGB_b (#9470)
* lab_tetra squashed

* initial version is almost written

* unfinished work

* compilation fixed, to be debugged

* Lab test removed

* more fixes

* Luv2RGBinteger: channels order fixed

* Lab structs removed

* good trilinear interpolation added

* several fixes

* removed Luv2RGB interpolations, XYZ tables; 8-cell LUT added

* no_interpolate made 8-cell

* interpolations rewritten to 8-cell, minor fixes

* packed interpolation added for RGB2Luv

* tetra implemented

* removing unnecessary code

* LUT building merged

* changes ported to color.cpp

* minor fixes; try to suppress warnings

* fixed v range of Luv

* fixed incorrect src channel number

* minor fixes

* preliminary version of Luv2RGBinteger is done

* Luv2RGB_b is in progress

* XYZ color constants converted to softfloat

* Luv test: precision fixed

* Luv bit-exactness test added

* warnings fixed

* compilation fixed, error message fixed

* Luv check is limited to [0-2,0-2,0-2] by XYZ

* L->Y generation moved to LUT

* LUTs added for up and vp of Luv2RGB_b

* still works

* fixed-point is done, works at maxerr 2

* vectorized code is done, 2x slower than original

* perf improved by 10%

* extra comments removed

* code moved to color.cpp

* test_lab.cpp updated

* minor refactoring

* test added for Luv2RGB

* OCL Luv2RGB_b: XYZ are limited to [0, 2]; docs updated

* Luv2RGB_b rewritten to universal intrinsics

* test_lab.cpp moved to luv_tetra branch
2017-09-21 14:20:45 +03:00
Vadim Pisarevsky bb679f978d Merge pull request #9653 from dkurt:thresh_16u 2017-09-21 10:57:46 +00:00
Vadim Pisarevsky 2ad27f5757 Merge pull request #9673 from dkurt:feature_dnn_tensorflow_defun 2017-09-21 10:55:25 +00:00
Vadim Pisarevsky 8a31a37434 Merge pull request #9674 from alalek:cmake_cl2cpp_fix 2017-09-21 10:54:40 +00:00
Tomoaki Teshima bf718b0865 use universal intrinsic in FAST 2017-09-21 18:28:15 +09:00
Alexander Alekhin 2d813910de Merge pull request #9669 from kraj:master 2017-09-20 19:06:49 +00:00
Alexander Alekhin 3b993431be cmake: fix build process of OpenCL kernels 2017-09-20 18:10:31 +03:00
Alexander Alekhin c57aef75de Merge pull request #9647 from alalek:cmake_ipp_absolute_path 2017-09-20 12:56:33 +00:00
Vadim Pisarevsky e70b75b51a Merge pull request #8820 from woodychow:multithread_sift_findScaleSpaceExtrema 2017-09-20 12:03:25 +00:00
Alexander Alekhin 8755a19e02 Merge pull request #9668 from Erotemic:msvc_version_warning 2017-09-20 11:35:25 +00:00
Dmitry Kurtaev bdd8cc697a Import wrapped Dropout subgraphs from TensorFlow 2017-09-20 13:30:25 +03:00
Khem Raj 2c7a123ed8 Do not enable asm with clang
clang pretends to be gcc 4.2.0 which means we will
use inline asm for no reason, instead of builtins
on clang when possible.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2017-09-19 18:09:30 -07:00
joncrall a936ec325b Added warning when MSVC_VERSION is not recognized 2017-09-19 18:00:25 -04:00
Alexander Alekhin e5890fc92a ocl: fix build 2017-09-19 15:34:36 +03:00
Alexander Alekhin 1283d62e49 ocl: Kernel::runProfiling() 2017-09-19 15:34:35 +03:00
Alexander Alekhin d9ab31490c ocl: profiling queue 2017-09-19 15:32:15 +03:00
Alexander Alekhin 6a5298a532 Merge pull request #9664 from tomoaki0705:fixBuildVS2013 2017-09-19 12:25:18 +00:00
Alexander Alekhin 8129f5378f Merge pull request #9656 from bblanchon:RelWithDebInfo 2017-09-19 11:12:58 +00:00
Adam Rankin fb8143d55d Using environment variable to store capture options (#9292)
* Using environment variable to store options parsed by av_dict_parse_string(ENV{OPENCV_FFMPEG_CAPTURE_OPTIONS}, ";", "|")

* Adding missing mandatory flags parameter

* Guarding against missing function via LIBAVUTIL version

* Code review fixes

Copy/paste error due to coder mistake reverted
Proper version checking for LIBAVUTIL_BUILD
2017-09-19 13:29:43 +03:00
Vadim Pisarevsky fd20529686 Merge pull request #9657 from alalek:ocl_global_size_adjustment 2017-09-19 10:19:45 +00:00
Vadim Pisarevsky 92deccbf41 Merge pull request #9654 from savuor:seamlessclone 2017-09-19 10:16:37 +00:00
Tomoaki Teshima 48c4bea57c fix build on Visual Studio 2013 and earlier 2017-09-19 19:08:23 +09:00
Alexander Alekhin 2e68f89225 ocl: update kernel global size adjustment
Prevents 10000x1 => 10000x8 transformation after getContinuousSize() call
2017-09-18 19:04:46 +03:00
Benoit Blanchon 2d0611bc01 cmake: map RelWithDebInfo and MinSizeRel configuration to Release 2017-09-18 17:47:49 +02:00
Dmitry Kurtaev fa109b94d9 Update 16UC thresholding 2017-09-18 18:34:45 +03:00
Arvid Piehl Lauritsen Böttiger ca245e995a Added support for thresholding CV_16U images. 2017-09-18 15:34:37 +03:00
Vadim Pisarevsky 0624411875 Merge pull request #9624 from nilaykumarpatel:Feature2d_getDefaultName 2017-09-18 10:34:35 +00:00
Vadim Pisarevsky 63584bc4d0 Merge pull request #9444 from hrnr:akaze_tutorial 2017-09-18 10:27:07 +00:00
Vadim Pisarevsky f7df5dd32c Merge pull request #9305 from dkurt:public_dnn_importer_is_deprecated 2017-09-18 09:35:35 +00:00
Vadim Pisarevsky 70c5d69640 Merge pull request #9310 from r2d3:svm_parallel 2017-09-18 09:32:41 +00:00
Vadim Pisarevsky e012ccda4a Merge pull request #9517 from dkurt:tf_mobilenet 2017-09-18 09:31:19 +00:00
Vadim Pisarevsky f4136679ea Merge pull request #9551 from ChristofKaufmann:MultiChannelMask 2017-09-18 09:28:34 +00:00
Vadim Pisarevsky 3358b8910b Merge pull request #9591 from dkurt:feature_dnn_caffe_importer_fp16 2017-09-18 09:26:23 +00:00
Vadim Pisarevsky 73298ea875 Merge pull request #9642 from saskatchewancatch:psnr-checks 2017-09-18 09:24:03 +00:00
Dmitry Kurtaev bd8e6b7e14 Make external cv::dnn::Importer usage is deprecated 2017-09-18 08:52:36 +03:00
Alexander Alekhin 6757101f55 cmake/IPP: use absolute path 2017-09-17 23:12:59 +03:00
Nishant Arora 37ba1d6f2d Merge pull request #9599 from whizzzkid:master
Incorrect Naming (#9599)

* Resolved #9544

* This is a better fix

* This should be good.
2017-09-17 19:24:43 +00:00
Christof Kaufmann 7ec59fc097 Revert changes of mean and meanStdDev 2017-09-17 21:00:28 +02:00
RAJ NATARAJAN 0e44ad5543 Removed unnecessary assertion 2017-09-16 19:55:45 -07:00
Vadim Pisarevsky 4196543cd5 Merge pull request #9313 from dkurt:dnn_perf_test 2017-09-16 19:39:23 +00:00
RAJ NATARAJAN 6da62f56fa Add some useful input assertions to PSNR function
Input arrays must be depth CV_8U and of identical size.
2017-09-15 23:36:58 -06:00
Alexander Alekhin 99fae8146f Merge pull request #9626 from T0ny0:fisheye_fix_ 2017-09-15 20:29:39 +00:00
Tony0 2f0036c918 remove assignments in expressions 2017-09-15 22:45:17 +03:00
Alexander Alekhin 9dea296241 Merge pull request #9458 from csukuangfj:fix-doc 2017-09-15 19:35:01 +00:00
Alexander Alekhin 2566ef3515 Merge pull request #9526 from sturkmen72:update_documentation 2017-09-15 18:47:06 +00:00
Dmitry Kurtaev d891e9b1d8 Layers for MobileNet from TensorFlow 2017-09-15 20:17:30 +03:00
Dmitry Kurtaev 8646d5fb84 FP16 Caffe models import and export 2017-09-15 18:06:34 +03:00
stalin18 d343a58580 removed unnecessary line 2017-09-15 17:09:21 +03:00
stalin18 ed3d2cd122 fixed unnecessary reconstruction in seamlessclone
fixed unnecessary reconstruction in seamlessclone by using only the
required rectangular area in input images
2017-09-15 17:09:21 +03:00
Vadim Pisarevsky 6bf8fe815d Merge pull request #9384 from dkurt:torch_split 2017-09-15 13:05:05 +00:00
Vadim Pisarevsky a391871cce Merge pull request #9301 from dkurt:dnn_npy 2017-09-15 12:42:02 +00:00
Vadim Pisarevsky 41b23fde9f Merge pull request #9524 from dkurt:dnn_torch_openface 2017-09-15 12:38:12 +00:00
Vadim Pisarevsky 48cc1b351d Merge pull request #9560 from sovrasov:undistort_stop_criteria 2017-09-15 12:34:16 +00:00
Vadim Pisarevsky 5707304777 Merge pull request #9633 from saskatchewancatch:psnr-doc 2017-09-15 12:26:34 +00:00
Vadim Pisarevsky cb0d695984 Merge pull request #9616 from dkurt:feature_dnn_tf_importer_atrous_conv 2017-09-15 10:24:05 +00:00
Vadim Pisarevsky d60de63fa0 Merge pull request #9623 from dkurt:hotfix_disable_ssd_cpu_halide_test 2017-09-15 10:21:44 +00:00
saskatchewancatch a90a93b454 i9629 - Added actual documentation for cv::PSNR function 2017-09-14 18:20:00 -06:00
Patel, Nilaykumar K 6857870412 Overloading getDefaultName method for Feature2D and its child classes
Signed-off-by: Vipin Anand <anand.vipin@gmail.com>
Signed-off-by: Prashanth Voora <prashanthx85@gmail.com>
Signed-off-by: Patel, Nilaykumar K <nilay.nilpat@gmail.com>
2017-09-14 23:22:18 +05:30
dtmoodie 3c229aa2eb async bugfix
upload winsize and iters as members to prevent async out of scope issues
2017-09-14 14:48:49 +00:00
Tony0 62df5e8c8b fisheye: fix initUndistortRectifyMap() 2017-09-14 14:57:21 +03:00
Rostislav Vasilikhin 4435ec5f26 Bit-exact version of RGB2Luv_b (#9226)
* Imgproc_ColorLab_Full.accuracy test fixed

* Lab and Luv tests: rewritten, constants explained

* CV_ColorCvtBaseTest: added methods for 8u implementations

* Lab2RGB_b: bit-exactness enabled for all modes; non-vectorized code fixed to comply with vectorized

* srgb support added

* XYZ constants made softdouble

* bit-exact tests written for Lab

* ColorLab_full test fixed

* reverted: no 8u convertors for CV_ColorCvtBaseTest

* added checksum-based test for Lab bit-exactness

* extra declarations removed

* Lab test fix: stop at first mismatch

* test info output improved

* error message fixed

* lab_tetra squashed

* initial version is almost written

* unfinished work

* compilation fixed, to be debugged

* Lab test removed

* more fixes

* Luv2RGBinteger: channels order fixed

* Lab structs removed

* good trilinear interpolation added

* several fixes

* removed Luv2RGB interpolations, XYZ tables; 8-cell LUT added

* no_interpolate made 8-cell

* interpolations rewritten to 8-cell, minor fixes

* packed interpolation added for RGB2Luv

* tetra implemented

* removing unnecessary code

* LUT building merged

* changes ported to color.cpp

* minor fixes; try to suppress warnings

* fixed v range of Luv

* fixed incorrect src channel number

* minor fixes

* preliminary version of Luv2RGBinteger is done

* Luv2RGB_b is in progress

* XYZ color constants converted to softfloat

* Luv test: precision fixed

* Luv bit-exactness test added

* warnings fixed

* compilation fixed, error message fixed

* test_lab.cpp removed
2017-09-14 14:51:27 +03:00
Vladislav Sovrasov b421ebef86 imgproc: slightly change the signature of undistortPoints overload 2017-09-14 12:19:40 +03:00
Vladislav Sovrasov 701c7e5685 imgproc: add stop criteria tuning in undistortPoints 2017-09-14 11:43:54 +03:00
Dmitry Kurtaev 0ce7c33bc8 Torch's Concat and ConcatTable doesn't use Split layer 2017-09-14 09:26:57 +03:00
Dmitry Kurtaev 7dc6b1d7d4 Layers for OpenFace face recognition network 2017-09-14 09:11:31 +03:00
Dmitry Kurtaev 58b890b9f7 Dilated convolution import from TensorFlow 2017-09-13 18:44:14 +03:00
Dmitry Kurtaev 6639348c5e Disable SSD on CPU Halide test 2017-09-13 18:19:54 +03:00
Vadim Pisarevsky 9640bbe76d Merge pull request #9592 from alalek:issue_9589 2017-09-13 14:57:49 +00:00
Faheel Ahmad 7d168d3d6f Improve README (#9243) 2017-09-13 17:58:34 +03:00
Vadim Pisarevsky 32bb71d686 Merge pull request #9603 from alalek:ocl_device_extensions 2017-09-13 14:43:36 +00:00
Vadim Pisarevsky 822d33d64b Merge pull request #9374 from savuor:test_lab_bit_exact 2017-09-13 14:39:04 +00:00
Suleyman TURKMEN d547c6b1a2 documentation improvement 2017-09-13 17:24:59 +03:00
Kerry Billingham 31348f8c30 Removed hard-coded version from integration test. (#9335)
Documented how to change the version of Maven to match OpenCV core and modified bash scripts accordingly.

Extracted integration test module and placed into own profile.

Configured CMake Maven plugin to use native CMake by default.

Updated documentation.
2017-09-13 17:19:16 +03:00
Vadim Pisarevsky bc09d1ba3b Merge pull request #9406 from Cartucho:update_core_tutorials 2017-09-13 14:09:39 +00:00
Vadim Pisarevsky f1aa180a40 Merge pull request #9574 from saskatchewancatch:i9482 2017-09-13 13:59:43 +00:00
Vadim Pisarevsky 8c7f19850f Merge pull request #9576 from dkurt:feature_dnn_tf_importer_fp16 2017-09-13 13:57:38 +00:00
Vadim Pisarevsky da257f3397 Merge pull request #9541 from sturkmen72:patch-15 2017-09-13 13:47:27 +00:00
Vadim Pisarevsky 622318aeae Merge pull request #9561 from dkurt:fix_8693 2017-09-13 13:34:49 +00:00
Vadim Pisarevsky b8b5d83ad0 Merge pull request #9566 from alalek:python_signatures 2017-09-13 13:32:05 +00:00
Vadim Pisarevsky 93c3f20deb Merge pull request #9569 from dkurt:test_dnn_ssd_halide 2017-09-13 13:29:50 +00:00
Vadim Pisarevsky 258b13f2e0 Merge pull request #9600 from StevenPuttemans:fix_9583 2017-09-13 13:27:04 +00:00
Vadim Pisarevsky 42cd061af0 Merge pull request #9581 from sovrasov:rtree_disable_cv 2017-09-13 13:20:52 +00:00
Suleyman TURKMEN f6daaccccf Update train_HOG.cpp 2017-09-12 20:07:37 +03:00
Rostislav Vasilikhin 18ca3d1e62 error message fixed 2017-09-12 20:05:58 +03:00
Rostislav Vasilikhin 2457bfc1e3 test info output improved 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin f6a165d10f Lab test fix: stop at first mismatch 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 92093a6e6c extra declarations removed 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin f1e8aa70a0 added checksum-based test for Lab bit-exactness 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin d25344c257 reverted: no 8u convertors for CV_ColorCvtBaseTest 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 62ee92e3e2 ColorLab_full test fixed 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 375ec5ed7e bit-exact tests written for Lab 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 758f914249 XYZ constants made softdouble 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 121fa04906 srgb support added 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 5ea1c72291 Lab2RGB_b: bit-exactness enabled for all modes; non-vectorized code fixed to comply with vectorized 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin f5dff87242 CV_ColorCvtBaseTest: added methods for 8u implementations 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin f0ef7bd149 Lab and Luv tests: rewritten, constants explained 2017-09-12 17:16:30 +03:00
Rostislav Vasilikhin 0e6c335077 Imgproc_ColorLab_Full.accuracy test fixed 2017-09-12 17:16:30 +03:00
Dmitry Kurtaev ce41a15437 Import and convert FP16 weights from TensorFlow 2017-09-12 09:50:55 +03:00
Alexander Alekhin d9e364f31f Merge pull request #9606 from sovrasov:fix_gcc7_warnings 2017-09-11 18:45:31 +00:00
Vladislav Sovrasov 32bf712102 cmake: disable implicit-fallthrough by default 2017-09-11 16:04:00 +03:00
Steven Puttemans 98e0d13f99 fixing issue 9583 - issue in cascadeclassifier code clipObjects 2017-09-11 09:15:04 +02:00
saskatchewancatch c9d3c0f206 More whitespace fixes 2017-09-10 19:03:56 -06:00
Alexander Alekhin 9e381d0782 ts: dump OpenCL device extensions 2017-09-10 20:32:30 +00:00
Alexander Alekhin 169add5aa6 ocl: added cv::ocl::Device::isExtensionSupported() method 2017-09-10 20:32:30 +00:00
Alexander Alekhin 597b3f4456 Merge pull request #9580 from mshabunin:fix-static-6 2017-09-09 19:31:21 +00:00
Alexander Alekhin 26ad229bd6 Merge pull request #9590 from alalek:ocl_runtime_fix 2017-09-09 19:30:07 +00:00
tribta 45afd29b72 Tutorial Mask Operations on Matrices 2017-09-09 15:20:21 +01:00
tribta 954e2f9b9c Tutorial Discrete Fourier Transform 2017-09-09 15:10:18 +01:00
tribta 13317bdfda Tutorial Basic Geometric Drawing 2017-09-09 15:02:51 +01:00
tribta c4c1e94088 Tutorial Adding Images 2017-09-09 15:02:51 +01:00
saskatchewancatch 30ff197f78 Fix whitespace issues 2017-09-08 20:27:03 -06:00
saskatchewancatch 8877e3aedb Adjustmenbts 2017-09-08 19:55:19 -06:00
Alexander Alekhin 9c973144d8 Merge pull request #9595 from paroj:imreadmulti_py 2017-09-08 14:03:03 +00:00
Alexander Alekhin 576a85368d Merge pull request #9582 from sovrasov:fix_gcc7_macro_warning 2017-09-08 13:31:27 +00:00
Pavel Rojtberg 2d34443834 python: imreadmulti - add CV_OUT so it is correctly wrapped 2017-09-08 15:09:25 +02:00
Alexander Alekhin f8598e173b Merge pull request #9588 from lupustr3:pvlasov/ipp_compatibility 2017-09-08 11:23:41 +00:00
Alexander Alekhin d63f698cbe cudafilters: don't modify "const" data 2017-09-08 14:19:09 +03:00
Alexander Alekhin 44b75eb116 core: fix OpenCL runtime compilation with HAVE_OPENCL_STATIC 2017-09-08 12:43:33 +03:00
Maksim Shabunin 248e2c7d47 Fixed some issues found by static analysis 2017-09-08 12:22:12 +03:00
Pavel Vlasov 37ab318657 Compatibility improvement with old IPP versions (tested on 9.0.1);
Manual IPP dispatcher simplification;
2017-09-08 11:08:24 +03:00
Dmitry Kurtaev cad7c4d51d MobileNet-SSD and VGG-SSD topologies in Halide 2017-09-08 09:55:53 +03:00
saskatchewancatch fda1e76776 Feedback.
Still need to remove the descriptions of these flags from cv::norm
2017-09-07 22:43:55 -06:00
Vladislav Sovrasov eeba5c3603 core: fix gcc7 warning about empty VA_ARGS in Assert macro 2017-09-07 16:20:38 +03:00
Vladislav Sovrasov 3eb9a655c7 ml: disable not implemented k-fold validation in RTrees 2017-09-07 15:49:46 +03:00
Vadim Pisarevsky d25cbaaba8 Merge pull request #9293 from sovrasov:assert_improvement 2017-09-07 11:17:42 +00:00
Vadim Pisarevsky 4970a56341 Merge pull request #9577 from mshabunin:const-foreach 2017-09-07 11:12:45 +00:00
Vadim Pisarevsky f080d9390a Merge pull request #9578 from sovrasov:objdet_build_fix 2017-09-07 11:11:30 +00:00
Vadim Pisarevsky f4265d251a Merge pull request #9579 from alalek:ocl_float_calc 2017-09-07 11:10:20 +00:00
Vladislav Sovrasov f2105419fa objdetect: fix wrong cxx11 features check 2017-09-07 12:49:49 +03:00
Alexander Alekhin 89bb028bfc imgproc(ocl): don't use doubles to process float data 2017-09-07 12:42:20 +03:00
Maksim Shabunin c92c99ed0b Enabled forEach for const Mats 2017-09-07 11:35:14 +03:00
saskatchewancatch 570083fb9f i9482:
Removing description for cv::NormTypes that's already in cv::norm

Masking out NORM_TYPE_MASK from docs since it's not intended to be exposed to user
2017-09-06 22:42:01 -06:00
saskatchewancatch b32685c714 i9482: Improve documentation concerning norm functionality.
Added forkfour Latex command to math js support.

Split cv::norm documentation between the cv::norm and its overload, to make things clearer

Corrected some typos and cleaned up grammar.

Result is clearer documentation for the norms.

Work pending...
2017-09-06 22:35:39 -06:00
Maksim Shabunin 2ac57a2b1f Merge pull request #9457 from alalek:type_traits_issue_7599 2017-09-06 13:34:29 +00:00
Alexander Alekhin b05789ff0b Merge pull request #9564 from saskatchewancatch:i9550 2017-09-06 08:29:16 +00:00
Alexander Alekhin 572a7bf6ce python: add special targets gen_opencv_python2(3) 2017-09-06 08:23:04 +03:00
Alexander Alekhin 200c8a0d3a python: generate pyopencv_signatures.json file 2017-09-06 08:23:04 +03:00
saskatchewancatch 4832c24ef7 Allow TIFF min=white PHOTOMETRIC interpretation images to be read unchanged 2017-09-05 21:43:33 -06:00
Dmitry Kurtaev 8b094755fa Fix https://github.com/opencv/opencv/issues/8693 2017-09-05 23:33:18 +03:00
Lewis B 1caca2112b Merge pull request #8934 from lewisjb:python-classes
* Refactor Python Classes
2017-09-05 05:38:17 +00:00
Alexander Alekhin 42fbbfecc6 Merge pull request #9522 from terfendail:resize_move 2017-09-05 05:33:07 +00:00
Christof Kaufmann 46a668c565 Add multi-channel mask support to mean, meanStdDev and setTo
This adds the possibility to use multi-channel masks for the functions
cv::mean, cv::meanStdDev and the method Mat::setTo. The tests have now a
probability to use multi-channel masks for operations that support them.
This also includes Mat::copyTo, which supported multi-channel masks
before, but there was no test confirming this.
2017-09-04 19:40:27 +02:00
Alexander Alekhin 164a41b399 fix CUDA build
CUDA implementation wants to convert std::vector<KeyPoint> <-> GpuMat.
There is no direct mapping from KeyPoint (mix of int/float fields)
into cv::Mat element type, so this conversion must be avoided.

Legacy mode is turned back for CUDA builds.
2017-09-04 14:41:29 +03:00
Maksim Shabunin 791a11f949 Merge pull request #9548 from alalek:python_tests 2017-09-04 10:14:13 +00:00
Maksim Shabunin 334241d82e Merge pull request #9546 from sturkmen72:GrammaTech 2017-09-04 09:51:22 +00:00
Alexander Alekhin 7791839f22 python(test): tests filtering 2017-09-03 18:26:24 +00:00
Alexander Alekhin 2f94637899 python(test): refactor test.py, move test code outside from test.py 2017-09-03 18:26:09 +00:00
Alexander Alekhin 936234d5b1 python(test): enable pylint checks for tests 2017-09-03 18:19:17 +00:00
Alexander Alekhin e1b102e9a6 Merge pull request #9476 from dkurt:tutorial_dnn_android 2017-09-03 10:34:25 +00:00
Dmitry Kurtaev 72001dc13c Android sample for DNN module 2017-09-03 12:58:10 +03:00
Alexander Alekhin 3df41b3263 Merge pull request #9426 from borisfom:dispatch 2017-09-03 09:24:59 +00:00
Alexander Alekhin 7b4f323b8b Merge pull request #9498 from saskatchewancatch:i9403 2017-09-03 09:15:15 +00:00
Suleyman TURKMEN ee6aacee9c Update window_gtk.cpp
Update miniflann.cpp

Update test_stereomatching.cpp
2017-09-03 04:06:45 +03:00
Alexander Alekhin 62c6656130 Merge pull request #9533 from alalek:regression_test_9507 2017-09-02 06:44:47 +00:00
Alexander Alekhin 4acdcfd008 Merge pull request #9527 from mshabunin:mediasdk-fix 2017-09-01 19:25:12 +00:00
Alexander Alekhin 273add5d5d Merge pull request #9534 from alalek:cmake_cl2cpp_dependency_fix 2017-09-01 18:11:15 +00:00
Alexander Alekhin f7a273cfb3 core(test): regression test for 9507 2017-09-01 21:08:58 +03:00
Alexander Alekhin d57321f7c1 Merge pull request #9528 from berak:fix_bfmatcher_hamming2 2017-09-01 18:07:57 +00:00
Alexander Alekhin 146be78390 cmake: cl2cpp change main OUTPUT to .hpp file
To reduce number of unnecessary rebuilds on updates of OpenCL kernels
2017-09-01 08:24:59 +03:00
saskatchewancatch cc17400849 i9403: Removing checks from trackbar min/max set functions.
Removing unnecessary range checks for QT backend support's setTrackbarMin and setTrackbarMax fucntions

Fixes
2017-08-31 17:52:29 -06:00
Alexander Alekhin 1114cbf671 Merge pull request #9514 from LaurentBerger:docInsWin 2017-08-31 19:19:39 +00:00
LaurentBerger 82ad0749af add pushd popd 2017-08-31 19:25:53 +02:00
Alexander Alekhin 0451629e22 core(persistence): resolve DMatch/KeyPoint problem 2017-08-31 19:35:48 +03:00
Alexander Alekhin 86b55b3923 core: eliminate CV_ELEM_SIZE() 2017-08-31 19:35:48 +03:00
Alexander Alekhin 01519313d7 dnn: invalid bindings 2017-08-31 19:35:48 +03:00
Alexander Alekhin 7e12c879c2 core: extend traits::Type / traits::Depth for compatible types
DMatch and Keypoint are not compatible types (mixed float/int fields)
2017-08-31 19:35:48 +03:00
Alexander Alekhin d0f902053f Merge pull request #9510 from sturkmen72:update_samples 2017-08-31 15:57:45 +00:00
berak da208216ee features2d: fix BFMatcher.radiusMatch with HAMMING2 2017-08-31 17:24:02 +02:00
Maksim Shabunin 235b00b6ee Fixed MediaSDK tests and build warnings 2017-08-31 16:50:42 +03:00
Vitaly Tuzov e8caa9b5c0 removed unused interpolateLinear 2017-08-31 15:34:27 +03:00
Alexander Alekhin 05b99a4dde Merge pull request #9523 from vivekwisdom:master
Corrected Typo in Additional Resources Section
2017-08-31 12:17:29 +00:00
Vivek Wisdom e6ee800fde Corrected Typo in Additional Resources Section
Corrected the Typo 'Hasing' to 'Hashing' in second item in Additional Resources section. Also added Wikipedia link for the LSH.
2017-08-31 17:37:24 +05:30
Alexander Alekhin 72f789bf34 core: fix type traits 2017-08-31 15:05:46 +03:00
Alexander Alekhin f6265500fb Merge pull request #9516 from arrybn:ssd_face_detector 2017-08-31 11:43:04 +00:00
Vitaly Tuzov b1f46b6d69 Move resize implementation to separate file 2017-08-31 14:36:19 +03:00
Aleksandr Rybnikov d991054202 Added files for face detector sample 2017-08-31 13:46:17 +03:00
Balint Cristian 0c4e294504 Enable CUDA_NVCC_FLAGS at arch detect step. 2017-08-31 12:57:43 +03:00
Alexander Alekhin 5c572ffa1f Merge pull request #9509 from borisfom:cuda9-shfl 2017-08-31 09:20:12 +00:00
Alexander Alekhin cae467cda0 Merge pull request #9521 from saskatchewancatch:i9489 2017-08-31 09:19:28 +00:00
LaurentBerger 3e9a659f4c Another way to build opencv
update

add anchor
2017-08-31 08:45:18 +02:00
saskatchewancatch 33ba7867f6 Don't truncate label for tracknbar name (Qt)
Setting truncate option for QString leftJustified method to false fixes 10 character truncation issue noted in issue 9489
2017-08-31 00:40:51 -06:00
Alexander Alekhin 80519a0278 Merge pull request #9326 from sovrasov:video_cap_new_check 2017-08-30 14:29:48 +00:00
Vadim Pisarevsky d743a4c969 Merge pull request #9506 from alalek:ocl_fix_canny_ub_9496 2017-08-30 13:37:44 +00:00
Alexander Alekhin 02d98d3242 Merge pull request #9518 from alalek:fix_flann_unsupported_type 2017-08-30 12:48:02 +00:00
Suleyman TURKMEN efa0e75eac Update stitching.cpp 2017-08-30 15:09:33 +03:00
Alexander Alekhin e1ab227b6d Merge pull request #9515 from berak:fix_directx_samples 2017-08-30 10:33:17 +00:00
Alexander Alekhin 7067c1597d flann: std::vector<size_t> can't be converted into cv::Mat properly
size_t is not supported cv::Mat type
2017-08-30 13:16:00 +03:00
berak a0e26817e2 fix missing std:: in d3dsample 2017-08-30 11:00:18 +02:00
Boris Fomitchev dde04d5d3e Addressing CUDA9 shfl deprecation 2017-08-29 13:27:21 -07:00
Alexander Alekhin 91ef0b9537 Merge pull request #9507 from delftrobotics-forks:restrict-initializer-list-constructor 2017-08-29 18:09:11 +00:00
Alexander Alekhin 964dda2ef2 Merge pull request #9503 from sovrasov:convex_hull_disable_inplace 2017-08-29 16:41:55 +00:00
Alexander Alekhin e3b12bdb59 imgproc(ocl): eliminate div by zero in Canny 2017-08-29 19:29:53 +03:00
Maarten de Vries 3571e8f263 Restrict std::initializer_list constructors to arithmetic types. 2017-08-29 16:37:20 +02:00
Vladislav Sovrasov 91e56abcf1 imgproc: disable buggy inplace processing in convexHull 2017-08-29 15:28:34 +03:00
Alexander Alekhin 4ee3034496 Merge pull request #9504 from alalek:regression_9376 2017-08-29 12:13:18 +00:00
Alexander Alekhin 034aaa7a70 Merge pull request #9465 from tomoaki0705:fixJetsonTK1Build 2017-08-29 11:46:10 +00:00
Alexander Alekhin 8f05126619 imgcodecs: fix regression 9376 2017-08-29 13:31:26 +03:00
Tomoaki Teshima 6531fd142c fix build error on Jetson TK1
* guard correctly in header file
  * guard correctly in cmake file
2017-08-29 19:05:13 +09:00
Vadim Pisarevsky 518c6ae8c6 Merge pull request #9327 from sovrasov:fs_free_on_error_fix 2017-08-28 20:25:34 +00:00
Vadim Pisarevsky 048feeb3f0 Merge pull request #9416 from eruffaldi:f_9411_mingw_videoio 2017-08-28 20:22:56 +00:00
Vadim Pisarevsky b00dff83de Merge pull request #9456 from adishavit:issue_8840/CorrectlyRestoreWindowPosOnMultipleMonitors 2017-08-28 20:15:12 +00:00
Vadim Pisarevsky 4a81492b68 Merge pull request #9474 from miqlas:haiku_support 2017-08-28 20:11:59 +00:00
Vadim Pisarevsky d861c03366 Merge pull request #9479 from alalek:issue_9477 2017-08-28 20:10:32 +00:00
Alexander Alekhin 52a60526f1 Merge pull request #9492 from paroj:ximea_serial 2017-08-28 19:33:54 +00:00
Alexander Alekhin ee26889205 Merge pull request #9495 from alalek:fix_pylint_version 2017-08-28 18:37:50 +00:00
Alexander Alekhin 537ab13842 cmake: fix Pylint version detection 2017-08-28 19:03:44 +03:00
Pavel Rojtberg 01acb08c7b videoio: ximea - allow opening capture by serial number 2017-08-28 16:58:22 +02:00
KUANG Fangjun 11fa0094ff Improve the documentation.
Add demo code for cv::reduce, cv::merge and cv::split.
2017-08-28 12:36:23 +02:00
Dmitry Kurtaev 5c43a394c5 Added performance test for Caffe framework 2017-08-27 19:40:58 +03:00
Adi Shavit 183081ccd3 Changes window position only if BOTH top corners are outside ALL monitors. 2017-08-27 13:47:20 +03:00
Alexander Alekhin 897b071b97 videoio(v4l): move MJPEG/JPEG to the end of probe list 2017-08-27 10:26:05 +03:00
Zoltán Mizsei 6258ff36bc Haiku build fix 2017-08-26 11:37:59 +02:00
Zoltán Mizsei c7516b840a Haiku got no -lrt and -ld 2017-08-26 11:35:13 +02:00
Alexander Alekhin 8ffa29473f Merge pull request #9467 from sovrasov:stereo_calib_fix_td 2017-08-25 14:32:57 +00:00
Vladislav Sovrasov e0ff5106d3 calib3d: fix warning from gcc7 2017-08-25 16:29:59 +03:00
Alexander Alekhin 603fa03ac6 Merge pull request #9441 from wzw-intel:delete_program 2017-08-25 12:03:27 +00:00
Adi Shavit 8a094a5f54 Merge pull request #9445 from adishavit:master
* Adds cv::resizeWindow() overload taking a single cv::Size argument.

* Replaces copied documentaion with Doxygen @overload command.
2017-08-25 11:37:50 +00:00
Vladislav Sovrasov ef7833a271 calib3d: add CALIB_FIX_TANGENT_DIST flag to stereoCalibrate 2017-08-25 13:05:16 +03:00
Wu Zhiwen da3da84a20 ocl: Add a function to unload a run-time cached program
This function is the counterpart of "Context::getProg".
With this function, users have chance to unload a program
from global run-time cached programs, and save resource.
2017-08-25 08:42:11 +08:00
Alexander Alekhin b18983a005 test(hal): properly dispatch FP16 test 2017-08-24 20:54:17 +00:00
Alexander Alekhin bee5cb504b Merge pull request #9140 from Cartucho:linter_python 2017-08-24 19:49:12 +00:00
Alexander Alekhin 717b2f496f Merge pull request #9139 from Cartucho:improve_match_template_py
GSoC - Improving code match_template.py
2017-08-24 19:51:09 +00:00
Alexander Alekhin a2f7132648 Merge pull request #9460 from Cartucho:pylint_samples_py 2017-08-24 19:46:54 +00:00
tribta 7555ab194f Samples Python:
* Unused variables
* Bad identation
2017-08-24 17:45:14 +01:00
Alexander Alekhin 91f680aff6 Merge pull request #9448 from alalek:issue_9443 2017-08-24 16:05:08 +00:00
Alexander Alekhin 3202bbe17c Merge pull request #9349 from dkurt:tf_deconv 2017-08-24 15:58:38 +00:00
Alexander Alekhin bc3280d64d Merge pull request #9414 from gadcam:HOGDescriptor-winSigma 2017-08-24 15:57:18 +00:00
Alexander Alekhin 8e7e24ac80 Merge pull request #9394 from dkurt:fix_halide_wrapper 2017-08-24 15:56:54 +00:00
Alexander Alekhin cc5da83474 Merge pull request #9252 from jbms:fix/tiff-in-memory 2017-08-24 15:33:48 +00:00
Alexander Alekhin c515e878ab build: eliminate Win32 warnings 2017-08-24 16:07:12 +03:00
Alexander Alekhin d195f2775a cmake: change Pylint integration 2017-08-24 14:59:33 +03:00
tribta b7fa6d84bc Using Pylint Tool to Test the python tutorial codes
* Adding CMake script to check if pylint is installed
* Adding Pylint config file (to choose the tests that are enabled)
* Adding CMake script to samples/python/tutorial_code

Testing: bad-indentation, mixed-indentation, unnecessary-semicolon, unused-variable
2017-08-24 14:58:48 +03:00
Alexander Alekhin 9c14a2f0aa Merge pull request #9395 from lupustr3:pvlasov/icv2017u3_update 2017-08-24 11:48:53 +00:00
Alexander Alekhin e80766abf0 Merge pull request #9419 from sturkmen72:patch-1 2017-08-24 09:49:03 +00:00
Alexander Alekhin 25a4559565 Merge pull request #9294 from arrybn:layers_perf 2017-08-24 09:37:49 +00:00
Alexander Alekhin dcfc1fe17e Merge pull request #9333 from dkurt:update_mobilenet_sample 2017-08-24 09:37:08 +00:00
Alexander Alekhin 63cd581d75 Merge pull request #9451 from alalek:fix_warning_self_assign 2017-08-24 08:46:40 +00:00
Boris Fomitchev c48807c383 Merge pull request #9418 from borisfom:cuda9
CUDA9 build fixed, added detection (#9418)

* CUDA9 build fixed, added detection

* Replacing deprecated __shfl_xxx with __shfl_sync, fixing bogus CUDA9 warnings
2017-08-24 07:11:44 +00:00
Alexander Alekhin d0509f6702 Merge pull request #9449 from ribalda:ocv 2017-08-23 19:40:36 +00:00
Alexander Alekhin 1fc9425bb1 Merge pull request #9450 from alalek:issue_9440 2017-08-23 19:40:15 +00:00
Alexander Alekhin 8285924cf3 ts: eliminate build warning '-Wself-assign' 2017-08-23 19:08:55 +03:00
Alexander Alekhin 97aaaf50b8 carotene: removed unnecessary 'register' specifier 2017-08-23 18:57:00 +03:00
Alexander Alekhin c5f2170ce8 carotene: don't use __asm__ with aarch64 2017-08-23 18:56:53 +03:00
Ricardo Ribalda Delgado 6fc5697950 ocl: Fix OpenCL library detection in Linux
OpenCL runtime does not require OpenCL development file (libOpenCL.so),
just the "run" library (so.1).

This patch searches for the run library (so.1) if the dev library (.so)
is not found.

Web search shows that this error has been present since at least 2015
http://answers.opencv.org/question/80532/haveopencl-return-false/

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
2017-08-23 16:38:06 +02:00
Alexander Alekhin aacae20657 imgcodesc: fix code problems with integer overflow / address arithmetic / UB 2017-08-23 17:27:27 +03:00
Alexander Alekhin c9fe702671 Merge pull request #9447 from dkurt:qt_windows 2017-08-23 14:19:45 +00:00
Dmitry Kurtaev 7123d9c376 Added 1ms delay to let system decorate Qt windows 2017-08-23 15:48:52 +03:00
Alexander Alekhin a893b147dc Merge pull request #9428 from csukuangfj:fix-commandline-parser 2017-08-23 12:48:28 +00:00
Pavel Vlasov a57718e1ac ICV2017u3 package update;
- Optimizations set change. Now IPP integrations will provide code for SSE42, AVX2 and AVX512 (SKX) CPUs only. For HW below SSE42 IPP code is disabled.
- Performance regressions fixes for IPP code paths;
- cv::boxFilter integration improvement;
- cv::filter2D integration improvement;
2017-08-23 14:24:43 +03:00
Aleksandr Rybnikov 8b1146deb2 Added function to get timings for layers 2017-08-23 13:40:05 +03:00
KUANG Fangjun 97ec91ad67 fix cv::CommandLineParser.
It should handle bool value not only of "true" but also of "TRUE" and "True".
2017-08-23 11:38:58 +02:00
Jiri Horner f6deaf5f2a tracking tutorial: add fps to stats 2017-08-23 10:40:17 +02:00
Dmitry Kurtaev 1e3052d3cd Update MobileNet object detection sample 2017-08-23 09:29:01 +03:00
Alexander Alekhin b67c64e2c8 Merge pull request #9439 from eruffaldi:macos_build_opengl_qt5_interop2 2017-08-23 04:13:50 +00:00
Emanuele Ruffaldi 301ab43897 apple exclusion 2017-08-22 23:32:01 +02:00
Alexander Alekhin a710317aa0 Merge pull request #9421 from csukuangfj:fix-doc 2017-08-22 20:51:49 +00:00
Alexander Alekhin 8f301151e4 Merge pull request #9438 from lpea:master 2017-08-22 19:25:09 +00:00
Guillaume Jacob 688fcf14f3 CMakeLists.txt: fix a typo in a message 2017-08-22 20:48:35 +02:00
Alexander Alekhin f0fb665407 Merge pull request #9376 from alalek:imgcodecs_refactoring 2017-08-22 16:32:47 +00:00
Dmitry Kurtaev e74c475162 Removed 3rdparty serialized NumPy arrays parser 2017-08-22 18:14:32 +03:00
Alexander Alekhin cc5b99c236 Merge pull request #9436 from alalek:cmake_drop_install_name_dir 2017-08-22 14:10:18 +00:00
Alexander Alekhin af09cb2834 Merge pull request #9347 from kschwan:fix-docs
Fix doxygen comment in BFMatcher
2017-08-22 13:55:03 +00:00
Alexander Alekhin 5adc0bf3a7 Merge pull request #9434 from alalek:fix_numpy_warning 2017-08-22 13:44:47 +00:00
Alexander Alekhin 58dc58aa51 cmake: drop INSTALL_NAME_DIR 2017-08-22 15:26:20 +03:00
Alexander Alekhin 2eb3c02059 Merge pull request #9431 from alalek:cmake_compiler_version 2017-08-22 12:22:45 +00:00
Alexander Alekhin 179ef0a975 Merge pull request #9429 from StevenPuttemans:fix_9404 2017-08-22 09:25:29 +00:00
Alexander Alekhin ea6fe71a50 python: eliminate -Wundef warning about NPY_INTERNAL_BUILD
numpy 1.13.0+
2017-08-22 11:56:55 +03:00
Boris Fomitchev 76f7fb5231 Extending CPU dispatch to the tests; fixing a typo 2017-08-21 20:58:12 -07:00
Dmitry Kurtaev 54f0616a13 Deconvolution layer from TensorFlow 2017-08-21 21:38:07 +03:00
Alexander Alekhin f694192878 cmake: use CMAKE_CXX_COMPILER_VERSION (CMake 2.8.8+)
- '-fvisibility' flag was updated
- PVAPI library detection was changed
2017-08-21 18:06:40 +03:00
Suleyman TURKMEN ea4bcadb38 Update faq.markdown 2017-08-21 17:27:21 +03:00
Steven Puttemans 9b173e2db1 fix description of setTrackbarMin 2017-08-21 12:47:04 +02:00
Alexander Alekhin 89172c08a2 Merge pull request #9049 from Cartucho:improve_mask_tutorial_codes 2017-08-21 07:14:46 +00:00
KUANG Fangjun 336996152a Improve the documentation. 2017-08-20 17:21:39 +02:00
Emanuele Ruffaldi 588ca5d126 videoio for mingw32: added STRSAFE_NO_DEPRECATE and realpath 2017-08-19 23:51:02 +02:00
Alexander Alekhin a2120263de Merge pull request #9415 from alalek:cmake_deprecated_policies 2017-08-19 18:19:31 +00:00
Alexander Alekhin 8c84763ed3 vtk: eliminate 'override' build warning 2017-08-19 16:05:52 +00:00
Alexander Alekhin 87a98e4562 cmake: CMP0026 NEW 2017-08-19 15:15:05 +00:00
Alexander Alekhin e63d3dd25f cmake: CMP0046 NEW 2017-08-19 15:15:05 +00:00
Alexander Alekhin b6949c5088 cmake: CMP0022 NEW 2017-08-19 15:15:05 +00:00
Alexander Alekhin 870d9502bb cmake: CMP0020 NEW 2017-08-19 15:15:05 +00:00
Camille Barneaud d5e64f4eb2 Avoid HOGDescriptor with sigma = 0
Solve #9307.
2017-08-19 15:03:16 +02:00
Alexander Alekhin 3b38eeaccf Merge pull request #9400 from sovrasov:videoio_fix_warn 2017-08-18 16:03:50 +00:00
Vladislav Sovrasov 2b8f888ea4 videoio: remove throw lists since they are deprecated in cxx11 (and gcc7 produces a warning) 2017-08-18 12:07:24 +03:00
Alexander Alekhin 316fb26f5b Merge pull request #9397 from alalek:memcpy_null_guard 2017-08-18 08:47:17 +00:00
Alexander Alekhin a835517049 Merge pull request #9369 from alalek:cpp_refactor_gtk 2017-08-17 20:05:56 +00:00
Alexander Alekhin 5c325466e0 Merge pull request #8847 from Cartucho:java_highgui 2017-08-17 20:04:33 +00:00
Nishant Arora 98db804541 Merge pull request #9210 from whizzzkid/fixing-cuda
Fixing explicitly call download method for cuda::GpuMat object
2017-08-17 16:32:53 +00:00
Alexander Alekhin 71e1889825 core: fix memcpy with zero size 2017-08-17 18:30:31 +03:00
Dmitry Kurtaev 4e28c00e7b Fix Halide buffer behavior in case of OpenCL device memory allocation 2017-08-17 13:27:54 +03:00
Jiri Horner a5b5684670 Merge pull request #9330 from hrnr:akaze_ocl
[GSOC] Enable OCL for AKAZE (#9330)

* revert e0489cb - reenable OCL for AKAZE

* deal with conversion internally in AKAZE

* pass InputArray directly to AKAZE to allow distiguishing input Mat/UMat. deal with conversion there
* ensure that keypoints orientations are always computed. prevents misuse of internal AKAZE class.

* covert internal AKAZE functions to use InputArray/OutputArray

* make internal functions private in AKAZE

* split OCL and CPU paths in AKAZE

* create 2 separate pyramids, 1 for OCL and 1 for CPU
* template functions that use temporaries to always store them as correct type (UMat/Mat)

* remove variable used only in OCL path

causes unused variable warning

* update AKAZE documentation

* run ocl version only when ocl is enabled

* add tests for OCL path in AKAZE

* relax condition for keypoints angle
2017-08-16 16:46:11 +00:00
Alexander Alekhin 78a310630f imgproc(test): add checks for remove() call 2017-08-16 18:56:42 +03:00
Alexander Alekhin 999f41fb4f imgcodecs: refactoring, improve code quality 2017-08-16 18:56:41 +03:00
Alexander Alekhin 3a8dbebd37 Merge pull request #9382 from StevenPuttemans:fix_9121 2017-08-16 13:56:33 +00:00
Alexander Alekhin 0d854db361 build: workaround GCC 7.1.1 compilation issue with sanitize flags
Version: gcc (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3)
Flags: -fsanitize=address,undefined
2017-08-16 14:06:30 +03:00
Alexander Alekhin fdb3d4ff60 Merge pull request #9379 from berak:imgproc_hanning 2017-08-16 10:28:19 +00:00
Steven Puttemans 9e5c9dad55 fix_9121 2017-08-16 11:34:55 +02:00
berak e7b9cfa8f2 imgproc:fix winSize in createHanningWindow() 2017-08-16 08:53:45 +02:00
Alexander Alekhin 1d4a29f149 Merge pull request #9366 from martinsey:brisk-detection-parameter-extension 2017-08-15 10:48:11 +00:00
Martin Seyferth e5f129424c brisk add detection threshold for custom sampling pattern 2017-08-15 11:41:04 +02:00
Rostislav Vasilikhin 66b0651607 Merge pull request #9329 from savuor:softfloat_sincos
SoftFloat: added sin, cos and docs (#9329)

* softfloat: comparison operators made inline, min() max() eps() isSubnormal() added

* softfloat: get/set sign/exp

* softfloat: get/set frac

* softfloat: tests rewritten with new tools

* softfloat: added pi(), sin(), cos()

* softfloat: more comments

* softfloat: updated sincos arg reduction

* softfloat: initial tests for sincos added

* softfloat: test works, code cleanup is pending

* softfloat: sincos argreduce rewritten

* softfloat: sincos refactored and simplified

* softfloat sincos: epsilons calibrated

* softfloat: junk code removed from tests

* softfloat: docs added

* inline comparisons undone; warning fixed
2017-08-15 09:23:26 +00:00
Alexander Alekhin 803274e207 Merge pull request #9358 from azatsman:master 2017-08-15 09:16:45 +00:00
Alexander Alekhin b7ff13b603 Merge pull request #9368 from alalek:fix_9361 2017-08-15 09:14:40 +00:00
Alexander Alekhin 9e239c7a1e highgui: refactor GTK backend
- eliminate legacy C code, used fields
- fix mutex synchronization issues
- set trackbar min/max without unnecessary truncation; allow negative values
2017-08-14 19:33:00 +00:00
Alexander Alekhin 19270103ec Merge pull request #9367 from StevenPuttemans:fix_doc_9359 2017-08-14 15:16:07 +00:00
Alexander Alekhin 7f1114d935 cmake: disable HAVE_POSIX_SEMAPHORES on Apple platform 2017-08-14 17:19:51 +03:00
Steven Puttemans bdcb81e81e fix issue 9359 2017-08-14 16:16:04 +02:00
Alexander Alekhin d1e7a7e06b Merge pull request #9364 from alalek:update_pthread 2017-08-14 14:15:23 +00:00
Alexander Alekhin 6b2510d312 Merge pull request #9317 from sturkmen72:warpPerspective_demo 2017-08-14 13:15:48 +00:00
Alexander Alekhin a048cb9f0d Merge pull request #9338 from dkurt:fix_ocl 2017-08-14 12:56:07 +00:00
Alexander Alekhin 87598c8749 Merge pull request #9365 from alalek:build_fix_parallel 2017-08-14 10:28:53 +00:00
Alexander Alekhin ca9a88785e core(build): fix compilation of parallel.cpp (OpenMP configuration) 2017-08-14 11:42:49 +03:00
Alexander Alekhin 2072168a1c Merge pull request #9360 from tomoaki0705:suppressCalib3dWarning 2017-08-14 08:10:58 +00:00
Alexander Alekhin 6ff9fc67bb build: HAVE_LIBPTHREAD, HAVE_PTHREAD(S) => HAVE_PTHREAD 2017-08-14 10:59:38 +03:00
Tomoaki Teshima 800f656402 suppress warning message 2017-08-14 08:26:06 +09:00
Alex Zatsman e2bfd1a036 Changed NORM_RELATIVE_INF, NORM_RELATIVE_L1 and NORM_RELATIVE_L2 to
NORM_RELATIVE | NORM_INF, NORM_RELATIVE | NORM_L1 and NORM_RELATIVE | NORM_L2
respectively in the documentation for cv::norm and cv::NormTypes
2017-08-13 11:55:35 -04:00
Kim Lindberg Schwaner 7f9fe6f1f2 Fix doxy comment for BFMatcher::create()
A missing asterisk caused doxygen to not generate documentation for the
BFMatcher::create() method.
2017-08-11 14:18:53 +02:00
Alexander Alekhin ef2b73043d Merge pull request #9342 from alalek:fix_parallel_for 2017-08-10 20:22:44 +00:00
Alexander Alekhin 7a10369f4b Merge pull request #9331 from tomoaki0705:suppressWarningVS 2017-08-10 20:22:25 +00:00
Tomoaki Teshima 14b76a5bca suppress warnings on Visual Studio 2013 and earlier 2017-08-10 23:03:27 +09:00
Suleyman TURKMEN 8bb3863f52 New example - warpPerspective_demo.cpp
An example program shows using cv::findHomography and cv::warpPerspective for image warping
2017-08-10 15:08:13 +03:00
Alexander Alekhin fa288af58b Merge pull request #9343 from PhilLab:patch-4 2017-08-10 10:25:36 +00:00
Alexander Alekhin 0e7edca7e3 Merge pull request #9340 from paroj:stereocalib_cpp 2017-08-10 10:24:29 +00:00
Alexander Alekhin 9e5a8ba9f5 Merge pull request #9339 from johnhany:Fix-SyntaxError-check-tests-py 2017-08-10 10:20:05 +00:00
Alexander Alekhin c9fb1434c0 Merge pull request #9332 from csukuangfj:improve-documentation 2017-08-10 10:00:12 +00:00
Alexander Alekhin a5ea5888b8 Merge pull request #9328 from taketwo:example-superres-fix 2017-08-10 09:59:51 +00:00
Philipp Hasper 2c7a15b195 Clarified documentation cv::RotatedRect::points 2017-08-10 11:06:40 +02:00
Alexander Alekhin 0ebabe17df core: fix flag processing for nested regions in cv::parallel_for_() 2017-08-10 08:37:47 +00:00
Pavel Rojtberg 5ada462773 calib3d: use cpp functions in cvStereoCalibrate to make it more readable 2017-08-09 17:21:14 +02:00
John Hany 69e19b88c2 Fix SyntaxError with print 2017-08-09 21:25:16 +08:00
Dmitry Kurtaev 41519d3ac0 Fixed some OpenCL interface bugs 2017-08-09 11:54:55 +03:00
Vladislav Sovrasov 9a10bdbae5 core: use new assert in matmul.cpp 2017-08-08 23:00:11 +03:00
KUANG, Fangjun 4bbe67451d fix some typos in the documentation. 2017-08-08 17:32:04 +02:00
Vladislav Sovrasov 651a1d2869 videoio: don't pass zero fps to 3rd-party codecs 2017-08-08 15:17:42 +03:00
David Geldreich 7c334f45c6 trainAuto: uses parallel_for_ to dispatch all parameters combination to test 2017-08-08 13:27:02 +02:00
Sergey Alexandrov 0f8faa3441 Minor update for example-gpu-super_resolution
* Remove "simple" flow estimation from help (because it was disabled by 653bca8b)
* Add `flush` after printing iteration number for better UX
2017-08-07 21:39:51 +02:00
Vladislav Sovrasov 5e68b28ad3 core: fix file not closed when exception in FS 2017-08-07 21:03:59 +03:00
Vladislav Sovrasov aa54acd54d core: add a test to reproduce #9312 2017-08-07 16:16:14 +03:00
Alexander Alekhin 87c27a074d Merge tag '3.3.0'
OpenCV 3.3.0
2017-08-04 00:00:18 +00:00
Alexander Alekhin 4af3ca4e4d OpenCV version++
OpenCV 3.3.0
2017-08-03 23:58:23 +00:00
Alexander Alekhin 953160ddd6 Merge tag '3.3.0-cvsdk'
OpenCV 3.3.0 for Intel Computer Vision SDK
2017-08-03 23:04:38 +00:00
Alexander Alekhin 5c961169cc Merge pull request #9308 from alalek:akaze_fixes 2017-08-03 22:59:22 +00:00
Alexander Alekhin 94dbc35d92 features2d(test): more AKAZE tests 2017-08-03 22:54:45 +00:00
Alexander Alekhin ad2e864a9a akaze: more fixes
- boundary checks
- div by zero guard
- fixed bilinear interpolation (another case)
- reduce memory allocation
2017-08-03 21:45:35 +00:00
Alexander Alekhin e0489cb4a6 akaze: fix T-API interfaces, disable OpenCL code
- OpenCL kernels don't handle matrices properly. Assumptions are not checked.
- OpenCL/T-API integration is not correct.
2017-08-03 20:35:06 +00:00
Alexander Alekhin 922ac1a1ec Merge pull request #9303 from alalek:akaze_update 2017-08-03 17:17:03 +00:00
Alexander Alekhin c95a97389d Merge pull request #9235 from sturkmen72:patch-3 2017-08-03 17:04:28 +00:00
Alexander Alekhin 2a8322ddbb akaze: uninitialized field 2017-08-03 20:04:21 +03:00
Alexander Alekhin cfb964834c stitching(perf): increase test check tolerance 2017-08-03 19:51:46 +03:00
Alexander Alekhin 73c3d14a66 akaze: fRound -> cvRound, fix bilinear interpolation 2017-08-03 19:51:46 +03:00
Alexander Alekhin f6ceeaa2e5 akaze: getAngle() -> fastAtan2() 2017-08-03 19:51:46 +03:00
Alexander Alekhin 6847cc9f1c akaze: remove usage of int8_t / uint8_t 2017-08-03 19:51:46 +03:00
Alexander Alekhin 411d36ff13 features2d(test): update descriptor regression test 2017-08-03 19:51:46 +03:00
Alexander Alekhin 63ae5f00b1 features2d(test): enable debug messages 2017-08-03 19:51:46 +03:00
Alexander Alekhin 43e0912516 akaze: resolve issue with using of uninitialized memory 2017-08-03 19:51:45 +03:00
Alexander Alekhin 64533009b3 akaze: optimize allocations 2017-08-03 19:51:45 +03:00
Alexander Alekhin 8aca8d90d6 akaze: replace ceil()
- integer division => divUp()
- cast to 'int' => cvCeil()
2017-08-03 19:51:45 +03:00
Alexander Alekhin 9ca39821c8 core: divUp function 2017-08-03 19:51:45 +03:00
Alexander Alekhin 2e608b1c97 Merge pull request #9306 from alalek:cmake_fix_macro
cmake: fix __STDC macros for opencv_world build
2017-08-03 16:32:13 +00:00
Alexander Alekhin dcc63d7408 Merge pull request #9248 from alalek:alloc_refactoring 2017-08-03 16:25:29 +00:00
Alexander Alekhin 5e32de8173 cmake: fix __STDC macros for opencv_world build 2017-08-03 18:40:05 +03:00
Vladislav Sovrasov 5375a77f84 core: add multi-argument CV_Assert 2017-08-03 15:31:05 +03:00
Alexander Alekhin 2f4a3e40eb Merge pull request #9287 from dkurt:tensorflow_unit_tests 2017-08-03 12:21:23 +00:00
Alexander Alekhin 15aa0df23c Merge pull request #9297 from alalek:akaze_remove_rand 2017-08-03 09:21:22 +00:00
Jiri Horner 3166d0c667 Merge pull request #9249 from hrnr:akaze_part3
[GSOC] Speeding-up AKAZE, part #3 (#9249)

* use finding of scale extremas from fast_akaze

* incorporade finding of extremas and subpixel refinement from Hideaki Suzuki's fast_akaze (https://github.com/h2suzuki/fast_akaze)
* use opencv parallel framework
* do not search for keypoints near the border, where we can't compute sensible descriptors (bugs fixed in ffd9ad99f4, 2c5389594b), but the descriptors were not 100% correct. this is a better solution

this version produces less keypoints with the same treshold. It is more effective in pruning similar keypoints (which do not bring any new information), so we have less keypoints, but with high quality. Accuracy is about the same.

* incorporate bugfix from upstream

* fix bug in subpixel refinement
* see commit db3dc22981e856ca8111f2f7fe57d9c2e0286efc in Pablo's repo

* rework finding of scale space extremas

* store just keypoints positions
* store positions in uchar mask for effective spatial search for neighbours
* construct keypoints structs at the very end

* lower inlier threshold in test

* win32 has lower accuracy
2017-08-03 08:35:07 +00:00
dkurt 339793143c Unit tests for TensorFlow importer 2017-08-03 11:29:48 +03:00
Alexander Alekhin 8be1ba708e features2d: don't use rand(), because it is not thread-safe
Results are not stable with srand()
2017-08-02 23:48:54 +03:00
Alexander Alekhin 0bd357e7ec Merge pull request #9296 from dkurt:halide_device_interface 2017-08-02 20:26:30 +00:00
Alexander Alekhin cfe849bd43 Merge pull request #9246 from bragboy:patch-1 2017-08-02 20:22:11 +00:00
Alexander Alekhin d8c70e2e73 Merge pull request #9286 from alalek:rect_size_empty 2017-08-02 20:20:16 +00:00
Alexander Alekhin 03bf0a89b5 Merge pull request #9280 from alalek:fix_repo_url 2017-08-02 20:19:51 +00:00
Alexander Alekhin 1ce9ffcc7f Merge pull request #9285 from arrybn:issue_9223 2017-08-02 17:51:46 +00:00
dkurt b1ef44b1ac Replace halide_opencl_device_interface 2017-08-02 20:38:30 +03:00
Alexander Alekhin da0a36c323 Merge pull request #9288 from sensics:honor-fix-principal-point-fisheye 2017-08-02 10:05:18 +00:00
Aleksandr Rybnikov 8d6b8b45b6 Added ELU and test for it 2017-08-02 11:13:59 +03:00
Ryan Pavlik 5d699e9ba5 Honor fixing principal point in camera calib tutorial. 2017-08-01 10:35:18 -05:00
Alexander Alekhin 321c0ec533 core: empty() for Rect/Size templates
Check for empty objects via .area() is not a good practice due overflows
2017-08-01 17:19:18 +03:00
Alexander Alekhin 4ad45af53f Merge pull request #9253 from jbms:fix/image-decoding-tempfile 2017-08-01 13:47:15 +00:00
Alexander Alekhin 37a7e08b38 Merge pull request #9097 from piotr-semenov:fix/cv_rect_monoid_identity 2017-08-01 13:06:37 +00:00
Alexander Alekhin bab4bc0968 Merge pull request #9284 from ipuustin:dnn-opencl-fixes 2017-08-01 13:06:01 +00:00
Alexander Alekhin f6c4901b8f Merge pull request #9279 from alalek:ocl_fix_program_cache 2017-08-01 13:05:43 +00:00
Jiri Horner bb6496d9e5 Merge pull request #8951 from hrnr:akaze_part2
[GSOC] Speeding-up AKAZE, part #2 (#8951)

* feature2d: instrument more functions used in AKAZE

* rework Compute_Determinant_Hessian_Response

* this takes 84% of time of Feature_Detection
* run everything in parallel
* compute Scharr kernels just once
* compute sigma more efficiently
* allocate all matrices in evolution without zeroing

* features2d: add one bigger image to tests

* now test have images: 600x768, 900x600 and 1385x700 to cover different resolutions

* explicitly zero Lx and Ly

* add Lflow and Lstep to evolution as in original AKAZE code

* reworked computing keypoints orientation

integrated faster function from https://github.com/h2suzuki/fast_akaze

* use standard fastAtan2 instead of getAngle

* compute keypoints orientation in parallel

* fix visual studio warnings

* replace some wrapped functions with direct calls to OpenCV functions

* improved readability for people familiar with opencv
* do not same image twice in base level

* rework diffusity stencil

* use one pass stencil for diffusity from https://github.com/h2suzuki/fast_akaze
* improve locality in Create_Scale_Space

* always compute determinat od hessian and spacial derivatives

* this needs to be computed always as we need derivatives while computing descriptors
* fixed tests of AKAZE with KAZE descriptors which have been affected by this

Currently it computes all first and second order derivatives together and the determiant of the hessian. For descriptors it would be enough to compute just first order derivates, but it is not probably worth it optimize for scenario where descriptors and keypoints are computed separately, since it is already very inefficient. When computing keypoint and descriptors together it is faster to do it the current way (preserves locality).

* parallelize non linear diffusion computation

* do multiplication right in the nlp diffusity kernel

* rework kfactor computation

* get rid of sharing buffers when creating scale space pyramid, the performace impact is neglegible

* features2d: initialize TBB scheduler in perf tests

* ensures more stable output
* more reasonable profiles, since the first call of parallel_for_ is not getting big performace hit

* compute_kfactor: interleave finding of maximum and computing distance

* no need to go twice through the data

* start to use UMats in AKAZE to leverage OpenCl in the future

* fixed bug that prevented computing determinant for scale pyramid of size 1 (just the base image)
* all descriptors now support writing to uninitialized memory
* use InputArray and OutputArray for input image and descriptors, allows to make use UMAt that user passes to us

* enable use of all existing ocl paths in AKAZE

* all parts that uses ocl-enabled functions should use ocl by now

* imgproc: fix dispatching of IPP version when OCL is disabled

* when OCL is disabled IPP version should be always prefered (even when the dst is UMat)

* get rid of copy in DeterminantHessian response

* this slows CPU version considerably
* do no run in parallel when running with OCL

* store derivations as UMat in pyramid

* enables OCL path computing of determint hessian
* will allow to compute descriptors on GPU in the future

* port diffusivity to OCL

* diffusivity itself is not a blocker, but this saves us downloading and uploading derivations

* implement kernel for nonlinear scalar diffusion step

* download the pyramid from GPU just once

we don't want to downlaod matrices ad hoc from gpu when the function in AKAZE needs it. There is a HUGE mapping overhead and without shared memory support a LOT of unnecessary transfers.

This maps/downloads matrices just once.

* fix bug with uninitialized values in non linear diffusion

* this was causing spurious segfaults in stitching tests due to propagation of NaNs
* added new test, which checks for NaNs (added new debug asserts for NaNs)
* valgrind now says everything is ok

* add nonlinear diffusion step OCL implementation

* Lt in pyramid changed to UMat, it will be downlaoded from GPU along with Lx, Ly
* fix bug in pm_g2 kernel. OpenCV mangles dimensions passed to OpenCL, so we need to check for boundaries in each OCL kernel.

* port computing of determinant to OCL

* computing of determinant is not a blocker, but with this change we don't need to download all spatial derivatives to CPU, we only download determinant
* make Ldet in the pyramid UMat, download it from CPU together with the other parts of the pyramid
* add profiling macros

* fix visual studio warning

* instrument non_linear_diffusion

* remove changes I have made to TEvolution

* TEvolution is used only in KAZE now

* Revert "features2d: initialize TBB scheduler in perf tests"

This reverts commit ba81e2a711.
2017-08-01 12:46:01 +00:00
Ismo Puustinen c2de5cf735 dnn: force floating point literals to be float.
In OpenCL code in activations.cl, make the type of floating point
literals to be float. Otherwise the values will be interpreted as
doubles, causing Beignet to have type conversion issues.
2017-08-01 15:02:24 +03:00
Alexander Alekhin 2959e7aba9 Merge pull request #9188 from arrybn:mobilenet_ssd_sample 2017-08-01 11:12:54 +00:00
Aleksandr Rybnikov ce1cc352d9 MobileNet SSD sample 2017-08-01 12:30:27 +03:00
Jeremy Maitin-Shepard 350d483a70 grfmt_tiff: support in-memory TIFF encoding and decoding
Previously, only file-based encoding and decoding were supported with
the libtiff library, leading to the possible use of temporary files.

This fixes issue #8483.
2017-07-31 10:22:11 -07:00
Alexander Alekhin d34eec3ab3 Merge pull request #9278 from alalek:ts_perf_threads 2017-07-31 16:21:51 +00:00
Jeremy Maitin-Shepard 2be955a0ef loadsave: check for errors when using temp file
Previously, the return value of fwrite and fclose were not properly
checked, leading to possible silent truncation of the data if writing
failed, e.g. due to lack of disk space.

Fixes issue #9251.
2017-07-31 09:02:42 -07:00
Alexander Alekhin 830bff1241 fix OpenCV GitHub repository URL 2017-07-31 17:48:57 +03:00
Alexander Alekhin 16fb74425e ocl: fix program cache key 2017-07-31 17:24:08 +03:00
Alexander Alekhin 3786d30320 Merge pull request #9225 from paroj:reproject_cpp 2017-07-31 14:11:37 +00:00
Alexander Alekhin adb62403ec Merge pull request #9276 from mshabunin:bump-dnn-docs 2017-07-31 13:56:03 +00:00
Alexander Alekhin 50b9a5afa9 ts(perf): initialize ThreadPool 2017-07-31 16:51:08 +03:00
Alexander Alekhin 230f22b1cd Merge pull request #9271 from berak:patch-2 2017-07-31 13:10:41 +00:00
Alexander Alekhin 06a9c16961 Merge pull request #9275 from alalek:cmake_protobuf_optional 2017-07-31 12:03:54 +00:00
Alexander Alekhin d22506092e Merge pull request #9274 from alalek:ipp_meanstddev 2017-07-31 12:02:59 +00:00
Alexander Alekhin 728bd68977 Merge pull request #9272 from tomoaki0705:fixCudaBuild 2017-07-31 12:02:40 +00:00
Alexander Alekhin 65519ab786 Merge pull request #9265 from alalek:python_stitching 2017-07-31 12:02:18 +00:00
Maksim Shabunin 886b1f39d9 Moved dnn module documentation and tutorials links higher in the lists 2017-07-31 14:54:28 +03:00
Alexander Alekhin cbced23de4 cmake: don't include protobuf on disabled DNN module 2017-07-31 14:18:59 +03:00
Alexander Alekhin e58a778bd5 core(stat): disable IPP optimization in meanStdDev (cn > 1) 2017-07-31 14:09:18 +03:00
Tomoaki Teshima 1c49796e8e guad for CUDA correctly 2017-07-31 18:42:36 +09:00
berak 6b0661cca1 Update README.android 2017-07-31 08:28:34 +02:00
Alexander Alekhin 46f05f2db6 python: disable assertion in NumpyAllocator 2017-07-30 14:44:11 +03:00
Alexander Alekhin 15a6586062 python: stitching simple test 2017-07-30 14:44:10 +03:00
Alexander Alekhin bdb6b45c91 Merge pull request #9259 from eyolfson:patch-1 2017-07-30 10:08:23 +00:00
Alexander Alekhin 1170d74868 Merge pull request #9261 from puqeko:patch-2 2017-07-30 10:07:09 +00:00
Alexander Alekhin 6ae5a9f07a Merge pull request #9255 from marting87:marting87/gpu_samples_usage_msg 2017-07-30 09:54:53 +00:00
Alexander Alekhin cc1a95d161 Merge pull request #9254 from jtkb:feature/maven_package_update 2017-07-30 09:54:02 +00:00
Alexander Alekhin fffd0f5b68 Merge pull request #9241 from alalek:tlsSlotsSize 2017-07-30 09:53:39 +00:00
Suleyman TURKMEN 89480801b8 some improvements on tutorials 2017-07-29 20:08:19 +03:00
puqeko 9deb206e74 Add tested codecs for OSX 2017-07-29 11:56:02 +12:00
Jon Eyolfson 27cf941284 Remove unused method declarations in hog.cpp
The class `App` appears to have two unused methods: `message` and `checkRectSimilarity`. The is no definition or use of either of these methods. This appears to be dead code.
2017-07-28 10:19:35 -04:00
Kerry Billingham 04cd09a30a Updated package dependency list & package check script. 2017-07-28 10:03:05 +01:00
Martin Ganeff 3ea889050b Removed _gpu-suffix from usage messages to align with executable name 2017-07-28 10:20:59 +02:00
Alexander Alekhin b46e741c95 core(alloc): drop unused code, use memalign() functions instead of hacks
valgrind provides better detection without memory buffer hacks
2017-07-27 18:10:41 +03:00
Alexander Alekhin 34f9c039c5 Merge pull request #9238 from alalek:valgrind_fixes 2017-07-27 14:33:01 +00:00
Alexander Alekhin d35422b523 core(tls): hide assertions from Thread Sanitizer 2017-07-27 17:31:51 +03:00
Bragadeesh d61f5d160d A simple spelling change. 2017-07-27 17:08:45 +05:30
Alexander Alekhin 68ef903a7c core(tls): don't use tlsSlots without synchronization 2017-07-26 22:45:55 +03:00
Alexander Alekhin 06407b4d14 Merge pull request #9233 from LaurentBerger:dnndoc 2017-07-26 16:25:28 +00:00
Alexander Alekhin 12213f9985 flann: fix out of buffer access 2017-07-26 18:17:03 +03:00
Alexander Alekhin caa5e3b4c5 imgproc: fix vectorized code of accumulate 2017-07-26 17:21:46 +03:00
Alexander Alekhin 2e17251160 calib3d: fix invalid memory access 2017-07-26 17:21:46 +03:00
Alexander Alekhin 3f102e5d3a dnn: protobuf shutdown 2017-07-26 17:21:46 +03:00
Alexander Alekhin aad6d28e13 ts: don't run large videoio test (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin 1650c664bc ts: don't run imgcodecs tests on large images (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin d17b099994 ts: don't run DNN tests with large models (valgrind) 2017-07-26 17:21:46 +03:00
Alexander Alekhin 1516103a15 cmake: fix compiler flags 2017-07-26 17:21:46 +03:00
Alexander Alekhin bf0173bf38 ts: update valgrind suppressions 2017-07-26 17:21:45 +03:00
Alexander Alekhin b4e300b78b Merge pull request #9236 from dkurt:fix_json_bool 2017-07-26 13:08:13 +00:00
Alexander Alekhin 402a77e7f7 Merge pull request #9237 from alalek:fix_winrt_build 2017-07-26 10:42:49 +00:00
Alexander Alekhin 2ca561f104 Merge pull request #9217 from alalek:cleanup_3rdparty 2017-07-26 10:38:28 +00:00
Alexander Alekhin 174cb06a7a Merge pull request #9215 from alalek:cmake_min_version 2017-07-26 10:38:11 +00:00
dkurt 583b327523 Fix JSON booleans without quotes 2017-07-26 12:51:06 +03:00
Alexander Alekhin 1081cee35f winrt: update script for MSVS2017 / SDK 10.0 2017-07-26 12:02:43 +03:00
LaurentBerger 69fd57bc96 update tutorial link for dnn 2017-07-25 19:32:17 +02:00
Alexander Alekhin 8e6e05ed3f Merge pull request #9227 from alalek:cmake_fix_ocv_add_testdata 2017-07-25 15:56:57 +00:00
Alexander Alekhin c512bf6c66 Merge pull request #9232 from dkurt:json_named_nodes 2017-07-25 15:56:03 +00:00
Alexander Alekhin bcff9fd067 Merge pull request #9229 from alalek:dnn_torch_memory_leaks 2017-07-25 13:23:18 +00:00
Alexander Alekhin 0d7aeacc34 Merge pull request #9230 from alalek:mat_cleanup_on_exception 2017-07-25 13:17:09 +00:00
dkurt 3515f6ec33 Missed NAMED bit of JSON nodes tag 2017-07-25 13:39:32 +03:00
Alexander Alekhin 602f047fe8 build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
Alexander Alekhin 7f3eea6325 core: fix Mat/UMat cleanup on exceptions in deallocate() 2017-07-25 12:27:30 +03:00
Alexander Alekhin 878a6906cc dnn: fix torch importer memory leaks 2017-07-25 12:20:55 +03:00
Alexander Alekhin 0194d5a2d5 Merge pull request #9222 from dkurt:fix_dnn_tests 2017-07-25 09:09:23 +00:00
Alexander Alekhin d219709cfa Merge pull request #9228 from neok-m4700:cmake 2017-07-25 09:03:10 +00:00
neok-m4700 c2e281f8cf Update OpenCVCompilerOptions.cmake
misplaced else
2017-07-25 10:25:20 +02:00
Alexander Alekhin 07334bc25c cmake: fix ocv_add_testdata() hardcoded path 2017-07-25 06:56:03 +03:00
Pavel Rojtberg 94fdd45b75 calib3d: rewrite reprojectImageTo3D using Matx expressions
about the same speed, but significatly more readable
2017-07-24 17:36:31 +02:00
dkurt 70ff3804e9 Fix SqueezeNet Halide performance test 2017-07-24 10:45:04 +03:00
Alexander Alekhin 8741d97a4f Merge pull request #9216 from alalek:build_global_defines 2017-07-22 04:29:52 +00:00
Alexander Alekhin 432d0fd707 Merge pull request #9213 from tomoaki0705:fixDnnBaseline 2017-07-21 13:34:47 +00:00
Alexander Alekhin e45d5446f2 cleanup unused 3rdparty files 2017-07-21 15:20:13 +03:00
Tomoaki Teshima 0f91faddae fix linker error when trying CPU_BASELINE=AVX 2017-07-21 21:13:47 +09:00
Alexander Alekhin 5e6e12600f build: enable __STDC_FORMAT_MACROS macro 2017-07-21 14:29:03 +03:00
Alexander Alekhin 92f182bc3b minimal CMake version => 2.8.12.2 2017-07-21 14:06:19 +03:00
Alexander Alekhin bc3c7e80a6 Merge pull request #9209 from alalek:fix_persistence_format 2017-07-21 10:55:40 +00:00
Alexander Alekhin 32683ee6e0 Merge pull request #9208 from alalek:ipp_minmaxidx 2017-07-21 10:54:57 +00:00
Alexander Alekhin 544eb4be1f IPP: update minMaxIdx, disable some AVX optimizations with mask 2017-07-21 12:56:36 +03:00
Alexander Alekhin d9e092325b test: regression test for IPP minMaxIdx problem 2017-07-21 12:55:07 +03:00
Alexander Alekhin ec7ce81401 core: fix FileStorage format detection in case of .gz archives 2017-07-20 19:58:36 +03:00
Alexander Alekhin 5bc291937f test: FileStorage format regression test 2017-07-20 19:58:10 +03:00
Alexander Alekhin 9313978f61 Merge pull request #9190 from alalek:update_java_build 2017-07-20 15:32:47 +00:00
Alexander Alekhin ce6b06efb9 Merge pull request #9203 from tomoaki0705:eliminateRandFromTest 2017-07-20 15:31:41 +00:00
Alexander Alekhin f01c029446 Merge pull request #9202 from alalek:cmake-3.9.0 2017-07-20 15:28:38 +00:00
Alexander Alekhin 928552ac9e Merge pull request #9206 from tomoaki0705:fixC11VS2012 2017-07-20 15:27:25 +00:00
Alexander Alekhin ab58cac236 Merge pull request #9194 from tomoaki0705:fixBuildErrorDnn 2017-07-20 15:27:07 +00:00
Tomoaki Teshima 71496e3be4 fix build error on Visual Studio 2012 2017-07-20 22:56:05 +09:00
Tomoaki Teshima e63d628677 remove some rand functions
* make test more reproducible
2017-07-20 22:43:11 +09:00
Alexander Alekhin dcb3c4ff1e Merge pull request #9189 from tomoaki0705:fixCalib3dRandom 2017-07-20 12:24:34 +00:00
Alexander Alekhin 488b5d95dc Merge pull request #9200 from alalek:perf_stitching_win32 2017-07-20 12:08:35 +00:00
Alexander Alekhin 22f12dc93c cmake: fix build with CMake 3.9.0 2017-07-20 14:49:37 +03:00
Alexander Alekhin ad183481c0 perf: skip stitching OpenCL test on Win32 platform 2017-07-20 14:14:22 +03:00
Alexander Alekhin 08c94aa5c0 build: reuse int32_t workaround from softfloat.hpp 2017-07-20 14:01:21 +03:00
Tomoaki Teshima 1989bc33a7 fix build error on Visual Studio 2012 2017-07-20 11:00:04 +09:00
Tomoaki Teshima 46bee83005 fix the test fail on Calib3d_SolvePnP.accuracy
* move array size to enum
  * move array size to member variable
  * loosen the eps of SOLVEPNP_P3P
  * loosen the eps in Calib3d_SolveP3P.accuracy
2017-07-20 06:32:32 +09:00
Alexander Alekhin 2360291c3e java: update source files processing, maven stuff 2017-07-19 22:39:23 +03:00
Alexander Alekhin 12ed7ca63e Merge pull request #9143 from sovrasov:gen_pattern_fix 2017-07-19 15:46:42 +00:00
Alexander Alekhin e8357c0544 build: added DEBUG build guard
To prevent linkage of binary incompatible DEBUG/RELEASE binaries/runtimes
2017-07-19 18:38:08 +03:00
Alexander Alekhin ca479c3f5b Merge pull request #9161 from alalek:separate_debug_symbols 2017-07-19 15:34:43 +00:00
Alexander Alekhin 02829f73e0 Merge pull request #9186 from alalek:cmake_fix_dump_duplication 2017-07-19 11:21:48 +00:00
Alexander Alekhin a44c0fd51f cmake: ocv_cmake_dump_vars() remove duplicated information 2017-07-19 12:37:36 +03:00
Alexander Alekhin 773365405f Merge pull request #9037 from arrybn:googlenet_test 2017-07-18 16:35:00 +00:00
Alexander Alekhin cb0a61b9ba Merge pull request #9181 from alalek:stitching_perf_test 2017-07-18 15:53:32 +00:00
Alexander Alekhin 8a9a9403a3 Merge pull request #9180 from alalek:fix_photo_crash_win32 2017-07-18 15:52:25 +00:00
Aleksandr Rybnikov 7d1140340e Rewrote googlenet tests 2017-07-18 18:49:14 +03:00
Alexander Alekhin 862242aa8d stitching(perf): check for available OpenCL memory 2017-07-18 17:26:21 +03:00
Alexander Alekhin 1ff6c758ec photo: crash workaround for MSVC 2015 32-bit 2017-07-18 16:04:35 +03:00
Alexander Alekhin 6ba22dea46 Merge pull request #8967 from savuor:rgb2lab_faster 2017-07-17 19:55:19 +00:00
Rostislav Vasilikhin 70b984434d RGB2Lab_f and trilinear interpolation code are in separate branch; cubeRoot(x) instead of std::pow(x, 1.f/3.f)
file with internal accuracy&speed tests moved to lab_tetra branch
2017-07-17 21:59:54 +03:00
Alexander Alekhin e5ed9cc612 Merge pull request #8498 from savuor:bit_exact_lab 2017-07-17 14:01:05 +00:00
Alexander Alekhin 1fbf914348 Merge pull request #9176 from alalek:fix_nightly_builds 2017-07-17 13:37:46 +00:00
Alexander Alekhin 09436df1ad Merge pull request #9175 from alalek:issue_9169 2017-07-17 13:05:12 +00:00
Alexander Alekhin 4bb4a349c9 imgproc: fix warp optimizations 2017-07-17 15:12:41 +03:00
Alexander Alekhin b4716b1d92 core: fix convertTo() AVX2 optimization 2017-07-17 15:02:14 +03:00
Alexander Alekhin acc8589083 core: clarify documentation of cv::Mat::deallocate() method 2017-07-17 13:31:47 +03:00
Alexander Alekhin c0dc2f2bb3 Merge pull request #9173 from thcd:patch-1 2017-07-17 10:09:33 +00:00
Alexander Alekhin 66ab4e15db Merge pull request #9172 from atinfinity:fixed_cxx11_flag 2017-07-17 07:56:31 +00:00
Shuyu Liang c10d08f795 Fix typo in imgproc.hpp 2017-07-17 15:51:10 +08:00
Rostislav Vasilikhin 4b75be801e initial version of Lab2RGB_f tetrahedral interpolation written
RGB2Lab_f added, bugs fixed, moved to float

several bugs fixed

LUT fixed, no switch in tetraInterpolate()

temporary code; to be removed and rewritten

before refactoring

extra interpolations removed, some things to do left

added Lab2RGB_b +XYZ version, etc.

basic version is done, to be sped up

tetra refactored

interpolations: LUT for weights, refactor., etc.

address arithm optimized

initial version of vectorized code added (not compiling now)

compilation fixed, now segfaults

a lot of fixes, vectorization temp. disabled

fixed trilinear shift size, max error dropped from 19 to 10

fixed several bugs (255 vs 256, signed vs unsigned, bIdx)

minor changes

packed: address arithmetics fixed

shorter code

experiments with pure integer calculations

Lab2RGB max error decreased to 2; need to clean the code

ready for vectorization; need cleaning

vectorized, to be debugged

precision fixed, max error is 2

Lab->XYZ shortened

minor fixes

Lab2RGB_f version fixed, to be completely rewritten using _b code

RGB2Lab_f vectorized

minors

moved to separate file

refactored Lab2RGB to float and int versions

minor fix

Lab2RGB_f vectorized

minor refactoring

Lab2RGBint refactored: process methods, vectorize by 4 pix

Lab2RGB_f int version is done

cleanup extra code

code copied to color.cpp

fixed blue idx bug

optimizations enabled when testing; mulFracConst introduced

divConst -> mulFracConst

calc min time in perf instead of avg

minors

process() slightly sped up

Lab2RGB_f: disabled int version

reinterpret added, minor fixes in names

some warnings fixed

changes transferred to color.cpp

RGB2Lab_f code (and trilinear interpolation code) moved to rgb2lab_faster

whitespace

shift negative fixed

more warnings fixed

"constant condition" warnings fixed, little speed up

minor changes

test_photo decolor fixed

changes copied to test_lab.cpp

idx bounds checking in LUT init

several fixes

WIP: softfloat almost integrated

test_lab partially rewritten to SoftFloat

color.cpp rewritten to SoftFloat

test_lab.cpp: accuracy code added

several fixes

RGB2Lab_b testing fixed

splineBuild() rewritten to SoftFloat

accuracy control improved

rounding fixed

Luv <=> RGB: rewritten to SoftFloat

OCL cvtColor Lab and Lut rewritten to SoftFloat

minor fixes

refactored to new SoftFloat interface

round() -> cvRound, etc.

fixed OCL tests

softfloat.cpp: internal functions made static, unused ones removed

meaningful constants

extra lines removed

unused function removed

unfinished work

it works, need to fix TODOs

refactoring; more calls rewritten

mulFracConst removed

constants made bit exact; minors

changes moved to color.cpp

fixed 1 bug and 4 warnings

OCL: fixed constants

pow(x, _1_3f) replaced by cubeRoot(x)

fixed compilation on MSVC32

magic constants explained

file with internal accuracy&speed tests moved to lab_tetra branch
2017-07-17 00:32:30 +03:00
atinfinity ac64713881 fixed 'OpenCVDetectCXXCompiler.cmake' to detect C++11 feature 2017-07-17 00:20:14 +09:00
Alexander Alekhin c455fc0334 Merge pull request #9133 from sovrasov:mser_add_test 2017-07-14 19:38:05 +00:00
Alexander Alekhin 42c0914382 Merge pull request #9086 from catree:improve_solvePnPRansac 2017-07-14 17:28:47 +00:00
Alexander Alekhin 49e1f6b161 Merge pull request #9091 from alalek:update_ffmpeg 2017-07-14 17:25:35 +00:00
Alexander Alekhin 1a4c22fc46 Merge pull request #9095 from alalek:fix_gstreamer 2017-07-14 17:24:14 +00:00
Alexander Alekhin 5f4c7372c0 Merge pull request #9159 from alalek:cmake_target_rename 2017-07-14 17:19:26 +00:00
Alexander Alekhin d07eb9ad60 Merge pull request #9157 from zhmu:opencv-dshow-allow-enable-disable-of-debug-messages 2017-07-14 17:18:31 +00:00
Alexander Alekhin 5a54acef4e Merge pull request #9130 from alalek:android_define 2017-07-14 17:17:24 +00:00
Vladislav Sovrasov e5fbb4f5d2 Merge pull request #9034 from sovrasov:mats_from_initializer_list
Add constructors taking initializer_list for some of OpenCV data types (#9034)

* Add a constructor taking initializer_list for Matx

* Add a constructor taking initializer list for Mat and Mat_

* Add one more method to initialize Mat to the corresponding tutorial

* Add a note how to initialize Matx

* CV_CXX_11->CV_CXX11
2017-07-14 17:17:09 +00:00
Alexander Alekhin 11626fe32c Merge pull request #8975 from sovrasov:fs_additional_errors 2017-07-14 17:13:50 +00:00
Alexander Alekhin 63e89bc326 Merge pull request #9048 from sovrasov:morph_hitmiss_fix
imgproc: fix MORPH_HITMISS operation when kernel has no negative values
2017-07-14 17:13:06 +00:00
Satoshi Tanaka 96a3c7954d Merge pull request #8914 from stnk20:gstreamer_yuv
Add gstreamer capture capability for some YUV formats (#8914)

* Add gstreamer capture capability for some YUV formats.(only for gstreamer-1.0)

* avoid cross initialization error

* add checking if pipeline is manualpipeline, for compatibility.
2017-07-14 17:11:30 +00:00
Vladislav Sovrasov 25af743902 mser: add a couple of new regression tests 2017-07-14 20:07:32 +03:00
gylns 6d1cdcf601 Merge pull request #8910 from gylns:mser
fix the MSER history's size issue (#8910)

* simplify growHistory and merge

* add assertion for history's size

* MSER: fix merging components' history
2017-07-14 16:58:56 +00:00
Alexander Alekhin dc59476c34 Merge pull request #9078 from arrybn:resnet_squeezenet_tests
Added tests for ResNet-50 and SqueezeNet v1.1
2017-07-14 16:50:25 +00:00
Alexander Alekhin 4e39d0371d Merge pull request #9074 from alalek:cpu_dispatch_core_hamming
cpu dispatch(core): hamming
2017-07-14 16:48:07 +00:00
Alexander Alekhin 11feae6631 Merge pull request #9041 from terfendail:filter_avx
AVX optimized implementation of separable filters migrated
2017-07-14 16:45:27 +00:00
Alexander Alekhin eef78f5664 Merge pull request #9061 from terfendail:convert_avx
AVX and SSE4.1 optimized conversion migrated
2017-07-14 16:43:54 +00:00
Alexander Alekhin 9ef742bbf4 Merge pull request #9082 from terfendail:imgwarp_avx
AVX and SSE4.1 optimized implementation of resize and warp functions migrated
2017-07-14 16:42:42 +00:00
Alexander Alekhin 928bfe0b93 Merge pull request #9088 from sovrasov:no_nostl
core: get rid of OPENCV_NOSTL definition
2017-07-14 16:26:03 +00:00
Alexander Alekhin 86e8a105a5 Merge pull request #9090 from vpisarev:dnn_optim_scale_concat 2017-07-14 16:21:24 +00:00
Alexander Alekhin a586ef725c Merge pull request #9127 from willbrazil:master
Fix typo in harris corner detection tutorial.
2017-07-14 16:12:48 +00:00
Alexander Alekhin fe7fd4c312 Merge pull request #9098 from savuor:fix/luv_div 2017-07-14 15:46:03 +00:00
Vadim Pisarevsky 0488d9bdb2 optimize out scaleLayer & concatLayer whenever possible
fixed problem in concat layer by disabling memory re-use in layers with multiple inputs

trying to fix the tests when Halide is used to run deep nets

another attempt to fix Halide tests

see if the Halide tests will pass with concat layer fusion turned off

trying to fix failures in halide tests; another try

one more experiment to make halide_concat & halide_enet tests pass

continue attempts to fix halide tests

moving on

uncomment parallel concat layer

seemingly fixed failures in Halide tests and re-enabled concat layer fusion; thanks to dkurt for the patch
2017-07-14 18:30:53 +03:00
Alexander Alekhin 431e2e6d68 Merge pull request #9042 from terfendail:haar_avx
AVX optimized implementation of haar migrated to separate file
2017-07-14 15:05:11 +00:00
Alexander Alekhin 9439872a62 Merge pull request #9021 from terfendail:corner_avx 2017-07-14 14:58:06 +00:00
Alexander Alekhin f6dd549e58 Merge pull request #9027 from terfendail:undistort_avx 2017-07-14 14:56:42 +00:00
Alexander Alekhin 454bc7a674 Merge pull request #9063 from alalek:hamming_perf_test 2017-07-14 14:46:17 +00:00
Alexander Alekhin 8f4b534937 Merge pull request #9093 from wzw-intel:histogram 2017-07-14 14:38:55 +00:00
Alexander Alekhin e251ed7773 Merge pull request #9122 from ivsgroup:fix_msvc_virtual_destructor 2017-07-14 14:37:22 +00:00
Alexander Alekhin 0e6ebafdb3 Merge pull request #9110 from patrikhuber:fix-msvc1911-cmake 2017-07-14 14:37:01 +00:00
Alexander Alekhin 7d17d20dce Merge pull request #9153 from sovrasov:fix_tangent_dist_flag 2017-07-14 14:35:51 +00:00
Alexander Alekhin 1d2baf0bd3 Merge pull request #9094 from ArkadiuszRaj:fix-aravis-dependency 2017-07-14 14:31:57 +00:00
Alexander Alekhin 10e6491c22 Merge pull request #9024 from tomoaki0705:featureDispatchAccumulate 2017-07-14 14:30:06 +00:00
Alexander Alekhin 95a438d233 OpenCV version '-cvsdk' 2017-07-14 13:03:12 +03:00
Alexander Alekhin 4238add35b Merge pull request #9058 from alalek:dnn_minor_fixes 2017-07-14 09:53:09 +00:00
Alexander Alekhin f448d75aa8 build: added DEBUG build guard
To prevent linkage of binary incompatible DEBUG/RELEASE binaries/runtimes
2017-07-14 01:25:31 +03:00
Alexander Alekhin 19c9174543 cmake: rename cpufeatures target
It is configurable via OPENCV_CPUFEATURES_TARGET_NAME variable
2017-07-13 19:24:10 +03:00
Alexander Alekhin 4784c7be5f dnn: cleanup dispatched code, fix SIMD128 types 2017-07-13 19:00:34 +03:00
Alexander Alekhin c3e6de293f dnn: code cleanup, refactor detection output layer 2017-07-13 19:00:34 +03:00
Alexander Alekhin 544908d06c dnn: some minor fixes in docs, indentation, unused code 2017-07-13 15:33:49 +03:00
Alexander Alekhin 520da7aaaf Merge pull request #9111 from vpisarev:dnn_optim_avx1 2017-07-13 12:27:05 +00:00
Vladislav Sovrasov bb0f9d6bc4 core: use matlab-style in 2d fftShift 2017-07-13 13:33:02 +03:00
Rink Springer df7fb00c21 dshow: Only show debugging messages if environment variable OPENCV_DSHOW_DEBUG is explicitly set to non-zero
Based on discussion at: https://github.com/opencv/opencv/pull/9051
2017-07-13 11:44:20 +02:00
Vladislav Sovrasov fa17267e05 calib3d: fix not working CALIB_FIX_TANGENT_DIST flag 2017-07-13 10:49:35 +03:00
Alexander Alekhin ed4de20fd1 Merge pull request #9107 from alalek:static_analyze_python 2017-07-12 16:45:14 +00:00
Alexander Alekhin 9b9e685dbc Merge pull request #9142 from alalek:vzeroupper_guard_unused_warning 2017-07-12 16:44:00 +00:00
Alexander Alekhin 49bb0bf9c8 Merge pull request #9149 from alalek:ocl_fp16_test 2017-07-12 16:23:33 +00:00
Alexander Alekhin d6c5e18e24 core(test): fix input data for OCL FP16 test 2017-07-12 18:51:11 +03:00
Alexander Alekhin 617e6b4cc9 Merge pull request #9145 from alalek:ipp_minmaxidx_nan 2017-07-12 15:37:54 +00:00
Vladislav Sovrasov a683a496ea core: use matlab-style 1d fftShift in pc 2017-07-12 18:01:58 +03:00
Alexander Alekhin 5ebfb52a4a ipp(minmaxIdx): disable SSE4.2 optimizations for 32f datatype
NaN values handling issue
2017-07-12 16:06:18 +03:00
PkLab.net 6dd9e18b2e add std::string overload for cv::read() 2017-07-12 15:51:11 +03:00
Vladislav Sovrasov 5b833db558 core: forbid conversion real->int in some cases in FileStorage 2017-07-12 15:50:57 +03:00
Vladislav Sovrasov fce018e7a9 Fix wrong chessboard generation in gen_pattern tool 2017-07-12 15:32:40 +03:00
Alexander Alekhin e7cc2eea1d build: fix unused variable warning for vzeroupper guard 2017-07-11 16:46:35 +03:00
tribta 7c65f7ef11 Fixing Bad identations (line 18 to 96)
Adding _ to the unused variables for clarity (line 77)
2017-07-11 11:59:22 +01:00
Alexander Alekhin a4a47b538c build: detect Android via '__ANDROID__' macro
https://sourceforge.net/p/predef/wiki/OperatingSystems
2017-07-10 12:43:59 +03:00
Guilherme William Guedes d098048aba Fix typo: 'right direction' to 'y direction'.
Fix typo: 'right direction' to 'y direction' in harris corner detector tutorial.
2017-07-09 15:57:55 -07:00
Pascal Thomet 309c962169 core/bufferpool.hpp: let msvc accept a non virtual protected destructor
BufferPoolController has a non virtual protected destructor (which is legitimate)

However, Visual Studio sees this as a bug, if you enable more warnings, like below
```
add_compile_options(/W3)     # level 3 warnings
add_compile_options(/we4265) # warning about missing virtual destructors
```

This is a proposition in order to silence this warning.

See https://github.com/ivsgroup/boost_warnings_minimal_demo for a demo of the same problem
with boost/exception.hpp
2017-07-08 16:15:26 +02:00
Tomoaki Teshima e7d5dbfec0 dispatch accumulate series
- use universal intrinsic for base
 - dispatch for float/double version using AVX
 - AVX2 optimization not done yet
2017-07-07 18:45:30 +09:00
Vadim Pisarevsky ed9564106c reuse AVX2-optimized kernels for AVX1 CPUs (like IvyBridge) 2017-07-06 21:36:59 +03:00
Patrik Huber 600b7a30e6 Added detection of MSVC1911
This is VS2017 Preview. It makes sure the version is detected properly and the INSTALL target then correctly installs to x64/vc15 (the same as MSVC1910).
2017-07-06 19:02:19 +01:00
Alexander Alekhin b32d914aab static analyze: python dynamic_cast checks 2017-07-06 17:11:51 +03:00
Vitaly Tuzov 526d1d6db1 AVX optimized implementation of undistort migrated to separate file 2017-07-06 12:08:25 +03:00
Rostislav Vasilikhin aa621d6f3c magic constants explained 2017-07-06 00:30:53 +03:00
Rostislav Vasilikhin 704c688225 OCL code fixed, fix for NEON added 2017-07-05 22:08:49 +03:00
Rostislav Vasilikhin 6c71988c54 RGB2Luv_f: R, G, B limited to [0, 1] 2017-07-05 22:08:49 +03:00
Rostislav Vasilikhin 82811d0706 Luv: singularities fixed 2017-07-05 22:08:49 +03:00
Piotr Semenov c5b5d5c8d3 Fix. Now cv::Rect() is the identity under cv::Rect::operator| operation 2017-07-05 19:01:13 +03:00
Alexander Alekhin cc862e996e videoio: fixes for GStreamer support
- emulated frame counter (with autodetection of GStreamer broken behavior)
- skip 'seek' tests if seeking is not supported by backend
- update 'fps' and total frames checks (increase error tolerance)
- update synthetic image generation
2017-07-05 16:52:48 +03:00
wzw 635342ab73 ocl_calcHist1: Use proper local size for merge_histogram kernel
merge_histogram kernel only need "BINS" theads to accumulate the
histgrams, it is not efficient to directly use maxGroupSize as
local size if maxGroupSize is far greater then BINS.
2017-07-05 21:24:09 +08:00
catree 98c78e0acd Use directly solvePnP when the number of input points is equal to the number of model points. Enable useExtrinsicGuess parameter. Return rvec and tvec estimated using all the inliers instead of the best rvec and tvec estimated during the Minimal Sample Sets step. Document the behavior of solvePnPRansac. 2017-07-05 13:17:38 +02:00
Alexander Alekhin 6833b46a05 videoio(test): fix message 2017-07-05 13:45:34 +03:00
Arkadiusz Raj 0ef5c8c541 Fixing Aravis support compilation issue 2017-07-05 11:30:43 +02:00
Alexander Alekhin 359bd21bd7 ffmpeg: update 3.3.2
- ffmpeg 3.3 -> 3.3.2
- added VERSIONINFO
2017-07-04 18:49:30 +03:00
Vitaly Tuzov fadf25acd6 SSE4_1 optimized implementation of resize and warp functions migrated to separate file 2017-07-04 17:05:36 +03:00
Vitaly Tuzov 77264dcca9 AVX optimized implementation of haar migrated to separate file 2017-07-04 16:54:48 +03:00
Vitaly Tuzov 5448d9186a AVX and SSE4.1 optimized conversion implementations migrated to separate files 2017-07-04 14:48:01 +03:00
Vladislav Sovrasov 2a2a1dc5b4 Get rid of OPENCV_NOSTL definition 2017-07-04 14:17:02 +03:00
Vitaly Tuzov 4d0f789e0a AVX optimized implementation of separable filters migrated to separate file 2017-07-04 13:47:47 +03:00
Aleksandr Rybnikov d3c14ce3ea Added tests for ResNet-50 and SqueezeNet v1.1 2017-07-04 12:19:27 +03:00
Vladislav Sovrasov 42936d3227 imgproc: fix MORPH_HITMISS operation when kernel has no negative values 2017-07-04 11:17:44 +03:00
Vitaly Tuzov 3681dcef1a AVX optimized implementation of resize and warp functions migrated to separate file 2017-07-03 18:18:20 +03:00
Alexander Alekhin b3f5e3bf94 core(stat): optimize size of binaries, drop AVX dispatch (no imrovements) 2017-07-02 22:45:10 +00:00
Alexander Alekhin b66c349bba core(stat): add required CV_AVX_GUARD
Added guard with 'vzeroupper' instruction
2017-07-02 22:45:10 +00:00
Alexander Alekhin c45d3568ae core(stat): register dispatched code, fix build 2017-07-02 22:45:10 +00:00
Alexander Alekhin 6a6222d21c core(stat): remove useless checks 2017-07-02 22:45:10 +00:00
Alexander Alekhin 880052d3f3 core(stat): create dispatch.cpp file 2017-07-02 22:45:10 +00:00
Alexander Alekhin 85afbd409b core(stat): move implementations into .hpp file w/o changes 2017-07-02 22:45:09 +00:00
Alexander Alekhin 03c3e0edcf core(stat): stat.cpp minor refactoring
- remove unused code
- added: #if CV_ENABLE_UNROLLED in Hamming's functions
2017-07-02 22:45:09 +00:00
Alexander Alekhin 4f558e8b89 cmake: added "SSE4_2" into default CPU dispatch 2017-07-02 22:45:09 +00:00
tribta 6512a4b7e3 OpenCV Java Highgui Class
The objective is to:

    *Reduce greatly the number of lines of code in the Java codes;
    *Make it easy for Java users to add a trackbar and show the results;
    *Get the code more similar between C++, Java and Python, making the tutorials more uniform.
2017-07-01 11:07:20 +01:00
Alexander Alekhin 582bb3c311 core(perf): added Hamming tests 2017-07-01 00:49:18 +00:00
tribta d53a5210a8 Improving codes of the tutorial: mat_mask_oprations
*Fixing typos;
*Making codes more similar to the main one, in C++;
*Adding Grayscale option to the Python and Java codes;
*Fixing python identation, whitespaces and redundancies.
2017-06-30 12:38:24 +01:00
Vitaly Tuzov 1ed9a58b64 AVX optimized implementation of Harris corner detector migrated to separate file 2017-06-29 15:19:23 +03:00
678098 d0ab595f52 batch-oriented mutex locking in parallel haar detect loop body 2017-06-21 23:25:57 +03:00
Woody Chow 5a4f2b5d27 Add function to sort keypoints that are calculated in parallel to ensure stable output 2017-05-29 17:59:20 +09:00
4192 changed files with 566414 additions and 525500 deletions
+31
View File
@@ -0,0 +1,31 @@
# https://editorconfig.org/
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[{CMakeLists.*,*.cmake}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
[*.{bat,cmd,cmd.*}]
end_of_line = crlf
indent_style = space
indent_size = 2
[*.{ps1,ps1.*}]
end_of_line = crlf
indent_style = space
indent_size = 4
[*.{md,markdown}]
indent_size = 2
+4
View File
@@ -43,6 +43,8 @@
# reST underlines/overlines can look like conflict markers
*.rst text conflict-marker-size=80
# Markdown heading markers can look like conflict markers
*.md text conflict-marker-size=200
*.cmake text whitespace=tabwidth=2
*.cmakein text whitespace=tabwidth=2
@@ -79,6 +81,8 @@ org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
*.cmd text eol=crlf
*.cmd.tmpl text eol=crlf
*.dsp text eol=crlf -whitespace
*.ps1 text eol=crlf
*.ps1.in text eol=crlf
*.sln text eol=crlf -whitespace
*.vcproj text eol=crlf -whitespace merge=union
*.vcxproj text eol=crlf -whitespace merge=union
+9 -1
View File
@@ -2,6 +2,14 @@
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
Please:
* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->
@@ -27,4 +35,4 @@ This is a template helping you to create an issue which can be processed as quic
// C++ code example
```
or attach as .txt or .zip file
-->
-->
+4 -4
View File
@@ -1,10 +1,11 @@
# ignore dot files/directories
.*
!.gitignore
*.autosave
*.pyc
*.user
*~
.*.swp
.DS_Store
.sw[a-z]
Thumbs.db
tags
tegra/
@@ -21,4 +22,3 @@ bin/
*.log
*.tlog
build
.cache
-2
View File
@@ -1,2 +0,0 @@
[tgit]
icon = doc/opencv.ico
-2
View File
@@ -37,6 +37,4 @@ if(WITH_NEON)
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
endif()
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
+8 -9
View File
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
@@ -14,18 +12,20 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
set(AARCH64 TRUE)
endif()
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-function)
set(TEGRA_COMPILER_FLAGS "")
if(CMAKE_COMPILER_IS_GNUCXX)
if(CV_GCC OR CV_CLANG)
# Generate unwind information even for functions that can't throw/propagate exceptions.
# This lets debuggers and such get non-broken backtraces for such functions, even without debugging symbols.
list(APPEND TEGRA_COMPILER_FLAGS -funwind-tables)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
if(CV_GCC OR CV_CLANG)
if(X86 OR ARMEABI_V6 OR (MIPS AND ANDROID_COMPILER_VERSION VERSION_LESS "4.6"))
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2)
elseif(CMAKE_COMPILER_IS_CLANGCXX)
elseif(CV_CLANG)
list(APPEND TEGRA_COMPILER_FLAGS -fwrapv)
else()
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched2-use-superblocks -fsched2-use-traces
@@ -42,7 +42,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEGRA_COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEGRA_COMPILER_FLAGS}")
if(ARMEABI_V7A)
if (CMAKE_COMPILER_IS_GNUCXX)
if(CV_GCC OR CV_CLANG)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-tree-vectorize" )
endif()
@@ -55,7 +55,7 @@ endif()
set(CAROTENE_NS "carotene_o4t" CACHE STRING "" FORCE)
function(compile_carotene)
if(ENABLE_NEON)
if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
set(WITH_NEON ON)
endif()
@@ -85,7 +85,7 @@ include_directories("${CAROTENE_DIR}/include")
get_target_property(carotene_defs carotene_objs INTERFACE_COMPILE_DEFINITIONS)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
if (CMAKE_COMPILER_IS_GNUCXX)
if(CV_GCC)
# allow more inlines - these parameters improve performance for:
# matchTemplate about 5-10%
# goodFeaturesToTrack 10-20%
@@ -95,7 +95,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
endif()
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
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)
+10 -10
View File
@@ -67,7 +67,7 @@
size_t src2_step;
#define DST_ARG1 DT * dst1_data_, size_t dst1_step_,
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
#define DST_VAR1 DT * dst1_data; \
size_t dst1_step;
@@ -1073,7 +1073,7 @@ struct FilterCtx
inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace)
{
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
src_type != CV_8UC1 || dst_type != CV_8UC1 ||
delta != 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2 )
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1105,7 +1105,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
return CV_HAL_ERROR_NOT_IMPLEMENTED;
}
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
{
delete ctx;
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1212,7 +1212,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
return CV_HAL_ERROR_NOT_IMPLEMENTED;
}
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
{
delete ctx;
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -1341,8 +1341,8 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
ctx->anchor_y = anchor_y;
switch(operation)
{
case MORPH_ERODE:
case MORPH_DILATE:
case CV_HAL_MORPH_ERODE:
case CV_HAL_MORPH_DILATE:
ctx->operation = operation;
break;
default:
@@ -1355,7 +1355,7 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
{
if( operation == MORPH_ERODE )
if( operation == CV_HAL_MORPH_ERODE )
for(int i = 0; i < ctx->channels; ++i)
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
else
@@ -1404,14 +1404,14 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
( \
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
context && CAROTENE_NS::isSupportedConfiguration() ? \
((MorphCtx*)context)->operation == MORPH_ERODE ? \
((MorphCtx*)context)->operation == CV_HAL_MORPH_ERODE ? \
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
src_data, src_step, dst_data, dst_step, \
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
CV_HAL_ERROR_OK : \
((MorphCtx*)context)->operation == MORPH_DILATE ? \
((MorphCtx*)context)->operation == CV_HAL_MORPH_DILATE ? \
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
src_data, src_step, dst_data, dst_step, \
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
@@ -1531,7 +1531,7 @@ class TegraCvtColor_##name##_Invoker : public cv::ParallelLoopBody \
public: \
TegraCvtColor_##name##_Invoker(const uchar * src_data_, size_t src_step_, uchar * dst_data_, size_t dst_step_, int width_, int height_) : \
cv::ParallelLoopBody(), src_data(src_data_), src_step(src_step_), dst_data(dst_data_), dst_step(dst_step_), width(width_), height(height_) {} \
virtual void operator()(const cv::Range& range) const \
virtual void operator()(const cv::Range& range) const CV_OVERRIDE \
{ \
CAROTENE_NS::func(CAROTENE_NS::Size2D(width, range.end-range.start), __VA_ARGS__); \
} \
+8 -8
View File
@@ -49,7 +49,7 @@ void extract2(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -60,7 +60,7 @@ void extract2(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
#ifndef __ANDROID__
for (; dj < roiw32; sj += 64, dj += 32)
{
internal::prefetch(src + sj);
@@ -101,7 +101,7 @@ void extract3(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -112,7 +112,7 @@ void extract3(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
#ifndef __ANDROID__
for (; dj < roiw32; sj += 96, dj += 32)
{
internal::prefetch(src + sj);
@@ -153,7 +153,7 @@ void extract4(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -164,7 +164,7 @@ void extract4(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
#ifndef __ANDROID__
for (; dj < roiw32; sj += 128, dj += 32)
{
internal::prefetch(src + sj);
@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
srcStride == dst2Stride && \
srcStride == dst3Stride &&
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
} \
}
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
#define ALPHA_QUAD(sgn, bits) { \
internal::prefetch(src + sj); \
+5 -5
View File
@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
dstStride == src2Stride && \
dstStride == src3Stride &&
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
#define MERGE_ASM2(sgn, bits) __asm__ ( \
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
@@ -240,7 +240,7 @@ void combineYUYV(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -253,7 +253,7 @@ void combineYUYV(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t syj = 0u, sj = 0u, dj = 0u;
#ifndef ANDROID
#ifndef __ANDROID__
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
{
internal::prefetch(srcy + syj);
@@ -317,7 +317,7 @@ void combineUYVY(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -330,7 +330,7 @@ void combineUYVY(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t syj = 0u, sj = 0u, dj = 0u;
#ifndef ANDROID
#ifndef __ANDROID__
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
{
internal::prefetch(srcy + syj);
+62 -62
View File
@@ -49,12 +49,12 @@ namespace {
enum
{
SHIFT = 14,
SHIFT = 15,
SHIFT_DELTA = 1 << (SHIFT - 1),
R2Y_BT601 = 4899,
G2Y_BT601 = 9617,
B2Y_BT601 = 1868,
R2Y_BT601 = 9798,
G2Y_BT601 = 19235,
B2Y_BT601 = 3735,
R2Y_BT709 = 3483,
G2Y_BT709 = 11718,
@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
for (; dj < roiw8; sj += 24, dj += 8)
{
internal::prefetch(src + sj);
@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
for (; dj < roiw8; sj += 32, dj += 8)
{
internal::prefetch(src + sj);
@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
for (; dj < roiw8; sj += 24, dj += 8)
{
internal::prefetch(src + sj);
@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
for (; dj < roiw8; sj += 32, dj += 8)
{
internal::prefetch(src + sj);
@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
for (; sj < roiw16; sj += 16, dj += 48)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld1.8 {d0-d1}, [%[in0]] \n\t"
"vmov.8 q1, q0 \n\t"
@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
if (sj < roiw8)
{
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld1.8 {d0}, [%[in]] \n\t"
"vmov.8 d1, d0 \n\t"
@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
#else
uint8x16x4_t vRgba;
@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
for (; sj < roiw16; sj += 16, dj += 64)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld1.8 {d0-d1}, [%[in0]] \n\t"
"vmov.8 q1, q0 \n\t"
@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
if (sj < roiw8)
{
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld1.8 {d5}, [%[in]] \n\t"
"vmov.8 d6, d5 \n\t"
@@ -672,7 +672,7 @@ void rgb2rgbx(const Size2D &size,
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
#else
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
@@ -688,7 +688,7 @@ void rgb2rgbx(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 24, dj += 32, j += 8)
{
internal::prefetch(src + sj);
@@ -742,7 +742,7 @@ void rgbx2rgb(const Size2D &size,
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
#if !defined(__GNUC__) || !defined(__arm__)
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
@@ -754,7 +754,7 @@ void rgbx2rgb(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
@@ -805,7 +805,7 @@ void rgb2bgr(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#if !defined(__GNUC__) || !defined(__arm__)
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -817,7 +817,7 @@ void rgb2bgr(const Size2D &size,
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 24, dj += 24, j += 8)
{
internal::prefetch(src + sj);
@@ -874,7 +874,7 @@ void rgbx2bgrx(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#if !defined(__GNUC__) || !defined(__arm__)
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -885,7 +885,7 @@ void rgbx2bgrx(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 32, dj += 32, j += 8)
{
internal::prefetch(src + sj);
@@ -943,7 +943,7 @@ void rgbx2bgr(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#if !defined(__GNUC__) || !defined(__arm__)
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -954,7 +954,7 @@ void rgbx2bgr(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
@@ -1010,7 +1010,7 @@ void rgb2bgrx(const Size2D &size,
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
#else
union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
@@ -1019,7 +1019,7 @@ void rgb2bgrx(const Size2D &size,
vals8.v4.val[3] = vmov_n_u8(255);
#endif
#if !defined(__GNUC__) || !defined(__arm__)
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -1030,7 +1030,7 @@ void rgb2bgrx(const Size2D &size,
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u, j = 0u;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
for (; j < roiw8; sj += 24, dj += 32, j += 8)
{
internal::prefetch(src + sj);
@@ -1087,12 +1087,12 @@ inline uint8x8x3_t convertToHSV(const uint8x8_t vR, const uint8x8_t vG, const ui
const s32 hrange )
{
const s32 hsv_shift = 12;
register const f32 vsdiv_table = f32(255 << hsv_shift);
register f32 vhdiv_table = f32(hrange << hsv_shift);
register const s32 vhrange = hrange;
register const s32 v0 = s32(0);
register const s32 vshift = s32(1 << (hsv_shift-1));
register const s32 v6 = s32(6);
const f32 vsdiv_table = f32(255 << hsv_shift);
f32 vhdiv_table = f32(hrange << hsv_shift);
const s32 vhrange = hrange;
const s32 v0 = s32(0);
const s32 vshift = s32(1 << (hsv_shift-1));
const s32 v6 = s32(6);
uint8x8_t vMin = vmin_u8(vR, vG);
uint8x8_t vMax = vmax_u8(vR, vG);
@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
"d24","d25","d26","d27","d28","d29","d30","d31" \
);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
#define YCRCB_CONSTS \
register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
#define COEFF_G ( 8663)
#define COEFF_B (-17705)
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
#define YUV420ALPHA3_CONST
#define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
#define YUV420ALPHA3_CONVERT
@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
const s32 hsv_shift = 12;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register const f32 vsdiv_table = f32(255 << hsv_shift);
register f32 vhdiv_table = f32(hrange << hsv_shift);
register const s32 vhrange = hrange;
@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
for (; j < roiw8; sj += 24, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
#else
uint8x8x3_t vRgb = vld3_u8(src + sj);
@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
const s32 hsv_shift = 12;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register const f32 vsdiv_table = f32(255 << hsv_shift);
register f32 vhdiv_table = f32(hrange << hsv_shift);
register const s32 vhrange = hrange;
@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
#else
uint8x8x4_t vRgb = vld4_u8(src + sj);
@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
const s32 hsv_shift = 12;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register const f32 vsdiv_table = f32(255 << hsv_shift);
register f32 vhdiv_table = f32(hrange << hsv_shift);
register const s32 vhrange = hrange;
@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
for (; j < roiw8; sj += 24, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
#else
uint8x8x3_t vRgb = vld3_u8(src + sj);
@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
const s32 hsv_shift = 12;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register const f32 vsdiv_table = f32(255 << hsv_shift);
register f32 vhdiv_table = f32(hrange << hsv_shift);
register const s32 vhrange = hrange;
@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
#else
uint8x8x4_t vRgb = vld4_u8(src + sj);
@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
for (; j < roiw16; sj += 64, dj += 32, j += 16)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
"vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
for (; j < roiw16; sj += 48, dj += 32, j += 16)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
"vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
for (; j < roiw16; sj += 64, dj += 32, j += 16)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
"vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
for (; j < roiw16; sj += 48, dj += 32, j += 16)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
"vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
for (; j < roiw8; sj += 24, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
#else
uint8x8x3_t vRgb = vld3_u8(src + sj);
@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
#else
uint8x8x4_t vRgba = vld4_u8(src + sj);
@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
for (; j < roiw8; sj += 24, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
#else
uint8x8x3_t vBgr = vld3_u8(src + sj);
@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
for (; j < roiw8; sj += 32, dj += 24, j += 8)
{
internal::prefetch(src + sj);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
#else
uint8x8x4_t vBgra = vld4_u8(src + sj);
@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(3, d1, d0, q5, q6)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(4, d1, d0, q5, q6)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(3, d0, d1, q5, q6)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(4, d0, d1, q5, q6)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(3, d1, d0, q6, q5)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(4, d1, d0, q6, q5)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(3, d0, d1, q6, q5)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
internal::prefetch(uv + j);
internal::prefetch(y1 + j);
internal::prefetch(y2 + j);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CONVERTYUV420TORGB(4, d0, d1, q6, q5)
#else
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
+27 -27
View File
@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
}
})
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(u8, u16, 16,
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
{
@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(u8, s32, 16,
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(u8, f32, 16,
,
{
@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
}
})
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(s8, u16, 16,
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
{
@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s8, s16, 16,
,
{
@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(s8, s32, 16,
,
{
@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s8, f32, 16,
,
{
@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(u16, u8, 16,
,
{
@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(u16, s8, 16,
register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
{
@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(u16, s16, 8,
register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
{
@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(u16, s32, 8,
register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
{
@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(u16, f32, 8,
,
{
@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s16, u8, 16,
,
{
@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s16, s8, 16,
,
{
@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVT_FUNC(s16, u16, 8,
register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
{
@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s16, s32, 8,
,
{
@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s16, f32, 8,
,
{
@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s32, u8, 8,
,
{
@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s32, s8, 8,
,
{
@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s32, u16, 8,
,
{
@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s32, s16, 8,
,
{
@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(s32, f32, 8,
,
{
@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(f32, u8, 8,
register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(f32, s8, 8,
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
{
@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(f32, u16, 8,
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
{
@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(f32, s16, 8,
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
{
@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
CVT_FUNC(f32, s32, 8,
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
{
+36 -36
View File
@@ -135,7 +135,7 @@ namespace CAROTENE_NS {
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC1(u8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -220,7 +220,7 @@ CVTS_FUNC1(u8, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(u8, s8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -305,7 +305,7 @@ CVTS_FUNC(u8, s8, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(u8, u16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -389,7 +389,7 @@ CVTS_FUNC(u8, u16, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(u8, s16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u8, s32, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u8, f32, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
@@ -643,7 +643,7 @@ CVTS_FUNC(u8, f32, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(s8, u8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -728,7 +728,7 @@ CVTS_FUNC(s8, u8, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC1(s8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -813,7 +813,7 @@ CVTS_FUNC1(s8, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(s8, u16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -899,7 +899,7 @@ CVTS_FUNC(s8, u16, 16,
})
#endif
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
CVTS_FUNC(s8, s16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s8, s32, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s8, f32, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u16, u8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u16, s8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC1(u16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u16, s16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u16, s32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(u16, f32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s16, u8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s16, s8, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s16, u16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC1(s16, 16,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s16, s32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s16, f32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s32, u8, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s32, s8, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s32, u16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s32, s16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC1(s32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(s32, f32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(f32, u8, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(f32, s8, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(f32, u16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(f32, s16, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC(f32, s32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
})
#endif
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
CVTS_FUNC1(f32, 8,
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
+22 -36
View File
@@ -151,6 +151,10 @@ void div(const Size2D &size,
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::vec64 vec64;
#if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
static_assert(std::numeric_limits<T>::is_integer, "template implementation is for integer types only");
#endif
if (scale == 0.0f ||
(std::numeric_limits<T>::is_integer &&
(scale * std::numeric_limits<T>::max()) < 1.0f &&
@@ -311,6 +315,10 @@ void recip(const Size2D &size,
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::vec64 vec64;
#if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
static_assert(std::numeric_limits<T>::is_integer, "template implementation is for integer types only");
#endif
if (scale == 0.0f ||
(std::numeric_limits<T>::is_integer &&
scale < 1.0f &&
@@ -463,8 +471,6 @@ void div(const Size2D &size,
return;
}
float32x4_t v_zero = vdupq_n_f32(0.0f);
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
@@ -485,9 +491,7 @@ void div(const Size2D &size,
float32x4_t v_src0 = vld1q_f32(src0 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_f32(v_src0, internal::vrecpq_f32(v_src1))), v_mask)));
vst1q_f32(dst + j, vmulq_f32(v_src0, internal::vrecpq_f32(v_src1)));
}
for (; j < roiw64; j += 2)
@@ -495,14 +499,12 @@ void div(const Size2D &size,
float32x2_t v_src0 = vld1_f32(src0 + j);
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_f32(v_src0, internal::vrecp_f32(v_src1))), v_mask)));
vst1_f32(dst + j, vmul_f32(v_src0, internal::vrecp_f32(v_src1)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? src0[j] / src1[j] : 0.0f;
dst[j] = src0[j] / src1[j];
}
}
}
@@ -523,10 +525,8 @@ void div(const Size2D &size,
float32x4_t v_src0 = vld1q_f32(src0 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_f32(vmulq_n_f32(v_src0, scale),
internal::vrecpq_f32(v_src1))), v_mask)));
vst1q_f32(dst + j, vmulq_f32(vmulq_n_f32(v_src0, scale),
internal::vrecpq_f32(v_src1)));
}
for (; j < roiw64; j += 2)
@@ -534,15 +534,13 @@ void div(const Size2D &size,
float32x2_t v_src0 = vld1_f32(src0 + j);
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_f32(vmul_n_f32(v_src0, scale),
internal::vrecp_f32(v_src1))), v_mask)));
vst1_f32(dst + j, vmul_f32(vmul_n_f32(v_src0, scale),
internal::vrecp_f32(v_src1)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? src0[j] * scale / src1[j] : 0.0f;
dst[j] = src0[j] * scale / src1[j];
}
}
}
@@ -620,8 +618,6 @@ void reciprocal(const Size2D &size,
return;
}
float32x4_t v_zero = vdupq_n_f32(0.0f);
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
@@ -639,23 +635,19 @@ void reciprocal(const Size2D &size,
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(internal::vrecpq_f32(v_src1)), v_mask)));
vst1q_f32(dst + j, internal::vrecpq_f32(v_src1));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(internal::vrecp_f32(v_src1)), v_mask)));
vst1_f32(dst + j, internal::vrecp_f32(v_src1));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? 1.0f / src1[j] : 0;
dst[j] = 1.0f / src1[j];
}
}
}
@@ -673,25 +665,19 @@ void reciprocal(const Size2D &size,
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_n_f32(internal::vrecpq_f32(v_src1),
scale)),v_mask)));
vst1q_f32(dst + j, vmulq_n_f32(internal::vrecpq_f32(v_src1), scale));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_n_f32(internal::vrecp_f32(v_src1),
scale)), v_mask)));
vst1_f32(dst + j, vmul_n_f32(internal::vrecp_f32(v_src1), scale));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? scale / src1[j] : 0;
dst[j] = scale / src1[j];
}
}
}
+4 -4
View File
@@ -105,12 +105,12 @@ void flip3(const Size2D & size,
{
using namespace internal;
#ifndef ANDROID
#ifndef __ANDROID__
typedef typename VecTraits<T, 3>::vec128 vec128;
#endif
typedef typename VecTraits<T, 3>::vec64 vec64;
#ifndef ANDROID
#ifndef __ANDROID__
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
#endif
@@ -123,7 +123,7 @@ void flip3(const Size2D & size,
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
size_t j = 0, js = 0, jd = size.width * 3;
#ifndef ANDROID
#ifndef __ANDROID__
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
{
prefetch(src + js);
@@ -139,7 +139,7 @@ void flip3(const Size2D & size,
vst3q(dst + jd - step_base3, v_dst);
}
#endif // ANDROID
#endif // __ANDROID__
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
{
+3 -3
View File
@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
u16* lidx1 = lane + x - 1*2;
u16* lidx3 = lane + x + 1*2;
u16* lidx4 = lane + x + 2*2;
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ __volatile__ (
"vld2.16 {d0, d2}, [%[in0]]! \n\t"
"vld2.16 {d1, d3}, [%[in0]] \n\t"
@@ -398,7 +398,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
u16* lidx1 = lane + x - 1*3;
u16* lidx3 = lane + x + 1*3;
u16* lidx4 = lane + x + 2*3;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ __volatile__ (
"vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
"vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
@@ -482,7 +482,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
u16* lidx1 = lane + x - 1*4;
u16* lidx3 = lane + x + 1*4;
u16* lidx4 = lane + x + 2*4;
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ __volatile__ (
"vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
"vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
+15 -15
View File
@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
for (; x < roiw8; x += 8)
{
internal::prefetch(lane + 2 * x);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld2.16 {d0-d3}, [%[in0]] \n\t"
"vld2.16 {d4-d7}, [%[in4]] \n\t"
@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
for (; x < roiw4; x += 4)
{
internal::prefetch(lane + 2 * x);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld2.32 {d0-d3}, [%[in0]] \n\t"
"vld2.32 {d4-d7}, [%[in4]] \n\t"
@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
f32* lane = internal::alignPtr(&_buf[2*cn], 32);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
@@ -680,12 +680,12 @@ void gaussianPyramidDown(const Size2D &srcSize,
register float32x4_t vc4d64f32 asm ("q14") = vmovq_n_f32(0.0625f); //4/4/16
register float32x4_t vc6d64f32 asm ("q15") = vmovq_n_f32(0.09375f); //6/4/16
#else
register float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
register float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
register float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
register float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
register float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
#endif
for (size_t i = 0; i < dstSize.height; ++i)
@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
for (; x < roiw4; x += 4)
{
internal::prefetch(lane + 2 * x);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ __volatile__ (
"vld2.32 {d0-d3}, [%[in0]] \n\t"
"vld2.32 {d8-d11}, [%[in4]] \n\t"
@@ -932,7 +932,7 @@ pyrUp8uHorizontalConvolution:
for (; x < lim; x += 8)
{
internal::prefetch(lane + x);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
@@ -973,7 +973,7 @@ pyrUp8uHorizontalConvolution:
for (; x < lim; x += 24)
{
internal::prefetch(lane + x);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vmov.u16 q9, #6 \n\t"
"vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
@@ -1064,7 +1064,7 @@ pyrUp8uHorizontalConvolution:
for (; x < lim; x += 8)
{
internal::prefetch(lane + x);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
@@ -1210,7 +1210,7 @@ pyrUp16sHorizontalConvolution:
for (; x < lim; x += 4)
{
internal::prefetch(lane + x);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
@@ -1251,7 +1251,7 @@ pyrUp16sHorizontalConvolution:
for (; x < lim; x += 12)
{
internal::prefetch(lane + x + 3);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vmov.s32 q9, #6 \n\t"
"vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
@@ -1343,7 +1343,7 @@ pyrUp16sHorizontalConvolution:
for (; x < lim; x += 4)
{
internal::prefetch(lane + x);
#if defined(__GNUC__) && defined(__arm__)
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
__asm__ (
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
+15 -13
View File
@@ -106,8 +106,10 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
&& !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF)// Restrict image size since internal index evaluation
// is performed with u32
#endif
&& dsize.width >= 2 && dsize.height >= 8)
&& dsize.width >= 2 && dsize.height >= 8
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
return isSupportedConfiguration();
return false;
default:
return false;
};
@@ -359,7 +361,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
}
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
#endif
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
@@ -373,7 +375,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw16; dj += 16, sj += 64)
{
internal::prefetch(src0_row + sj);
@@ -450,7 +452,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
{
if ((wr == 2.0f) && (hr == 2.0f))
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
#endif
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
@@ -462,7 +464,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw4; dj += 16, sj += 32)
{
internal::prefetch(src0_row + sj);
@@ -537,7 +539,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
}
else if ((wr == 0.5f) && (hr == 0.5f))
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
#endif
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
@@ -549,7 +551,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw32; dj += 128, sj += 64)
{
internal::prefetch(src_row + sj);
@@ -758,7 +760,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
{
if ((wr == 2.0f) && (wr == 2.0f))
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
#endif
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
@@ -770,7 +772,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw16; dj += 48, sj += 96)
{
internal::prefetch(src0_row + sj);
@@ -856,7 +858,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
}
else if ((wr == 0.5f) && (hr == 0.5f))
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
#endif
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
@@ -868,7 +870,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw32; dj += 96, sj += 48)
{
internal::prefetch(src_row + sj);
@@ -928,7 +930,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
}
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
{
#ifndef ANDROID
#ifndef __ANDROID__
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
#endif
@@ -941,7 +943,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0, dj = 0;
#ifndef ANDROID
#ifndef __ANDROID__
for ( ; dj < roiw8; dj += 24, sj += 96)
{
internal::prefetch(src0_row + sj);
+2 -2
View File
@@ -72,11 +72,11 @@ __declspec(naked) static void vcvtr_s32_f64_imp(f64 d)
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
# define CAROTENE_ROUND_FLT(value) { \
register union { f32 f; s32 i; } result; \
union { f32 f; s32 i; } result; \
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
return result.i; }
# define CAROTENE_ROUND_DBL(value) { \
register union {f32 f; s32 i;} __tegra_result; \
union {f32 f; s32 i;} __tegra_result; \
asm ( \
"ftosid %0, %P1\n" \
: "=w" (__tegra_result.f) \
+2 -2
View File
@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
__asm__ (
"vld1.8 {d0}, [%[src0]] \n\t"
"vld1.8 {d2}, [%[src2]] \n\t"
@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
x = 0;
for( ; x < roiw8; x += 8 )
{
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
__asm__ (
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
+9 -5
View File
@@ -2,19 +2,21 @@ if(NOT ANDROID)
message("cpufeatures is ANDROID project")
endif()
ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
set(CPUFEATURES_LIBRARIES cpufeatures CACHE INTERNAL "")
set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
if(NOT DEFINED CPUFEATURES_SOURCES)
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
endif()
include_directories(${CPUFEATURES_INCLUDE_DIRS})
add_library(cpufeatures STATIC ${CPUFEATURES_SOURCES})
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
set_target_properties(cpufeatures
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
PROPERTIES OUTPUT_NAME cpufeatures
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME cpufeatures
@@ -23,9 +25,11 @@ set_target_properties(cpufeatures
)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(cpufeatures PROPERTIES FOLDER "3rdparty")
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(cpufeatures 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)
endif()
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)
+1
View File
@@ -30,6 +30,7 @@
#include <sys/cdefs.h>
#include <stdint.h>
#include <string.h>
__BEGIN_DECLS
+63
View File
@@ -0,0 +1,63 @@
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_ffmpeg_64.dll"
$expected_md5 = "@FFMPEG_FILE_HASH_BIN64@"
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSION@_64.dll"
Write-Output ("=" * 120)
try {
Get-content -Path "$PSScriptRoot\@OPENCV_LICENSES_INSTALL_PATH@\ffmpeg-readme.txt" -ErrorAction 'Stop'
} catch {
Write-Output "Refer to OpenCV FFmpeg wrapper readme notes about library usage / licensing details."
}
Write-Output ("=" * 120)
Write-Output ""
if(![System.IO.File]::Exists($output)) {
try {
Write-Output ("Downloading: " + $output)
Import-Module BitsTransfer
$start_time = Get-Date
Start-BitsTransfer -Source $url -Destination $output -ErrorAction 'Stop'
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
} catch {
$_ # Dump error
try {
Write-Output ("Downloading (second attempt): " + $output)
$start_time = Get-Date
Invoke-WebRequest -Uri $url -OutFile $output
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
} catch {
Write-Output ("Can't download file: " + $output)
Write-Output ("URL: " + $url)
Write-Output "You need to download this file manually. Stop"
Pause
Exit
}
}
} else {
Write-Output ("File exists: " + $output)
Write-Output ("Downloading is skipped. Remove this file and re-run this script to force downloading.")
}
if(![System.IO.File]::Exists($output)) {
Write-Output ("Destination file not found: " + $output)
Write-Output "Stop"
Pause
Exit
}
try {
$hash = Get-FileHash $output -Algorithm MD5 -ErrorAction 'Stop'
if($hash.Hash -eq $expected_md5) {
Write-Output "MD5 check passed"
} else {
Write-Output ("MD5 : " + $hash.Hash.toLower())
Write-Output ("Expected: " + $expected_md5)
Write-Output "MD5 hash mismatch"
}
} catch {
$_ # Dump error
Write-Output "Can't check MD5 hash (requires PowerShell 4+)"
}
Pause
Write-Output "Exit"
+13 -6
View File
@@ -1,9 +1,9 @@
# Binary branch name: ffmpeg/master_20170418
# Binaries were created for OpenCV: b993b9b7c7f6f5f37d10acacb2962812228410ba
set(FFMPEG_BINARIES_COMMIT "86c4a841055f2612774e85b4292bb20e5fe8a783")
set(FFMPEG_FILE_HASH_BIN32 "3dea5f7f009b44601fe95728328e0f9e")
set(FFMPEG_FILE_HASH_BIN64 "9debe701975ef074bd6661981f3f0716")
set(FFMPEG_FILE_HASH_CMAKE "208c00f03d2f6f39fa6262649e0bfc8d")
# Binaries branch name: ffmpeg/master_20181106
# Binaries were created for OpenCV: 2c6f1ab57d4250ee46e32d1b51c056431965b470
ocv_update(FFMPEG_BINARIES_COMMIT "759a23e24ab787a0979f8a93103dcc3105ec10c1")
ocv_update(FFMPEG_FILE_HASH_BIN32 "849286ccc527c99e5a218b67f13c6e8c")
ocv_update(FFMPEG_FILE_HASH_BIN64 "96444a4645753aaafa296479665c9185")
ocv_update(FFMPEG_FILE_HASH_CMAKE "f710891525a04586d565d0e700e62a9c")
function(download_win_ffmpeg script_var)
set(${script_var} "" PARENT_SCOPE)
@@ -35,3 +35,10 @@ function(download_win_ffmpeg script_var)
set(${script_var} "${FFMPEG_DOWNLOAD_DIR}/ffmpeg_version.cmake" PARENT_SCOPE)
endif()
endfunction()
if(OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT)
configure_file("${CMAKE_CURRENT_LIST_DIR}/ffmpeg-download.ps1.in" "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" DESTINATION "." COMPONENT libs)
endif()
ocv_install_3rdparty_licenses(ffmpeg license.txt readme.txt)
+4 -5
View File
@@ -16,19 +16,18 @@
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
opencv_ffmpeg_64.dll (version for 64-bit Windows).
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
The pre-built opencv_ffmpeg*.dll is:
* LGPL library, not BSD libraries.
* Loaded at runtime by opencv_videoio module.
If it succeeds, ffmpeg can be used to decode/encode videos;
otherwise, other API is used.
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
FFMPEG build includes support for H264 encoder based on the OpenH264 library.
OpenH264 Video Codec provided by Cisco Systems, Inc.
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
Downloaded binary file can be placed into global system path (System32 or SysWOW64) or near application binaries.
You can also specify location of binary file via OPENH264_LIBRARY_PATH environment variable.
OpenH264 library should be installed separatelly. Downloaded binary file can be placed into global system path
(System32 or SysWOW64) or near application binaries (check documentation of "LoadLibrary" Win32 function from MSDN).
Or you can specify location of binary file via OPENH264_LIBRARY environment variable.
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
-110
View File
@@ -1,110 +0,0 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
#define NONAMELESSUNION 1
#endif
#if defined(NONAMELESSSTRUCT) && \
!defined(NONAMELESSUNION)
#define NONAMELESSUNION 1
#endif
#if defined(NONAMELESSUNION) && \
!defined(NONAMELESSSTRUCT)
#define NONAMELESSSTRUCT 1
#endif
#ifndef __ANONYMOUS_DEFINED
#define __ANONYMOUS_DEFINED
#if defined(__GNUC__) || defined(__GNUG__)
#define _ANONYMOUS_UNION __extension__
#define _ANONYMOUS_STRUCT __extension__
#else
#define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT
#endif
#ifndef NONAMELESSUNION
#define _UNION_NAME(x)
#define _STRUCT_NAME(x)
#else /* NONAMELESSUNION */
#define _UNION_NAME(x) x
#define _STRUCT_NAME(x) x
#endif
#endif /* __ANONYMOUS_DEFINED */
#ifndef DUMMYUNIONNAME
# ifdef NONAMELESSUNION
# define DUMMYUNIONNAME u
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
# define DUMMYUNIONNAME2 u2
# define DUMMYUNIONNAME3 u3
# define DUMMYUNIONNAME4 u4
# define DUMMYUNIONNAME5 u5
# define DUMMYUNIONNAME6 u6
# define DUMMYUNIONNAME7 u7
# define DUMMYUNIONNAME8 u8
# define DUMMYUNIONNAME9 u9
# else /* NONAMELESSUNION */
# define DUMMYUNIONNAME
# define DUMMYUNIONNAME1 /* Wine uses this variant */
# define DUMMYUNIONNAME2
# define DUMMYUNIONNAME3
# define DUMMYUNIONNAME4
# define DUMMYUNIONNAME5
# define DUMMYUNIONNAME6
# define DUMMYUNIONNAME7
# define DUMMYUNIONNAME8
# define DUMMYUNIONNAME9
# endif
#endif /* DUMMYUNIONNAME */
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
# ifdef NONAMELESSUNION
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
# else
# define DUMMYUNIONNAME1 /* Wine uses this variant */
# endif
#endif /* DUMMYUNIONNAME1 */
#ifndef DUMMYSTRUCTNAME
# ifdef NONAMELESSUNION
# define DUMMYSTRUCTNAME s
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
# define DUMMYSTRUCTNAME2 s2
# define DUMMYSTRUCTNAME3 s3
# define DUMMYSTRUCTNAME4 s4
# define DUMMYSTRUCTNAME5 s5
# else
# define DUMMYSTRUCTNAME
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
# define DUMMYSTRUCTNAME2
# define DUMMYSTRUCTNAME3
# define DUMMYSTRUCTNAME4
# define DUMMYSTRUCTNAME5
# endif
#endif /* DUMMYSTRUCTNAME */
/* These are for compatibility with the Wine source tree */
#ifndef WINELIB_NAME_AW
# ifdef __MINGW_NAME_AW
# define WINELIB_NAME_AW __MINGW_NAME_AW
# else
# ifdef UNICODE
# define WINELIB_NAME_AW(func) func##W
# else
# define WINELIB_NAME_AW(func) func##A
# endif
# endif
#endif /* WINELIB_NAME_AW */
#ifndef DECL_WINELIB_TYPE_AW
# ifdef __MINGW_TYPEDEF_AW
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
# else
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
# endif
#endif /* DECL_WINELIB_TYPE_AW */
-33
View File
@@ -1,33 +0,0 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#if !defined(_INC_CRT_UNICODE_MACROS)
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
#if defined(UNICODE)
# define _INC_CRT_UNICODE_MACROS 1
# define __MINGW_NAME_AW(func) func##W
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
# define __MINGW_NAME_UAW(func) func##_W
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "W"
#else
# define _INC_CRT_UNICODE_MACROS 2
# define __MINGW_NAME_AW(func) func##A
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
# define __MINGW_NAME_UAW(func) func##_A
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "A"
#endif
#define __MINGW_TYPEDEF_AW(type) \
typedef __MINGW_NAME_AW(type) type;
#define __MINGW_TYPEDEF_UAW(type) \
typedef __MINGW_NAME_UAW(type) type;
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
-1290
View File
File diff suppressed because it is too large Load Diff
-31
View File
@@ -1,31 +0,0 @@
#ifndef _AUDEVCOD_H
#define _AUDEVCOD_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _tagSND_DEVICE_ERROR {
SNDDEV_ERROR_Open = 1,
SNDDEV_ERROR_Close = 2,
SNDDEV_ERROR_GetCaps = 3,
SNDDEV_ERROR_PrepareHeader = 4,
SNDDEV_ERROR_UnprepareHeader = 5,
SNDDEV_ERROR_Reset = 6,
SNDDEV_ERROR_Restart = 7,
SNDDEV_ERROR_GetPosition = 8,
SNDDEV_ERROR_Write = 9,
SNDDEV_ERROR_Pause = 10,
SNDDEV_ERROR_Stop = 11,
SNDDEV_ERROR_Start = 12,
SNDDEV_ERROR_AddBuffer = 13,
SNDDEV_ERROR_Query = 14
} SNDDEV_ERR;
#ifdef __cplusplus
}
#endif
#endif
-32
View File
@@ -1,32 +0,0 @@
#ifndef _BDATYPES_H
#define _BDATYPES_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*--- DirectShow Reference - DirectShow Enumerated Types */
typedef enum {
MEDIA_TRANSPORT_PACKET,
MEDIA_ELEMENTARY_STREAM,
MEDIA_MPEG2_PSI,
MEDIA_TRANSPORT_PAYLOAD
} MEDIA_SAMPLE_CONTENT;
/*--- DirectShow Reference - DirectShow Structures */
typedef struct {
DWORD dwOffset;
DWORD dwPacketLength;
DWORD dwStride;
} MPEG2_TRANSPORT_STRIDE;
typedef struct {
ULONG ulPID;
MEDIA_SAMPLE_CONTENT MediaSampleContent ;
} PID_MAP;
#ifdef __cplusplus
}
#endif
#endif
-1467
View File
File diff suppressed because it is too large Load Diff
-2712
View File
File diff suppressed because it is too large Load Diff
-61
View File
@@ -1,61 +0,0 @@
/*
* Copyright (C) 2002 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DSHOW_INCLUDED__
#define __DSHOW_INCLUDED__
#define AM_NOVTABLE
#ifndef __WINESRC__
# include <windows.h>
# include <windowsx.h>
#else
# include <windef.h>
# include <wingdi.h>
# include <objbase.h>
#endif
#include <olectl.h>
#include <dshow/ddraw.h>
#include <mmsystem.h>
/* FIXME: #include <strsafe.h>*/
#ifndef NUMELMS
#define NUMELMS(array) (sizeof(array)/sizeof((array)[0]))
#endif
#include <dshow/strmif.h>
#include <dshow/amvideo.h>
#ifdef DSHOW_USE_AMAUDIO
/* FIXME: #include <amaudio.h>*/
#endif
#include <dshow/control.h>
#include <dshow/evcode.h>
#include <dshow/uuids.h>
#include <dshow/errors.h>
/* FIXME: #include <edevdefs.h> */
#include <dshow/audevcod.h>
/* FIXME: #include <dvdevcod.h> */
#ifndef OATRUE
#define OATRUE (-1)
#endif
#ifndef OAFALSE
#define OAFALSE (0)
#endif
#endif /* __DSHOW_INCLUDED__ */
-1199
View File
File diff suppressed because it is too large Load Diff
-75
View File
@@ -1,75 +0,0 @@
/*
* Copyright (C) 2008 Maarten Lankhorst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DVDMEDIA_H__
#define __DVDMEDIA_H__
#define AMCONTROL_USED 0x00000001
#define AMCONTROL_PAD_TO_4x3 0x00000002
#define AMCONTROL_PAD_TO_16x9 0x00000004
enum AM_MPEG2Level {
AM_MPEG2Level_Low = 1,
AM_MPEG2Level_Main,
AM_MPEG2Level_High1440,
AM_MPEG2Level_High
};
enum AM_MPEG2Profile {
AM_MPEG2Profile_Simple = 1,
AM_MPEG2Profile_Main,
AM_MPEG2Profile_SNRScalable,
AM_MPEG2Profile_SpatiallyScalable,
AM_MPEG2Profile_High
};
typedef enum {
AM_RATE_ChangeRate = 1,
AM_RATE_FullDataRateMax = 2,
AM_RATE_ReverseDecode = 3,
AM_RATE_DecoderPosition = 4,
AM_RATE_DecoderVersion = 5
} AM_PROPERTY_DVD_RATE_CHANGE;
typedef struct tagVIDEOINFOHEADER2 {
RECT rcSource;
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
DWORD dwInterlaceFlags;
DWORD dwCopyProtectFlags;
DWORD dwPictAspectRatioX;
DWORD dwPictAspectRatioY;
union {
DWORD dwControlFlags;
DWORD dwReserved1;
} DUMMYUNIONNAME;
DWORD dwReserved2;
BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER2;
typedef struct tagMPEG2VIDEOINFO {
VIDEOINFOHEADER2 hdr;
DWORD dwStartTimeCode;
DWORD cbSequenceHeader;
DWORD dwProfile;
DWORD dwLevel;
DWORD dwFlags;
DWORD dwSequenceHeader[1];
} MPEG2VIDEOINFO;
#endif /* __DVDMEDIA_H__ */
-169
View File
@@ -1,169 +0,0 @@
#ifndef _ERRORS_H
#define _ERRORS_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*--- DirectShow Reference - Constants and GUIDs - Error and Success Codes */
#define VFW_S_NO_MORE_ITEMS 0x00040103
#define VFW_S_DUPLICATE_NAME 0x0004022D
#define VFW_S_STATE_INTERMEDIATE 0x00040237
#define VFW_S_PARTIAL_RENDER 0x00040242
#define VFW_S_SOME_DATA_IGNORED 0x00040245
#define VFW_S_CONNECTIONS_DEFERRED 0x00040246
#define VFW_S_RESOURCE_NOT_NEEDED 0x00040250
#define VFW_S_MEDIA_TYPE_IGNORED 0x00040254
#define VFW_S_VIDEO_NOT_RENDERED 0x00040257
#define VFW_S_AUDIO_NOT_RENDERED 0x00040258
#define VFW_S_RPZA 0x0004025A
#define VFW_S_ESTIMATED 0x00040260
#define VFW_S_RESERVED 0x00040263
#define VFW_S_STREAM_OFF 0x00040267
#define VFW_S_CANT_CUE 0x00040268
#define VFW_S_NOPREVIEWPIN 0x0004027E
#define VFW_S_DVD_NON_ONE_SEQUENTIAL 0x00040280
#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE 0x0004028C
#define VFW_S_DVD_NOT_ACCURATE 0x0004028D
#define VFW_E_INVALIDMEDIATYPE 0x80040200
#define VFW_E_INVALIDSUBTYPE 0x80040201
#define VFW_E_NEED_OWNER 0x80040202
#define VFW_E_ENUM_OUT_OF_SYNC 0x80040203
#define VFW_E_ALREADY_CONNECTED 0x80040204
#define VFW_E_FILTER_ACTIVE 0x80040205
#define VFW_E_NO_TYPES 0x80040206
#define VFW_E_NO_ACCEPTABLE_TYPES 0x80040207
#define VFW_E_INVALID_DIRECTION 0x80040208
#define VFW_E_NOT_CONNECTED 0x80040209
#define VFW_E_NO_ALLOCATOR 0x8004020A
#define VFW_E_RUNTIME_ERROR 0x8004020B
#define VFW_E_BUFFER_NOTSET 0x8004020C
#define VFW_E_BUFFER_OVERFLOW 0x8004020D
#define VFW_E_BADALIGN 0x8004020E
#define VFW_E_ALREADY_COMMITTED 0x8004020F
#define VFW_E_BUFFERS_OUTSTANDING 0x80040210
#define VFW_E_NOT_COMMITTED 0x80040211
#define VFW_E_SIZENOTSET 0x80040212
#define VFW_E_NO_CLOCK 0x80040213
#define VFW_E_NO_SINK 0x80040214
#define VFW_E_NO_INTERFACE 0x80040215
#define VFW_E_NOT_FOUND 0x80040216
#define VFW_E_CANNOT_CONNECT 0x80040217
#define VFW_E_CANNOT_RENDER 0x80040218
#define VFW_E_CHANGING_FORMAT 0x80040219
#define VFW_E_NO_COLOR_KEY_SET 0x8004021A
#define VFW_E_NOT_OVERLAY_CONNECTION 0x8004021B
#define VFW_E_NOT_SAMPLE_CONNECTION 0x8004021C
#define VFW_E_PALETTE_SET 0x8004021D
#define VFW_E_COLOR_KEY_SET 0x8004021E
#define VFW_E_NO_COLOR_KEY_FOUND 0x8004021F
#define VFW_E_NO_PALETTE_AVAILABLE 0x80040220
#define VFW_E_NO_DISPLAY_PALETTE 0x80040221
#define VFW_E_TOO_MANY_COLORS 0x80040222
#define VFW_E_STATE_CHANGED 0x80040223
#define VFW_E_NOT_STOPPED 0x80040224
#define VFW_E_NOT_PAUSED 0x80040225
#define VFW_E_NOT_RUNNING 0x80040226
#define VFW_E_WRONG_STATE 0x80040227
#define VFW_E_START_TIME_AFTER_END 0x80040228
#define VFW_E_INVALID_RECT 0x80040229
#define VFW_E_TYPE_NOT_ACCEPTED 0x8004022A
#define VFW_E_SAMPLE_REJECTED 0x8004022B
#define VFW_E_SAMPLE_REJECTED_EOS 0x8004022C
#define VFW_E_DUPLICATE_NAME 0x8004022D
#define VFW_E_TIMEOUT 0x8004022E
#define VFW_E_INVALID_FILE_FORMAT 0x8004022F
#define VFW_E_ENUM_OUT_OF_RANGE 0x80040230
#define VFW_E_CIRCULAR_GRAPH 0x80040231
#define VFW_E_NOT_ALLOWED_TO_SAVE 0x80040232
#define VFW_E_TIME_ALREADY_PASSED 0x80040233
#define VFW_E_ALREADY_CANCELLED 0x80040234
#define VFW_E_CORRUPT_GRAPH_FILE 0x80040235
#define VFW_E_ADVISE_ALREADY_SET 0x80040236
#define VFW_E_NO_MODEX_AVAILABLE 0x80040238
#define VFW_E_NO_ADVISE_SET 0x80040239
#define VFW_E_NO_FULLSCREEN 0x8004023A
#define VFW_E_IN_FULLSCREEN_MODE 0x8004023B
#define VFW_E_UNKNOWN_FILE_TYPE 0x80040240
#define VFW_E_CANNOT_LOAD_SOURCE_FILTER 0x80040241
#define VFW_E_FILE_TOO_SHORT 0x80040243
#define VFW_E_INVALID_FILE_VERSION 0x80040244
#define VFW_E_INVALID_CLSID 0x80040247
#define VFW_E_INVALID_MEDIA_TYPE 0x80040248
#define VFW_E_SAMPLE_TIME_NOT_SET 0x80040249
#define VFW_E_MEDIA_TIME_NOT_SET 0x80040251
#define VFW_E_NO_TIME_FORMAT_SET 0x80040252
#define VFW_E_MONO_AUDIO_HW 0x80040253
#define VFW_E_NO_DECOMPRESSOR 0x80040255
#define VFW_E_NO_AUDIO_HARDWARE 0x80040256
#define VFW_E_RPZA 0x80040259
#define VFW_E_PROCESSOR_NOT_SUITABLE 0x8004025B
#define VFW_E_UNSUPPORTED_AUDIO 0x8004025C
#define VFW_E_UNSUPPORTED_VIDEO 0x8004025D
#define VFW_E_MPEG_NOT_CONSTRAINED 0x8004025E
#define VFW_E_NOT_IN_GRAPH 0x8004025F
#define VFW_E_NO_TIME_FORMAT 0x80040261
#define VFW_E_READ_ONLY 0x80040262
#define VFW_E_BUFFER_UNDERFLOW 0x80040264
#define VFW_E_UNSUPPORTED_STREAM 0x80040265
#define VFW_E_NO_TRANSPORT 0x80040266
#define VFW_E_BAD_VIDEOCD 0x80040269
#define VFW_S_NO_STOP_TIME 0x80040270
#define VFW_E_OUT_OF_VIDEO_MEMORY 0x80040271
#define VFW_E_VP_NEGOTIATION_FAILED 0x80040272
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE 0x80040273
#define VFW_E_NO_VP_HARDWARE 0x80040274
#define VFW_E_NO_CAPTURE_HARDWARE 0x80040275
#define VFW_E_DVD_OPERATION_INHIBITED 0x80040276
#define VFW_E_DVD_INVALIDDOMAIN 0x80040277
#define VFW_E_DVD_NO_BUTTON 0x80040278
#define VFW_E_DVD_GRAPHNOTREADY 0x80040279
#define VFW_E_DVD_RENDERFAIL 0x8004027A
#define VFW_E_DVD_DECNOTENOUGH 0x8004027B
#define VFW_E_DDRAW_VERSION_NOT_SUITABLE 0x8004027C
#define VFW_E_COPYPROT_FAILED 0x8004027D
#define VFW_E_TIME_EXPIRED 0x8004027F
#define VFW_E_DVD_WRONG_SPEED 0x80040281
#define VFW_E_DVD_MENU_DOES_NOT_EXIST 0x80040282
#define VFW_E_DVD_CMD_CANCELLED 0x80040283
#define VFW_E_DVD_STATE_WRONG_VERSION 0x80040284
#define VFW_E_DVD_STATE_CORRUPT 0x80040285
#define VFW_E_DVD_STATE_WRONG_DISC 0x80040286
#define VFW_E_DVD_INCOMPATIBLE_REGION 0x80040287
#define VFW_E_DVD_NO_ATTRIBUTES 0x80040288
#define VFW_E_DVD_NO_GOUP_PGC 0x80040289
#define VFW_E_DVD_LOW_PARENTAL_LEVEL 0x8004028A
#define VFW_E_DVD_NOT_IN_KARAOKE_MODE 0x8004028B
#define VFW_E_FRAME_STEP_UNSUPPORTED 0x8004028E
#define VFW_E_DVD_STREAM_DISABLED 0x8004028F
#define VFW_E_DVD_TITLE_UNKNOWN 0x80040290
#define VFW_E_DVD_INVALID_DISC 0x80040291
#define VFW_E_DVD_NO_RESUME_INFORMATION 0x80040292
#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD 0x80040293
#define VFW_E_PIN_ALREADY_BLOCKED 0x80040294
#define VFW_E_CERTIFICATION_FAILURE 0x80040295
#define VFW_E_VMR_NOT_IN_MIXER_MODE 0x80040296
#define VFW_E_VMR_NO_AP_SUPPLIED 0x80040297
#define VFW_E_VMR_NO_DEINTERLACE_HW 0x80040298
#define VFW_E_VMR_NO_PROCAMP_HW 0x80040299
#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC 0x8004029A
#define VFW_E_NO_COPP_HW 0x8004029B
#define VFW_E_BAD_KEY 0x800403F2
/*--- DirectShow Reference - Functions */
#define MAX_ERROR_TEXT_LEN 160
/*--- DirectShow Reference - Functions */
DWORD WINAPI AMGetErrorTextA(HRESULT,CHAR*,DWORD);
DWORD WINAPI AMGetErrorTextW(HRESULT,WCHAR*,DWORD);
#ifdef UNICODE
#define AMGetErrorText AMGetErrorTextW
#else
#define AMGetErrorText AMGetErrorTextA
#endif
#ifdef __cplusplus
}
#endif
#endif
-68
View File
@@ -1,68 +0,0 @@
#ifndef _EVCODE_H
#define _EVCODE_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*--- DirectShow Reference - Constants and GUIDs - Event Notification Codes */
#define EC_ACTIVATE 0x0013
#define EC_BUFFERING_DATA 0x0011
#define EC_BUILT 0x0300
#define EC_CLOCK_CHANGED 0x000D
#define EC_CLOCK_UNSET 0x0051
#define EC_CODECAPI_EVENT 0x0057
#define EC_COMPLETE 0x0001
#define EC_DEVICE_LOST 0x001F
#define EC_DISPLAY_CHANGED 0x0016
#define EC_END_OF_SEGMENT 0x001C
#define EC_ERROR_STILLPLAYING 0x0008
#define EC_ERRORABORT 0x0003
#define EC_EXTDEVICE_MODE_CHANGE 0x0031
#define EC_FULLSCREEN_LOST 0x0012
#define EC_GRAPH_CHANGED 0x0050
#define EC_LENGTH_CHANGED 0x001E
#define EC_NEED_RESTART 0x0014
#define EC_NOTIFY_WINDOW 0x0019
#define EC_OLE_EVENT 0x0018
#define EC_OPENING_FILE 0x0010
#define EC_PALETTE_CHANGED 0x0009
#define EC_PAUSED 0x000E
#define EC_PREPROCESS_COMPLETE 0x0056
#define EC_QUALITY_CHANGE 0x000B
#define EC_REPAINT 0x0005
#define EC_SEGMENT_STARTED 0x001D
#define EC_SHUTTING_DOWN 0x000C
#define EC_SNDDEV_IN_ERROR 0x0200
#define EC_SNDDEV_OUT_ERROR 0x0201
#define EC_STARVATION 0x0017
#define EC_STATE_CHANGE 0x0032
#define EC_STEP_COMPLETE 0x0024
#define EC_STREAM_CONTROL_STARTED 0x001B
#define EC_STREAM_CONTROL_STOPPED 0x001A
#define EC_STREAM_ERROR_STILLPLAYING 0x0007
#define EC_STREAM_ERROR_STOPPED 0x0006
#define EC_TIMECODE_AVAILABLE 0x0030
#define EC_UNBUILT 0x0301
#define EC_USERABORT 0x0002
#define EC_VIDEO_SIZE_CHANGED 0x000A
#define EC_VMR_RENDERDEVICE_SET 0x0053
#define EC_VMR_SURFACE_FLIPPED 0x0054
#define EC_VMR_RECONNECTION_FAILED 0x0055
#define EC_WINDOW_DESTROYED 0x0015
#define EC_WMT_EVENT 0x0252
#define EC_WMT_INDEX_EVENT 0x0251
#define EC_USER 0x8000
/*--- DirectShow Reference - DirectShow Structures */
typedef struct {
HRESULT hrStatus;
void *pData;
} AM_WMT_EVENT_DATA;
#ifdef __cplusplus
}
#endif
#endif
-191
View File
@@ -1,191 +0,0 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK,
0x36523B13,0x8EE5,0x11d1,0x8C,0xA3,0x00,0x60,0xB0,0x57,0x66,0x4A)
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES,
0xe06d8020,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_WMDRM_TRANSPORT,
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO,
0xe06d8026,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO,
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_VIDEOINFO2,
0xf72a76A0L,0xeb0a,0x11d0,0xac,0xe4,0x0,0x0,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM,
0xe06d8022,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT,
0xe06d8023,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO,
0xe06d802b,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3,
0xe06d802c,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE,
0xe06d802d,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO,
0xe06d8032,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK,
0xed0b916a,0x044d,0x11d1,0xaa,0x78,0x00,0xc0,0x04f,0xc3,0x1d,0x60)
OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION,
0xe06d802e,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI,
0xe06d802f,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI,
0xe06d8030,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER,
0xe06d8031,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2Video,
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_DolbyAC3,
0xe06d80e4,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2Audio,
0xe06d80e5,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio,
0xe06d80e6,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(AM_KSPROPSETID_AC3,
0xBFABE720,0x6E1F,0x11D0,0xBC,0xF2,0x44,0x45,0x53,0x54,0x00,0x00)
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic,
0xac390460,0x43af,0x11d0,0xbd,0x6a,0x00,0x35,0x05,0xc1,0x03,0xa9)
OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt,
0x0E8A0A40,0x6AEF,0x11D0,0x9E,0xD0,0x00,0xA0,0x24,0xCA,0x19,0xB3)
OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange,
0xa503c5c0,0x1d1d,0x11d1,0xad,0x80,0x44,0x45,0x53,0x54,0x0,0x0)
OUR_GUID_ENTRY(AM_KSPROPSETID_MPEG4_MediaType_Attributes,
0xff6c4bfa,0x7a9,0x4c7b,0xa2,0x37,0x67,0x2f,0x9d,0x68,0x6,0x5f)
OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE,
0x65E8773DL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER,
0x65E8773EL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR,
0x1E84C900L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO,
0x6994AD04L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO,
0x6994AD05L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER,
0xa799a800L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR,
0xa799a801L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO,
0xa799a802L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC,
0x07dad660L,0x22f1,0x11d1,0xa9,0xf4,0x00,0xc0,0x4f,0xbb,0xde,0x8f)
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER,
0x0A4252A0L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(IID_IKsInterfaceHandler,
0xD3ABC7E0L,0x9A61,0x11D0,0xA4,0x0D,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(IID_IKsDataTypeHandler,
0x5FFBAA02L,0x49A3,0x11D0,0x9F,0x36,0x00,0xAA,0x00,0xA2,0x16,0xA1)
OUR_GUID_ENTRY(IID_IKsPin,
0xb61178d1L,0xa2d9,0x11cf,0x9e,0x53,0x00,0xaa,0x00,0xa2,0x16,0xa1)
OUR_GUID_ENTRY(IID_IKsControl,
0x28F54685L,0x06FD,0x11D2,0xB2,0x7A,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(IID_IKsPinFactory,
0xCD5EBE6BL,0x8B6E,0x11D1,0x8A,0xE0,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard,
0x1A8766A0L,0x62CE,0x11CF,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_SECTIONS,
0x455f176c,0x4b06,0x47ce,0x9a,0xef,0x8c,0xae,0xf7,0x3d,0xf7,0xb5)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VERSIONED_TABLES,
0x1ed988b0,0x3ffc,0x4523,0x87,0x25,0x34,0x7b,0xee,0xc1,0xa8,0xa0)
OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI,
0xb3c7397c,0xd303,0x414d,0xb3,0x3c,0x4e,0xd2,0xc9,0xd2,0x97,0x33)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI,
0xe9dd31a3,0x221d,0x4adb,0x85,0x32,0x9a,0xf3,0x9,0xc1,0xa4,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_ISDB_SI,
0xe89ad298,0x3601,0x4b06,0xaa,0xec,0x9d,0xde,0xed,0xcc,0x5b,0xd0)
OUR_GUID_ENTRY(MEDIASUBTYPE_TIF_SI,
0xec232eb2,0xcb96,0x4191,0xb2,0x26,0xe,0xa1,0x29,0xf3,0x82,0x50)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA,
0xc892e55b,0x252d,0x42b5,0xa3,0x16,0xd9,0x97,0xe7,0xa5,0xd9,0x95)
#endif
/* ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) ||
(NTDDI_VERSION >= NTDDI_WS03SP1) */
#if (NTDDI_VERSION >= NTDDI_WINXP)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE,
0x138aa9a4,0x1ee2,0x4c5b,0x98,0x8e,0x19,0xab,0xfd,0xbc,0x8a,0x11)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_UDCR_TRANSPORT,
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_RAW,
0x0d7aed42,0xcb9a,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_PROCESSED,
0xaf748dd4,0xd80,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_DTS,
0xe06d8033,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS,
0xe06d8034,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange,
0x3577eb09,0x9582,0x477f,0xb2,0x9c,0xb0,0xc4,0x52,0xa4,0xff,0x9a)
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke,
0xae4720ae,0xaa71,0x42d8,0xb8,0x2a,0xff,0xfd,0xf5,0x8b,0x76,0xfd)
OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep,
0xc830acbd,0xab07,0x492f,0x88,0x52,0x45,0xb6,0x98,0x7c,0x29,0x79)
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC_MI,
0x9c24a977,0x951,0x451a,0x80,0x6,0xe,0x49,0xbd,0x28,0xcd,0x5f)
#endif /* NTDDI_VERSION >= NTDDI_WS03SP1 */
-9392
View File
File diff suppressed because it is too large Load Diff
-368
View File
@@ -1,368 +0,0 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef OUR_GUID_ENTRY
#define OUR_GUID_ENTRY(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8);
#endif
#define MEDIATYPE_NULL GUID_NULL
#define MEDIASUBTYPE_NULL GUID_NULL
OUR_GUID_ENTRY(MEDIASUBTYPE_None,0xe436eb8e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIATYPE_Video,0x73646976,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Audio,0x73647561,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Text,0x73747874,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Midi,0x7364696D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Stream,0xe436eb83,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIATYPE_Interleaved,0x73766169,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_File,0x656c6966,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand,0x73636d64,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data,0x670aea80,0x3a82,0x11d0,0xb7,0x9b,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIATYPE_VBI,0xf72a76e1,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIATYPE_Timecode,0x482dee3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_LMRT,0x74726c6d,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM,0x736c7275,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL,0x4C504C43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV,0x56595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV,0x56555949,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9,0x39555659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y411,0x31313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P,0x50313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2,0x32595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU,0x55595659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY,0x59565955,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y211,0x31313259,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR,0x524a4c43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IF09,0x39304649,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA,0x414c5043,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG,0x47504A4D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ,0x4A4D5654,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE,0x454B4157,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC,0x43434643,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG,0x47504A49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Plum,0x6D756C50,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS,0x53435644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD,0x44535644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF,0x4656444D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1,0xe436eb78,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4,0xe436eb79,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8,0xe436eb7a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565,0xe436eb7b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555,0xe436eb7c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32,0xe436eb7e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555,0x297c55af,0xe209,0x4cb3,0xb7,0x57,0xc7,0x6d,0x6b,0x9c,0x88,0xa8)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444,0x6e6415e6,0x5c24,0x425f,0x93,0xcd,0x80,0x10,0x2b,0x3d,0x1c,0xca)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32,0x773c9ac0,0x3274,0x11d0,0xb7,0x24,0x0,0xaa,0x0,0x6c,0x1a,0x1)
OUR_GUID_ENTRY(MEDIASUBTYPE_A2R10G10B10,0x2f8bb76d,0xb644,0x4550,0xac,0xf3,0xd3,0x0c,0xaa,0x65,0xd5,0xc5)
OUR_GUID_ENTRY(MEDIASUBTYPE_A2B10G10R10,0x576f7893,0xbdf6,0x48c4,0x87,0x5f,0xae,0x7b,0x81,0x83,0x45,0x67)
OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV,0x56555941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_AI44,0x34344941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IA44,0x34344149,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT,0x32335237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT,0x36315237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT,0x38384137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT,0x34344137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT,0x35314137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX9_RT,0x32335239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX9_RT,0x36315239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX9_RT,0x38384139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX9_RT,0x34344139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX9_RT,0x35314139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
#define MEDIASUBTYPE_HASALPHA(mt) (((mt).subtype==MEDIASUBTYPE_ARGB4444) || ((mt).subtype==MEDIASUBTYPE_ARGB32) || ((mt).subtype==MEDIASUBTYPE_AYUV) || ((mt).subtype==MEDIASUBTYPE_AI44) || ((mt).subtype==MEDIASUBTYPE_IA44) || ((mt).subtype==MEDIASUBTYPE_ARGB1555) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
#define MEDIASUBTYPE_HASALPHA7(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT))
#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX7_RT))
#define MEDIASUBTYPE_HASALPHA9(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
#define MEDIASUBTYPE_D3D_DX9_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX9_RT))
OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90,0x9412,0x11d1,0xad,0xed,0x0,0x0,0xf8,0x75,0x4b,0x99)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576,0x8E7A,0x466F,0x9E,0x90,0x5D,0x3F,0x30,0x83,0x73,0x8B)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620,0x9792,0x4d8d,0x81,0xa4,0x86,0xaf,0x25,0x77,0x20,0x90)
OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo,0xa0af4f81,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio,0xa0af4f82,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo,0x5a9b6a40,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI,0x5a9b6a41,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder,0xBF87B6E0,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2,0xBF87B6E1,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
OUR_GUID_ENTRY(CLSID_ProtoFilterGraph,0xe436ebb0,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_SystemClock,0xe436ebb1,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterMapper,0xe436ebb2,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterGraph,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterGraphNoThread,0xe436ebb8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_MPEG1Doc,0xe4bbd160,0x4269,0x11ce,0x83,0x8d,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_FileSource,0x701722e0,0x8ae3,0x11ce,0xa8,0x5c,0x00,0xaa,0x00,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer,0x26c25940,0x4ca9,0x11ce,0xa8,0x28,0x0,0xaa,0x0,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_MPEG1Splitter,0x336475d0,0x942a,0x11ce,0xa8,0x70,0x00,0xaa,0x00,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_CMpegVideoCodec,0xfeb50740,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
OUR_GUID_ENTRY(CLSID_CMpegAudioCodec,0x4a2286e0,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
OUR_GUID_ENTRY(CLSID_TextRender,0xe30629d3,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_InfTee,0xf8388a40,0xd5bb,0x11d0,0xbe,0x5a,0x0,0x80,0xc7,0x6,0x56,0x8e)
OUR_GUID_ENTRY(CLSID_AviSplitter,0x1b544c20,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_AviReader,0x1b544c21,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_VfwCapture,0x1b544c22,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_CaptureProperties,0x1B544c22,0xFD0B,0x11ce,0x8C,0x63,0x00,0xAA,0x00,0x44,0xB5,0x1F)
OUR_GUID_ENTRY(CLSID_FGControl,0xe436ebb4,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_MOVReader,0x44584800,0xf8ee,0x11ce,0xb2,0xd4,0x00,0xdd,0x1,0x10,0x1b,0x85)
OUR_GUID_ENTRY(CLSID_QuickTimeParser,0xd51bd5a0,0x7548,0x11cf,0xa5,0x20,0x0,0x80,0xc7,0x7e,0xf5,0x8a)
OUR_GUID_ENTRY(CLSID_QTDec,0xfdfe9681,0x74a3,0x11d0,0xaf,0xa7,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_AVIDoc,0xd3588ab0,0x0781,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0xb,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_VideoRenderer,0x70e102b0,0x5556,0x11ce,0x97,0xc0,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_Colour,0x1643e180,0x90f5,0x11ce,0x97,0xd5,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_Dither,0x1da08500,0x9edc,0x11cf,0xbc,0x10,0x00,0xaa,0x00,0xac,0x74,0xf6)
OUR_GUID_ENTRY(CLSID_ModexRenderer,0x7167665,0x5011,0x11cf,0xbf,0x33,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_AudioRender,0xe30629d1,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_AudioProperties,0x05589faf,0xc356,0x11ce,0xbf,0x01,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_DSoundRender,0x79376820,0x07D0,0x11CF,0xA2,0x4D,0x0,0x20,0xAF,0xD7,0x97,0x67)
OUR_GUID_ENTRY(CLSID_AudioRecord,0xe30629d2,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties,0x2ca8ca52,0x3c3f,0x11d2,0xb7,0x3d,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
OUR_GUID_ENTRY(CLSID_AVIDec,0xcf49d4e0,0x1115,0x11ce,0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_AVIDraw,0xa888df60,0x1e90,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
OUR_GUID_ENTRY(CLSID_ACMWrapper,0x6a08cf80,0x0e18,0x11cf,0xa2,0x4d,0x0,0x20,0xaf,0xd7,0x97,0x67)
OUR_GUID_ENTRY(CLSID_AsyncReader,0xe436ebb5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_URLReader,0xe436ebb6,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_PersistMonikerPID,0xe436ebb7,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_AVICo,0xd76e2820,0x1563,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
OUR_GUID_ENTRY(CLSID_FileWriter,0x8596e5f0,0xda5,0x11d0,0xbd,0x21,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AviDest,0xe2510970,0xf137,0x11ce,0x8b,0x67,0x0,0xaa,0x0,0xa3,0xf1,0xa6)
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage,0xc647b5c0,0x157c,0x11d0,0xbd,0x23,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1,0xa9ae910,0x85c0,0x11d0,0xbd,0x42,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AVIMIDIRender,0x07b65360,0xc445,0x11ce,0xaf,0xde,0x00,0xaa,0x00,0x6c,0x14,0xf4)
OUR_GUID_ENTRY(CLSID_WMAsfReader,0x187463a0,0x5bb7,0x11d3,0xac,0xbe,0x0,0x80,0xc7,0x5e,0x24,0x6e)
OUR_GUID_ENTRY(CLSID_WMAsfWriter,0x7c23220e,0x55bb,0x11d3,0x8b,0x16,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer,0xafb6c280,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a)
OUR_GUID_ENTRY(CLSID_MMSPLITTER,0x3ae86b20,0x7be8,0x11d1,0xab,0xe6,0x00,0xa0,0xc9,0x05,0xf3,0x75)
OUR_GUID_ENTRY(CLSID_StreamBufferSink,0x2db47ae5,0xcf39,0x43c2,0xb4,0xd6,0xc,0xd8,0xd9,0x9,0x46,0xf4)
OUR_GUID_ENTRY(CLSID_StreamBufferSource,0xc9f5fe02,0xf851,0x4eb5,0x99,0xee,0xad,0x60,0x2a,0xf1,0xe6,0x19)
OUR_GUID_ENTRY(CLSID_StreamBufferConfig,0xfa8a68b2,0xc864,0x4ba2,0xad,0x53,0xd3,0x87,0x6a,0x87,0x49,0x4b)
OUR_GUID_ENTRY(CLSID_Mpeg2VideoStreamAnalyzer,0x6cfad761,0x735d,0x4aa5,0x8a,0xfc,0xaf,0x91,0xa7,0xd6,0x1e,0xba)
OUR_GUID_ENTRY(CLSID_StreamBufferRecordingAttributes,0xccaa63ac,0x1057,0x4778,0xae,0x92,0x12,0x6,0xab,0x9a,0xce,0xe6)
OUR_GUID_ENTRY(CLSID_StreamBufferComposeRecording,0xd682c4ba,0xa90a,0x42fe,0xb9,0xe1,0x3,0x10,0x98,0x49,0xc4,0x23)
OUR_GUID_ENTRY(CLSID_DVVideoCodec,0xb1b77c00,0xc3e4,0x11cf,0xaf,0x79,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVVideoEnc,0x13aa3650,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVSplitter,0x4eb31670,0x9fc6,0x11cf,0xaf,0x6e,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVMux,0x129d7e40,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_SeekingPassThru,0x60af76c,0x68dd,0x11d0,0x8f,0xc1,0x0,0xc0,0x4f,0xd9,0x18,0x9d)
OUR_GUID_ENTRY(CLSID_Line21Decoder,0x6e8d4a20,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(CLSID_Line21Decoder2,0xe4206432,0x01a1,0x4bee,0xb3,0xe1,0x37,0x02,0xc8,0xed,0xc5,0x74)
OUR_GUID_ENTRY(CLSID_OverlayMixer,0xcd8743a1,0x3736,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(CLSID_VBISurfaces,0x814b9800,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(CLSID_WSTDecoder,0x70bc06e0,0x5666,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(CLSID_MjpegDec,0x301056d0,0x6dff,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
OUR_GUID_ENTRY(CLSID_MJPGEnc,0xb80ab0a0,0x7416,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
OUR_GUID_ENTRY(CLSID_SystemDeviceEnum,0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CDeviceMoniker,0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CVidCapClassManager,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CQzFilterClassManager,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_VideoCompressorCategory,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CIcmCoClassManager,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioCompressorCategory,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CAcmCoClassManager,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CWaveinClassManager,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioRendererCategory,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CWaveOutClassManager,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_MidiRendererCategory,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
OUR_GUID_ENTRY(CLSID_CMidiOutClassManager,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
OUR_GUID_ENTRY(CLSID_TransmitCategory,0xcc7bfb41,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
OUR_GUID_ENTRY(CLSID_DeviceControlCategory,0xcc7bfb46,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
OUR_GUID_ENTRY(CLSID_ActiveMovieCategories,0xda4e3da0,0xd07d,0x11d0,0xbd,0x50,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory,0x2721AE20,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(CLSID_MediaEncoderCategory,0x7D22E920,0x5CA9,0x4787,0x8C,0x2B,0xA6,0x77,0x9B,0xD1,0x17,0x81)
OUR_GUID_ENTRY(CLSID_MediaMultiplexerCategory,0x236C9559,0xADCE,0x4736,0xBF,0x72,0xBA,0xB3,0x4E,0x39,0x21,0x96)
OUR_GUID_ENTRY(CLSID_FilterMapper2,0xcda42200,0xbd88,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_MemoryAllocator,0x1e651cc0,0xb199,0x11d0,0x82,0x12,0x00,0xc0,0x4f,0xc3,0x2c,0x45)
OUR_GUID_ENTRY(CLSID_MediaPropertyBag,0xcdbd8d00,0xc193,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_DvdGraphBuilder,0xFCC152B7,0xF372,0x11d0,0x8E,0x00,0x00,0xC0,0x4F,0xD7,0xC0,0x8B)
OUR_GUID_ENTRY(CLSID_DVDNavigator,0x9b8c4620,0x2c1a,0x11d0,0x84,0x93,0x0,0xa0,0x24,0x38,0xad,0x48)
OUR_GUID_ENTRY(CLSID_DVDState,0xf963c5cf,0xa659,0x4a93,0x96,0x38,0xca,0xf3,0xcd,0x27,0x7d,0x13)
OUR_GUID_ENTRY(CLSID_SmartTee,0xcc58e280,0x8aa1,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(FORMAT_None,0x0F6417D6,0xc318,0x11d0,0xa4,0x3f,0x00,0xa0,0xc9,0x22,0x31,0x96)
OUR_GUID_ENTRY(FORMAT_VideoInfo,0x05589f80,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_VideoInfo2,0xf72a76A0,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(FORMAT_WaveFormatEx,0x05589f81,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_MPEGVideo,0x05589f82,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_MPEGStreams,0x05589f83,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_DvInfo,0x05589f84,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_DirectDrawProperties,0x944d4c00,0xdd52,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_PerformanceProperties,0x59ce6880,0xacf8,0x11cf,0xb5,0x6e,0x00,0x80,0xc7,0xc4,0xb6,0x8a)
OUR_GUID_ENTRY(CLSID_QualityProperties,0x418afb70,0xf8b8,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
OUR_GUID_ENTRY(IID_IBaseVideoMixer,0x61ded640,0xe912,0x11ce,0xa0,0x99,0x00,0xaa,0x00,0x47,0x9a,0x58)
OUR_GUID_ENTRY(IID_IDirectDrawVideo,0x36d39eb0,0xdd75,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IQualProp,0x1bd0ecb0,0xf8e2,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
OUR_GUID_ENTRY(CLSID_VPObject,0xce292861,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPObject,0xce292862,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPControl,0x25df12c1,0x3de0,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(CLSID_VPVBIObject,0x814b9801,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPVBIObject,0x814b9802,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPConfig,0xbc29a660,0x30e3,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPNotify,0xc76794a1,0xd6c5,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPNotify2,0xebf47183,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPVBIConfig,0xec529b00,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPVBINotify,0xec529b01,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IMixerPinConfig,0x593cdde1,0x759,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IMixerPinConfig2,0xebf47182,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
#ifndef __DDRAW_INCLUDED__
OUR_GUID_ENTRY(CLSID_DirectDraw,0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35)
OUR_GUID_ENTRY(CLSID_DirectDrawClipper,0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56)
OUR_GUID_ENTRY(IID_IDirectDraw,0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56)
OUR_GUID_ENTRY(IID_IDirectDrawSurface,0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawSurface2,0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27)
OUR_GUID_ENTRY(IID_IDirectDrawSurface3,0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB)
OUR_GUID_ENTRY(IID_IDirectDrawSurface4,0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B)
OUR_GUID_ENTRY(IID_IDirectDrawSurface7,0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b)
OUR_GUID_ENTRY(IID_IDirectDrawPalette,0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawClipper,0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
#endif
#ifndef __DVP_INCLUDED__
OUR_GUID_ENTRY(IID_IDDVideoPortContainer,0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
#endif
#ifndef __DDKM_INCLUDED__
OUR_GUID_ENTRY(IID_IDirectDrawKernel,0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel,0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
#endif
OUR_GUID_ENTRY(CLSID_ModexProperties,0x0618aa30,0x6bc4,0x11cf,0xbf,0x36,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IFullScreenVideo,0xdd1d7110,0x7836,0x11cf,0xbf,0x47,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IFullScreenVideoEx,0x53479470,0xf1dd,0x11cf,0xbc,0x42,0x00,0xaa,0x00,0xac,0x74,0xf6)
OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage,0x101193c0,0xbfe,0x11d0,0xaf,0x91,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage,0x4150f050,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage,0x4db880e0,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(IID_IAMDirectSound,0x546f4260,0xd53e,0x11cf,0xb3,0xf0,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(IID_IMpegAudioDecoder,0xb45dd570,0x3c77,0x11d1,0xab,0xe1,0x00,0xa0,0xc9,0x05,0xf3,0x75)
OUR_GUID_ENTRY(IID_IAMLine21Decoder,0x6e8d4a21,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(IID_IAMWstDecoder,0xc056de21,0x75c2,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage,0x4e27f80,0x91e4,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(FORMAT_AnalogVideo,0x482dde0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo,0x482dde1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M,0x482dde2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B,0x482dde5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D,0x482dde6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G,0x482dde7,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H,0x482dde8,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I,0x482dde9,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M,0x482ddea,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N,0x482ddeb,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO,0x482ddec,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B,0x482ddf0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D,0x482ddf1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G,0x482ddf2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H,0x482ddf3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K,0x482ddf4,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1,0x482ddf5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L,0x482ddf6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio,0x482dee1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
#include "dshow/ksuuids.h"
OUR_GUID_ENTRY(TIME_FORMAT_NONE,0L,0,0,0,0,0,0,0,0,0,0)
OUR_GUID_ENTRY(TIME_FORMAT_FRAME,0x7b785570,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_BYTE,0x7b785571,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE,0x7b785572,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_FIELD,0x7b785573,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME,0x7b785574,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(AMPROPSETID_Pin,0x9b00f101,0x1567,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE,0xfb6c4281,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW,0xfb6c4282,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN,0xfb6c4283,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VBI,0xfb6c4284,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT,0xfb6c4285,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_NABTS,0xfb6c4286,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_EDS,0xfb6c4287,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT,0xfb6c4288,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_CC,0xfb6c4289,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_STILL,0xfb6c428a,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE,0xfb6c428b,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI,0xfb6c428c,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY,0xac798be1,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage,0x266eee41,0x6c63,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage,0x71f96461,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage,0x71f96463,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage,0x71f96464,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage,0x71f96465,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage,0x71f96466,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage,0x71f96467,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties,0x37e92a92,0xd9aa,0x11d2,0xbf,0x84,0x8e,0xf2,0xb1,0x55,0x5a,0xed)
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,0xB87BEB7B,0x8D29,0x423f,0xAE,0x4D,0x65,0x82,0xC1,0x01,0x75,0xAC)
OUR_GUID_ENTRY(CLSID_VideoRendererDefault,0x6BC1CFFA,0x8FC1,0x4261,0xAC,0x22,0xCF,0xB4,0xCC,0x38,0xDB,0x50)
OUR_GUID_ENTRY(CLSID_AllocPresenter,0x99d54f63,0x1a69,0x41ae,0xaa,0x4d,0xc9,0x76,0xeb,0x3f,0x07,0x13)
OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode,0x4444ac9e,0x242e,0x471b,0xa3,0xc7,0x45,0xdc,0xd4,0x63,0x52,0xbc)
OUR_GUID_ENTRY(CLSID_VideoPortManager,0x6f26a6cd,0x967b,0x47fd,0x87,0x4a,0x7a,0xed,0x2c,0x9d,0x25,0xa2)
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9,0x51b4abf3,0x748f,0x4e3b,0xa2,0x76,0xc8,0x28,0x33,0x0e,0x92,0x6a)
OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider,0x0dad2fdd,0x5fd7,0x11d3,0x8f,0x50,0x00,0xc0,0x4f,0x79,0x71,0xe2)
OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage,0xe3444d16,0x5ac4,0x4386,0x88,0xdf,0x13,0xfd,0x23,0x0e,0x1d,0xda)
OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider,0xfa4b375a,0x45b4,0x4d45,0x84,0x40,0x26,0x39,0x57,0xb1,0x16,0x23)
OUR_GUID_ENTRY(CLSID_DVBTNetworkProvider,0x216c62df,0x6d7f,0x4e9a,0x85,0x71,0x5,0xf1,0x4e,0xdb,0x76,0x6a)
OUR_GUID_ENTRY(CLSID_DVBCNetworkProvider,0xdc0c0fe7,0x485,0x4266,0xb9,0x3f,0x68,0xfb,0xf8,0xe,0xd8,0x34)
OUR_GUID_ENTRY(CLSID_DShowTVEFilter,0x05500280,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties,0x05500281,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties,0x05500282,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties,0x05500283,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_IVideoEncoderProxy,0xb43c4eec,0x8c32,0x4791,0x91,0x2,0x50,0x8a,0xda,0x5e,0xe8,0xe7)
OUR_GUID_ENTRY(CLSID_ICodecAPIProxy,0x7ff0997a,0x1999,0x4286,0xa7,0x3c,0x62,0x2b,0x88,0x14,0xe7,0xeb)
OUR_GUID_ENTRY(CLSID_IVideoEncoderCodecAPIProxy,0xb05dabd9,0x56e5,0x4fdc,0xaf,0xa4,0x8a,0x47,0xe9,0x1f,0x1c,0x9c)
#ifndef __ENCODER_API_GUIDS__
#define __ENCODER_API_GUIDS__
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE,0x49cc4c43,0xca83,0x4ad4,0xa9,0xaf,0xf3,0x69,0x6a,0xf6,0x66,0xdf)
OUR_GUID_ENTRY(ENCAPIPARAM_PEAK_BITRATE,0x703f16a9,0x3d48,0x44a1,0xb0,0x77,0x1,0x8d,0xff,0x91,0x5d,0x19)
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE_MODE,0xee5fb25c,0xc713,0x40d1,0x9d,0x58,0xc0,0xd7,0x24,0x1e,0x25,0xf)
OUR_GUID_ENTRY(CODECAPI_CHANGELISTS,0x62b12acf,0xf6b0,0x47d9,0x94,0x56,0x96,0xf2,0x2c,0x4e,0x0b,0x9d)
OUR_GUID_ENTRY(CODECAPI_VIDEO_ENCODER,0x7112e8e1,0x3d03,0x47ef,0x8e,0x60,0x03,0xf1,0xcf,0x53,0x73,0x01)
OUR_GUID_ENTRY(CODECAPI_AUDIO_ENCODER,0xb9d19a3e,0xf897,0x429c,0xbc,0x46,0x81,0x38,0xb7,0x27,0x2b,0x2d)
OUR_GUID_ENTRY(CODECAPI_SETALLDEFAULTS,0x6c5e6a7c,0xacf8,0x4f55,0xa9,0x99,0x1a,0x62,0x81,0x09,0x05,0x1b)
OUR_GUID_ENTRY(CODECAPI_ALLSETTINGS,0x6a577e92,0x83e1,0x4113,0xad,0xc2,0x4f,0xce,0xc3,0x2f,0x83,0xa1)
OUR_GUID_ENTRY(CODECAPI_SUPPORTSEVENTS,0x0581af97,0x7693,0x4dbd,0x9d,0xca,0x3f,0x9e,0xbd,0x65,0x85,0xa1)
OUR_GUID_ENTRY(CODECAPI_CURRENTCHANGELIST,0x1cb14e83,0x7d72,0x4657,0x83,0xfd,0x47,0xa2,0xc5,0xb9,0xd1,0x3d)
#endif
#undef OUR_GUID_ENTRY
-301
View File
@@ -1,301 +0,0 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_INTTYPES_H_ // [
#define _MSC_INTTYPES_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <msc_stdint.h>
// 7.8 Format conversion of integer types
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
// The fprintf macros for signed integers are:
#define PRId8 "d"
#define PRIi8 "i"
#define PRIdLEAST8 "d"
#define PRIiLEAST8 "i"
#define PRIdFAST8 "d"
#define PRIiFAST8 "i"
#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIdLEAST16 "hd"
#define PRIiLEAST16 "hi"
#define PRIdFAST16 "hd"
#define PRIiFAST16 "hi"
#define PRId32 "I32d"
#define PRIi32 "I32i"
#define PRIdLEAST32 "I32d"
#define PRIiLEAST32 "I32i"
#define PRIdFAST32 "I32d"
#define PRIiFAST32 "I32i"
#define PRId64 "I64d"
#define PRIi64 "I64i"
#define PRIdLEAST64 "I64d"
#define PRIiLEAST64 "I64i"
#define PRIdFAST64 "I64d"
#define PRIiFAST64 "I64i"
#define PRIdMAX "I64d"
#define PRIiMAX "I64i"
#define PRIdPTR "Id"
#define PRIiPTR "Ii"
// The fprintf macros for unsigned integers are:
#define PRIo8 "o"
#define PRIu8 "u"
#define PRIx8 "x"
#define PRIX8 "X"
#define PRIoLEAST8 "o"
#define PRIuLEAST8 "u"
#define PRIxLEAST8 "x"
#define PRIXLEAST8 "X"
#define PRIoFAST8 "o"
#define PRIuFAST8 "u"
#define PRIxFAST8 "x"
#define PRIXFAST8 "X"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"
#define PRIoLEAST16 "ho"
#define PRIuLEAST16 "hu"
#define PRIxLEAST16 "hx"
#define PRIXLEAST16 "hX"
#define PRIoFAST16 "ho"
#define PRIuFAST16 "hu"
#define PRIxFAST16 "hx"
#define PRIXFAST16 "hX"
#define PRIo32 "I32o"
#define PRIu32 "I32u"
#define PRIx32 "I32x"
#define PRIX32 "I32X"
#define PRIoLEAST32 "I32o"
#define PRIuLEAST32 "I32u"
#define PRIxLEAST32 "I32x"
#define PRIXLEAST32 "I32X"
#define PRIoFAST32 "I32o"
#define PRIuFAST32 "I32u"
#define PRIxFAST32 "I32x"
#define PRIXFAST32 "I32X"
#define PRIo64 "I64o"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#define PRIoLEAST64 "I64o"
#define PRIuLEAST64 "I64u"
#define PRIxLEAST64 "I64x"
#define PRIXLEAST64 "I64X"
#define PRIoFAST64 "I64o"
#define PRIuFAST64 "I64u"
#define PRIxFAST64 "I64x"
#define PRIXFAST64 "I64X"
#define PRIoMAX "I64o"
#define PRIuMAX "I64u"
#define PRIxMAX "I64x"
#define PRIXMAX "I64X"
#define PRIoPTR "Io"
#define PRIuPTR "Iu"
#define PRIxPTR "Ix"
#define PRIXPTR "IX"
// The fscanf macros for signed integers are:
#define SCNd8 "d"
#define SCNi8 "i"
#define SCNdLEAST8 "d"
#define SCNiLEAST8 "i"
#define SCNdFAST8 "d"
#define SCNiFAST8 "i"
#define SCNd16 "hd"
#define SCNi16 "hi"
#define SCNdLEAST16 "hd"
#define SCNiLEAST16 "hi"
#define SCNdFAST16 "hd"
#define SCNiFAST16 "hi"
#define SCNd32 "ld"
#define SCNi32 "li"
#define SCNdLEAST32 "ld"
#define SCNiLEAST32 "li"
#define SCNdFAST32 "ld"
#define SCNiFAST32 "li"
#define SCNd64 "I64d"
#define SCNi64 "I64i"
#define SCNdLEAST64 "I64d"
#define SCNiLEAST64 "I64i"
#define SCNdFAST64 "I64d"
#define SCNiFAST64 "I64i"
#define SCNdMAX "I64d"
#define SCNiMAX "I64i"
#ifdef _WIN64 // [
# define SCNdPTR "I64d"
# define SCNiPTR "I64i"
#else // _WIN64 ][
# define SCNdPTR "ld"
# define SCNiPTR "li"
#endif // _WIN64 ]
// The fscanf macros for unsigned integers are:
#define SCNo8 "o"
#define SCNu8 "u"
#define SCNx8 "x"
#define SCNX8 "X"
#define SCNoLEAST8 "o"
#define SCNuLEAST8 "u"
#define SCNxLEAST8 "x"
#define SCNXLEAST8 "X"
#define SCNoFAST8 "o"
#define SCNuFAST8 "u"
#define SCNxFAST8 "x"
#define SCNXFAST8 "X"
#define SCNo16 "ho"
#define SCNu16 "hu"
#define SCNx16 "hx"
#define SCNX16 "hX"
#define SCNoLEAST16 "ho"
#define SCNuLEAST16 "hu"
#define SCNxLEAST16 "hx"
#define SCNXLEAST16 "hX"
#define SCNoFAST16 "ho"
#define SCNuFAST16 "hu"
#define SCNxFAST16 "hx"
#define SCNXFAST16 "hX"
#define SCNo32 "lo"
#define SCNu32 "lu"
#define SCNx32 "lx"
#define SCNX32 "lX"
#define SCNoLEAST32 "lo"
#define SCNuLEAST32 "lu"
#define SCNxLEAST32 "lx"
#define SCNXLEAST32 "lX"
#define SCNoFAST32 "lo"
#define SCNuFAST32 "lu"
#define SCNxFAST32 "lx"
#define SCNXFAST32 "lX"
#define SCNo64 "I64o"
#define SCNu64 "I64u"
#define SCNx64 "I64x"
#define SCNX64 "I64X"
#define SCNoLEAST64 "I64o"
#define SCNuLEAST64 "I64u"
#define SCNxLEAST64 "I64x"
#define SCNXLEAST64 "I64X"
#define SCNoFAST64 "I64o"
#define SCNuFAST64 "I64u"
#define SCNxFAST64 "I64x"
#define SCNXFAST64 "I64X"
#define SCNoMAX "I64o"
#define SCNuMAX "I64u"
#define SCNxMAX "I64x"
#define SCNXMAX "I64X"
#ifdef _WIN64 // [
# define SCNoPTR "I64o"
# define SCNuPTR "I64u"
# define SCNxPTR "I64x"
# define SCNXPTR "I64X"
#else // _WIN64 ][
# define SCNoPTR "lo"
# define SCNuPTR "lu"
# define SCNxPTR "lx"
# define SCNXPTR "lX"
#endif // _WIN64 ]
// 7.8.2 Functions for greatest-width integer types
// 7.8.2.1 The imaxabs function
#define imaxabs _abs64
// 7.8.2.2 The imaxdiv function
// This is modified version of div() function from Microsoft's div.c found
// in %MSVC.NET%\crt\src\div.c
#ifdef STATIC_IMAXDIV // [
static
#else // STATIC_IMAXDIV ][
_inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
imaxdiv_t result;
result.quot = numer / denom;
result.rem = numer % denom;
if (numer < 0 && result.rem > 0) {
// did division wrong; must fix up
++result.quot;
result.rem -= denom;
}
return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
#define strtoimax _strtoi64
#define strtoumax _strtoui64
// 7.8.2.4 The wcstoimax and wcstoumax functions
#define wcstoimax _wcstoi64
#define wcstoumax _wcstoui64
#endif // _MSC_INTTYPES_H_ ]
-219
View File
@@ -1,219 +0,0 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#include <limits.h>
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#if (_MSC_VER < 1300) && defined(__cplusplus)
extern "C++" {
#endif
# include <wchar.h>
#if (_MSC_VER < 1300) && defined(__cplusplus)
}
#endif
#if defined __GNUC__ || _MSC_VER >= 1600
#include "stdint.h"
#else
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN _I8_MIN
#define INT8_MAX _I8_MAX
#define INT16_MIN _I16_MIN
#define INT16_MAX _I16_MAX
#define INT32_MIN _I32_MIN
#define INT32_MAX _I32_MAX
#define INT64_MIN _I64_MIN
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val
#define INT16_C(val) val
#define INT32_C(val) val##L
#define INT64_C(val) val##i64
#define UINT8_C(val) val
#define UINT16_C(val) val
#define UINT32_C(val) val##UL
#define UINT64_C(val) val##Ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif
#endif // _MSC_STDINT_H_ ]
+25
View File
@@ -0,0 +1,25 @@
Copyright (c) 2008-2015 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
https://www.khronos.org/registry/
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+92
View File
@@ -0,0 +1,92 @@
//
// File: vk_platform.h
//
/*
** Copyright (c) 2014-2017 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.
*/
#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/
/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This
// is true even if the rest of the application passes floats on the stack,
// as it does by default when compiling for the armeabi-v7a NDK ABI.
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
#include <stddef.h>
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif // !defined(VK_NO_STDINT_H)
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif
+83
View File
@@ -0,0 +1,83 @@
#ifndef VULKAN_H_
#define VULKAN_H_ 1
/*
** Copyright (c) 2015-2018 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.
*/
#include "vk_platform.h"
#include "vulkan_core.h"
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#include "vulkan_android.h"
#endif
#ifdef VK_USE_PLATFORM_FUCHSIA
#include <zircon/types.h>
#include "vulkan_fuchsia.h"
#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
#include "vulkan_ios.h"
#endif
#ifdef VK_USE_PLATFORM_MACOS_MVK
#include "vulkan_macos.h"
#endif
#ifdef VK_USE_PLATFORM_MIR_KHR
#include <mir_toolkit/client_types.h>
#include "vulkan_mir.h"
#endif
#ifdef VK_USE_PLATFORM_VI_NN
#include "vulkan_vi.h"
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <wayland-client.h>
#include "vulkan_wayland.h"
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
#include <windows.h>
#include "vulkan_win32.h"
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xcb.h>
#include "vulkan_xcb.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
#include <X11/Xlib.h>
#include "vulkan_xlib.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "vulkan_xlib_xrandr.h"
#endif
#endif // VULKAN_H_
+126
View File
@@ -0,0 +1,126 @@
#ifndef VULKAN_ANDROID_H_
#define VULKAN_ANDROID_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_android_surface 1
struct ANativeWindow;
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkAndroidSurfaceCreateFlagsKHR flags;
struct ANativeWindow* window;
} VkAndroidSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer;
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
typedef struct VkAndroidHardwareBufferUsageANDROID {
VkStructureType sType;
void* pNext;
uint64_t androidHardwareBufferUsage;
} VkAndroidHardwareBufferUsageANDROID;
typedef struct VkAndroidHardwareBufferPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeBits;
} VkAndroidHardwareBufferPropertiesANDROID;
typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkFormat format;
uint64_t externalFormat;
VkFormatFeatureFlags formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange;
VkChromaLocation suggestedXChromaOffset;
VkChromaLocation suggestedYChromaOffset;
} VkAndroidHardwareBufferFormatPropertiesANDROID;
typedef struct VkImportAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
struct AHardwareBuffer* buffer;
} VkImportAndroidHardwareBufferInfoANDROID;
typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
} VkMemoryGetAndroidHardwareBufferInfoANDROID;
typedef struct VkExternalFormatANDROID {
VkStructureType sType;
void* pNext;
uint64_t externalFormat;
} VkExternalFormatANDROID;
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
VkDevice device,
const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
VkDevice device,
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer);
#endif
#ifdef __cplusplus
}
#endif
#endif
File diff suppressed because it is too large Load Diff
+58
View File
@@ -0,0 +1,58 @@
#ifndef VULKAN_FUCHSIA_H_
#define VULKAN_FUCHSIA_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_FUCHSIA_imagepipe_surface 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkImagePipeSurfaceCreateFlagsFUCHSIA flags;
zx_handle_t imagePipeHandle;
} VkImagePipeSurfaceCreateInfoFUCHSIA;
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
VkInstance instance,
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif
+58
View File
@@ -0,0 +1,58 @@
#ifndef VULKAN_IOS_H_
#define VULKAN_IOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_ios_surface 1
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
typedef struct VkIOSSurfaceCreateInfoMVK {
VkStructureType sType;
const void* pNext;
VkIOSSurfaceCreateFlagsMVK flags;
const void* pView;
} VkIOSSurfaceCreateInfoMVK;
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
VkInstance instance,
const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif
+58
View File
@@ -0,0 +1,58 @@
#ifndef VULKAN_MACOS_H_
#define VULKAN_MACOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef struct VkMacOSSurfaceCreateInfoMVK {
VkStructureType sType;
const void* pNext;
VkMacOSSurfaceCreateFlagsMVK flags;
const void* pView;
} VkMacOSSurfaceCreateInfoMVK;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif
+65
View File
@@ -0,0 +1,65 @@
#ifndef VULKAN_MIR_H_
#define VULKAN_MIR_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_mir_surface 1
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
typedef struct VkMirSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkMirSurfaceCreateFlagsKHR flags;
MirConnection* connection;
MirSurface* mirSurface;
} VkMirSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
VkInstance instance,
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
MirConnection* connection);
#endif
#ifdef __cplusplus
}
#endif
#endif
+58
View File
@@ -0,0 +1,58 @@
#ifndef VULKAN_VI_H_
#define VULKAN_VI_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_NN_vi_surface 1
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
typedef VkFlags VkViSurfaceCreateFlagsNN;
typedef struct VkViSurfaceCreateInfoNN {
VkStructureType sType;
const void* pNext;
VkViSurfaceCreateFlagsNN flags;
void* window;
} VkViSurfaceCreateInfoNN;
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
VkInstance instance,
const VkViSurfaceCreateInfoNN* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif
+65
View File
@@ -0,0 +1,65 @@
#ifndef VULKAN_WAYLAND_H_
#define VULKAN_WAYLAND_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_wayland_surface 1
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
typedef struct VkWaylandSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWaylandSurfaceCreateFlagsKHR flags;
struct wl_display* display;
struct wl_surface* surface;
} VkWaylandSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct wl_display* display);
#endif
#ifdef __cplusplus
}
#endif
#endif
+276
View File
@@ -0,0 +1,276 @@
#ifndef VULKAN_WIN32_H_
#define VULKAN_WIN32_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_win32_surface 1
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
typedef struct VkWin32SurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWin32SurfaceCreateFlagsKHR flags;
HINSTANCE hinstance;
HWND hwnd;
} VkWin32SurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex);
#endif
#define VK_KHR_external_memory_win32 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportMemoryWin32HandleInfoKHR;
typedef struct VkExportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportMemoryWin32HandleInfoKHR;
typedef struct VkMemoryWin32HandlePropertiesKHR {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryWin32HandlePropertiesKHR;
typedef struct VkMemoryGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
VkDevice device,
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#endif
#define VK_KHR_win32_keyed_mutex 1
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t acquireCount;
const VkDeviceMemory* pAcquireSyncs;
const uint64_t* pAcquireKeys;
const uint32_t* pAcquireTimeouts;
uint32_t releaseCount;
const VkDeviceMemory* pReleaseSyncs;
const uint64_t* pReleaseKeys;
} VkWin32KeyedMutexAcquireReleaseInfoKHR;
#define VK_KHR_external_semaphore_win32 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportSemaphoreWin32HandleInfoKHR;
typedef struct VkExportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportSemaphoreWin32HandleInfoKHR;
typedef struct VkD3D12FenceSubmitInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t waitSemaphoreValuesCount;
const uint64_t* pWaitSemaphoreValues;
uint32_t signalSemaphoreValuesCount;
const uint64_t* pSignalSemaphoreValues;
} VkD3D12FenceSubmitInfoKHR;
typedef struct VkSemaphoreGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkExternalSemaphoreHandleTypeFlagBits handleType;
} VkSemaphoreGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
VkDevice device,
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
VkDevice device,
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_KHR_external_fence_win32 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
typedef struct VkImportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkFenceImportFlags flags;
VkExternalFenceHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportFenceWin32HandleInfoKHR;
typedef struct VkExportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportFenceWin32HandleInfoKHR;
typedef struct VkFenceGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkExternalFenceHandleTypeFlagBits handleType;
} VkFenceGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
VkDevice device,
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
VkDevice device,
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_NV_external_memory_win32 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagsNV handleType;
HANDLE handle;
} VkImportMemoryWin32HandleInfoNV;
typedef struct VkExportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
} VkExportMemoryWin32HandleInfoNV;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
VkDevice device,
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle);
#endif
#define VK_NV_win32_keyed_mutex 1
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
VkStructureType sType;
const void* pNext;
uint32_t acquireCount;
const VkDeviceMemory* pAcquireSyncs;
const uint64_t* pAcquireKeys;
const uint32_t* pAcquireTimeoutMilliseconds;
uint32_t releaseCount;
const VkDeviceMemory* pReleaseSyncs;
const uint64_t* pReleaseKeys;
} VkWin32KeyedMutexAcquireReleaseInfoNV;
#ifdef __cplusplus
}
#endif
#endif
+66
View File
@@ -0,0 +1,66 @@
#ifndef VULKAN_XCB_H_
#define VULKAN_XCB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xcb_surface 1
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
typedef struct VkXcbSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXcbSurfaceCreateFlagsKHR flags;
xcb_connection_t* connection;
xcb_window_t window;
} VkXcbSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
#endif
#ifdef __cplusplus
}
#endif
#endif
+66
View File
@@ -0,0 +1,66 @@
#ifndef VULKAN_XLIB_H_
#define VULKAN_XLIB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xlib_surface 1
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
typedef struct VkXlibSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXlibSurfaceCreateFlagsKHR flags;
Display* dpy;
Window window;
} VkXlibSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
Display* dpy,
VisualID visualID);
#endif
#ifdef __cplusplus
}
#endif
#endif
+54
View File
@@ -0,0 +1,54 @@
#ifndef VULKAN_XLIB_XRANDR_H_
#define VULKAN_XLIB_XRANDR_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 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.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_EXT_acquire_xlib_display 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
RROutput rrOutput,
VkDisplayKHR* pDisplay);
#endif
#ifdef __cplusplus
}
#endif
#endif
+6 -3
View File
@@ -6,7 +6,7 @@ project(${IPP_IW_LIBRARY})
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
add_definitions(-DIW_BUILD)
if(HAVE_IPP_ICV_ONLY)
if(HAVE_IPP_ICV)
add_definitions(-DICV_BASE)
endif()
@@ -20,8 +20,11 @@ file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IP
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-function")
if(CV_GCC OR CV_CLANG OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
endif()
if(CV_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")
endif()
endif()
+13 -13
View File
@@ -2,37 +2,37 @@ function(download_ippicv root_var)
set(${root_var} "" PARENT_SCOPE)
# Commit SHA in the opencv_3rdparty repo
set(IPPICV_COMMIT "a62e20676a60ee0ad6581e217fe7e4bada3b95db")
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
# Define actual ICV versions
if(APPLE)
set(OPENCV_ICV_PLATFORM "macosx")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_intel64_20170418.tgz")
set(OPENCV_ICV_HASH "0c25953c99dbb499ff502485a9356d8d")
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
else()
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_ia32_20170418.tgz")
set(OPENCV_ICV_HASH "5f225948f3f64067c681293c098d50d8")
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
endif()
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_intel64_20170418.tgz")
set(OPENCV_ICV_HASH "87cbdeb627415d8e4bc811156289fa3a")
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
else()
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_ia32_20170418.tgz")
set(OPENCV_ICV_HASH "f2cece00d802d4dea86df52ed095257e")
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
endif()
elseif(WIN32 AND NOT ARM)
set(OPENCV_ICV_PLATFORM "windows")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2017u2_win_intel64_20170418.zip")
set(OPENCV_ICV_HASH "75060a0c662c0800f48995b7e9b085f6")
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
else()
set(OPENCV_ICV_NAME "ippicv_2017u2_win_ia32_20170418.zip")
set(OPENCV_ICV_HASH "60fcf3ccd9a2ebc9e432ffb5cb91638b")
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
endif()
else()
return()
+4 -6
View File
@@ -15,6 +15,8 @@ if(NOT WIN32)
endif()
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wimplicit-fallthrough)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
set(ITT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
@@ -43,12 +45,6 @@ if(NOT WIN32)
endif()
endif()
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
set_target_properties(${ITT_LIBRARY} PROPERTIES
OUTPUT_NAME ${ITT_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
@@ -66,3 +62,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
+1 -1
View File
@@ -335,7 +335,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
#ifdef SDL_STRNCPY_S
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
#else
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, l)
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
#endif /* SDL_STRNCPY_S */
#define __itt_fstrdup(s) strdup(s)
+7 -8
View File
@@ -25,16 +25,13 @@ endif(WIN32 AND NOT MINGW)
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
-Wsign-compare -Wstrict-overflow)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
-Wsign-compare -Wstrict-overflow -Wpointer-compare
-Wabsolute-value # clang on Linux
-Wimplicit-fallthrough
)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
set_target_properties(${JASPER_LIBRARY}
PROPERTIES
OUTPUT_NAME ${JASPER_LIBRARY}
@@ -51,3 +48,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
ocv_install_3rdparty_licenses(jasper LICENSE README copyright)
+124
View File
@@ -0,0 +1,124 @@
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 2)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD "${BUILD}-debug")
endif()
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
include(CheckCSourceCompiles)
include(CheckIncludeFiles)
include(CheckTypeSize)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
if(SIZEOF_SIZE_T EQUAL SIZEOF_UNSIGNED_LONG)
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
HAVE_BUILTIN_CTZL)
endif()
if(MSVC)
check_include_files("intrin.h" HAVE_INTRIN_H)
endif()
if(UNIX)
# Check for headers
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(stddef.h HAVE_STDDEF_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(sys/types.h NEED_SYS_TYPES_H)
# Other predefines
# undef NEED_BSD_STRINGS
ocv_update(HAVE_UNSIGNED_CHAR 1)
ocv_update(HAVE_UNSIGNED_SHORT 1)
# undef INCOMPLETE_TYPES_BROKEN
ocv_update(RIGHT_SHIFT_IS_UNSIGNED 0)
ocv_update(__CHAR_UNSIGNED__ 0)
endif()
set(BITS_IN_JSAMPLE 8)
if(WITH_ARITH_ENC)
set(C_ARITH_CODING_SUPPORTED 1)
endif()
if(WITH_ARITH_DEC)
set(D_ARITH_CODING_SUPPORTED 1)
endif()
set(JPEG_LIB_VERSION 62)
# OpenCV
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
if(MSVC)
add_definitions(-W3 -wd4996 -wd4018)
endif()
if(WIN32)
configure_file(jconfig.h.win.in jconfig.h)
else()
configure_file(jconfig.h.in jconfig.h)
endif()
configure_file(jconfigint.h.in jconfigint.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
endif()
if(WITH_ARITH_ENC)
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
endif()
if(WITH_ARITH_DEC)
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
endif()
# No SIMD
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
ocv_list_add_prefix(JPEG_SOURCES src/)
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
set_target_properties(${JPEG_LIBRARY}
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${JPEG_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${JPEG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty")
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg)
+132
View File
@@ -0,0 +1,132 @@
libjpeg-turbo Licenses
======================
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
- The IJG (Independent JPEG Group) License, which is listed in
[README.ijg](README.ijg)
This license applies to the libjpeg API library and associated programs
(any code inherited from libjpeg, and any modifications to that code.)
- The Modified (3-clause) BSD License, which is listed below
This license covers the TurboJPEG API library and associated programs, as
well as the build system.
- The [zlib License](https://opensource.org/licenses/Zlib)
This license is a subset of the other two, and it covers the libjpeg-turbo
SIMD extensions.
Complying with the libjpeg-turbo Licenses
=========================================
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
best of our understanding.
1. If you are distributing a modified version of the libjpeg-turbo source,
then:
1. You cannot alter or remove any existing copyright or license notices
from the source.
**Origin**
- Clause 1 of the IJG License
- Clause 1 of the Modified BSD License
- Clauses 1 and 3 of the zlib License
2. You must add your own copyright notice to the header of each source
file you modified, so others can tell that you modified that file (if
there is not an existing copyright header in that file, then you can
simply add a notice stating that you modified the file.)
**Origin**
- Clause 1 of the IJG License
- Clause 2 of the zlib License
3. You must include the IJG README file, and you must not alter any of the
copyright or license text in that file.
**Origin**
- Clause 1 of the IJG License
2. If you are distributing only libjpeg-turbo binaries without the source, or
if you are distributing an application that statically links with
libjpeg-turbo, then:
1. Your product documentation must include a message stating:
This software is based in part on the work of the Independent JPEG
Group.
**Origin**
- Clause 2 of the IJG license
2. If your binary distribution includes or uses the TurboJPEG API, then
your product documentation must include the text of the Modified BSD
License (see below.)
**Origin**
- Clause 2 of the Modified BSD License
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
contributors thereof in advertising, publicity, etc.
**Origin**
- IJG License
- Clause 3 of the Modified BSD License
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
free of defects, nor do we accept any liability for undesirable
consequences resulting from your use of the software.
**Origin**
- IJG License
- Modified BSD License
- zlib License
The Modified (3-clause) BSD License
===================================
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the libjpeg-turbo Project nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Why Three Licenses?
===================
The zlib License could have been used instead of the Modified (3-clause) BSD
License, and since the IJG License effectively subsumes the distribution
conditions of the zlib License, this would have effectively placed
libjpeg-turbo binary distributions under the IJG License. However, the IJG
License specifically refers to the Independent JPEG Group and does not extend
attribution and endorsement protections to other entities. Thus, it was
desirable to choose a license that granted us the same protections for new code
that were granted to the IJG for code derived from their software.
+277
View File
@@ -0,0 +1,277 @@
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
to include only information relevant to libjpeg-turbo, to wordsmith certain
sections, and to remove impolitic language that existed in the libjpeg v8
README. It is included only for reference. Please see README.md for
information specific to libjpeg-turbo.
The Independent JPEG Group's JPEG software
==========================================
This distribution contains a release of the Independent JPEG Group's free JPEG
software. You are welcome to redistribute this software and 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.
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
(also known as JPEG, together with ITU-T SG16).
DOCUMENTATION ROADMAP
=====================
This file contains the following sections:
OVERVIEW General description of JPEG and the IJG software.
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
REFERENCES Where to learn more about JPEG.
ARCHIVE LOCATIONS Where to find newer versions of this software.
FILE FORMAT WARS Software *not* to get.
TO DO Plans for future IJG releases.
Other documentation files in the distribution are:
User documentation:
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
rdjpgcom, and wrjpgcom.
*.1 Unix-style man pages for programs (same info as usage.txt).
wizard.txt Advanced usage instructions for JPEG wizards only.
change.log Version-to-version change highlights.
Programmer and internal documentation:
libjpeg.txt How to use the JPEG library in your own programs.
example.txt Sample code for calling the JPEG library.
structure.txt Overview of the JPEG library's internal structure.
coderules.txt Coding style rules --- please read if you contribute code.
Please read at least usage.txt. Some information can also be found in the JPEG
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
out where to obtain the FAQ article.
If you want to understand how the JPEG code works, we suggest reading one or
more of the REFERENCES, then looking at the documentation files (in roughly
the order listed) before diving into the code.
OVERVIEW
========
This package contains C software to implement JPEG image encoding, decoding,
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and grayscale images. JPEG's strong suit is compressing
photographic images or other types of images that have smooth color and
brightness transitions between neighboring pixels. Images with sharp lines or
other abrupt features may not compress well with JPEG, and a higher JPEG
quality may have to be used to avoid visible compression artifacts with such
images.
JPEG is lossy, meaning that the output pixels are not necessarily identical to
the input pixels. However, on photographic content and other "smooth" images,
very good compression ratios can be obtained with no visible compression
artifacts, and extremely high compression ratios are possible if you are
willing to sacrifice image quality (by reducing the "quality" setting in the
compressor.)
This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these
processes, although some uncommon parameter settings aren't implemented yet.
We have made no provision for supporting the hierarchical or lossless
processes defined in the standard.
We provide a set of library routines for reading and writing JPEG image files,
plus two sample applications "cjpeg" and "djpeg", which use the library to
perform conversion between JPEG and some other popular image file formats.
The library is intended to be reused in other applications.
In order to support file conversion and viewing software, we have included
considerable functionality beyond the bare JPEG coding/decoding capability;
for example, the color quantization modules are not strictly part of JPEG
decoding, but they are essential for output to colormapped file formats or
colormapped displays. These extra functions can be compiled out of the
library if not required for a particular application.
We have also included "jpegtran", a utility for lossless transcoding between
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
applications for inserting and extracting textual comments in JFIF files.
The emphasis in designing this software has been on achieving portability and
flexibility, while also making it fast enough to be useful. In particular,
the software is not intended to be read as a tutorial on JPEG. (See the
REFERENCES section for introductory material.) Rather, it is intended to
be reliable, portable, industrial-strength code. We do not claim to have
achieved that goal in every aspect of the software, but we strive for it.
We welcome the use of this software as a component of commercial products.
No royalty is required, but we do ask for an acknowledgement in product
documentation, as described under LEGAL ISSUES.
LEGAL ISSUES
============
In plain English:
1. We don't promise that this software works. (But if you find any bugs,
please let us know!)
2. You can use this software for whatever you want. You don't have to pay us.
3. You may not pretend that you wrote this software. If you use it in a
program, you must acknowledge somewhere in your documentation that
you've used the IJG code.
In legalese:
The authors make NO WARRANTY or representation, either express or implied,
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.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
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
==========
We recommend reading one or more of these references before trying to
understand the innards of the JPEG software.
The best short technical introduction to the JPEG compression algorithm is
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
(Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue
handy, a PDF file containing a revised version of Wallace's article is
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and IEEE,
and it may not be used for commercial purposes.
A somewhat less technical, more leisurely introduction to JPEG can be found in
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
good explanations and example C code for a multitude of compression methods
including JPEG. It is an excellent source if you are comfortable reading C
code but don't know much about data compression in general. The book's JPEG
sample code is far from industrial-strength, but when you are ready to look
at a full implementation, you've got one here...
The best currently available description of JPEG is the textbook "JPEG Still
Image Data Compression Standard" by William B. Pennebaker and Joan L.
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
standards (DIS 10918-1 and draft DIS 10918-2).
The original JPEG standard is divided into two parts, Part 1 being the actual
specification, while Part 2 covers compliance testing methods. Part 1 is
titled "Digital Compression and Coding of Continuous-tone Still Images,
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
Continuous-tone Still Images, Part 2: Compliance testing" and has document
numbers ISO/IEC IS 10918-2, ITU-T T.83.
The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details, we follow the "JFIF" conventions, revision
1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
Recommendation ITU-T T.871 (05/2011): Information technology - Digital
compression and coding of continuous-tone still images: JPEG File Interchange
Format (JFIF). It is available as a free download in PDF file format from
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
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
uses our library to implement TIFF/JPEG per the Note.
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".
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
FILE FORMAT COMPATIBILITY
=========================
This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
a subset thereof, but there are other formats containing the name "JPEG" that
are incompatible with the DCT-based JPEG standard or with JFIF (for instance,
JPEG 2000 and JPEG XR). This software therefore does not support these
formats. Indeed, one of the original reasons for developing this free software
was to help force convergence on a common, interoperable format standard for
JPEG files.
JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
modified by TIFF Technical Note #2) can be used for "high end" applications
that need to record a lot of additional data about an image.
TO DO
=====
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
+346
View File
@@ -0,0 +1,346 @@
Background
==========
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
generally 2-6x as fast as libjpeg, all else being equal. On other types of
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
virtue of its highly-optimized Huffman coding routines. In many cases, the
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
colorspace extensions that allow it to compress from/decompress to 32-bit and
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
interface.
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
VirtualGL projects made numerous enhancements to the codec in 2009, and in
early 2010, libjpeg-turbo spun off into an independent project, with the goal
of making high-speed JPEG compression/decompression technology available to a
broader range of users and developers.
License
=======
libjpeg-turbo is covered by three compatible BSD-style open source licenses.
Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.
Building libjpeg-turbo
======================
Refer to [BUILDING.md](BUILDING.md) for complete instructions.
Using libjpeg-turbo
===================
libjpeg-turbo includes two APIs that can be used to compress and decompress
JPEG images:
- **TurboJPEG API**<br>
This API provides an easy-to-use interface for compressing and decompressing
JPEG images in memory. It also provides some functionality that would not be
straightforward to achieve using the underlying libjpeg API, such as
generating planar YUV images and performing multiple simultaneous lossless
transforms on an image. The Java interface for libjpeg-turbo is written on
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
[TJExample.java](java/TJExample.java) for examples of its usage and to
<http://libjpeg-turbo.org/Documentation/Documentation> for API documentation.
- **libjpeg API**<br>
This is the de facto industry-standard API for compressing and decompressing
JPEG images. It is more difficult to use than the TurboJPEG API but also
more powerful. The libjpeg API implementation in libjpeg-turbo is both
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
There is no significant performance advantage to either API when both are used
to perform similar operations.
Colorspace Extensions
---------------------
libjpeg-turbo includes extensions that allow JPEG images to be compressed
directly from (and decompressed directly to) buffers that use BGR, BGRX,
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
colorspace constants:
JCS_EXT_RGB /* red/green/blue */
JCS_EXT_RGBX /* red/green/blue/x */
JCS_EXT_BGR /* blue/green/red */
JCS_EXT_BGRX /* blue/green/red/x */
JCS_EXT_XBGR /* x/blue/green/red */
JCS_EXT_XRGB /* x/red/green/blue */
JCS_EXT_RGBA /* red/green/blue/alpha */
JCS_EXT_BGRA /* blue/green/red/alpha */
JCS_EXT_ABGR /* alpha/blue/green/red */
JCS_EXT_ARGB /* alpha/red/green/blue */
Setting `cinfo.in_color_space` (compression) or `cinfo.out_color_space`
(decompression) to one of these values will cause libjpeg-turbo to read the
red, green, and blue values from (or write them to) the appropriate position in
the pixel when compressing from/decompressing to an RGB buffer.
Your application can check for the existence of these extensions at compile
time with:
#ifdef JCS_EXTENSIONS
At run time, attempting to use these extensions with a libjpeg implementation
that does not support them will result in a "Bogus input colorspace" error.
Applications can trap this error in order to test whether run-time support is
available for the colorspace extensions.
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
can set that byte to whatever value it wishes. If an application expects the X
byte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`,
`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`. When these colorspace
constants are used, the X byte is guaranteed to be 0xFF, which is interpreted
as opaque.
Your application can check for the existence of the alpha channel colorspace
extensions at compile time with:
#ifdef JCS_ALPHA_EXTENSIONS
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
how to check for the existence of the colorspace extensions at compile time and
run time.
libjpeg v7 and v8 API/ABI Emulation
-----------------------------------
With libjpeg v7 and v8, new features were added that necessitated extending the
compression and decompression structures. Unfortunately, due to the exposed
nature of those structures, extending them also necessitated breaking backward
ABI compatibility with previous libjpeg releases. Thus, programs that were
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
as widely used as v6b, enough programs (including a few Linux distros) made
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
in libjpeg-turbo. It should be noted, however, that this feature was added
primarily so that applications that had already been compiled to use libjpeg
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
without recompiling. libjpeg-turbo does not claim to support all of the
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
cases (see below.)
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
The following section describes which libjpeg v7+ features are supported and
which aren't.
### Support for libjpeg v7 and v8 Features
#### Fully supported
- **libjpeg: IDCT scaling extensions in decompressor**<br>
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
and 1/2 are SIMD-accelerated.)
- **libjpeg: Arithmetic coding**
- **libjpeg: In-memory source and destination managers**<br>
See notes below.
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
Note that the libpjeg v7+ API was extended to accommodate this feature only
for convenience purposes. It has always been possible to implement this
feature with libjpeg v6b (see rdswitch.c for an example.)
- **cjpeg: 32-bit BMP support**
- **cjpeg: `-rgb` option**
- **jpegtran: Lossless cropping**
- **jpegtran: `-perfect` option**
- **jpegtran: Forcing width/height when performing lossless crop**
- **rdjpgcom: `-raw` option**
- **rdjpgcom: Locale awareness**
#### Not supported
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,
but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
- **libjpeg: DCT scaling in compressor**<br>
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
There is no technical reason why DCT scaling could not be supported when
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
8/9 would be available, which is of limited usefulness.
- **libjpeg: SmartScale**<br>
`cinfo.block_size` is silently ignored.
SmartScale is an extension to the JPEG format that allows for DCT block
sizes other than 8x8. Providing support for this new format would be
feasible (particularly without full acceleration.) However, until/unless
the format becomes either an official industry standard or, at minimum, an
accepted solution in the community, we are hesitant to implement it, as
there is no sense of whether or how it might change in the future. It is
our belief that SmartScale has not demonstrated sufficient usefulness as a
lossless format nor as a means of quality enhancement, and thus our primary
interest in providing this feature would be as a means of supporting
additional DCT scaling factors.
- **libjpeg: Fancy downsampling in compressor**<br>
`cinfo.do_fancy_downsampling` is silently ignored.
This requires the DCT scaling feature, which is not supported.
- **jpegtran: Scaling**<br>
This requires both the DCT scaling and SmartScale features, which are not
supported.
- **Lossless RGB JPEG files**<br>
This requires the SmartScale feature, which is not supported.
### What About libjpeg v9?
libjpeg v9 introduced yet another field to the JPEG compression structure
(`color_transform`), thus making the ABI backward incompatible with that of
libjpeg v8. This new field was introduced solely for the purpose of supporting
lossless SmartScale encoding. Furthermore, there was actually no reason to
extend the API in this manner, as the color transform could have just as easily
been activated by way of a new JPEG colorspace constant, thus preserving
backward ABI compatibility.
Our research (see link above) has shown that lossless SmartScale does not
generally accomplish anything that can't already be accomplished better with
existing, standard lossless formats. Therefore, at this time it is our belief
that there is not sufficient technical justification for software projects to
upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient
technical justification for us to emulate the libjpeg v9 ABI.
In-Memory Source/Destination Managers
-------------------------------------
By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and
`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
API/ABI emulation in order to use the in-memory source/destination managers,
but several projects requested that those functions be included when emulating
the libjpeg v6b API/ABI as well. This allows the use of those functions by
programs that need them, without breaking ABI compatibility for programs that
don't, and it allows those functions to be provided in the "official"
libjpeg-turbo binaries.
Those who are concerned about maintaining strict conformance with the libjpeg
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
libjpeg v8 API/ABI.
On Un*x systems, including the in-memory source/destination managers changes
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
Note that, on most Un*x systems, the dynamic linker will not look for a
function in a library until that function is actually used. Thus, if a program
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
`jpeg_mem_dest()`, that program will not fail if run against an older version
of libjpeg-turbo or against libjpeg v7- until the program actually tries to
call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows.
If a program is built against the libjpeg-turbo 1.3+ DLL and uses
`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+
DLL at run time.
Both cjpeg and djpeg have been extended to allow testing the in-memory
source/destination manager functions. See their respective man pages for more
details.
Mathematical Compatibility
==========================
For the most part, libjpeg-turbo should produce identical output to libjpeg
v6b. The one exception to this is when using the floating point DCT/IDCT, in
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
following reasons:
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
slightly more accurate than the implementation in libjpeg v6b, but not by
any amount perceptible to human vision (generally in the range of 0.01 to
0.08 dB gain in PNSR.)
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
(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.)
- If the floating point algorithms in libjpeg-turbo are not implemented using
SIMD instructions on a particular platform, then the accuracy of the
floating point DCT/IDCT can depend on the compiler settings.
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
still using the same algorithms as libjpeg v6b, so there are several specific
cases in which libjpeg-turbo cannot be expected to produce the same output as
libjpeg v8:
- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
implements those scaling algorithms differently than libjpeg v6b does, and
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
- When using chrominance subsampling, because libjpeg v8 implements this
with its DCT/IDCT scaling algorithms rather than with a separate
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
reason.
- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
merged upsampling with scaling factors > 1.
Performance Pitfalls
====================
Restart Markers
---------------
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
in a way that makes the rest of the libjpeg infrastructure happy, so it is
necessary to use the slow Huffman decoder when decompressing a JPEG image that
has restart markers. This can cause the decompression performance to drop by
as much as 20%, but the performance will still be much greater than that of
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
generating JPEG images, so images generated by those programs will experience
this issue.
Fast Integer Forward DCT at High Quality Levels
-----------------------------------------------
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
whenever encoding images with a JPEG quality of 98 or higher.
+73
View File
@@ -0,0 +1,73 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION @VERSION@
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
/* Support arithmetic encoding */
#cmakedefine C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#cmakedefine D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
#cmakedefine MEM_SRCDST_SUPPORTED 1
/* Use accelerated SIMD routines. */
#cmakedefine WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define if you need to include <sys/types.h> to get size_t. */
#cmakedefine NEED_SYS_TYPES_H 1
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
memset/memcpy in <string.h>. */
#cmakedefine NEED_BSD_STRINGS 1
/* Define to 1 if the system has the type `unsigned char'. */
#cmakedefine HAVE_UNSIGNED_CHAR 1
/* Define to 1 if the system has the type `unsigned short'. */
#cmakedefine HAVE_UNSIGNED_SHORT 1
/* Compiler does not support pointers to undefined structures. */
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
/* Define if your (broken) compiler shifts signed values as if they were
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 */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
+34
View File
@@ -0,0 +1,34 @@
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
#define LIBJPEG_TURBO_VERSION @VERSION@
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
#cmakedefine C_ARITH_CODING_SUPPORTED
#cmakedefine D_ARITH_CODING_SUPPORTED
#cmakedefine MEM_SRCDST_SUPPORTED
#cmakedefine WITH_SIMD
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
#define HAVE_STDDEF_H
#define HAVE_STDLIB_H
#undef NEED_SYS_TYPES_H
#undef NEED_BSD_STRINGS
#define HAVE_UNSIGNED_CHAR
#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 */
typedef unsigned char boolean;
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
/* Define "INT32" as int, not long, per Windows custom */
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
typedef short INT16;
typedef signed int INT32;
#endif
#define XMD_H /* prevent jmorecfg.h from redefining it */
+39
View File
@@ -0,0 +1,39 @@
/* libjpeg-turbo build number */
#define BUILD "@BUILD@"
/* Compiler's inline keyword */
#undef inline
/* How to obtain function inlining. */
#ifndef INLINE
#if defined(__GNUC__)
#define INLINE inline __attribute__((always_inline))
#elif defined(_MSC_VER)
#define INLINE __forceinline
#else
#define INLINE
#endif
#endif
/* Define to the full name of this package. */
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
/* Version number of package */
#define VERSION "@VERSION@"
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
#cmakedefine HAVE_BUILTIN_CTZL
/* Define to 1 if you have the <intrin.h> header file. */
#cmakedefine HAVE_INTRIN_H
#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
#if (SIZEOF_SIZE_T == 8)
#define HAVE_BITSCANFORWARD64
#elif (SIZEOF_SIZE_T == 4)
#define HAVE_BITSCANFORWARD
#endif
#endif
+157
View File
@@ -0,0 +1,157 @@
/*
* jaricom.c
*
* This file was part of the Independent JPEG Group's software:
* Developed 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, 2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains probability estimation tables for common use in
* arithmetic entropy encoding and decoding routines.
*
* This data represents Table D.2 in
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994 and Table 24 in
* Recommendation ITU-T T.82 (1993) | ISO/IEC 11544:1993.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* The following #define specifies the packing of the four components
* into the compact JLONG representation.
* Note that this formula must match the actual arithmetic encoder
* and decoder implementation. The implementation has to be changed
* if this formula is changed.
* The current organization is leaned on Markus Kuhn's JBIG
* implementation (jbig_tab.c).
*/
#define V(i, a, b, c, d) \
(((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
const JLONG jpeg_aritab[113 + 1] = {
/*
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
*/
V( 0, 0x5a1d, 1, 1, 1 ),
V( 1, 0x2586, 14, 2, 0 ),
V( 2, 0x1114, 16, 3, 0 ),
V( 3, 0x080b, 18, 4, 0 ),
V( 4, 0x03d8, 20, 5, 0 ),
V( 5, 0x01da, 23, 6, 0 ),
V( 6, 0x00e5, 25, 7, 0 ),
V( 7, 0x006f, 28, 8, 0 ),
V( 8, 0x0036, 30, 9, 0 ),
V( 9, 0x001a, 33, 10, 0 ),
V( 10, 0x000d, 35, 11, 0 ),
V( 11, 0x0006, 9, 12, 0 ),
V( 12, 0x0003, 10, 13, 0 ),
V( 13, 0x0001, 12, 13, 0 ),
V( 14, 0x5a7f, 15, 15, 1 ),
V( 15, 0x3f25, 36, 16, 0 ),
V( 16, 0x2cf2, 38, 17, 0 ),
V( 17, 0x207c, 39, 18, 0 ),
V( 18, 0x17b9, 40, 19, 0 ),
V( 19, 0x1182, 42, 20, 0 ),
V( 20, 0x0cef, 43, 21, 0 ),
V( 21, 0x09a1, 45, 22, 0 ),
V( 22, 0x072f, 46, 23, 0 ),
V( 23, 0x055c, 48, 24, 0 ),
V( 24, 0x0406, 49, 25, 0 ),
V( 25, 0x0303, 51, 26, 0 ),
V( 26, 0x0240, 52, 27, 0 ),
V( 27, 0x01b1, 54, 28, 0 ),
V( 28, 0x0144, 56, 29, 0 ),
V( 29, 0x00f5, 57, 30, 0 ),
V( 30, 0x00b7, 59, 31, 0 ),
V( 31, 0x008a, 60, 32, 0 ),
V( 32, 0x0068, 62, 33, 0 ),
V( 33, 0x004e, 63, 34, 0 ),
V( 34, 0x003b, 32, 35, 0 ),
V( 35, 0x002c, 33, 9, 0 ),
V( 36, 0x5ae1, 37, 37, 1 ),
V( 37, 0x484c, 64, 38, 0 ),
V( 38, 0x3a0d, 65, 39, 0 ),
V( 39, 0x2ef1, 67, 40, 0 ),
V( 40, 0x261f, 68, 41, 0 ),
V( 41, 0x1f33, 69, 42, 0 ),
V( 42, 0x19a8, 70, 43, 0 ),
V( 43, 0x1518, 72, 44, 0 ),
V( 44, 0x1177, 73, 45, 0 ),
V( 45, 0x0e74, 74, 46, 0 ),
V( 46, 0x0bfb, 75, 47, 0 ),
V( 47, 0x09f8, 77, 48, 0 ),
V( 48, 0x0861, 78, 49, 0 ),
V( 49, 0x0706, 79, 50, 0 ),
V( 50, 0x05cd, 48, 51, 0 ),
V( 51, 0x04de, 50, 52, 0 ),
V( 52, 0x040f, 50, 53, 0 ),
V( 53, 0x0363, 51, 54, 0 ),
V( 54, 0x02d4, 52, 55, 0 ),
V( 55, 0x025c, 53, 56, 0 ),
V( 56, 0x01f8, 54, 57, 0 ),
V( 57, 0x01a4, 55, 58, 0 ),
V( 58, 0x0160, 56, 59, 0 ),
V( 59, 0x0125, 57, 60, 0 ),
V( 60, 0x00f6, 58, 61, 0 ),
V( 61, 0x00cb, 59, 62, 0 ),
V( 62, 0x00ab, 61, 63, 0 ),
V( 63, 0x008f, 61, 32, 0 ),
V( 64, 0x5b12, 65, 65, 1 ),
V( 65, 0x4d04, 80, 66, 0 ),
V( 66, 0x412c, 81, 67, 0 ),
V( 67, 0x37d8, 82, 68, 0 ),
V( 68, 0x2fe8, 83, 69, 0 ),
V( 69, 0x293c, 84, 70, 0 ),
V( 70, 0x2379, 86, 71, 0 ),
V( 71, 0x1edf, 87, 72, 0 ),
V( 72, 0x1aa9, 87, 73, 0 ),
V( 73, 0x174e, 72, 74, 0 ),
V( 74, 0x1424, 72, 75, 0 ),
V( 75, 0x119c, 74, 76, 0 ),
V( 76, 0x0f6b, 74, 77, 0 ),
V( 77, 0x0d51, 75, 78, 0 ),
V( 78, 0x0bb6, 77, 79, 0 ),
V( 79, 0x0a40, 77, 48, 0 ),
V( 80, 0x5832, 80, 81, 1 ),
V( 81, 0x4d1c, 88, 82, 0 ),
V( 82, 0x438e, 89, 83, 0 ),
V( 83, 0x3bdd, 90, 84, 0 ),
V( 84, 0x34ee, 91, 85, 0 ),
V( 85, 0x2eae, 92, 86, 0 ),
V( 86, 0x299a, 93, 87, 0 ),
V( 87, 0x2516, 86, 71, 0 ),
V( 88, 0x5570, 88, 89, 1 ),
V( 89, 0x4ca9, 95, 90, 0 ),
V( 90, 0x44d9, 96, 91, 0 ),
V( 91, 0x3e22, 97, 92, 0 ),
V( 92, 0x3824, 99, 93, 0 ),
V( 93, 0x32b4, 99, 94, 0 ),
V( 94, 0x2e17, 93, 86, 0 ),
V( 95, 0x56a8, 95, 96, 1 ),
V( 96, 0x4f46, 101, 97, 0 ),
V( 97, 0x47e5, 102, 98, 0 ),
V( 98, 0x41cf, 103, 99, 0 ),
V( 99, 0x3c3d, 104, 100, 0 ),
V( 100, 0x375e, 99, 93, 0 ),
V( 101, 0x5231, 105, 102, 0 ),
V( 102, 0x4c0f, 106, 103, 0 ),
V( 103, 0x4639, 107, 104, 0 ),
V( 104, 0x415e, 103, 99, 0 ),
V( 105, 0x5627, 105, 106, 1 ),
V( 106, 0x50e7, 108, 107, 0 ),
V( 107, 0x4b85, 109, 103, 0 ),
V( 108, 0x5597, 110, 109, 0 ),
V( 109, 0x504f, 111, 107, 0 ),
V( 110, 0x5a10, 110, 111, 1 ),
V( 111, 0x5522, 112, 109, 0 ),
V( 112, 0x59eb, 112, 111, 1 ),
/*
* This last entry is used for fixed probability estimate of 0.5
* as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.
*/
V( 113, 0x5a1d, 113, 113, 0 )
};
+295
View File
@@ -0,0 +1,295 @@
/*
* jcapimin.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains application interface code for the compression half
* of the JPEG library. These are the "minimum" API routines that may be
* needed in either the normal full-compression case or the transcoding-only
* case.
*
* Most of the routines intended to be called directly by an application
* are in this file or in jcapistd.c. But also see jcparam.c for
* parameter-setup helper routines, jcomapi.c for routines shared by
* compression and decompression, and jctrans.c for the transcoding case.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/*
* Initialization of a JPEG compression object.
* The error manager must already be set up (in case memory manager fails).
*/
GLOBAL(void)
jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
{
int i;
/* Guard against version mismatches between library and caller. */
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != sizeof(struct jpeg_compress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int)sizeof(struct jpeg_compress_struct), (int)structsize);
/* For debugging purposes, we zero the whole master structure.
* But the application has already set the err pointer, and may have set
* client_data, so we have to save and restore those fields.
* Note: if application hasn't set client_data, tools like Purify may
* complain here.
*/
{
struct jpeg_error_mgr *err = cinfo->err;
void *client_data = cinfo->client_data; /* ignore Purify complaint here */
MEMZERO(cinfo, sizeof(struct jpeg_compress_struct));
cinfo->err = err;
cinfo->client_data = client_data;
}
cinfo->is_decompressor = FALSE;
/* Initialize a memory manager instance for this object */
jinit_memory_mgr((j_common_ptr)cinfo);
/* Zero out pointers to permanent structures. */
cinfo->progress = NULL;
cinfo->dest = NULL;
cinfo->comp_info = NULL;
for (i = 0; i < NUM_QUANT_TBLS; i++) {
cinfo->quant_tbl_ptrs[i] = NULL;
#if JPEG_LIB_VERSION >= 70
cinfo->q_scale_factor[i] = 100;
#endif
}
for (i = 0; i < NUM_HUFF_TBLS; i++) {
cinfo->dc_huff_tbl_ptrs[i] = NULL;
cinfo->ac_huff_tbl_ptrs[i] = NULL;
}
#if JPEG_LIB_VERSION >= 80
/* Must do it here for emit_dqt in case jpeg_write_tables is used */
cinfo->block_size = DCTSIZE;
cinfo->natural_order = jpeg_natural_order;
cinfo->lim_Se = DCTSIZE2 - 1;
#endif
cinfo->script_space = NULL;
cinfo->input_gamma = 1.0; /* in case application forgets */
/* OK, I'm ready */
cinfo->global_state = CSTATE_START;
}
/*
* Destruction of a JPEG compression object
*/
GLOBAL(void)
jpeg_destroy_compress(j_compress_ptr cinfo)
{
jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
}
/*
* Abort processing of a JPEG compression operation,
* but don't destroy the object itself.
*/
GLOBAL(void)
jpeg_abort_compress(j_compress_ptr cinfo)
{
jpeg_abort((j_common_ptr)cinfo); /* use common routine */
}
/*
* Forcibly suppress or un-suppress all quantization and Huffman tables.
* Marks all currently defined tables as already written (if suppress)
* or not written (if !suppress). This will control whether they get emitted
* by a subsequent jpeg_start_compress call.
*
* This routine is exported for use by applications that want to produce
* abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
* since it is called by jpeg_start_compress, we put it here --- otherwise
* jcparam.o would be linked whether the application used it or not.
*/
GLOBAL(void)
jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
{
int i;
JQUANT_TBL *qtbl;
JHUFF_TBL *htbl;
for (i = 0; i < NUM_QUANT_TBLS; i++) {
if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
qtbl->sent_table = suppress;
}
for (i = 0; i < NUM_HUFF_TBLS; i++) {
if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
htbl->sent_table = suppress;
if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
htbl->sent_table = suppress;
}
}
/*
* Finish JPEG compression.
*
* If a multipass operating mode was selected, this may do a great deal of
* work including most of the actual output.
*/
GLOBAL(void)
jpeg_finish_compress(j_compress_ptr cinfo)
{
JDIMENSION iMCU_row;
if (cinfo->global_state == CSTATE_SCANNING ||
cinfo->global_state == CSTATE_RAW_OK) {
/* Terminate first pass */
if (cinfo->next_scanline < cinfo->image_height)
ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
(*cinfo->master->finish_pass) (cinfo);
} else if (cinfo->global_state != CSTATE_WRCOEFS)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Perform any remaining passes */
while (!cinfo->master->is_last_pass) {
(*cinfo->master->prepare_for_pass) (cinfo);
for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)iMCU_row;
cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* We bypass the main controller and invoke coef controller directly;
* all work is being done from the coefficient buffer.
*/
if (!(*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE)NULL))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
}
(*cinfo->master->finish_pass) (cinfo);
}
/* Write EOI, do final cleanup */
(*cinfo->marker->write_file_trailer) (cinfo);
(*cinfo->dest->term_destination) (cinfo);
/* We can use jpeg_abort to release memory and reset global_state */
jpeg_abort((j_common_ptr)cinfo);
}
/*
* Write a special marker.
* This is only recommended for writing COM or APPn markers.
* Must be called after jpeg_start_compress() and before
* first call to jpeg_write_scanlines() or jpeg_write_raw_data().
*/
GLOBAL(void)
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr,
unsigned int datalen)
{
void (*write_marker_byte) (j_compress_ptr info, int val);
if (cinfo->next_scanline != 0 ||
(cinfo->global_state != CSTATE_SCANNING &&
cinfo->global_state != CSTATE_RAW_OK &&
cinfo->global_state != CSTATE_WRCOEFS))
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
while (datalen--) {
(*write_marker_byte) (cinfo, *dataptr);
dataptr++;
}
}
/* Same, but piecemeal. */
GLOBAL(void)
jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
{
if (cinfo->next_scanline != 0 ||
(cinfo->global_state != CSTATE_SCANNING &&
cinfo->global_state != CSTATE_RAW_OK &&
cinfo->global_state != CSTATE_WRCOEFS))
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
}
GLOBAL(void)
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
{
(*cinfo->marker->write_marker_byte) (cinfo, val);
}
/*
* Alternate compression function: just write an abbreviated table file.
* Before calling this, all parameters and a data destination must be set up.
*
* To produce a pair of files containing abbreviated tables and abbreviated
* image data, one would proceed as follows:
*
* initialize JPEG object
* set JPEG parameters
* set destination to table file
* jpeg_write_tables(cinfo);
* set destination to image file
* jpeg_start_compress(cinfo, FALSE);
* write data...
* jpeg_finish_compress(cinfo);
*
* jpeg_write_tables has the side effect of marking all tables written
* (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
* will not re-emit the tables unless it is passed write_all_tables=TRUE.
*/
GLOBAL(void)
jpeg_write_tables(j_compress_ptr cinfo)
{
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* (Re)initialize error mgr and destination modules */
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
(*cinfo->dest->init_destination) (cinfo);
/* Initialize the marker writer ... bit of a crock to do it here. */
jinit_marker_writer(cinfo);
/* Write them tables! */
(*cinfo->marker->write_tables_only) (cinfo);
/* And clean up. */
(*cinfo->dest->term_destination) (cinfo);
/*
* In library releases up through v6a, we called jpeg_abort() here to free
* any working memory allocated by the destination manager and marker
* writer. Some applications had a problem with that: they allocated space
* of their own from the library memory manager, and didn't want it to go
* away during write_tables. So now we do nothing. This will cause a
* memory leak if an app calls write_tables repeatedly without doing a full
* compression cycle or otherwise resetting the JPEG object. However, that
* seems less bad than unexpectedly freeing memory in the normal case.
* An app that prefers the old behavior can call jpeg_abort for itself after
* each call to jpeg_write_tables().
*/
}
+162
View File
@@ -0,0 +1,162 @@
/*
* jcapistd.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains application interface code for the compression half
* of the JPEG library. These are the "standard" API routines that are
* used in the normal full-compression case. They are not used by a
* transcoding-only application. Note that if an application links in
* jpeg_start_compress, it will end up linking in the entire compressor.
* We thus must separate this file from jcapimin.c to avoid linking the
* whole compression library into a transcoder.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/*
* Compression initialization.
* Before calling this, all parameters and a data destination must be set up.
*
* We require a write_all_tables parameter as a failsafe check when writing
* multiple datastreams from the same compression object. Since prior runs
* will have left all the tables marked sent_table=TRUE, a subsequent run
* would emit an abbreviated stream (no tables) by default. This may be what
* is wanted, but for safety's sake it should not be the default behavior:
* programmers should have to make a deliberate choice to emit abbreviated
* images. Therefore the documentation and examples should encourage people
* to pass write_all_tables=TRUE; then it will take active thought to do the
* wrong thing.
*/
GLOBAL(void)
jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
{
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (write_all_tables)
jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
/* (Re)initialize error mgr and destination modules */
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
(*cinfo->dest->init_destination) (cinfo);
/* Perform master selection of active modules */
jinit_compress_master(cinfo);
/* Set up for the first pass */
(*cinfo->master->prepare_for_pass) (cinfo);
/* Ready for application to drive first pass through jpeg_write_scanlines
* or jpeg_write_raw_data.
*/
cinfo->next_scanline = 0;
cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
}
/*
* Write some scanlines of data to the JPEG compressor.
*
* The return value will be the number of lines actually written.
* This should be less than the supplied num_lines only in case that
* the data destination module has requested suspension of the compressor,
* or if more than image_height scanlines are passed in.
*
* Note: we warn about excess calls to jpeg_write_scanlines() since
* this likely signals an application programmer error. However,
* excess scanlines passed in the last valid call are *silently* ignored,
* so that the application need not adjust num_lines for end-of-image
* when using a multiple-scanline buffer.
*/
GLOBAL(JDIMENSION)
jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines,
JDIMENSION num_lines)
{
JDIMENSION row_ctr, rows_left;
if (cinfo->global_state != CSTATE_SCANNING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (cinfo->next_scanline >= cinfo->image_height)
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)cinfo->next_scanline;
cinfo->progress->pass_limit = (long)cinfo->image_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* Give master control module another chance if this is first call to
* jpeg_write_scanlines. This lets output of the frame/scan headers be
* delayed so that application can write COM, etc, markers between
* jpeg_start_compress and jpeg_write_scanlines.
*/
if (cinfo->master->call_pass_startup)
(*cinfo->master->pass_startup) (cinfo);
/* Ignore any extra scanlines at bottom of image. */
rows_left = cinfo->image_height - cinfo->next_scanline;
if (num_lines > rows_left)
num_lines = rows_left;
row_ctr = 0;
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
cinfo->next_scanline += row_ctr;
return row_ctr;
}
/*
* Alternate entry point to write raw data.
* Processes exactly one iMCU row per call, unless suspended.
*/
GLOBAL(JDIMENSION)
jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data,
JDIMENSION num_lines)
{
JDIMENSION lines_per_iMCU_row;
if (cinfo->global_state != CSTATE_RAW_OK)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (cinfo->next_scanline >= cinfo->image_height) {
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
return 0;
}
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)cinfo->next_scanline;
cinfo->progress->pass_limit = (long)cinfo->image_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* Give master control module another chance if this is first call to
* jpeg_write_raw_data. This lets output of the frame/scan headers be
* delayed so that application can write COM, etc, markers between
* jpeg_start_compress and jpeg_write_raw_data.
*/
if (cinfo->master->call_pass_startup)
(*cinfo->master->pass_startup) (cinfo);
/* Verify that at least one iMCU row has been passed. */
lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
if (num_lines < lines_per_iMCU_row)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
/* Directly compress the row. */
if (!(*cinfo->coef->compress_data) (cinfo, data)) {
/* If compressor did not consume the whole row, suspend processing. */
return 0;
}
/* OK, we processed one iMCU row. */
cinfo->next_scanline += lines_per_iMCU_row;
return lines_per_iMCU_row;
}
+932
View File
@@ -0,0 +1,932 @@
/*
* jcarith.c
*
* This file was part of the Independent JPEG Group's software:
* Developed 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, 2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains portable arithmetic entropy encoding routines for JPEG
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
*
* Both sequential and progressive modes are supported in this single module.
*
* Suspension is not currently supported in this module.
*
* NOTE: All referenced figures are from
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Expanded entropy encoder object for arithmetic encoding. */
typedef struct {
struct jpeg_entropy_encoder pub; /* public fields */
JLONG c; /* C register, base of coding interval, layout as in sec. D.1.3 */
JLONG a; /* A register, normalized size of coding interval */
JLONG sc; /* counter for stacked 0xFF values which might overflow */
JLONG zc; /* counter for pending 0x00 output values which might *
* be discarded at the end ("Pacman" termination) */
int ct; /* bit shift counter, determines when next byte will be written */
int buffer; /* buffer for most recent output byte != 0xFF */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
unsigned int restarts_to_go; /* MCUs left in this restart interval */
int next_restart_num; /* next restart number to write (0-7) */
/* Pointers to statistics areas (these workspaces have image lifespan) */
unsigned char *dc_stats[NUM_ARITH_TBLS];
unsigned char *ac_stats[NUM_ARITH_TBLS];
/* Statistics bin for coding with fixed probability 0.5 */
unsigned char fixed_bin[4];
} arith_entropy_encoder;
typedef arith_entropy_encoder *arith_entropy_ptr;
/* The following two definitions specify the allocation chunk size
* for the statistics area.
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
*
* We use a compact representation with 1 byte per statistics bin,
* thus the numbers directly represent byte sizes.
* This 1 byte per statistics bin contains the meaning of the MPS
* (more probable symbol) in the highest bit (mask 0x80), and the
* index into the probability estimation state machine table
* in the lower bits (mask 0x7F).
*/
#define DC_STAT_BINS 64
#define AC_STAT_BINS 256
/* NOTE: Uncomment the following #define if you want to use the
* given formula for calculating the AC conditioning parameter Kx
* for spectral selection progressive coding in section G.1.3.2
* of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).
* Although the spec and P&M authors claim that this "has proven
* to give good results for 8 bit precision samples", I'm not
* convinced yet that this is really beneficial.
* Early tests gave only very marginal compression enhancements
* (a few - around 5 or so - bytes even for very large files),
* which would turn out rather negative if we'd suppress the
* DAC (Define Arithmetic Conditioning) marker segments for
* the default parameters in the future.
* Note that currently the marker writing module emits 12-byte
* DAC segments for a full-component scan in a color image.
* This is not worth worrying about IMHO. However, since the
* spec defines the default values to be used if the tables
* are omitted (unlike Huffman tables, which are required
* anyway), one might optimize this behaviour in the future,
* and then it would be disadvantageous to use custom tables if
* they don't provide sufficient gain to exceed the DAC size.
*
* On the other hand, I'd consider it as a reasonable result
* that the conditioning has no significant influence on the
* compression performance. This means that the basic
* statistical model is already rather stable.
*
* Thus, at the moment, we use the default conditioning values
* anyway, and do not use the custom formula.
*
#define CALCULATE_SPECTRAL_CONDITIONING
*/
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.
* We assume that int right shift is unsigned if JLONG right shift is,
* which should be safe.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS int ishift_temp;
#define IRIGHT_SHIFT(x, shft) \
((ishift_temp = (x)) < 0 ? \
(ishift_temp >> (shft)) | ((~0) << (16 - (shft))) : \
(ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x, shft) ((x) >> (shft))
#endif
LOCAL(void)
emit_byte(int val, j_compress_ptr cinfo)
/* Write next output byte; we do not support suspension in this module. */
{
struct jpeg_destination_mgr *dest = cinfo->dest;
*dest->next_output_byte++ = (JOCTET)val;
if (--dest->free_in_buffer == 0)
if (!(*dest->empty_output_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
}
/*
* Finish up at the end of an arithmetic-compressed scan.
*/
METHODDEF(void)
finish_pass(j_compress_ptr cinfo)
{
arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
JLONG temp;
/* Section D.1.8: Termination of encoding */
/* Find the e->c in the coding interval with the largest
* number of trailing zero bits */
if ((temp = (e->a - 1 + e->c) & 0xFFFF0000UL) < e->c)
e->c = temp + 0x8000L;
else
e->c = temp;
/* Send remaining bytes to output */
e->c <<= e->ct;
if (e->c & 0xF8000000UL) {
/* One final overflow has to be handled */
if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer + 1, cinfo);
if (e->buffer + 1 == 0xFF)
emit_byte(0x00, cinfo);
}
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
e->sc = 0;
} else {
if (e->buffer == 0)
++e->zc;
else if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer, cinfo);
}
if (e->sc) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
do {
emit_byte(0xFF, cinfo);
emit_byte(0x00, cinfo);
} while (--e->sc);
}
}
/* Output final bytes only if they are not 0x00 */
if (e->c & 0x7FFF800L) {
if (e->zc) /* output final pending zero bytes */
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte((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);
if (((e->c >> 11) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo);
}
}
}
/*
* The core arithmetic encoding routine (common in JPEG and JBIG).
* This needs to go as fast as possible.
* Machine-dependent optimization facilities
* are not utilized in this portable implementation.
* However, this code should be fairly efficient and
* may be a good base for further optimizations anyway.
*
* Parameter 'val' to be encoded may be 0 or 1 (binary decision).
*
* Note: I've added full "Pacman" termination support to the
* byte output routines, which is equivalent to the optional
* Discard_final_zeros procedure (Figure D.15) in the spec.
* Thus, we always produce the shortest possible output
* stream compliant to the spec (no trailing zero bytes,
* except for FF stuffing).
*
* I've also introduced a new scheme for accessing
* the probability estimation state machine table,
* derived from Markus Kuhn's JBIG implementation.
*/
LOCAL(void)
arith_encode(j_compress_ptr cinfo, unsigned char *st, int val)
{
register arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
register unsigned char nl, nm;
register JLONG qe, temp;
register int sv;
/* Fetch values from our compact representation of Table D.2:
* Qe values and probability estimation state machine
*/
sv = *st;
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
/* Encode & estimation procedures per sections D.1.4 & D.1.5 */
e->a -= qe;
if (val != (sv >> 7)) {
/* Encode the less probable symbol */
if (e->a >= qe) {
/* If the interval size (qe) for the less probable symbol (LPS)
* is larger than the interval size for the MPS, then exchange
* the two symbols for coding efficiency, otherwise code the LPS
* as usual: */
e->c += e->a;
e->a = qe;
}
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
} else {
/* Encode the more probable symbol */
if (e->a >= 0x8000L)
return; /* A >= 0x8000 -> ready, no renormalization required */
if (e->a < qe) {
/* If the interval size (qe) for the less probable symbol (LPS)
* is larger than the interval size for the MPS, then exchange
* the two symbols for coding efficiency: */
e->c += e->a;
e->a = qe;
}
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
}
/* Renormalization & data output per section D.1.6 */
do {
e->a <<= 1;
e->c <<= 1;
if (--e->ct == 0) {
/* Another byte is ready for output */
temp = e->c >> 19;
if (temp > 0xFF) {
/* Handle overflow over all stacked 0xFF bytes */
if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer + 1, cinfo);
if (e->buffer + 1 == 0xFF)
emit_byte(0x00, cinfo);
}
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
e->sc = 0;
/* 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 */
} else if (temp == 0xFF) {
++e->sc; /* stack 0xFF byte (which might overflow later) */
} else {
/* Output all stacked 0xFF bytes, they will not overflow any more */
if (e->buffer == 0)
++e->zc;
else if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer, cinfo);
}
if (e->sc) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
do {
emit_byte(0xFF, cinfo);
emit_byte(0x00, cinfo);
} while (--e->sc);
}
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
}
e->c &= 0x7FFFFL;
e->ct += 8;
}
} while (e->a < 0x8000L);
}
/*
* Emit a restart marker & resynchronize predictions.
*/
LOCAL(void)
emit_restart(j_compress_ptr cinfo, int restart_num)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
int ci;
jpeg_component_info *compptr;
finish_pass(cinfo);
emit_byte(0xFF, cinfo);
emit_byte(JPEG_RST0 + restart_num, cinfo);
/* Re-initialize statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* DC needs no table for refinement scan */
if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
/* Reset DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
/* AC needs no table when not present */
if (cinfo->progressive_mode == 0 || cinfo->Se) {
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
}
}
/* Reset arithmetic encoding variables */
entropy->c = 0;
entropy->a = 0x10000L;
entropy->sc = 0;
entropy->zc = 0;
entropy->ct = 11;
entropy->buffer = -1; /* empty */
}
/*
* MCU encoding for DC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl;
int v, v2, m;
ISHIFT_TEMPS
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
/* Compute the DC value after the required point transform by Al.
* This is simply an arithmetic right shift.
*/
m = IRIGHT_SHIFT((int)((*block)[0]), cinfo->Al);
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.4: Encode_DC_DIFF */
if ((v = m - entropy->last_dc_val[ci]) == 0) {
arith_encode(cinfo, st, 0);
entropy->dc_context[ci] = 0; /* zero diff category */
} else {
entropy->last_dc_val[ci] = m;
arith_encode(cinfo, st, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
st += 2; /* Table F.4: SP = S0 + 2 */
entropy->dc_context[ci] = 4; /* small positive diff category */
} else {
v = -v;
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
st += 3; /* Table F.4: SN = S0 + 3 */
entropy->dc_context[ci] = 8; /* small negative diff category */
}
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
arith_encode(cinfo, st, 0);
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] += 8; /* large diff category */
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
}
return TRUE;
}
/*
* MCU encoding for AC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, k, ke;
int v, v2, m;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
/* Encode the MCU data block */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
/* Establish EOB (end-of-block) index */
for (ke = cinfo->Se; ke > 0; ke--)
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value.
*/
if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {
if (v >>= cinfo->Al) break;
} else {
v = -v;
if (v >>= cinfo->Al) break;
}
/* Figure F.5: Encode_AC_Coefficients */
for (k = cinfo->Ss; k <= ke; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
arith_encode(cinfo, st, 0); /* EOB decision */
for (;;) {
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
if (v >>= cinfo->Al) {
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 0);
break;
}
} else {
v = -v;
if (v >>= cinfo->Al) {
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 1);
break;
}
}
arith_encode(cinfo, st + 1, 0); st += 3; k++;
}
st += 2;
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
if (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
}
arith_encode(cinfo, st, 0);
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Encode EOB decision only if k <= cinfo->Se */
if (k <= cinfo->Se) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
arith_encode(cinfo, st, 1);
}
return TRUE;
}
/*
* MCU encoding for DC successive approximation refinement scan.
*/
METHODDEF(boolean)
encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
unsigned char *st;
int Al, blkn;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
st = entropy->fixed_bin; /* use fixed probability estimation */
Al = cinfo->Al;
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
/* We simply emit the Al'th bit of the DC coefficient value. */
arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);
}
return TRUE;
}
/*
* MCU encoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, k, ke, kex;
int v;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
/* Encode the MCU data block */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Section G.1.3.3: Encoding of AC coefficients */
/* Establish EOB (end-of-block) index */
for (ke = cinfo->Se; ke > 0; ke--)
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value.
*/
if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {
if (v >>= cinfo->Al) break;
} else {
v = -v;
if (v >>= cinfo->Al) break;
}
/* Establish EOBx (previous stage end-of-block) index */
for (kex = ke; kex > 0; kex--)
if ((v = (*block)[jpeg_natural_order[kex]]) >= 0) {
if (v >>= cinfo->Ah) break;
} else {
v = -v;
if (v >>= cinfo->Ah) break;
}
/* Figure G.10: Encode_AC_Coefficients_SA */
for (k = cinfo->Ss; k <= ke; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
if (k > kex)
arith_encode(cinfo, st, 0); /* EOB decision */
for (;;) {
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
if (v >>= cinfo->Al) {
if (v >> 1) /* previously nonzero coef */
arith_encode(cinfo, st + 2, (v & 1));
else { /* newly nonzero coef */
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 0);
}
break;
}
} else {
v = -v;
if (v >>= cinfo->Al) {
if (v >> 1) /* previously nonzero coef */
arith_encode(cinfo, st + 2, (v & 1));
else { /* newly nonzero coef */
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 1);
}
break;
}
}
arith_encode(cinfo, st + 1, 0); st += 3; k++;
}
}
/* Encode EOB decision only if k <= cinfo->Se */
if (k <= cinfo->Se) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
arith_encode(cinfo, st, 1);
}
return TRUE;
}
/*
* Encode and output one MCU's worth of arithmetic-compressed coefficients.
*/
METHODDEF(boolean)
encode_mcu(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
jpeg_component_info *compptr;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, k, ke;
int v, v2, m;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
compptr = cinfo->cur_comp_info[ci];
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
tbl = compptr->dc_tbl_no;
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.4: Encode_DC_DIFF */
if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {
arith_encode(cinfo, st, 0);
entropy->dc_context[ci] = 0; /* zero diff category */
} else {
entropy->last_dc_val[ci] = (*block)[0];
arith_encode(cinfo, st, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
st += 2; /* Table F.4: SP = S0 + 2 */
entropy->dc_context[ci] = 4; /* small positive diff category */
} else {
v = -v;
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
st += 3; /* Table F.4: SN = S0 + 3 */
entropy->dc_context[ci] = 8; /* small negative diff category */
}
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
arith_encode(cinfo, st, 0);
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] += 8; /* large diff category */
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
tbl = compptr->ac_tbl_no;
/* Establish EOB (end-of-block) index */
for (ke = DCTSIZE2 - 1; ke > 0; ke--)
if ((*block)[jpeg_natural_order[ke]]) break;
/* Figure F.5: Encode_AC_Coefficients */
for (k = 1; k <= ke; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
arith_encode(cinfo, st, 0); /* EOB decision */
while ((v = (*block)[jpeg_natural_order[k]]) == 0) {
arith_encode(cinfo, st + 1, 0); st += 3; k++;
}
arith_encode(cinfo, st + 1, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, entropy->fixed_bin, 0);
} else {
v = -v;
arith_encode(cinfo, entropy->fixed_bin, 1);
}
st += 2;
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
if (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
}
arith_encode(cinfo, st, 0);
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Encode EOB decision only if k <= DCTSIZE2 - 1 */
if (k <= DCTSIZE2 - 1) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
arith_encode(cinfo, st, 1);
}
}
return TRUE;
}
/*
* Initialize for an arithmetic-compressed scan.
*/
METHODDEF(void)
start_pass(j_compress_ptr cinfo, boolean gather_statistics)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
int ci, tbl;
jpeg_component_info *compptr;
if (gather_statistics)
/* Make sure to avoid that in the master control logic!
* We are fully adaptive here and need no extra
* statistics gathering pass!
*/
ERREXIT(cinfo, JERR_NOT_COMPILED);
/* We assume jcmaster.c already validated the progressive scan parameters. */
/* Select execution routines */
if (cinfo->progressive_mode) {
if (cinfo->Ah == 0) {
if (cinfo->Ss == 0)
entropy->pub.encode_mcu = encode_mcu_DC_first;
else
entropy->pub.encode_mcu = encode_mcu_AC_first;
} else {
if (cinfo->Ss == 0)
entropy->pub.encode_mcu = encode_mcu_DC_refine;
else
entropy->pub.encode_mcu = encode_mcu_AC_refine;
}
} else
entropy->pub.encode_mcu = encode_mcu;
/* Allocate & initialize requested statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* DC needs no table for refinement scan */
if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
tbl = compptr->dc_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->dc_stats[tbl] == NULL)
entropy->dc_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
/* Initialize DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
/* AC needs no table when not present */
if (cinfo->progressive_mode == 0 || cinfo->Se) {
tbl = compptr->ac_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->ac_stats[tbl] == NULL)
entropy->ac_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
#ifdef CALCULATE_SPECTRAL_CONDITIONING
if (cinfo->progressive_mode)
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
cinfo->arith_ac_K[tbl] = cinfo->Ss +
((8 + cinfo->Se - cinfo->Ss) >> 4);
#endif
}
}
/* Initialize arithmetic encoding variables */
entropy->c = 0;
entropy->a = 0x10000L;
entropy->sc = 0;
entropy->zc = 0;
entropy->ct = 11;
entropy->buffer = -1; /* empty */
/* Initialize restart stuff */
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num = 0;
}
/*
* Module initialization routine for arithmetic entropy encoding.
*/
GLOBAL(void)
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));
cinfo->entropy = (struct jpeg_entropy_encoder *)entropy;
entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass;
/* Mark tables unallocated */
for (i = 0; i < NUM_ARITH_TBLS; i++) {
entropy->dc_stats[i] = NULL;
entropy->ac_stats[i] = NULL;
}
/* Initialize index for fixed probability estimation */
entropy->fixed_bin[0] = 113;
}
+449
View File
@@ -0,0 +1,449 @@
/*
* jccoefct.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code and
* information relevant to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains the coefficient buffer controller for compression.
* This controller is the top level of the JPEG compressor proper.
* The coefficient buffer lies between forward-DCT and entropy encoding steps.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* We use a full-image coefficient buffer when doing Huffman optimization,
* and also for writing multiple-scan JPEG files. In all cases, the DCT
* step is run during the first pass, and subsequent passes need only read
* the buffered coefficients.
*/
#ifdef ENTROPY_OPT_SUPPORTED
#define FULL_COEF_BUFFER_SUPPORTED
#else
#ifdef C_MULTISCAN_FILES_SUPPORTED
#define FULL_COEF_BUFFER_SUPPORTED
#endif
#endif
/* Private buffer controller object */
typedef struct {
struct jpeg_c_coef_controller pub; /* public fields */
JDIMENSION iMCU_row_num; /* iMCU row # within image */
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
/* For single-pass compression, it's sufficient to buffer just one MCU
* (although this may prove a bit slow in practice). We allocate a
* workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
* MCU constructed and sent. In multi-pass modes, this array points to the
* current MCU's blocks within the virtual arrays.
*/
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
/* In multi-pass modes, we need a virtual block array for each component. */
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
} my_coef_controller;
typedef my_coef_controller *my_coef_ptr;
/* Forward declarations */
METHODDEF(boolean) compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
#ifdef FULL_COEF_BUFFER_SUPPORTED
METHODDEF(boolean) compress_first_pass(j_compress_ptr cinfo,
JSAMPIMAGE input_buf);
METHODDEF(boolean) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
#endif
LOCAL(void)
start_iMCU_row(j_compress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row */
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
/* In an interleaved scan, an MCU row is the same as an iMCU row.
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
* But at the bottom of the image, process only what's left.
*/
if (cinfo->comps_in_scan > 1) {
coef->MCU_rows_per_iMCU_row = 1;
} else {
if (coef->iMCU_row_num < (cinfo->total_iMCU_rows - 1))
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
else
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
coef->mcu_ctr = 0;
coef->MCU_vert_offset = 0;
}
/*
* Initialize for a processing pass.
*/
METHODDEF(void)
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
coef->iMCU_row_num = 0;
start_iMCU_row(cinfo);
switch (pass_mode) {
case JBUF_PASS_THRU:
if (coef->whole_image[0] != NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_data;
break;
#ifdef FULL_COEF_BUFFER_SUPPORTED
case JBUF_SAVE_AND_PASS:
if (coef->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_first_pass;
break;
case JBUF_CRANK_DEST:
if (coef->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_output;
break;
#endif
default:
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
break;
}
}
/*
* Process some data in the single-pass case.
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
* per call, ie, v_samp_factor block rows for each component in the image.
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
*
* NB: input_buf contains a plane for each component in image,
* which we index according to the component's SOF position.
*/
METHODDEF(boolean)
compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int blkn, bi, ci, yindex, yoffset, blockcnt;
JDIMENSION ypos, xpos;
jpeg_component_info *compptr;
/* Loop to write as much as one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* Determine where data comes from in input_buf and do the DCT thing.
* Each call on forward_DCT processes a horizontal row of DCT blocks
* as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
* sequentially. Dummy blocks at the right or bottom edge are filled in
* specially. The data in them does not matter for image reconstruction,
* so we fill them with values that will encode to the smallest amount of
* data, viz: all zeroes in the AC entries, DC entries equal to previous
* block's DC value. (Thanks to Thomas Kinsman for this idea.)
*/
blkn = 0;
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
compptr->last_col_width;
xpos = MCU_col_num * compptr->MCU_sample_width;
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yoffset + yindex < compptr->last_row_height) {
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
input_buf[compptr->component_index],
coef->MCU_buffer[blkn],
ypos, xpos, (JDIMENSION)blockcnt);
if (blockcnt < compptr->MCU_width) {
/* Create some dummy blocks at the right edge of the image. */
jzero_far((void *)coef->MCU_buffer[blkn + blockcnt],
(compptr->MCU_width - blockcnt) * sizeof(JBLOCK));
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn + bi][0][0] =
coef->MCU_buffer[blkn + bi - 1][0][0];
}
}
} else {
/* Create a row of dummy blocks at the bottom of the image. */
jzero_far((void *)coef->MCU_buffer[blkn],
compptr->MCU_width * sizeof(JBLOCK));
for (bi = 0; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn + bi][0][0] =
coef->MCU_buffer[blkn - 1][0][0];
}
}
blkn += compptr->MCU_width;
ypos += DCTSIZE;
}
}
/* Try to write the MCU. In event of a suspension failure, we will
* re-DCT the MCU on restart (a bit inefficient, could be fixed...)
*/
if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
coef->mcu_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
start_iMCU_row(cinfo);
return TRUE;
}
#ifdef FULL_COEF_BUFFER_SUPPORTED
/*
* Process some data in the first pass of a multi-pass case.
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
* per call, ie, v_samp_factor block rows for each component in the image.
* This amount of data is read from the source buffer, DCT'd and quantized,
* and saved into the virtual arrays. We also generate suitable dummy blocks
* as needed at the right and lower edges. (The dummy blocks are constructed
* in the virtual arrays, which have been padded appropriately.) This makes
* it possible for subsequent passes not to worry about real vs. dummy blocks.
*
* We must also emit the data to the entropy encoder. This is conveniently
* done by calling compress_output() after we've loaded the current strip
* of the virtual arrays.
*
* NB: input_buf contains a plane for each component in image. All
* components are DCT'd and loaded into the virtual arrays in this pass.
* However, it may be that only a subset of the components are emitted to
* the entropy encoder during this first pass; be careful about looking
* at the scan-dependent variables (MCU dimensions, etc).
*/
METHODDEF(boolean)
compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
JDIMENSION blocks_across, MCUs_across, MCUindex;
int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
JCOEF lastDC;
jpeg_component_info *compptr;
JBLOCKARRAY buffer;
JBLOCKROW thisblockrow, lastblockrow;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Align the virtual buffer for this component. */
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[ci],
coef->iMCU_row_num * compptr->v_samp_factor,
(JDIMENSION)compptr->v_samp_factor, TRUE);
/* Count non-dummy DCT block rows in this iMCU row. */
if (coef->iMCU_row_num < last_iMCU_row)
block_rows = compptr->v_samp_factor;
else {
/* NB: can't use last_row_height here, since may not be set! */
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
if (block_rows == 0) block_rows = compptr->v_samp_factor;
}
blocks_across = compptr->width_in_blocks;
h_samp_factor = compptr->h_samp_factor;
/* Count number of dummy blocks to be added at the right margin. */
ndummy = (int)(blocks_across % h_samp_factor);
if (ndummy > 0)
ndummy = h_samp_factor - ndummy;
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
* on forward_DCT processes a complete horizontal row of DCT blocks.
*/
for (block_row = 0; block_row < block_rows; block_row++) {
thisblockrow = buffer[block_row];
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
input_buf[ci], thisblockrow,
(JDIMENSION)(block_row * DCTSIZE),
(JDIMENSION)0, blocks_across);
if (ndummy > 0) {
/* Create dummy blocks at the right edge of the image. */
thisblockrow += blocks_across; /* => first dummy block */
jzero_far((void *)thisblockrow, ndummy * sizeof(JBLOCK));
lastDC = thisblockrow[-1][0];
for (bi = 0; bi < ndummy; bi++) {
thisblockrow[bi][0] = lastDC;
}
}
}
/* If at end of image, create dummy block rows as needed.
* The tricky part here is that within each MCU, we want the DC values
* of the dummy blocks to match the last real block's DC value.
* This squeezes a few more bytes out of the resulting file...
*/
if (coef->iMCU_row_num == last_iMCU_row) {
blocks_across += ndummy; /* include lower right corner */
MCUs_across = blocks_across / h_samp_factor;
for (block_row = block_rows; block_row < compptr->v_samp_factor;
block_row++) {
thisblockrow = buffer[block_row];
lastblockrow = buffer[block_row - 1];
jzero_far((void *)thisblockrow,
(size_t)(blocks_across * sizeof(JBLOCK)));
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
lastDC = lastblockrow[h_samp_factor - 1][0];
for (bi = 0; bi < h_samp_factor; bi++) {
thisblockrow[bi][0] = lastDC;
}
thisblockrow += h_samp_factor; /* advance to next MCU in row */
lastblockrow += h_samp_factor;
}
}
}
}
/* NB: compress_output will increment iMCU_row_num if successful.
* A suspension return will result in redoing all the work above next time.
*/
/* Emit data to the entropy encoder, sharing code with subsequent passes */
return compress_output(cinfo, input_buf);
}
/*
* Process some data in subsequent passes of a multi-pass case.
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
* per call, ie, v_samp_factor block rows for each component in the scan.
* The data is obtained from the virtual arrays and fed to the entropy coder.
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
*
* NB: input_buf is ignored; it is likely to be a NULL pointer.
*/
METHODDEF(boolean)
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
int blkn, ci, xindex, yindex, yoffset;
JDIMENSION start_col;
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
JBLOCKROW buffer_ptr;
jpeg_component_info *compptr;
/* Align the virtual buffers for the components used in this scan.
* NB: during first pass, this is safe only because the buffers will
* already be aligned properly, so jmemmgr.c won't need to do any I/O.
*/
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
buffer[ci] = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
coef->iMCU_row_num * compptr->v_samp_factor,
(JDIMENSION)compptr->v_samp_factor, FALSE);
}
/* Loop to process one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
}
/* Try to write the MCU. */
if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
coef->mcu_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
start_iMCU_row(cinfo);
return TRUE;
}
#endif /* FULL_COEF_BUFFER_SUPPORTED */
/*
* Initialize coefficient buffer controller.
*/
GLOBAL(void)
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
{
my_coef_ptr coef;
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_coef_controller));
cinfo->coef = (struct jpeg_c_coef_controller *)coef;
coef->pub.start_pass = start_pass_coef;
/* Create the coefficient buffer. */
if (need_full_buffer) {
#ifdef FULL_COEF_BUFFER_SUPPORTED
/* Allocate a full-image virtual array for each component, */
/* padded to a multiple of samp_factor DCT blocks in each direction. */
int ci;
jpeg_component_info *compptr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE,
(JDIMENSION)jround_up((long)compptr->width_in_blocks,
(long)compptr->h_samp_factor),
(JDIMENSION)jround_up((long)compptr->height_in_blocks,
(long)compptr->v_samp_factor),
(JDIMENSION)compptr->v_samp_factor);
}
#else
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
} else {
/* We only need a single-MCU buffer. */
JBLOCKROW buffer;
int i;
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
coef->MCU_buffer[i] = buffer + i;
}
coef->whole_image[0] = NULL; /* flag for no virtual arrays */
}
}
+144
View File
@@ -0,0 +1,144 @@
/*
* jccolext.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2012, 2015, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains input colorspace conversion routines.
*/
/* This file is included by jccolor.c */
/*
* 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.
*
* 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.
*/
INLINE
LOCAL(void)
rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int r, g, b;
register JLONG *ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
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]);
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
* need the general RIGHT_SHIFT macro.
*/
/* Y */
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
ctab[b + B_Y_OFF]) >> SCALEBITS);
/* Cb */
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
ctab[b + B_CB_OFF]) >> SCALEBITS);
/* Cr */
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
ctab[b + B_CR_OFF]) >> SCALEBITS);
}
}
}
/**************** Cases other than RGB -> YCbCr **************/
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles RGB->grayscale conversion, which is the same
* as the RGB->Y portion of RGB->YCbCr.
* We assume rgb_ycc_start has been called (we only use the Y tables).
*/
INLINE
LOCAL(void)
rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int r, g, b;
register JLONG *ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *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]);
inptr += RGB_PIXELSIZE;
/* Y */
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
ctab[b + B_Y_OFF]) >> SCALEBITS);
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles extended RGB->plain RGB conversion
*/
INLINE
LOCAL(void)
rgb_rgb_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows)
{
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
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]);
inptr += RGB_PIXELSIZE;
}
}
}
+710
View File
@@ -0,0 +1,710 @@
/*
* jccolor.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009-2012, 2015, D. R. Commander.
* Copyright (C) 2014, MIPS Technologies, Inc., California.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains input colorspace conversion routines.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "jconfigint.h"
/* Private subobject */
typedef struct {
struct jpeg_color_converter pub; /* public fields */
/* Private state for RGB->YCC conversion */
JLONG *rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
} my_color_converter;
typedef my_color_converter *my_cconvert_ptr;
/**************** RGB -> YCbCr conversion: most common case **************/
/*
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
* The conversion equations to be implemented are therefore
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
* negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
* were not represented exactly. Now we sacrifice exact representation of
* maximum red and maximum blue in order to get exact grayscales.
*
* To avoid floating-point arithmetic, we represent the fractional constants
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
* the products by 2^16, with appropriate rounding, to get the correct answer.
*
* For even more speed, we avoid doing any multiplications in the inner loop
* by precalculating the constants times R,G,B for all possible values.
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
* for 12-bit samples it is still acceptable. It's not very reasonable for
* 16-bit samples, but if you want lossless storage you shouldn't be changing
* colorspace anyway.
* The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
* in the tables to save adding them separately in the inner loop.
*/
#define SCALEBITS 16 /* speediest right-shift on some machines */
#define CBCR_OFFSET ((JLONG)CENTERJSAMPLE << SCALEBITS)
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
/* We allocate one big table and divide it up into eight parts, instead of
* doing eight alloc_small requests. This lets us use a single table base
* address, which can be held in a register in the inner loops on many
* machines (more than can hold all eight addresses, anyway).
*/
#define R_Y_OFF 0 /* offset to R => Y section */
#define G_Y_OFF (1 * (MAXJSAMPLE + 1)) /* offset to G => Y section */
#define B_Y_OFF (2 * (MAXJSAMPLE + 1)) /* etc. */
#define R_CB_OFF (3 * (MAXJSAMPLE + 1))
#define G_CB_OFF (4 * (MAXJSAMPLE + 1))
#define B_CB_OFF (5 * (MAXJSAMPLE + 1))
#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
#define G_CR_OFF (6 * (MAXJSAMPLE + 1))
#define B_CR_OFF (7 * (MAXJSAMPLE + 1))
#define TABLE_SIZE (8 * (MAXJSAMPLE + 1))
/* Include inline routines for colorspace extensions */
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#define RGB_RED EXT_RGB_RED
#define RGB_GREEN EXT_RGB_GREEN
#define RGB_BLUE EXT_RGB_BLUE
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
#define rgb_ycc_convert_internal extrgb_ycc_convert_internal
#define rgb_gray_convert_internal extrgb_gray_convert_internal
#define rgb_rgb_convert_internal extrgb_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
#define RGB_BLUE EXT_RGBX_BLUE
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal
#define rgb_gray_convert_internal extrgbx_gray_convert_internal
#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGR_RED
#define RGB_GREEN EXT_BGR_GREEN
#define RGB_BLUE EXT_BGR_BLUE
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
#define rgb_ycc_convert_internal extbgr_ycc_convert_internal
#define rgb_gray_convert_internal extbgr_gray_convert_internal
#define rgb_rgb_convert_internal extbgr_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
#define RGB_BLUE EXT_BGRX_BLUE
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal
#define rgb_gray_convert_internal extbgrx_gray_convert_internal
#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
#define RGB_BLUE EXT_XBGR_BLUE
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal
#define rgb_gray_convert_internal extxbgr_gray_convert_internal
#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
#define RGB_BLUE EXT_XRGB_BLUE
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal
#define rgb_gray_convert_internal extxrgb_gray_convert_internal
#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
/*
* Initialize for RGB->YCC colorspace conversion.
*/
METHODDEF(void)
rgb_ycc_start(j_compress_ptr cinfo)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
JLONG *rgb_ycc_tab;
JLONG i;
/* Allocate and fill in the conversion tables. */
cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(TABLE_SIZE * sizeof(JLONG)));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_ycc_tab[i + R_Y_OFF] = FIX(0.29900) * i;
rgb_ycc_tab[i + G_Y_OFF] = FIX(0.58700) * i;
rgb_ycc_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
rgb_ycc_tab[i + R_CB_OFF] = (-FIX(0.16874)) * i;
rgb_ycc_tab[i + G_CB_OFF] = (-FIX(0.33126)) * 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.
*/
rgb_ycc_tab[i + B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1;
/* B=>Cb and R=>Cr tables are the same
rgb_ycc_tab[i + R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1;
*/
rgb_ycc_tab[i + G_CR_OFF] = (-FIX(0.41869)) * i;
rgb_ycc_tab[i + B_CR_OFF] = (-FIX(0.08131)) * i;
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
*/
METHODDEF(void)
rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
{
switch (cinfo->in_color_space) {
case JCS_EXT_RGB:
extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGR:
extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
default:
rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
}
}
/**************** Cases other than RGB -> YCbCr **************/
/*
* Convert some rows of samples to the JPEG colorspace.
*/
METHODDEF(void)
rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
{
switch (cinfo->in_color_space) {
case JCS_EXT_RGB:
extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGR:
extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
default:
rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
}
}
/*
* Extended RGB to plain RGB conversion
*/
METHODDEF(void)
rgb_rgb_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
{
switch (cinfo->in_color_space) {
case JCS_EXT_RGB:
extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGR:
extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
default:
rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
}
}
/*
* 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.
* We assume rgb_ycc_start has been called.
*/
METHODDEF(void)
cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int r, g, b;
register JLONG *ctab = cconvert->rgb_ycc_tab;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
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]);
/* 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
* need the general RIGHT_SHIFT macro.
*/
/* Y */
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
ctab[b + B_Y_OFF]) >> SCALEBITS);
/* Cb */
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
ctab[b + B_CB_OFF]) >> SCALEBITS);
/* Cr */
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
ctab[b + B_CR_OFF]) >> SCALEBITS);
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles grayscale output with no conversion.
* The source can be either plain grayscale or YCbCr (since Y == gray).
*/
METHODDEF(void)
grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
{
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
int instride = cinfo->input_components;
while (--num_rows >= 0) {
inptr = *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 */
inptr += instride;
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles multi-component colorspaces without conversion.
* We assume input_components == num_components.
*/
METHODDEF(void)
null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
register JSAMPROW inptr;
register JSAMPROW outptr, outptr0, outptr1, outptr2, outptr3;
register JDIMENSION col;
register int ci;
int nc = cinfo->num_components;
JDIMENSION num_cols = cinfo->image_width;
if (nc == 3) {
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
outptr0[col] = *inptr++;
outptr1[col] = *inptr++;
outptr2[col] = *inptr++;
}
}
} else if (nc == 4) {
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
outptr3 = output_buf[3][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
outptr0[col] = *inptr++;
outptr1[col] = *inptr++;
outptr2[col] = *inptr++;
outptr3[col] = *inptr++;
}
}
} else {
while (--num_rows >= 0) {
/* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < nc; ci++) {
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 */
inptr += nc;
}
}
input_buf++;
output_row++;
}
}
}
/*
* Empty method for start_pass.
*/
METHODDEF(void)
null_method(j_compress_ptr cinfo)
{
/* no work needed */
}
/*
* Module initialization routine for input colorspace conversion.
*/
GLOBAL(void)
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));
cinfo->cconvert = (struct jpeg_color_converter *)cconvert;
/* set start_pass to null method until we find out differently */
cconvert->pub.start_pass = null_method;
/* Make sure input_components agrees with in_color_space */
switch (cinfo->in_color_space) {
case JCS_GRAYSCALE:
if (cinfo->input_components != 1)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
case JCS_RGB:
case JCS_EXT_RGB:
case JCS_EXT_RGBX:
case JCS_EXT_BGR:
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
case JCS_YCbCr:
if (cinfo->input_components != 3)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
case JCS_CMYK:
case JCS_YCCK:
if (cinfo->input_components != 4)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
default: /* JCS_UNKNOWN can be anything */
if (cinfo->input_components < 1)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
}
/* Check num_components, set conversion method based on requested space */
switch (cinfo->jpeg_color_space) {
case JCS_GRAYSCALE:
if (cinfo->num_components != 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_GRAYSCALE)
cconvert->pub.color_convert = grayscale_convert;
else if (cinfo->in_color_space == JCS_RGB ||
cinfo->in_color_space == JCS_EXT_RGB ||
cinfo->in_color_space == JCS_EXT_RGBX ||
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_gray())
cconvert->pub.color_convert = jsimd_rgb_gray_convert;
else {
cconvert->pub.start_pass = rgb_ycc_start;
cconvert->pub.color_convert = rgb_gray_convert;
}
} else if (cinfo->in_color_space == JCS_YCbCr)
cconvert->pub.color_convert = grayscale_convert;
else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_RGB:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (rgb_red[cinfo->in_color_space] == 0 &&
rgb_green[cinfo->in_color_space] == 1 &&
rgb_blue[cinfo->in_color_space] == 2 &&
rgb_pixelsize[cinfo->in_color_space] == 3) {
#if defined(__mips__)
if (jsimd_c_can_null_convert())
cconvert->pub.color_convert = jsimd_c_null_convert;
else
#endif
cconvert->pub.color_convert = null_convert;
} else if (cinfo->in_color_space == JCS_RGB ||
cinfo->in_color_space == JCS_EXT_RGB ||
cinfo->in_color_space == JCS_EXT_RGBX ||
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB)
cconvert->pub.color_convert = rgb_rgb_convert;
else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_YCbCr:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_RGB ||
cinfo->in_color_space == JCS_EXT_RGB ||
cinfo->in_color_space == JCS_EXT_RGBX ||
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_ycc())
cconvert->pub.color_convert = jsimd_rgb_ycc_convert;
else {
cconvert->pub.start_pass = rgb_ycc_start;
cconvert->pub.color_convert = rgb_ycc_convert;
}
} else if (cinfo->in_color_space == JCS_YCbCr) {
#if defined(__mips__)
if (jsimd_c_can_null_convert())
cconvert->pub.color_convert = jsimd_c_null_convert;
else
#endif
cconvert->pub.color_convert = null_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_CMYK:
if (cinfo->num_components != 4)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_CMYK) {
#if defined(__mips__)
if (jsimd_c_can_null_convert())
cconvert->pub.color_convert = jsimd_c_null_convert;
else
#endif
cconvert->pub.color_convert = null_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_YCCK:
if (cinfo->num_components != 4)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_CMYK) {
cconvert->pub.start_pass = rgb_ycc_start;
cconvert->pub.color_convert = cmyk_ycck_convert;
} else if (cinfo->in_color_space == JCS_YCCK) {
#if defined(__mips__)
if (jsimd_c_can_null_convert())
cconvert->pub.color_convert = jsimd_c_null_convert;
else
#endif
cconvert->pub.color_convert = null_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
default: /* allow null conversion of JCS_UNKNOWN */
if (cinfo->jpeg_color_space != cinfo->in_color_space ||
cinfo->num_components != cinfo->input_components)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
#if defined(__mips__)
if (jsimd_c_can_null_convert())
cconvert->pub.color_convert = jsimd_c_null_convert;
else
#endif
cconvert->pub.color_convert = null_convert;
break;
}
}
+721
View File
@@ -0,0 +1,721 @@
/*
* jcdctmgr.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 1999-2006, MIYASAKA Masaru.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, 2014-2015, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains the forward-DCT management logic.
* This code selects a particular DCT implementation to be used,
* and it performs related housekeeping chores including coefficient
* quantization.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdct.h" /* Private declarations for DCT subsystem */
#include "jsimddct.h"
/* Private subobject for this module */
typedef void (*forward_DCT_method_ptr) (DCTELEM *data);
typedef void (*float_DCT_method_ptr) (FAST_FLOAT *data);
typedef void (*convsamp_method_ptr) (JSAMPARRAY sample_data,
JDIMENSION start_col,
DCTELEM *workspace);
typedef void (*float_convsamp_method_ptr) (JSAMPARRAY sample_data,
JDIMENSION start_col,
FAST_FLOAT *workspace);
typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM *divisors,
DCTELEM *workspace);
typedef void (*float_quantize_method_ptr) (JCOEFPTR coef_block,
FAST_FLOAT *divisors,
FAST_FLOAT *workspace);
METHODDEF(void) quantize(JCOEFPTR, DCTELEM *, DCTELEM *);
typedef struct {
struct jpeg_forward_dct pub; /* public fields */
/* Pointer to the DCT routine actually in use */
forward_DCT_method_ptr dct;
convsamp_method_ptr convsamp;
quantize_method_ptr quantize;
/* The actual post-DCT divisors --- not identical to the quant table
* entries, because of scaling (especially for an unnormalized DCT).
* Each table is given in normal array order.
*/
DCTELEM *divisors[NUM_QUANT_TBLS];
/* work area for FDCT subroutine */
DCTELEM *workspace;
#ifdef DCT_FLOAT_SUPPORTED
/* Same as above for the floating-point case. */
float_DCT_method_ptr float_dct;
float_convsamp_method_ptr float_convsamp;
float_quantize_method_ptr float_quantize;
FAST_FLOAT *float_divisors[NUM_QUANT_TBLS];
FAST_FLOAT *float_workspace;
#endif
} my_fdct_controller;
typedef my_fdct_controller *my_fdct_ptr;
#if BITS_IN_JSAMPLE == 8
/*
* Find the highest bit in an integer through binary search.
*/
LOCAL(int)
flss(UINT16 val)
{
int bit;
bit = 16;
if (!val)
return 0;
if (!(val & 0xff00)) {
bit -= 8;
val <<= 8;
}
if (!(val & 0xf000)) {
bit -= 4;
val <<= 4;
}
if (!(val & 0xc000)) {
bit -= 2;
val <<= 2;
}
if (!(val & 0x8000)) {
bit -= 1;
val <<= 1;
}
return bit;
}
/*
* Compute values to do a division using reciprocal.
*
* This implementation is based on an algorithm described in
* "How to optimize for the Pentium family of microprocessors"
* (http://www.agner.org/assem/).
* More information about the basic algorithm can be found in
* the paper "Integer Division Using Reciprocals" by Robert Alverson.
*
* The basic idea is to replace x/d by x * d^-1. In order to store
* d^-1 with enough precision we shift it left a few places. It turns
* out that this algoright gives just enough precision, and also fits
* into DCTELEM:
*
* b = (the number of significant bits in divisor) - 1
* r = (word size) + b
* f = 2^r / divisor
*
* f will not be an integer for most cases, so we need to compensate
* for the rounding error introduced:
*
* no fractional part:
*
* result = input >> r
*
* fractional part of f < 0.5:
*
* round f down to nearest integer
* result = ((input + 1) * f) >> r
*
* fractional part of f > 0.5:
*
* round f up to nearest integer
* result = (input * f) >> r
*
* This is the original algorithm that gives truncated results. But we
* want properly rounded results, so we replace "input" with
* "input + divisor/2".
*
* In order to allow SIMD implementations we also tweak the values to
* allow the same calculation to be made at all times:
*
* dctbl[0] = f rounded to nearest integer
* dctbl[1] = divisor / 2 (+ 1 if fractional part of f < 0.5)
* dctbl[2] = 1 << ((word size) * 2 - r)
* dctbl[3] = r - (word size)
*
* dctbl[2] is for stupid instruction sets where the shift operation
* isn't member wise (e.g. MMX).
*
* The reason dctbl[2] and dctbl[3] reduce the shift with (word size)
* is that most SIMD implementations have a "multiply and store top
* half" operation.
*
* Lastly, we store each of the values in their own table instead
* of in a consecutive manner, yet again in order to allow SIMD
* routines.
*/
LOCAL(int)
compute_reciprocal(UINT16 divisor, DCTELEM *dtbl)
{
UDCTELEM2 fq, fr;
UDCTELEM c;
int b, r;
if (divisor == 1) {
/* divisor == 1 means unquantized, so these reciprocal/correction/shift
* values will cause the C quantization algorithm to act like the
* identity function. Since only the C quantization algorithm is used in
* these cases, the scale value is irrelevant.
*/
dtbl[DCTSIZE2 * 0] = (DCTELEM)1; /* reciprocal */
dtbl[DCTSIZE2 * 1] = (DCTELEM)0; /* correction */
dtbl[DCTSIZE2 * 2] = (DCTELEM)1; /* scale */
dtbl[DCTSIZE2 * 3] = -(DCTELEM)(sizeof(DCTELEM) * 8); /* shift */
return 0;
}
b = flss(divisor) - 1;
r = sizeof(DCTELEM) * 8 + b;
fq = ((UDCTELEM2)1 << r) / divisor;
fr = ((UDCTELEM2)1 << r) % divisor;
c = divisor / 2; /* for rounding */
if (fr == 0) { /* divisor is power of two */
/* fq will be one bit too large to fit in DCTELEM, so adjust */
fq >>= 1;
r--;
} else if (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */
c++;
} else { /* fractional part is > 0.5 */
fq++;
}
dtbl[DCTSIZE2 * 0] = (DCTELEM)fq; /* reciprocal */
dtbl[DCTSIZE2 * 1] = (DCTELEM)c; /* correction + roundfactor */
#ifdef WITH_SIMD
dtbl[DCTSIZE2 * 2] = (DCTELEM)(1 << (sizeof(DCTELEM) * 8 * 2 - r)); /* scale */
#else
dtbl[DCTSIZE2 * 2] = 1;
#endif
dtbl[DCTSIZE2 * 3] = (DCTELEM)r - sizeof(DCTELEM) * 8; /* shift */
if (r <= 16) return 0;
else return 1;
}
#endif
/*
* Initialize for a processing pass.
* Verify that all referenced Q-tables are present, and set up
* the divisor table for each one.
* In the current implementation, DCT of all components is done during
* the first pass, even if only some components will be output in the
* first scan. Hence all components should be examined here.
*/
METHODDEF(void)
start_pass_fdctmgr(j_compress_ptr cinfo)
{
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
int ci, qtblno, i;
jpeg_component_info *compptr;
JQUANT_TBL *qtbl;
DCTELEM *dtbl;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
qtblno = compptr->quant_tbl_no;
/* Make sure specified quantization table is present */
if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
cinfo->quant_tbl_ptrs[qtblno] == NULL)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
qtbl = cinfo->quant_tbl_ptrs[qtblno];
/* Compute divisors for this quant table */
/* We may do this more than once for same table, but it's not a big deal */
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
/* For LL&M IDCT method, divisors are equal to raw quantization
* coefficients multiplied by 8 (to counteract scaling).
*/
if (fdct->divisors[qtblno] == NULL) {
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(DCTSIZE2 * 4) * sizeof(DCTELEM));
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
#if BITS_IN_JSAMPLE == 8
if (!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) &&
fdct->quantize == jsimd_quantize)
fdct->quantize = quantize;
#else
dtbl[i] = ((DCTELEM)qtbl->quantval[i]) << 3;
#endif
}
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
{
/* For AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
*/
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
if (fdct->divisors[qtblno] == NULL) {
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(DCTSIZE2 * 4) * sizeof(DCTELEM));
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
#if BITS_IN_JSAMPLE == 8
if (!compute_reciprocal(
DESCALE(MULTIPLY16V16((JLONG)qtbl->quantval[i],
(JLONG)aanscales[i]),
CONST_BITS - 3), &dtbl[i]) &&
fdct->quantize == jsimd_quantize)
fdct->quantize = quantize;
#else
dtbl[i] = (DCTELEM)
DESCALE(MULTIPLY16V16((JLONG)qtbl->quantval[i],
(JLONG)aanscales[i]),
CONST_BITS - 3);
#endif
}
}
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
* What's actually stored is 1/divisor so that the inner loop can
* use a multiplication rather than a division.
*/
FAST_FLOAT *fdtbl;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
if (fdct->float_divisors[qtblno] == NULL) {
fdct->float_divisors[qtblno] = (FAST_FLOAT *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
DCTSIZE2 * sizeof(FAST_FLOAT));
}
fdtbl = fdct->float_divisors[qtblno];
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fdtbl[i] = (FAST_FLOAT)
(1.0 / (((double)qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col] * 8.0)));
i++;
}
}
}
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
}
}
/*
* Load data into workspace, applying unsigned->signed conversion.
*/
METHODDEF(void)
convsamp(JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)
{
register DCTELEM *workspaceptr;
register JSAMPROW elemptr;
register int elemr;
workspaceptr = workspace;
for (elemr = 0; elemr < DCTSIZE; elemr++) {
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;
#else
{
register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--)
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
}
#endif
}
}
/*
* Quantize/descale the coefficients, and store into coef_blocks[].
*/
METHODDEF(void)
quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
{
int i;
DCTELEM temp;
JCOEFPTR output_ptr = coef_block;
#if BITS_IN_JSAMPLE == 8
UDCTELEM recip, corr;
int shift;
UDCTELEM2 product;
for (i = 0; i < DCTSIZE2; i++) {
temp = workspace[i];
recip = divisors[i + DCTSIZE2 * 0];
corr = divisors[i + DCTSIZE2 * 1];
shift = divisors[i + DCTSIZE2 * 3];
if (temp < 0) {
temp = -temp;
product = (UDCTELEM2)(temp + corr) * recip;
product >>= shift + sizeof(DCTELEM) * 8;
temp = (DCTELEM)product;
temp = -temp;
} else {
product = (UDCTELEM2)(temp + corr) * recip;
product >>= shift + sizeof(DCTELEM) * 8;
temp = (DCTELEM)product;
}
output_ptr[i] = (JCOEF)temp;
}
#else
register DCTELEM qval;
for (i = 0; i < DCTSIZE2; i++) {
qval = divisors[i];
temp = workspace[i];
/* Divide the coefficient value by qval, ensuring proper rounding.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
*
* In most files, at least half of the output values will be zero
* (at default quantization settings, more like three-quarters...)
* so we should ensure that this case is fast. On many machines,
* a comparison is enough cheaper than a divide to make a special test
* a win. Since both inputs will be nonnegative, we need only test
* for a < b to discover whether a/b is 0.
* If your machine's division is fast enough, define FAST_DIVIDE.
*/
#ifdef FAST_DIVIDE
#define DIVIDE_BY(a, b) a /= b
#else
#define DIVIDE_BY(a, b) if (a >= b) a /= b; else a = 0
#endif
if (temp < 0) {
temp = -temp;
temp += qval >> 1; /* for rounding */
DIVIDE_BY(temp, qval);
temp = -temp;
} else {
temp += qval >> 1; /* for rounding */
DIVIDE_BY(temp, qval);
}
output_ptr[i] = (JCOEF)temp;
}
#endif
}
/*
* Perform forward DCT on one or more blocks of a component.
*
* The input samples are taken from the sample_data[] array starting at
* position start_row/start_col, and moving to the right for any additional
* blocks. The quantized coefficients are returned in coef_blocks[].
*/
METHODDEF(void)
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks)
/* This version is used for integer DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no];
DCTELEM *workspace;
JDIMENSION bi;
/* Make sure the compiler doesn't look up these every pass */
forward_DCT_method_ptr do_dct = fdct->dct;
convsamp_method_ptr do_convsamp = fdct->convsamp;
quantize_method_ptr do_quantize = fdct->quantize;
workspace = fdct->workspace;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
/* Load data into workspace, applying unsigned->signed conversion */
(*do_convsamp) (sample_data, start_col, workspace);
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
(*do_quantize) (coef_blocks[bi], divisors, workspace);
}
}
#ifdef DCT_FLOAT_SUPPORTED
METHODDEF(void)
convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
FAST_FLOAT *workspace)
{
register FAST_FLOAT *workspaceptr;
register JSAMPROW elemptr;
register int elemr;
workspaceptr = workspace;
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);
#else
{
register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--)
*workspaceptr++ = (FAST_FLOAT)
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
}
#endif
}
}
METHODDEF(void)
quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
FAST_FLOAT *workspace)
{
register FAST_FLOAT temp;
register int i;
register JCOEFPTR output_ptr = coef_block;
for (i = 0; i < DCTSIZE2; i++) {
/* Apply the quantization and scaling factor */
temp = workspace[i] * divisors[i];
/* Round to nearest integer.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
* The maximum coefficient size is +-16K (for 12-bit data), so this
* code should work for either 16-bit or 32-bit ints.
*/
output_ptr[i] = (JCOEF)((int)(temp + (FAST_FLOAT)16384.5) - 16384);
}
}
METHODDEF(void)
forward_DCT_float(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks)
/* This version is used for floating-point DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no];
FAST_FLOAT *workspace;
JDIMENSION bi;
/* Make sure the compiler doesn't look up these every pass */
float_DCT_method_ptr do_dct = fdct->float_dct;
float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;
float_quantize_method_ptr do_quantize = fdct->float_quantize;
workspace = fdct->float_workspace;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
/* Load data into workspace, applying unsigned->signed conversion */
(*do_convsamp) (sample_data, start_col, workspace);
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
(*do_quantize) (coef_blocks[bi], divisors, workspace);
}
}
#endif /* DCT_FLOAT_SUPPORTED */
/*
* Initialize FDCT manager.
*/
GLOBAL(void)
jinit_forward_dct(j_compress_ptr cinfo)
{
my_fdct_ptr fdct;
int i;
fdct = (my_fdct_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_fdct_controller));
cinfo->fdct = (struct jpeg_forward_dct *)fdct;
fdct->pub.start_pass = start_pass_fdctmgr;
/* First determine the DCT... */
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
fdct->pub.forward_DCT = forward_DCT;
if (jsimd_can_fdct_islow())
fdct->dct = jsimd_fdct_islow;
else
fdct->dct = jpeg_fdct_islow;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
fdct->pub.forward_DCT = forward_DCT;
if (jsimd_can_fdct_ifast())
fdct->dct = jsimd_fdct_ifast;
else
fdct->dct = jpeg_fdct_ifast;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
fdct->pub.forward_DCT = forward_DCT_float;
if (jsimd_can_fdct_float())
fdct->float_dct = jsimd_fdct_float;
else
fdct->float_dct = jpeg_fdct_float;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
/* ...then the supporting stages. */
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
#endif
#if defined(DCT_ISLOW_SUPPORTED) || defined(DCT_IFAST_SUPPORTED)
if (jsimd_can_convsamp())
fdct->convsamp = jsimd_convsamp;
else
fdct->convsamp = convsamp;
if (jsimd_can_quantize())
fdct->quantize = jsimd_quantize;
else
fdct->quantize = quantize;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
if (jsimd_can_convsamp_float())
fdct->float_convsamp = jsimd_convsamp_float;
else
fdct->float_convsamp = convsamp_float;
if (jsimd_can_quantize_float())
fdct->float_quantize = jsimd_quantize_float;
else
fdct->float_quantize = quantize_float;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
/* Allocate workspace memory */
#ifdef DCT_FLOAT_SUPPORTED
if (cinfo->dct_method == JDCT_FLOAT)
fdct->float_workspace = (FAST_FLOAT *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(FAST_FLOAT) * DCTSIZE2);
else
#endif
fdct->workspace = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(DCTELEM) * DCTSIZE2);
/* Mark divisor tables unallocated */
for (i = 0; i < NUM_QUANT_TBLS; i++) {
fdct->divisors[i] = NULL;
#ifdef DCT_FLOAT_SUPPORTED
fdct->float_divisors[i] = NULL;
#endif
}
}
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
/*
* jchuff.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains declarations for Huffman entropy encoding routines
* that are shared between the sequential encoder (jchuff.c) and the
* progressive encoder (jcphuff.c). No other modules need to see these.
*/
/* The legal range of a DCT coefficient is
* -1024 .. +1023 for 8-bit data;
* -16384 .. +16383 for 12-bit data.
* Hence the magnitude should always fit in 10 or 14 bits respectively.
*/
#if BITS_IN_JSAMPLE == 8
#define MAX_COEF_BITS 10
#else
#define MAX_COEF_BITS 14
#endif
/* Derived data constructed for each Huffman table */
typedef struct {
unsigned int ehufco[256]; /* code for each symbol */
char ehufsi[256]; /* length of code for each symbol */
/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
} c_derived_tbl;
/* Expand a Huffman table definition into the derived format */
EXTERN(void) jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC,
int tblno, c_derived_tbl **pdtbl);
/* Generate an optimal table definition given the specified counts */
EXTERN(void) jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL *htbl,
long freq[]);
+77
View File
@@ -0,0 +1,77 @@
/*
* jcinit.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains initialization logic for the JPEG compressor.
* This routine is in charge of selecting the modules to be executed and
* making an initialization call to each one.
*
* Logically, this code belongs in jcmaster.c. It's split out because
* linking this routine implies linking the entire compression library.
* For a transcoding-only application, we want to be able to use jcmaster.c
* without linking in the whole library.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/*
* Master selection of compression modules.
* This is done once at the start of processing an image. We determine
* which modules will be used and give them appropriate initialization calls.
*/
GLOBAL(void)
jinit_compress_master(j_compress_ptr cinfo)
{
/* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, FALSE /* full compression */);
/* Preprocessing */
if (!cinfo->raw_data_in) {
jinit_color_converter(cinfo);
jinit_downsampler(cinfo);
jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
}
/* Forward DCT */
jinit_forward_dct(cinfo);
/* Entropy encoding: either Huffman or arithmetic coding. */
if (cinfo->arith_code) {
#ifdef C_ARITH_CODING_SUPPORTED
jinit_arith_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
#endif
} else {
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
jinit_phuff_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else
jinit_huff_encoder(cinfo);
}
/* Need a full-image coefficient buffer in any multi-pass mode. */
jinit_c_coef_controller(cinfo, (boolean)(cinfo->num_scans > 1 ||
cinfo->optimize_coding));
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
jinit_marker_writer(cinfo);
/* We can now tell the memory manager to allocate virtual arrays. */
(*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
/* Write the datastream header (SOI) immediately.
* Frame and scan headers are postponed till later.
* This lets application insert special markers after the SOI.
*/
(*cinfo->marker->write_file_header) (cinfo);
}
+162
View File
@@ -0,0 +1,162 @@
/*
* jcmainct.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains the main buffer controller for compression.
* The main buffer lies between the pre-processor and the JPEG
* compressor proper; it holds downsampled data in the JPEG colorspace.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Private buffer controller object */
typedef struct {
struct jpeg_c_main_controller pub; /* public fields */
JDIMENSION cur_iMCU_row; /* number of current iMCU row */
JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
boolean suspended; /* remember if we suspended output */
J_BUF_MODE pass_mode; /* current operating mode */
/* If using just a strip buffer, this points to the entire set of buffers
* (we allocate one for each component). In the full-image case, this
* points to the currently accessible strips of the virtual arrays.
*/
JSAMPARRAY buffer[MAX_COMPONENTS];
} my_main_controller;
typedef my_main_controller *my_main_ptr;
/* Forward declarations */
METHODDEF(void) process_data_simple_main(j_compress_ptr cinfo,
JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail);
/*
* Initialize for a processing pass.
*/
METHODDEF(void)
start_pass_main(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
/* Do nothing in raw-data mode. */
if (cinfo->raw_data_in)
return;
if (pass_mode != JBUF_PASS_THRU)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
main_ptr->cur_iMCU_row = 0; /* initialize counters */
main_ptr->rowgroup_ctr = 0;
main_ptr->suspended = FALSE;
main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
main_ptr->pub.process_data = process_data_simple_main;
}
/*
* Process some data.
* This routine handles the simple pass-through mode,
* where we have only a strip buffer.
*/
METHODDEF(void)
process_data_simple_main(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)
{
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main buffer yet */
if (main_ptr->rowgroup_ctr < DCTSIZE)
(*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr,
in_rows_avail, main_ptr->buffer,
&main_ptr->rowgroup_ctr,
(JDIMENSION)DCTSIZE);
/* If we don't have a full iMCU row buffered, return to application for
* more data. Note that preprocessor will always pad to fill the iMCU row
* at the bottom of the image.
*/
if (main_ptr->rowgroup_ctr != DCTSIZE)
return;
/* Send the completed row to the compressor */
if (!(*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
if (!main_ptr->suspended) {
(*in_row_ctr)--;
main_ptr->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main buffer empty.
*/
if (main_ptr->suspended) {
(*in_row_ctr)++;
main_ptr->suspended = FALSE;
}
main_ptr->rowgroup_ctr = 0;
main_ptr->cur_iMCU_row++;
}
}
/*
* Initialize main buffer controller.
*/
GLOBAL(void)
jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer)
{
my_main_ptr main_ptr;
int ci;
jpeg_component_info *compptr;
main_ptr = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_main_controller));
cinfo->main = (struct jpeg_c_main_controller *)main_ptr;
main_ptr->pub.start_pass = start_pass_main;
/* We don't need to create a buffer in raw-data mode. */
if (cinfo->raw_data_in)
return;
/* Create the buffer. It holds downsampled data, so each component
* may be of a different size.
*/
if (need_full_buffer) {
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
} else {
/* Allocate a strip buffer for each component */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr)cinfo, JPOOL_IMAGE,
compptr->width_in_blocks * DCTSIZE,
(JDIMENSION)(compptr->v_samp_factor * DCTSIZE));
}
}
}
+664
View File
@@ -0,0 +1,664 @@
/*
* jcmarker.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains routines to write JPEG datastream markers.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jpegcomp.h"
typedef enum { /* JPEG marker codes */
M_SOF0 = 0xc0,
M_SOF1 = 0xc1,
M_SOF2 = 0xc2,
M_SOF3 = 0xc3,
M_SOF5 = 0xc5,
M_SOF6 = 0xc6,
M_SOF7 = 0xc7,
M_JPG = 0xc8,
M_SOF9 = 0xc9,
M_SOF10 = 0xca,
M_SOF11 = 0xcb,
M_SOF13 = 0xcd,
M_SOF14 = 0xce,
M_SOF15 = 0xcf,
M_DHT = 0xc4,
M_DAC = 0xcc,
M_RST0 = 0xd0,
M_RST1 = 0xd1,
M_RST2 = 0xd2,
M_RST3 = 0xd3,
M_RST4 = 0xd4,
M_RST5 = 0xd5,
M_RST6 = 0xd6,
M_RST7 = 0xd7,
M_SOI = 0xd8,
M_EOI = 0xd9,
M_SOS = 0xda,
M_DQT = 0xdb,
M_DNL = 0xdc,
M_DRI = 0xdd,
M_DHP = 0xde,
M_EXP = 0xdf,
M_APP0 = 0xe0,
M_APP1 = 0xe1,
M_APP2 = 0xe2,
M_APP3 = 0xe3,
M_APP4 = 0xe4,
M_APP5 = 0xe5,
M_APP6 = 0xe6,
M_APP7 = 0xe7,
M_APP8 = 0xe8,
M_APP9 = 0xe9,
M_APP10 = 0xea,
M_APP11 = 0xeb,
M_APP12 = 0xec,
M_APP13 = 0xed,
M_APP14 = 0xee,
M_APP15 = 0xef,
M_JPG0 = 0xf0,
M_JPG13 = 0xfd,
M_COM = 0xfe,
M_TEM = 0x01,
M_ERROR = 0x100
} JPEG_MARKER;
/* Private state */
typedef struct {
struct jpeg_marker_writer pub; /* public fields */
unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
} my_marker_writer;
typedef my_marker_writer *my_marker_ptr;
/*
* Basic output routines.
*
* Note that we do not support suspension while writing a marker.
* Therefore, an application using suspension must ensure that there is
* enough buffer space for the initial markers (typ. 600-700 bytes) before
* calling jpeg_start_compress, and enough space to write the trailing EOI
* (a few bytes) before calling jpeg_finish_compress. Multipass compression
* modes are not supported at all with suspension, so those two are the only
* points where markers will be written.
*/
LOCAL(void)
emit_byte(j_compress_ptr cinfo, int val)
/* Emit a byte */
{
struct jpeg_destination_mgr *dest = cinfo->dest;
*(dest->next_output_byte)++ = (JOCTET)val;
if (--dest->free_in_buffer == 0) {
if (!(*dest->empty_output_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
}
}
LOCAL(void)
emit_marker(j_compress_ptr cinfo, JPEG_MARKER mark)
/* Emit a marker code */
{
emit_byte(cinfo, 0xFF);
emit_byte(cinfo, (int)mark);
}
LOCAL(void)
emit_2bytes(j_compress_ptr cinfo, int value)
/* Emit a 2-byte integer; these are always MSB first in JPEG files */
{
emit_byte(cinfo, (value >> 8) & 0xFF);
emit_byte(cinfo, value & 0xFF);
}
/*
* Routines to write specific marker types.
*/
LOCAL(int)
emit_dqt(j_compress_ptr cinfo, int index)
/* Emit a DQT marker */
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
{
JQUANT_TBL *qtbl = cinfo->quant_tbl_ptrs[index];
int prec;
int i;
if (qtbl == NULL)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
prec = 0;
for (i = 0; i < DCTSIZE2; i++) {
if (qtbl->quantval[i] > 255)
prec = 1;
}
if (!qtbl->sent_table) {
emit_marker(cinfo, M_DQT);
emit_2bytes(cinfo, prec ? DCTSIZE2 * 2 + 1 + 2 : DCTSIZE2 + 1 + 2);
emit_byte(cinfo, index + (prec << 4));
for (i = 0; i < DCTSIZE2; i++) {
/* The table entries must be emitted in zigzag order. */
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
if (prec)
emit_byte(cinfo, (int)(qval >> 8));
emit_byte(cinfo, (int)(qval & 0xFF));
}
qtbl->sent_table = TRUE;
}
return prec;
}
LOCAL(void)
emit_dht(j_compress_ptr cinfo, int index, boolean is_ac)
/* Emit a DHT marker */
{
JHUFF_TBL *htbl;
int length, i;
if (is_ac) {
htbl = cinfo->ac_huff_tbl_ptrs[index];
index += 0x10; /* output index has AC bit set */
} else {
htbl = cinfo->dc_huff_tbl_ptrs[index];
}
if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
if (!htbl->sent_table) {
emit_marker(cinfo, M_DHT);
length = 0;
for (i = 1; i <= 16; i++)
length += htbl->bits[i];
emit_2bytes(cinfo, length + 2 + 1 + 16);
emit_byte(cinfo, index);
for (i = 1; i <= 16; i++)
emit_byte(cinfo, htbl->bits[i]);
for (i = 0; i < length; i++)
emit_byte(cinfo, htbl->huffval[i]);
htbl->sent_table = TRUE;
}
}
LOCAL(void)
emit_dac(j_compress_ptr cinfo)
/* Emit a DAC marker */
/* Since the useful info is so small, we want to emit all the tables in */
/* one DAC marker. Therefore this routine does its own scan of the table. */
{
#ifdef C_ARITH_CODING_SUPPORTED
char dc_in_use[NUM_ARITH_TBLS];
char ac_in_use[NUM_ARITH_TBLS];
int length, i;
jpeg_component_info *compptr;
for (i = 0; i < NUM_ARITH_TBLS; i++)
dc_in_use[i] = ac_in_use[i] = 0;
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0)
dc_in_use[compptr->dc_tbl_no] = 1;
/* AC needs no table when not present */
if (cinfo->Se)
ac_in_use[compptr->ac_tbl_no] = 1;
}
length = 0;
for (i = 0; i < NUM_ARITH_TBLS; i++)
length += dc_in_use[i] + ac_in_use[i];
if (length) {
emit_marker(cinfo, M_DAC);
emit_2bytes(cinfo, length * 2 + 2);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) {
emit_byte(cinfo, i);
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i] << 4));
}
if (ac_in_use[i]) {
emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
}
}
}
#endif /* C_ARITH_CODING_SUPPORTED */
}
LOCAL(void)
emit_dri(j_compress_ptr cinfo)
/* Emit a DRI marker */
{
emit_marker(cinfo, M_DRI);
emit_2bytes(cinfo, 4); /* fixed length */
emit_2bytes(cinfo, (int)cinfo->restart_interval);
}
LOCAL(void)
emit_sof(j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
{
int ci;
jpeg_component_info *compptr;
emit_marker(cinfo, code);
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
/* Make sure image isn't bigger than SOF field can handle */
if ((long)cinfo->_jpeg_height > 65535L || (long)cinfo->_jpeg_width > 65535L)
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)65535);
emit_byte(cinfo, cinfo->data_precision);
emit_2bytes(cinfo, (int)cinfo->_jpeg_height);
emit_2bytes(cinfo, (int)cinfo->_jpeg_width);
emit_byte(cinfo, cinfo->num_components);
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
emit_byte(cinfo, compptr->component_id);
emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
emit_byte(cinfo, compptr->quant_tbl_no);
}
}
LOCAL(void)
emit_sos(j_compress_ptr cinfo)
/* Emit a SOS marker */
{
int i, td, ta;
jpeg_component_info *compptr;
emit_marker(cinfo, M_SOS);
emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
emit_byte(cinfo, cinfo->comps_in_scan);
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
emit_byte(cinfo, compptr->component_id);
/* We emit 0 for unused field(s); this is recommended by the P&M text
* but does not seem to be specified in the standard.
*/
/* DC needs no table for refinement scan */
td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;
/* AC needs no table when not present */
ta = cinfo->Se ? compptr->ac_tbl_no : 0;
emit_byte(cinfo, (td << 4) + ta);
}
emit_byte(cinfo, cinfo->Ss);
emit_byte(cinfo, cinfo->Se);
emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
}
LOCAL(void)
emit_jfif_app0(j_compress_ptr cinfo)
/* Emit a JFIF-compliant APP0 marker */
{
/*
* Length of APP0 block (2 bytes)
* Block ID (4 bytes - ASCII "JFIF")
* Zero byte (1 byte to terminate the ID string)
* Version Major, Minor (2 bytes - major first)
* Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
* Xdpu (2 bytes - dots per unit horizontal)
* Ydpu (2 bytes - dots per unit vertical)
* Thumbnail X size (1 byte)
* Thumbnail Y size (1 byte)
*/
emit_marker(cinfo, M_APP0);
emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
emit_byte(cinfo, 0x46);
emit_byte(cinfo, 0x49);
emit_byte(cinfo, 0x46);
emit_byte(cinfo, 0);
emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
emit_byte(cinfo, cinfo->JFIF_minor_version);
emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
emit_2bytes(cinfo, (int)cinfo->X_density);
emit_2bytes(cinfo, (int)cinfo->Y_density);
emit_byte(cinfo, 0); /* No thumbnail image */
emit_byte(cinfo, 0);
}
LOCAL(void)
emit_adobe_app14(j_compress_ptr cinfo)
/* Emit an Adobe APP14 marker */
{
/*
* Length of APP14 block (2 bytes)
* Block ID (5 bytes - ASCII "Adobe")
* Version Number (2 bytes - currently 100)
* Flags0 (2 bytes - currently 0)
* Flags1 (2 bytes - currently 0)
* Color transform (1 byte)
*
* Although Adobe TN 5116 mentions Version = 101, all the Adobe files
* now in circulation seem to use Version = 100, so that's what we write.
*
* We write the color transform byte as 1 if the JPEG color space is
* YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
* whether the encoder performed a transformation, which is pretty useless.
*/
emit_marker(cinfo, M_APP14);
emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
emit_byte(cinfo, 0x64);
emit_byte(cinfo, 0x6F);
emit_byte(cinfo, 0x62);
emit_byte(cinfo, 0x65);
emit_2bytes(cinfo, 100); /* Version */
emit_2bytes(cinfo, 0); /* Flags0 */
emit_2bytes(cinfo, 0); /* Flags1 */
switch (cinfo->jpeg_color_space) {
case JCS_YCbCr:
emit_byte(cinfo, 1); /* Color transform = 1 */
break;
case JCS_YCCK:
emit_byte(cinfo, 2); /* Color transform = 2 */
break;
default:
emit_byte(cinfo, 0); /* Color transform = 0 */
break;
}
}
/*
* These routines allow writing an arbitrary marker with parameters.
* The only intended use is to emit COM or APPn markers after calling
* write_file_header and before calling write_frame_header.
* Other uses are not guaranteed to produce desirable results.
* Counting the parameter bytes properly is the caller's responsibility.
*/
METHODDEF(void)
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
/* Emit an arbitrary marker header */
{
if (datalen > (unsigned int)65533) /* safety check */
ERREXIT(cinfo, JERR_BAD_LENGTH);
emit_marker(cinfo, (JPEG_MARKER)marker);
emit_2bytes(cinfo, (int)(datalen + 2)); /* total length */
}
METHODDEF(void)
write_marker_byte(j_compress_ptr cinfo, int val)
/* Emit one byte of marker parameters following write_marker_header */
{
emit_byte(cinfo, val);
}
/*
* Write datastream header.
* This consists of an SOI and optional APPn markers.
* We recommend use of the JFIF marker, but not the Adobe marker,
* when using YCbCr or grayscale data. The JFIF marker should NOT
* be used for any other JPEG colorspace. The Adobe marker is helpful
* to distinguish RGB, CMYK, and YCCK colorspaces.
* Note that an application can write additional header markers after
* jpeg_start_compress returns.
*/
METHODDEF(void)
write_file_header(j_compress_ptr cinfo)
{
my_marker_ptr marker = (my_marker_ptr)cinfo->marker;
emit_marker(cinfo, M_SOI); /* first the SOI */
/* SOI is defined to reset restart interval to 0 */
marker->last_restart_interval = 0;
if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
emit_jfif_app0(cinfo);
if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
emit_adobe_app14(cinfo);
}
/*
* Write frame header.
* This consists of DQT and SOFn markers.
* Note that we do not emit the SOF until we have emitted the DQT(s).
* This avoids compatibility problems with incorrect implementations that
* try to error-check the quant table numbers as soon as they see the SOF.
*/
METHODDEF(void)
write_frame_header(j_compress_ptr cinfo)
{
int ci, prec;
boolean is_baseline;
jpeg_component_info *compptr;
/* Emit DQT for each quantization table.
* Note that emit_dqt() suppresses any duplicate tables.
*/
prec = 0;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
prec += emit_dqt(cinfo, compptr->quant_tbl_no);
}
/* now prec is nonzero iff there are any 16-bit quant tables. */
/* Check for a non-baseline specification.
* Note we assume that Huffman table numbers won't be changed later.
*/
if (cinfo->arith_code || cinfo->progressive_mode ||
cinfo->data_precision != 8) {
is_baseline = FALSE;
} else {
is_baseline = TRUE;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
is_baseline = FALSE;
}
if (prec && is_baseline) {
is_baseline = FALSE;
/* If it's baseline except for quantizer size, warn the user */
TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
}
}
/* Emit the proper SOF marker */
if (cinfo->arith_code) {
if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */
else
emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
} else {
if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
else if (is_baseline)
emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
else
emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
}
}
/*
* Write scan header.
* This consists of DHT or DAC markers, optional DRI, and SOS.
* Compressed data will be written following the SOS.
*/
METHODDEF(void)
write_scan_header(j_compress_ptr cinfo)
{
my_marker_ptr marker = (my_marker_ptr)cinfo->marker;
int i;
jpeg_component_info *compptr;
if (cinfo->arith_code) {
/* Emit arith conditioning info. We may have some duplication
* if the file has multiple scans, but it's so small it's hardly
* worth worrying about.
*/
emit_dac(cinfo);
} else {
/* Emit Huffman tables.
* Note that emit_dht() suppresses any duplicate tables.
*/
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0)
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
/* AC needs no table when not present */
if (cinfo->Se)
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
}
}
/* Emit DRI if required --- note that DRI value could change for each scan.
* We avoid wasting space with unnecessary DRIs, however.
*/
if (cinfo->restart_interval != marker->last_restart_interval) {
emit_dri(cinfo);
marker->last_restart_interval = cinfo->restart_interval;
}
emit_sos(cinfo);
}
/*
* Write datastream trailer.
*/
METHODDEF(void)
write_file_trailer(j_compress_ptr cinfo)
{
emit_marker(cinfo, M_EOI);
}
/*
* Write an abbreviated table-specification datastream.
* This consists of SOI, DQT and DHT tables, and EOI.
* Any table that is defined and not marked sent_table = TRUE will be
* emitted. Note that all tables will be marked sent_table = TRUE at exit.
*/
METHODDEF(void)
write_tables_only(j_compress_ptr cinfo)
{
int i;
emit_marker(cinfo, M_SOI);
for (i = 0; i < NUM_QUANT_TBLS; i++) {
if (cinfo->quant_tbl_ptrs[i] != NULL)
(void)emit_dqt(cinfo, i);
}
if (!cinfo->arith_code) {
for (i = 0; i < NUM_HUFF_TBLS; i++) {
if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
emit_dht(cinfo, i, FALSE);
if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
emit_dht(cinfo, i, TRUE);
}
}
emit_marker(cinfo, M_EOI);
}
/*
* Initialize the marker writer module.
*/
GLOBAL(void)
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));
cinfo->marker = (struct jpeg_marker_writer *)marker;
/* Initialize method pointers */
marker->pub.write_file_header = write_file_header;
marker->pub.write_frame_header = write_frame_header;
marker->pub.write_scan_header = write_scan_header;
marker->pub.write_file_trailer = write_file_trailer;
marker->pub.write_tables_only = write_tables_only;
marker->pub.write_marker_header = write_marker_header;
marker->pub.write_marker_byte = write_marker_byte;
/* Initialize private state */
marker->last_restart_interval = 0;
}
+640
View File
@@ -0,0 +1,640 @@
/*
* jcmaster.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, 2016, 2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains master control logic for the JPEG compressor.
* These routines are concerned with parameter validation, initial setup,
* and inter-pass control (determining the number of passes and the work
* to be done in each pass).
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jpegcomp.h"
#include "jconfigint.h"
/* Private state */
typedef enum {
main_pass, /* input data, also do first output step */
huff_opt_pass, /* Huffman code optimization pass */
output_pass /* data output pass */
} c_pass_type;
typedef struct {
struct jpeg_comp_master pub; /* public fields */
c_pass_type pass_type; /* the type of the current pass */
int pass_number; /* # of passes completed */
int total_passes; /* total # of passes needed */
int scan_number; /* current index in scan_info[] */
/*
* This is here so we can add libjpeg-turbo version/build information to the
* global string table without introducing a new global symbol. Adding this
* information to the global string table allows one to examine a binary
* object and determine which version of libjpeg-turbo it was built from or
* linked against.
*/
const char *jpeg_version;
} my_comp_master;
typedef my_comp_master *my_master_ptr;
/*
* Support routines that do various essential calculations.
*/
#if JPEG_LIB_VERSION >= 70
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions(j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
}
#endif
LOCAL(void)
initial_setup(j_compress_ptr cinfo, boolean transcode_only)
/* Do computations that are needed before master selection phase */
{
int ci;
jpeg_component_info *compptr;
long samplesperrow;
JDIMENSION jd_samplesperrow;
#if JPEG_LIB_VERSION >= 70
#if JPEG_LIB_VERSION >= 80
if (!transcode_only)
#endif
jpeg_calc_jpeg_dimensions(cinfo);
#endif
/* Sanity check on image dimensions */
if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0 ||
cinfo->num_components <= 0 || cinfo->input_components <= 0)
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
/* Make sure image isn't bigger than I can handle */
if ((long)cinfo->_jpeg_height > (long)JPEG_MAX_DIMENSION ||
(long)cinfo->_jpeg_width > (long)JPEG_MAX_DIMENSION)
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)JPEG_MAX_DIMENSION);
/* Width of an input scanline must be representable as JDIMENSION. */
samplesperrow = (long)cinfo->image_width * (long)cinfo->input_components;
jd_samplesperrow = (JDIMENSION)samplesperrow;
if ((long)jd_samplesperrow != samplesperrow)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
/* For now, precision must match compiled-in value... */
if (cinfo->data_precision != BITS_IN_JSAMPLE)
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
/* Check that number of components won't exceed internal array sizes */
if (cinfo->num_components > MAX_COMPONENTS)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPONENTS);
/* Compute maximum sampling factors; check factor validity */
cinfo->max_h_samp_factor = 1;
cinfo->max_v_samp_factor = 1;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (compptr->h_samp_factor <= 0 ||
compptr->h_samp_factor > MAX_SAMP_FACTOR ||
compptr->v_samp_factor <= 0 ||
compptr->v_samp_factor > MAX_SAMP_FACTOR)
ERREXIT(cinfo, JERR_BAD_SAMPLING);
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
compptr->h_samp_factor);
cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
compptr->v_samp_factor);
}
/* Compute dimensions of components */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Fill in the correct component_index value; don't rely on application */
compptr->component_index = ci;
/* For compression, we never do DCT scaling. */
#if JPEG_LIB_VERSION >= 70
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;
#else
compptr->DCT_scaled_size = DCTSIZE;
#endif
/* Size in DCT blocks */
compptr->width_in_blocks = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_width * (long)compptr->h_samp_factor,
(long)(cinfo->max_h_samp_factor * DCTSIZE));
compptr->height_in_blocks = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_height * (long)compptr->v_samp_factor,
(long)(cinfo->max_v_samp_factor * DCTSIZE));
/* Size in samples */
compptr->downsampled_width = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_width * (long)compptr->h_samp_factor,
(long)cinfo->max_h_samp_factor);
compptr->downsampled_height = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_height * (long)compptr->v_samp_factor,
(long)cinfo->max_v_samp_factor);
/* Mark component needed (this flag isn't actually used for compression) */
compptr->component_needed = TRUE;
}
/* Compute number of fully interleaved MCU rows (number of times that
* main controller will call coefficient controller).
*/
cinfo->total_iMCU_rows = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_height,
(long)(cinfo->max_v_samp_factor * DCTSIZE));
}
#ifdef C_MULTISCAN_FILES_SUPPORTED
LOCAL(void)
validate_script(j_compress_ptr cinfo)
/* Verify that the scan script in cinfo->scan_info[] is valid; also
* determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
*/
{
const jpeg_scan_info *scanptr;
int scanno, ncomps, ci, coefi, thisi;
int Ss, Se, Ah, Al;
boolean component_sent[MAX_COMPONENTS];
#ifdef C_PROGRESSIVE_SUPPORTED
int *last_bitpos_ptr;
int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
/* -1 until that coefficient has been seen; then last Al for it */
#endif
if (cinfo->num_scans <= 0)
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
/* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
* for progressive JPEG, no scan can have this.
*/
scanptr = cinfo->scan_info;
if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2 - 1) {
#ifdef C_PROGRESSIVE_SUPPORTED
cinfo->progressive_mode = TRUE;
last_bitpos_ptr = &last_bitpos[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (coefi = 0; coefi < DCTSIZE2; coefi++)
*last_bitpos_ptr++ = -1;
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else {
cinfo->progressive_mode = FALSE;
for (ci = 0; ci < cinfo->num_components; ci++)
component_sent[ci] = FALSE;
}
for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
/* Validate component indexes */
ncomps = scanptr->comps_in_scan;
if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
for (ci = 0; ci < ncomps; ci++) {
thisi = scanptr->component_index[ci];
if (thisi < 0 || thisi >= cinfo->num_components)
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
/* Components must appear in SOF order within each scan */
if (ci > 0 && thisi <= scanptr->component_index[ci - 1])
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
}
/* Validate progression parameters */
Ss = scanptr->Ss;
Se = scanptr->Se;
Ah = scanptr->Ah;
Al = scanptr->Al;
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
/* Rec. ITU-T T.81 | ISO/IEC 10918-1 simply gives the ranges 0..13 for Ah
* and Al, but that seems wrong: the upper bound ought to depend on data
* precision. Perhaps they really meant 0..N+1 for N-bit precision.
* Here we allow 0..10 for 8-bit data; Al larger than 10 results in
* out-of-range reconstructed DC values during the first DC scan,
* which might cause problems for some decoders.
*/
#if BITS_IN_JSAMPLE == 8
#define MAX_AH_AL 10
#else
#define MAX_AH_AL 13
#endif
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (Ss == 0) {
if (Se != 0) /* DC and AC together not OK */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
} else {
if (ncomps != 1) /* AC scans must be for only one component */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
}
for (ci = 0; ci < ncomps; ci++) {
last_bitpos_ptr = &last_bitpos[scanptr->component_index[ci]][0];
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
for (coefi = Ss; coefi <= Se; coefi++) {
if (last_bitpos_ptr[coefi] < 0) {
/* first scan of this coefficient */
if (Ah != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
} else {
/* not first scan */
if (Ah != last_bitpos_ptr[coefi] || Al != Ah - 1)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
}
last_bitpos_ptr[coefi] = Al;
}
}
#endif
} else {
/* For sequential JPEG, all progression parameters must be these: */
if (Ss != 0 || Se != DCTSIZE2 - 1 || Ah != 0 || Al != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
/* Make sure components are not sent twice */
for (ci = 0; ci < ncomps; ci++) {
thisi = scanptr->component_index[ci];
if (component_sent[thisi])
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
component_sent[thisi] = TRUE;
}
}
}
/* Now verify that everything got sent. */
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
/* For progressive mode, we only check that at least some DC data
* got sent for each component; the spec does not require that all bits
* of all coefficients be transmitted. Would it be wiser to enforce
* transmission of all coefficient bits??
*/
for (ci = 0; ci < cinfo->num_components; ci++) {
if (last_bitpos[ci][0] < 0)
ERREXIT(cinfo, JERR_MISSING_DATA);
}
#endif
} else {
for (ci = 0; ci < cinfo->num_components; ci++) {
if (!component_sent[ci])
ERREXIT(cinfo, JERR_MISSING_DATA);
}
}
}
#endif /* C_MULTISCAN_FILES_SUPPORTED */
LOCAL(void)
select_scan_parameters(j_compress_ptr cinfo)
/* Set up the scan parameters for the current scan */
{
int ci;
#ifdef C_MULTISCAN_FILES_SUPPORTED
if (cinfo->scan_info != NULL) {
/* Prepare for current scan --- the script is already validated */
my_master_ptr master = (my_master_ptr)cinfo->master;
const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number;
cinfo->comps_in_scan = scanptr->comps_in_scan;
for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
cinfo->cur_comp_info[ci] =
&cinfo->comp_info[scanptr->component_index[ci]];
}
cinfo->Ss = scanptr->Ss;
cinfo->Se = scanptr->Se;
cinfo->Ah = scanptr->Ah;
cinfo->Al = scanptr->Al;
} else
#endif
{
/* Prepare for single sequential-JPEG scan containing all components */
if (cinfo->num_components > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPS_IN_SCAN);
cinfo->comps_in_scan = cinfo->num_components;
for (ci = 0; ci < cinfo->num_components; ci++) {
cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
}
cinfo->Ss = 0;
cinfo->Se = DCTSIZE2 - 1;
cinfo->Ah = 0;
cinfo->Al = 0;
}
}
LOCAL(void)
per_scan_setup(j_compress_ptr cinfo)
/* Do computations that are needed before processing a JPEG scan */
/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
{
int ci, mcublks, tmp;
jpeg_component_info *compptr;
if (cinfo->comps_in_scan == 1) {
/* Noninterleaved (single-component) scan */
compptr = cinfo->cur_comp_info[0];
/* Overall image size in MCUs */
cinfo->MCUs_per_row = compptr->width_in_blocks;
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
/* For noninterleaved scan, always one block per MCU */
compptr->MCU_width = 1;
compptr->MCU_height = 1;
compptr->MCU_blocks = 1;
compptr->MCU_sample_width = DCTSIZE;
compptr->last_col_width = 1;
/* For noninterleaved scans, it is convenient to define last_row_height
* as the number of block rows present in the last iMCU row.
*/
tmp = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
if (tmp == 0) tmp = compptr->v_samp_factor;
compptr->last_row_height = tmp;
/* Prepare array describing MCU composition */
cinfo->blocks_in_MCU = 1;
cinfo->MCU_membership[0] = 0;
} else {
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_width,
(long)(cinfo->max_h_samp_factor * DCTSIZE));
cinfo->MCU_rows_in_scan = (JDIMENSION)
jdiv_round_up((long)cinfo->_jpeg_height,
(long)(cinfo->max_v_samp_factor * DCTSIZE));
cinfo->blocks_in_MCU = 0;
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Sampling factors give # of blocks of component in each MCU */
compptr->MCU_width = compptr->h_samp_factor;
compptr->MCU_height = compptr->v_samp_factor;
compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
/* Figure number of non-dummy blocks in last MCU column & row */
tmp = (int)(compptr->width_in_blocks % compptr->MCU_width);
if (tmp == 0) tmp = compptr->MCU_width;
compptr->last_col_width = tmp;
tmp = (int)(compptr->height_in_blocks % compptr->MCU_height);
if (tmp == 0) tmp = compptr->MCU_height;
compptr->last_row_height = tmp;
/* Prepare array describing MCU composition */
mcublks = compptr->MCU_blocks;
if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
while (mcublks-- > 0) {
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
}
/* Convert restart specified in rows to actual MCU count. */
/* Note that count must fit in 16 bits, so we provide limiting. */
if (cinfo->restart_in_rows > 0) {
long nominal = (long)cinfo->restart_in_rows * (long)cinfo->MCUs_per_row;
cinfo->restart_interval = (unsigned int)MIN(nominal, 65535L);
}
}
/*
* Per-pass setup.
* This is called at the beginning of each pass. We determine which modules
* will be active during this pass and give them appropriate start_pass calls.
* We also set is_last_pass to indicate whether any more passes will be
* required.
*/
METHODDEF(void)
prepare_for_pass(j_compress_ptr cinfo)
{
my_master_ptr master = (my_master_ptr)cinfo->master;
switch (master->pass_type) {
case main_pass:
/* Initial pass: will collect input data, and do either Huffman
* optimization or data output for the first scan.
*/
select_scan_parameters(cinfo);
per_scan_setup(cinfo);
if (!cinfo->raw_data_in) {
(*cinfo->cconvert->start_pass) (cinfo);
(*cinfo->downsample->start_pass) (cinfo);
(*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
}
(*cinfo->fdct->start_pass) (cinfo);
(*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
(*cinfo->coef->start_pass) (cinfo,
(master->total_passes > 1 ?
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
(*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
if (cinfo->optimize_coding) {
/* No immediate data output; postpone writing frame/scan headers */
master->pub.call_pass_startup = FALSE;
} else {
/* Will write frame/scan headers at first jpeg_write_scanlines call */
master->pub.call_pass_startup = TRUE;
}
break;
#ifdef ENTROPY_OPT_SUPPORTED
case huff_opt_pass:
/* Do Huffman optimization for a scan after the first one. */
select_scan_parameters(cinfo);
per_scan_setup(cinfo);
if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
(*cinfo->entropy->start_pass) (cinfo, TRUE);
(*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
master->pub.call_pass_startup = FALSE;
break;
}
/* Special case: Huffman DC refinement scans need no Huffman table
* and therefore we can skip the optimization pass for them.
*/
master->pass_type = output_pass;
master->pass_number++;
/*FALLTHROUGH*/
#endif
case output_pass:
/* Do a data-output pass. */
/* We need not repeat per-scan setup if prior optimization pass did it. */
if (!cinfo->optimize_coding) {
select_scan_parameters(cinfo);
per_scan_setup(cinfo);
}
(*cinfo->entropy->start_pass) (cinfo, FALSE);
(*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
/* We emit frame/scan headers now */
if (master->scan_number == 0)
(*cinfo->marker->write_frame_header) (cinfo);
(*cinfo->marker->write_scan_header) (cinfo);
master->pub.call_pass_startup = FALSE;
break;
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
}
master->pub.is_last_pass = (master->pass_number == master->total_passes - 1);
/* Set up progress monitor's pass info if present */
if (cinfo->progress != NULL) {
cinfo->progress->completed_passes = master->pass_number;
cinfo->progress->total_passes = master->total_passes;
}
}
/*
* Special start-of-pass hook.
* This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
* In single-pass processing, we need this hook because we don't want to
* write frame/scan headers during jpeg_start_compress; we want to let the
* application write COM markers etc. between jpeg_start_compress and the
* jpeg_write_scanlines loop.
* In multi-pass processing, this routine is not used.
*/
METHODDEF(void)
pass_startup(j_compress_ptr cinfo)
{
cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
(*cinfo->marker->write_frame_header) (cinfo);
(*cinfo->marker->write_scan_header) (cinfo);
}
/*
* Finish up at end of pass.
*/
METHODDEF(void)
finish_pass_master(j_compress_ptr cinfo)
{
my_master_ptr master = (my_master_ptr)cinfo->master;
/* The entropy coder always needs an end-of-pass call,
* either to analyze statistics or to flush its output buffer.
*/
(*cinfo->entropy->finish_pass) (cinfo);
/* Update state for next pass */
switch (master->pass_type) {
case main_pass:
/* next pass is either output of scan 0 (after optimization)
* or output of scan 1 (if no optimization).
*/
master->pass_type = output_pass;
if (!cinfo->optimize_coding)
master->scan_number++;
break;
case huff_opt_pass:
/* next pass is always output of current scan */
master->pass_type = output_pass;
break;
case output_pass:
/* next pass is either optimization or output of next scan */
if (cinfo->optimize_coding)
master->pass_type = huff_opt_pass;
master->scan_number++;
break;
}
master->pass_number++;
}
/*
* Initialize master compression control.
*/
GLOBAL(void)
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));
cinfo->master = (struct jpeg_comp_master *)master;
master->pub.prepare_for_pass = prepare_for_pass;
master->pub.pass_startup = pass_startup;
master->pub.finish_pass = finish_pass_master;
master->pub.is_last_pass = FALSE;
/* Validate parameters, determine derived values */
initial_setup(cinfo, transcode_only);
if (cinfo->scan_info != NULL) {
#ifdef C_MULTISCAN_FILES_SUPPORTED
validate_script(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else {
cinfo->progressive_mode = FALSE;
cinfo->num_scans = 1;
}
if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */
cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
/* Initialize my private state */
if (transcode_only) {
/* no main pass in transcoding */
if (cinfo->optimize_coding)
master->pass_type = huff_opt_pass;
else
master->pass_type = output_pass;
} else {
/* for normal compression, first pass is always this type: */
master->pass_type = main_pass;
}
master->scan_number = 0;
master->pass_number = 0;
if (cinfo->optimize_coding)
master->total_passes = cinfo->num_scans * 2;
else
master->total_passes = cinfo->num_scans;
master->jpeg_version = PACKAGE_NAME " version " VERSION " (build " BUILD ")";
}
+109
View File
@@ -0,0 +1,109 @@
/*
* jcomapi.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains application interface routines that are used for both
* compression and decompression.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/*
* Abort processing of a JPEG compression or decompression operation,
* but don't destroy the object itself.
*
* For this, we merely clean up all the nonpermanent memory pools.
* Note that temp files (virtual arrays) are not allowed to belong to
* the permanent pool, so we will be able to close all temp files here.
* Closing a data source or destination, if necessary, is the application's
* responsibility.
*/
GLOBAL(void)
jpeg_abort(j_common_ptr cinfo)
{
int pool;
/* Do nothing if called on a not-initialized or destroyed JPEG object. */
if (cinfo->mem == NULL)
return;
/* Releasing pools in reverse order might help avoid fragmentation
* with some (brain-damaged) malloc libraries.
*/
for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) {
(*cinfo->mem->free_pool) (cinfo, pool);
}
/* Reset overall state for possible reuse of object */
if (cinfo->is_decompressor) {
cinfo->global_state = DSTATE_START;
/* Try to keep application from accessing now-deleted marker list.
* A bit kludgy to do it here, but this is the most central place.
*/
((j_decompress_ptr)cinfo)->marker_list = NULL;
} else {
cinfo->global_state = CSTATE_START;
}
}
/*
* Destruction of a JPEG object.
*
* Everything gets deallocated except the master jpeg_compress_struct itself
* and the error manager struct. Both of these are supplied by the application
* and must be freed, if necessary, by the application. (Often they are on
* the stack and so don't need to be freed anyway.)
* Closing a data source or destination, if necessary, is the application's
* responsibility.
*/
GLOBAL(void)
jpeg_destroy(j_common_ptr cinfo)
{
/* We need only tell the memory manager to release everything. */
/* NB: mem pointer is NULL if memory mgr failed to initialize. */
if (cinfo->mem != NULL)
(*cinfo->mem->self_destruct) (cinfo);
cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
cinfo->global_state = 0; /* mark it destroyed */
}
/*
* Convenience routines for allocating quantization and Huffman tables.
* (Would jutils.c be a more reasonable place to put these?)
*/
GLOBAL(JQUANT_TBL *)
jpeg_alloc_quant_table(j_common_ptr cinfo)
{
JQUANT_TBL *tbl;
tbl = (JQUANT_TBL *)
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL));
tbl->sent_table = FALSE; /* make sure this is false in any new table */
return tbl;
}
GLOBAL(JHUFF_TBL *)
jpeg_alloc_huff_table(j_common_ptr cinfo)
{
JHUFF_TBL *tbl;
tbl = (JHUFF_TBL *)
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL));
tbl->sent_table = FALSE; /* make sure this is false in any new table */
return tbl;
}
+541
View File
@@ -0,0 +1,541 @@
/*
* jcparam.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains optional default-setting code for the JPEG compressor.
* Applications do not have to use this file, but those that don't use it
* must know a lot more about the innards of the JPEG code.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jstdhuff.c"
/*
* Quantization table setup routines
*/
GLOBAL(void)
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table, int scale_factor,
boolean force_baseline)
/* Define a quantization table equal to the basic_table times
* a scale factor (given as a percentage).
* If force_baseline is TRUE, the computed quantization table entries
* are limited to 1..255 for JPEG baseline compatibility.
*/
{
JQUANT_TBL **qtblptr;
int i;
long temp;
/* Safety check to ensure start_compress not called yet. */
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
qtblptr = &cinfo->quant_tbl_ptrs[which_tbl];
if (*qtblptr == NULL)
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)cinfo);
for (i = 0; i < DCTSIZE2; i++) {
temp = ((long)basic_table[i] * scale_factor + 50L) / 100L;
/* limit the values to the valid range */
if (temp <= 0L) temp = 1L;
if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
if (force_baseline && temp > 255L)
temp = 255L; /* limit to baseline range if requested */
(*qtblptr)->quantval[i] = (UINT16)temp;
}
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*qtblptr)->sent_table = FALSE;
}
/* These are the sample quantization tables given in Annex K (Clause K.1) of
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
* The spec says that the values given produce "good" quality, and
* when divided by 2, "very good" quality.
*/
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
};
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
};
#if JPEG_LIB_VERSION >= 70
GLOBAL(void)
jpeg_default_qtables(j_compress_ptr cinfo, boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables
* and straight percentage-scaling quality scales.
* This entry point allows different scalings for luminance and chrominance.
*/
{
/* Set up two quantization tables using the specified scaling */
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
cinfo->q_scale_factor[0], force_baseline);
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
cinfo->q_scale_factor[1], force_baseline);
}
#endif
GLOBAL(void)
jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor,
boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables
* and a straight percentage-scaling quality scale. In most cases it's better
* to use jpeg_set_quality (below); this entry point is provided for
* applications that insist on a linear percentage scaling.
*/
{
/* Set up two quantization tables using the specified scaling */
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
scale_factor, force_baseline);
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
scale_factor, force_baseline);
}
GLOBAL(int)
jpeg_quality_scaling(int quality)
/* Convert a user-specified quality rating to a percentage scaling factor
* for an underlying quantization table, using our recommended scaling curve.
* The input 'quality' factor should be 0 (terrible) to 100 (very good).
*/
{
/* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
if (quality <= 0) quality = 1;
if (quality > 100) quality = 100;
/* The basic table is used as-is (scaling 100) for a quality of 50.
* Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
* note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
* to make all the table entries 1 (hence, minimum quantization loss).
* Qualities 1..50 are converted to scaling percentage 5000/Q.
*/
if (quality < 50)
quality = 5000 / quality;
else
quality = 200 - quality * 2;
return quality;
}
GLOBAL(void)
jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables.
* This is the standard quality-adjusting entry point for typical user
* interfaces; only those who want detailed control over quantization tables
* would use the preceding three routines directly.
*/
{
/* Convert user 0-100 rating to percentage scaling */
quality = jpeg_quality_scaling(quality);
/* Set up standard quality tables */
jpeg_set_linear_quality(cinfo, quality, force_baseline);
}
/*
* Default parameter setup for compression.
*
* Applications that don't choose to use this routine must do their
* own setup of all these parameters. Alternately, you can call this
* to establish defaults and then alter parameters selectively. This
* is the recommended approach since, if we add any new parameters,
* your code will still work (they'll be set to reasonable defaults).
*/
GLOBAL(void)
jpeg_set_defaults(j_compress_ptr cinfo)
{
int i;
/* Safety check to ensure start_compress not called yet. */
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Allocate comp_info array large enough for maximum component count.
* Array is made permanent in case application wants to compress
* multiple images at same param settings.
*/
if (cinfo->comp_info == NULL)
cinfo->comp_info = (jpeg_component_info *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
MAX_COMPONENTS * sizeof(jpeg_component_info));
/* Initialize everything not dependent on the color space */
#if JPEG_LIB_VERSION >= 70
cinfo->scale_num = 1; /* 1:1 scaling */
cinfo->scale_denom = 1;
#endif
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 */
std_huff_tables((j_common_ptr)cinfo);
/* Initialize default arithmetic coding conditioning */
for (i = 0; i < NUM_ARITH_TBLS; i++) {
cinfo->arith_dc_L[i] = 0;
cinfo->arith_dc_U[i] = 1;
cinfo->arith_ac_K[i] = 5;
}
/* Default is no multiple-scan output */
cinfo->scan_info = NULL;
cinfo->num_scans = 0;
/* Expect normal source image, not raw downsampled data */
cinfo->raw_data_in = FALSE;
/* Use Huffman coding, not arithmetic coding, by default */
cinfo->arith_code = FALSE;
/* By default, don't do extra passes to optimize entropy coding */
cinfo->optimize_coding = FALSE;
/* The standard Huffman tables are only valid for 8-bit data precision.
* If the precision is higher, force optimization on so that usable
* tables will be computed. This test can be removed if default tables
* are supplied that are valid for the desired precision.
*/
if (cinfo->data_precision > 8)
cinfo->optimize_coding = TRUE;
/* By default, use the simpler non-cosited sampling alignment */
cinfo->CCIR601_sampling = FALSE;
#if JPEG_LIB_VERSION >= 70
/* By default, apply fancy downsampling */
cinfo->do_fancy_downsampling = TRUE;
#endif
/* No input smoothing */
cinfo->smoothing_factor = 0;
/* DCT algorithm preference */
cinfo->dct_method = JDCT_DEFAULT;
/* No restart markers */
cinfo->restart_interval = 0;
cinfo->restart_in_rows = 0;
/* Fill in default JFIF marker parameters. Note that whether the marker
* will actually be written is determined by jpeg_set_colorspace.
*
* By default, the library emits JFIF version code 1.01.
* An application that wants to emit JFIF 1.02 extension markers should set
* JFIF_minor_version to 2. We could probably get away with just defaulting
* to 1.02, but there may still be some decoders in use that will complain
* about that; saying 1.01 should minimize compatibility problems.
*/
cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
cinfo->JFIF_minor_version = 1;
cinfo->density_unit = 0; /* Pixel size is unknown by default */
cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
cinfo->Y_density = 1;
/* Choose JPEG colorspace based on input space, set defaults accordingly */
jpeg_default_colorspace(cinfo);
}
/*
* Select an appropriate JPEG colorspace for in_color_space.
*/
GLOBAL(void)
jpeg_default_colorspace(j_compress_ptr cinfo)
{
switch (cinfo->in_color_space) {
case JCS_GRAYSCALE:
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
break;
case JCS_RGB:
case JCS_EXT_RGB:
case JCS_EXT_RGBX:
case JCS_EXT_BGR:
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
jpeg_set_colorspace(cinfo, JCS_YCbCr);
break;
case JCS_YCbCr:
jpeg_set_colorspace(cinfo, JCS_YCbCr);
break;
case JCS_CMYK:
jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
break;
case JCS_YCCK:
jpeg_set_colorspace(cinfo, JCS_YCCK);
break;
case JCS_UNKNOWN:
jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
break;
default:
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
}
}
/*
* Set the JPEG colorspace, and choose colorspace-dependent default values.
*/
GLOBAL(void)
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
{
jpeg_component_info *compptr;
int ci;
#define SET_COMP(index, id, hsamp, vsamp, quant, dctbl, actbl) \
(compptr = &cinfo->comp_info[index], \
compptr->component_id = (id), \
compptr->h_samp_factor = (hsamp), \
compptr->v_samp_factor = (vsamp), \
compptr->quant_tbl_no = (quant), \
compptr->dc_tbl_no = (dctbl), \
compptr->ac_tbl_no = (actbl) )
/* Safety check to ensure start_compress not called yet. */
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* For all colorspaces, we use Q and Huff tables 0 for luminance components,
* tables 1 for chrominance components.
*/
cinfo->jpeg_color_space = colorspace;
cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
switch (colorspace) {
case JCS_GRAYSCALE:
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
cinfo->num_components = 1;
/* JFIF specifies component ID 1 */
SET_COMP(0, 1, 1, 1, 0, 0, 0);
break;
case JCS_RGB:
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
cinfo->num_components = 3;
SET_COMP(0, 0x52 /* 'R' */, 1, 1, 0, 0, 0);
SET_COMP(1, 0x47 /* 'G' */, 1, 1, 0, 0, 0);
SET_COMP(2, 0x42 /* 'B' */, 1, 1, 0, 0, 0);
break;
case JCS_YCbCr:
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
cinfo->num_components = 3;
/* JFIF specifies component IDs 1,2,3 */
/* We default to 2x2 subsamples of chrominance */
SET_COMP(0, 1, 2, 2, 0, 0, 0);
SET_COMP(1, 2, 1, 1, 1, 1, 1);
SET_COMP(2, 3, 1, 1, 1, 1, 1);
break;
case JCS_CMYK:
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
cinfo->num_components = 4;
SET_COMP(0, 0x43 /* 'C' */, 1, 1, 0, 0, 0);
SET_COMP(1, 0x4D /* 'M' */, 1, 1, 0, 0, 0);
SET_COMP(2, 0x59 /* 'Y' */, 1, 1, 0, 0, 0);
SET_COMP(3, 0x4B /* 'K' */, 1, 1, 0, 0, 0);
break;
case JCS_YCCK:
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
cinfo->num_components = 4;
SET_COMP(0, 1, 2, 2, 0, 0, 0);
SET_COMP(1, 2, 1, 1, 1, 1, 1);
SET_COMP(2, 3, 1, 1, 1, 1, 1);
SET_COMP(3, 4, 2, 2, 0, 0, 0);
break;
case JCS_UNKNOWN:
cinfo->num_components = cinfo->input_components;
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPONENTS);
for (ci = 0; ci < cinfo->num_components; ci++) {
SET_COMP(ci, ci, 1, 1, 0, 0, 0);
}
break;
default:
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
}
}
#ifdef C_PROGRESSIVE_SUPPORTED
LOCAL(jpeg_scan_info *)
fill_a_scan(jpeg_scan_info *scanptr, int ci, int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for specified component */
{
scanptr->comps_in_scan = 1;
scanptr->component_index[0] = ci;
scanptr->Ss = Ss;
scanptr->Se = Se;
scanptr->Ah = Ah;
scanptr->Al = Al;
scanptr++;
return scanptr;
}
LOCAL(jpeg_scan_info *)
fill_scans(jpeg_scan_info *scanptr, int ncomps, int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for each component */
{
int ci;
for (ci = 0; ci < ncomps; ci++) {
scanptr->comps_in_scan = 1;
scanptr->component_index[0] = ci;
scanptr->Ss = Ss;
scanptr->Se = Se;
scanptr->Ah = Ah;
scanptr->Al = Al;
scanptr++;
}
return scanptr;
}
LOCAL(jpeg_scan_info *)
fill_dc_scans(jpeg_scan_info *scanptr, int ncomps, int Ah, int Al)
/* Support routine: generate interleaved DC scan if possible, else N scans */
{
int ci;
if (ncomps <= MAX_COMPS_IN_SCAN) {
/* Single interleaved DC scan */
scanptr->comps_in_scan = ncomps;
for (ci = 0; ci < ncomps; ci++)
scanptr->component_index[ci] = ci;
scanptr->Ss = scanptr->Se = 0;
scanptr->Ah = Ah;
scanptr->Al = Al;
scanptr++;
} else {
/* Noninterleaved DC scan for each component */
scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
}
return scanptr;
}
/*
* Create a recommended progressive-JPEG script.
* cinfo->num_components and cinfo->jpeg_color_space must be correct.
*/
GLOBAL(void)
jpeg_simple_progression(j_compress_ptr cinfo)
{
int ncomps = cinfo->num_components;
int nscans;
jpeg_scan_info *scanptr;
/* Safety check to ensure start_compress not called yet. */
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Figure space needed for script. Calculation must match code below! */
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
/* Custom script for YCbCr color images. */
nscans = 10;
} else {
/* All-purpose script for other color spaces. */
if (ncomps > MAX_COMPS_IN_SCAN)
nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
else
nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
}
/* Allocate space for script.
* We need to put it in the permanent pool in case the application performs
* multiple compressions without changing the settings. To avoid a memory
* leak if jpeg_simple_progression is called repeatedly for the same JPEG
* object, we try to re-use previously allocated space, and we allocate
* enough space to handle YCbCr even if initially asked for grayscale.
*/
if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
cinfo->script_space_size = MAX(nscans, 10);
cinfo->script_space = (jpeg_scan_info *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
cinfo->script_space_size * sizeof(jpeg_scan_info));
}
scanptr = cinfo->script_space;
cinfo->scan_info = scanptr;
cinfo->num_scans = nscans;
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
/* Custom script for YCbCr color images. */
/* Initial DC scan */
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
/* Initial AC scan: get some luma data out in a hurry */
scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
/* Chroma data is too small to be worth expending many scans on */
scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
/* Complete spectral selection for luma AC */
scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
/* Refine next bit of luma AC */
scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
/* Finish DC successive approximation */
scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
/* Finish AC successive approximation */
scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
/* Luma bottom bit comes last since it's usually largest scan */
scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
} else {
/* All-purpose script for other color spaces. */
/* Successive approximation first pass */
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
/* Successive approximation second pass */
scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
/* Successive approximation final pass */
scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
}
}
#endif /* C_PROGRESSIVE_SUPPORTED */
File diff suppressed because it is too large Load Diff
+351
View File
@@ -0,0 +1,351 @@
/*
* jcprepct.c
*
* This file is part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant
* to libjpeg-turbo.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains the compression preprocessing controller.
* This controller manages the color conversion, downsampling,
* and edge expansion steps.
*
* Most of the complexity here is associated with buffering input rows
* as required by the downsampler. See the comments at the head of
* jcsample.c for the downsampler's needs.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* At present, jcsample.c can request context rows only for smoothing.
* In the future, we might also need context rows for CCIR601 sampling
* or other more-complex downsampling procedures. The code to support
* context rows should be compiled only if needed.
*/
#ifdef INPUT_SMOOTHING_SUPPORTED
#define CONTEXT_ROWS_SUPPORTED
#endif
/*
* For the simple (no-context-row) case, we just need to buffer one
* row group's worth of pixels for the downsampling step. At the bottom of
* the image, we pad to a full row group by replicating the last pixel row.
* The downsampler's last output row is then replicated if needed to pad
* out to a full iMCU row.
*
* When providing context rows, we must buffer three row groups' worth of
* pixels. Three row groups are physically allocated, but the row pointer
* arrays are made five row groups high, with the extra pointers above and
* below "wrapping around" to point to the last and first real row groups.
* This allows the downsampler to access the proper context rows.
* At the top and bottom of the image, we create dummy context rows by
* copying the first or last real pixel row. This copying could be avoided
* by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
* trouble on the compression side.
*/
/* Private buffer controller object */
typedef struct {
struct jpeg_c_prep_controller pub; /* public fields */
/* Downsampling input buffer. This buffer holds color-converted data
* until we have enough to do a downsample step.
*/
JSAMPARRAY color_buf[MAX_COMPONENTS];
JDIMENSION rows_to_go; /* counts rows remaining in source image */
int next_buf_row; /* index of next row to store in color_buf */
#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */
int this_row_group; /* starting row index of group to process */
int next_buf_stop; /* downsample when we reach this index */
#endif
} my_prep_controller;
typedef my_prep_controller *my_prep_ptr;
/*
* Initialize for a processing pass.
*/
METHODDEF(void)
start_pass_prep(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
if (pass_mode != JBUF_PASS_THRU)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
/* Initialize total-height counter for detecting bottom of image */
prep->rows_to_go = cinfo->image_height;
/* Mark the conversion buffer empty */
prep->next_buf_row = 0;
#ifdef CONTEXT_ROWS_SUPPORTED
/* Preset additional state variables for context mode.
* These aren't used in non-context mode, so we needn't test which mode.
*/
prep->this_row_group = 0;
/* Set next_buf_stop to stop after two row groups have been read in. */
prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
#endif
}
/*
* Expand an image vertically from height input_rows to height output_rows,
* by duplicating the bottom row.
*/
LOCAL(void)
expand_bottom_edge(JSAMPARRAY image_data, JDIMENSION num_cols, int input_rows,
int output_rows)
{
register int row;
for (row = input_rows; row < output_rows; row++) {
jcopy_sample_rows(image_data, input_rows - 1, image_data, row, 1,
num_cols);
}
}
/*
* Process some data in the simple no-context case.
*
* Preprocessor output data is counted in "row groups". A row group
* is defined to be v_samp_factor sample rows of each component.
* Downsampling will produce this much data from each max_v_samp_factor
* input rows.
*/
METHODDEF(void)
pre_process_data(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
{
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
int numrows, ci;
JDIMENSION inrows;
jpeg_component_info *compptr;
while (*in_row_ctr < in_rows_avail &&
*out_row_group_ctr < out_row_groups_avail) {
/* Do color conversion to fill the conversion buffer. */
inrows = in_rows_avail - *in_row_ctr;
numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
numrows = (int)MIN((JDIMENSION)numrows, inrows);
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
prep->color_buf,
(JDIMENSION)prep->next_buf_row,
numrows);
*in_row_ctr += numrows;
prep->next_buf_row += numrows;
prep->rows_to_go -= numrows;
/* If at bottom of image, pad to fill the conversion buffer. */
if (prep->rows_to_go == 0 &&
prep->next_buf_row < cinfo->max_v_samp_factor) {
for (ci = 0; ci < cinfo->num_components; ci++) {
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, cinfo->max_v_samp_factor);
}
prep->next_buf_row = cinfo->max_v_samp_factor;
}
/* If we've filled the conversion buffer, empty it. */
if (prep->next_buf_row == cinfo->max_v_samp_factor) {
(*cinfo->downsample->downsample) (cinfo,
prep->color_buf, (JDIMENSION)0,
output_buf, *out_row_group_ctr);
prep->next_buf_row = 0;
(*out_row_group_ctr)++;
}
/* If at bottom of image, pad the output to a full iMCU height.
* Note we assume the caller is providing a one-iMCU-height output buffer!
*/
if (prep->rows_to_go == 0 && *out_row_group_ctr < out_row_groups_avail) {
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
expand_bottom_edge(output_buf[ci], compptr->width_in_blocks * DCTSIZE,
(int)(*out_row_group_ctr * compptr->v_samp_factor),
(int)(out_row_groups_avail * compptr->v_samp_factor));
}
*out_row_group_ctr = out_row_groups_avail;
break; /* can exit outer loop without test */
}
}
}
#ifdef CONTEXT_ROWS_SUPPORTED
/*
* Process some data in the context case.
*/
METHODDEF(void)
pre_process_context(j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
{
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
int numrows, ci;
int buf_height = cinfo->max_v_samp_factor * 3;
JDIMENSION inrows;
while (*out_row_group_ctr < out_row_groups_avail) {
if (*in_row_ctr < in_rows_avail) {
/* Do color conversion to fill the conversion buffer. */
inrows = in_rows_avail - *in_row_ctr;
numrows = prep->next_buf_stop - prep->next_buf_row;
numrows = (int)MIN((JDIMENSION)numrows, inrows);
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
prep->color_buf,
(JDIMENSION)prep->next_buf_row,
numrows);
/* Pad at top of image, if first time through */
if (prep->rows_to_go == cinfo->image_height) {
for (ci = 0; ci < cinfo->num_components; ci++) {
int row;
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
jcopy_sample_rows(prep->color_buf[ci], 0, prep->color_buf[ci],
-row, 1, cinfo->image_width);
}
}
}
*in_row_ctr += numrows;
prep->next_buf_row += numrows;
prep->rows_to_go -= numrows;
} else {
/* Return for more data, unless we are at the bottom of the image. */
if (prep->rows_to_go != 0)
break;
/* When at bottom of image, pad to fill the conversion buffer. */
if (prep->next_buf_row < prep->next_buf_stop) {
for (ci = 0; ci < cinfo->num_components; ci++) {
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, prep->next_buf_stop);
}
prep->next_buf_row = prep->next_buf_stop;
}
}
/* If we've gotten enough data, downsample a row group. */
if (prep->next_buf_row == prep->next_buf_stop) {
(*cinfo->downsample->downsample) (cinfo, prep->color_buf,
(JDIMENSION)prep->this_row_group,
output_buf, *out_row_group_ctr);
(*out_row_group_ctr)++;
/* Advance pointers with wraparound as necessary. */
prep->this_row_group += cinfo->max_v_samp_factor;
if (prep->this_row_group >= buf_height)
prep->this_row_group = 0;
if (prep->next_buf_row >= buf_height)
prep->next_buf_row = 0;
prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
}
}
}
/*
* Create the wrapped-around downsampling input buffer needed for context mode.
*/
LOCAL(void)
create_context_buffer(j_compress_ptr cinfo)
{
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
int rgroup_height = cinfo->max_v_samp_factor;
int ci, i;
jpeg_component_info *compptr;
JSAMPARRAY true_buffer, fake_buffer;
/* Grab enough space for fake row pointers for all the components;
* we need five row groups' worth of pointers for each component.
*/
fake_buffer = (JSAMPARRAY)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(cinfo->num_components * 5 * rgroup_height) *
sizeof(JSAMPROW));
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Allocate the actual buffer space (3 row groups) for this component.
* We make the buffer wide enough to allow the downsampler to edge-expand
* horizontally within the buffer, if it so chooses.
*/
true_buffer = (*cinfo->mem->alloc_sarray)
((j_common_ptr)cinfo, JPOOL_IMAGE,
(JDIMENSION)(((long)compptr->width_in_blocks * DCTSIZE *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION)(3 * rgroup_height));
/* Copy true buffer row pointers into the middle of the fake row array */
MEMCOPY(fake_buffer + rgroup_height, true_buffer,
3 * rgroup_height * sizeof(JSAMPROW));
/* Fill in the above and below wraparound pointers */
for (i = 0; i < rgroup_height; i++) {
fake_buffer[i] = true_buffer[2 * rgroup_height + i];
fake_buffer[4 * rgroup_height + i] = true_buffer[i];
}
prep->color_buf[ci] = fake_buffer + rgroup_height;
fake_buffer += 5 * rgroup_height; /* point to space for next component */
}
}
#endif /* CONTEXT_ROWS_SUPPORTED */
/*
* Initialize preprocessing controller.
*/
GLOBAL(void)
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
{
my_prep_ptr prep;
int ci;
jpeg_component_info *compptr;
if (need_full_buffer) /* safety check */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
prep = (my_prep_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_prep_controller));
cinfo->prep = (struct jpeg_c_prep_controller *)prep;
prep->pub.start_pass = start_pass_prep;
/* Allocate the color conversion buffer.
* We make the buffer wide enough to allow the downsampler to edge-expand
* horizontally within the buffer, if it so chooses.
*/
if (cinfo->downsample->need_context_rows) {
/* Set up to provide context rows */
#ifdef CONTEXT_ROWS_SUPPORTED
prep->pub.pre_process_data = pre_process_context;
create_context_buffer(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else {
/* No context, just make it tall enough for one row group */
prep->pub.pre_process_data = pre_process_data;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr)cinfo, JPOOL_IMAGE,
(JDIMENSION)(((long)compptr->width_in_blocks * DCTSIZE *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION)cinfo->max_v_samp_factor);
}
}
}
+539
View File
@@ -0,0 +1,539 @@
/*
* jcsample.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* 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.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains downsampling routines.
*
* Downsampling input data is counted in "row groups". A row group
* is defined to be max_v_samp_factor pixel rows of each component,
* from which the downsampler produces v_samp_factor sample rows.
* A single row group is processed in each call to the downsampler module.
*
* The downsampler is responsible for edge-expansion of its output data
* to fill an integral number of DCT blocks horizontally. The source buffer
* may be modified if it is helpful for this purpose (the source buffer is
* allocated wide enough to correspond to the desired output width).
* The caller (the prep controller) is responsible for vertical padding.
*
* The downsampler may request "context rows" by setting need_context_rows
* during startup. In this case, the input arrays will contain at least
* one row group's worth of pixels above and below the passed-in data;
* the caller will create dummy rows at image top and bottom by replicating
* the first or last real pixel row.
*
* An excellent reference for image resampling is
* Digital Image Warping, George Wolberg, 1990.
* Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
*
* The downsampling algorithm used here is a simple average of the source
* pixels covered by the output pixel. The hi-falutin sampling literature
* refers to this as a "box filter". In general the characteristics of a box
* filter are not very good, but for the specific cases we normally use (1:1
* and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
* nearly so bad. If you intend to use other sampling ratios, you'd be well
* advised to improve this code.
*
* A simple input-smoothing capability is provided. This is mainly intended
* for cleaning up color-dithered GIF input files (if you find it inadequate,
* we suggest using an external filtering program such as pnmconvol). When
* enabled, each input pixel P is replaced by a weighted sum of itself and its
* eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF,
* where SF = (smoothing_factor / 1024).
* Currently, smoothing is only supported for 2h2v sampling factors.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
/* Pointer to routine to downsample a single component */
typedef void (*downsample1_ptr) (j_compress_ptr cinfo,
jpeg_component_info *compptr,
JSAMPARRAY input_data,
JSAMPARRAY output_data);
/* Private subobject */
typedef struct {
struct jpeg_downsampler pub; /* public fields */
/* Downsampling method pointers, one per component */
downsample1_ptr methods[MAX_COMPONENTS];
} my_downsampler;
typedef my_downsampler *my_downsample_ptr;
/*
* Initialize for a downsampling pass.
*/
METHODDEF(void)
start_pass_downsample(j_compress_ptr cinfo)
{
/* no work for now */
}
/*
* Expand a component horizontally from width input_cols to width output_cols,
* by duplicating the rightmost samples.
*/
LOCAL(void)
expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
JDIMENSION output_cols)
{
register JSAMPROW ptr;
register JSAMPLE pixval;
register int count;
int row;
int numcols = (int)(output_cols - 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 */
for (count = numcols; count > 0; count--)
*ptr++ = pixval;
}
}
}
/*
* Do downsampling for a whole row group (all components).
*
* In this version we simply downsample each component independently.
*/
METHODDEF(void)
sep_downsample(j_compress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index)
{
my_downsample_ptr downsample = (my_downsample_ptr)cinfo->downsample;
int ci;
jpeg_component_info *compptr;
JSAMPARRAY in_ptr, out_ptr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
in_ptr = input_buf[ci] + in_row_index;
out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
(*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
}
}
/*
* Downsample pixel values of a single component.
* One row group is processed per call.
* This version handles arbitrary integral sampling ratios, without smoothing.
* Note that this version is not actually used for customary sampling ratios.
*/
METHODDEF(void)
int_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JSAMPROW inptr, outptr;
JLONG outvalue;
h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
numpix = h_expand * v_expand;
numpix2 = numpix / 2;
/* Expand input data enough to let all the output samples be generated
* by the standard loop. Special-casing padded output would be more
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
output_cols * h_expand);
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
for (outcol = 0, outcol_h = 0; outcol < output_cols;
outcol++, outcol_h += h_expand) {
outvalue = 0;
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++);
}
}
*outptr++ = (JSAMPLE)((outvalue + numpix2) / numpix);
}
inrow += v_expand;
}
}
/*
* Downsample pixel values of a single component.
* This version handles the special case of a full-size component,
* without smoothing.
*/
METHODDEF(void)
fullsize_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
/* Copy the data */
jcopy_sample_rows(input_data, 0, output_data, 0, cinfo->max_v_samp_factor,
cinfo->image_width);
/* Edge-expand */
expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
compptr->width_in_blocks * DCTSIZE);
}
/*
* Downsample pixel values of a single component.
* This version handles the common case of 2:1 horizontal and 1:1 vertical,
* without smoothing.
*
* A note about the "bias" calculations: when rounding fractional values to
* integer, we do not want to always round 0.5 up to the next integer.
* If we did that, we'd introduce a noticeable bias towards larger values.
* Instead, this code is arranged so that 0.5 will be rounded up or down at
* alternate pixel locations (a simple ordered dither pattern).
*/
METHODDEF(void)
h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int outrow;
JDIMENSION outcol;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
register JSAMPROW inptr, outptr;
register int bias;
/* Expand input data enough to let all the output samples be generated
* by the standard loop. Special-casing padded output would be more
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
output_cols * 2);
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
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);
bias ^= 1; /* 0=>1, 1=>0 */
inptr += 2;
}
}
}
/*
* Downsample pixel values of a single component.
* This version handles the standard case of 2:1 horizontal and 2:1 vertical,
* without smoothing.
*/
METHODDEF(void)
h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int inrow, outrow;
JDIMENSION outcol;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
register JSAMPROW inptr0, inptr1, outptr;
register int bias;
/* Expand input data enough to let all the output samples be generated
* by the standard loop. Special-casing padded output would be more
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
output_cols * 2);
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
inptr0 = input_data[inrow];
inptr1 = input_data[inrow + 1];
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);
bias ^= 3; /* 1=>2, 2=>1 */
inptr0 += 2; inptr1 += 2;
}
inrow += 2;
}
}
#ifdef INPUT_SMOOTHING_SUPPORTED
/*
* Downsample pixel values of a single component.
* This version handles the standard case of 2:1 horizontal and 2:1 vertical,
* with smoothing. One row of context is required.
*/
METHODDEF(void)
h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int inrow, outrow;
JDIMENSION colctr;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
JLONG membersum, neighsum, memberscale, neighscale;
/* Expand input data enough to let all the output samples be generated
* by the standard loop. Special-casing padded output would be more
* efficient.
*/
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
cinfo->image_width, output_cols * 2);
/* We don't bother to form the individual "smoothed" input pixel values;
* we can directly compute the output which is the average of the four
* smoothed values. Each of the four member pixels contributes a fraction
* (1-8*SF) to its own smoothed image and a fraction SF to each of the three
* other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
* output. The four corner-adjacent neighbor pixels contribute a fraction
* SF to just one smoothed pixel, or SF/4 to the final output; while the
* eight edge-adjacent neighbors contribute SF to each of two smoothed
* pixels, or SF/2 overall. In order to use integer arithmetic, these
* factors are scaled by 2^16 = 65536.
* Also recall that SF = smoothing_factor / 1024.
*/
memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
inptr0 = input_data[inrow];
inptr1 = input_data[inrow + 1];
above_ptr = input_data[inrow - 1];
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]);
neighsum += neighsum;
neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(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]);
/* 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]);
/* 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]);
/* form final output scaled up by 2^16 */
membersum = membersum * memberscale + neighsum * neighscale;
/* round, descale and output it */
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
}
/* 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]);
neighsum += neighsum;
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
membersum = membersum * memberscale + neighsum * neighscale;
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
inrow += 2;
}
}
/*
* Downsample pixel values of a single component.
* This version handles the special case of a full-size component,
* with smoothing. One row of context is required.
*/
METHODDEF(void)
fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int outrow;
JDIMENSION colctr;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
register JSAMPROW inptr, above_ptr, below_ptr, outptr;
JLONG membersum, neighsum, memberscale, neighscale;
int colsum, lastcolsum, nextcolsum;
/* Expand input data enough to let all the output samples be generated
* by the standard loop. Special-casing padded output would be more
* efficient.
*/
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
cinfo->image_width, output_cols);
/* Each of the eight neighbor pixels contributes a fraction SF to the
* smoothed pixel, while the main pixel contributes (1-8*SF). In order
* to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
* Also recall that SF = smoothing_factor / 1024.
*/
memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
inptr = input_data[outrow];
above_ptr = input_data[outrow - 1];
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);
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++);
above_ptr++; below_ptr++;
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
lastcolsum = colsum; colsum = nextcolsum;
}
/* Special case for last column */
membersum = GETJSAMPLE(*inptr);
neighsum = lastcolsum + (colsum - membersum) + colsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
}
}
#endif /* INPUT_SMOOTHING_SUPPORTED */
/*
* Module initialization routine for downsampling.
* Note that we must select a routine for each component.
*/
GLOBAL(void)
jinit_downsampler(j_compress_ptr cinfo)
{
my_downsample_ptr downsample;
int ci;
jpeg_component_info *compptr;
boolean smoothok = TRUE;
downsample = (my_downsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_downsampler));
cinfo->downsample = (struct jpeg_downsampler *)downsample;
downsample->pub.start_pass = start_pass_downsample;
downsample->pub.downsample = sep_downsample;
downsample->pub.need_context_rows = FALSE;
if (cinfo->CCIR601_sampling)
ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
/* Verify we can handle the sampling factors, and set up method pointers */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor) {
downsample->methods[ci] = fullsize_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
} else
#endif
downsample->methods[ci] = fullsize_downsample;
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
smoothok = FALSE;
if (jsimd_can_h2v1_downsample())
downsample->methods[ci] = jsimd_h2v1_downsample;
else
downsample->methods[ci] = h2v1_downsample;
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor) {
#if defined(__mips__)
if (jsimd_can_h2v2_smooth_downsample())
downsample->methods[ci] = jsimd_h2v2_smooth_downsample;
else
#endif
downsample->methods[ci] = h2v2_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
} else
#endif
{
if (jsimd_can_h2v2_downsample())
downsample->methods[ci] = jsimd_h2v2_downsample;
else
downsample->methods[ci] = h2v2_downsample;
}
} else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
(cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
smoothok = FALSE;
downsample->methods[ci] = int_downsample;
} else
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
}
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor && !smoothok)
TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
#endif
}
+400
View File
@@ -0,0 +1,400 @@
/*
* jctrans.c
*
* 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.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains library routines for transcoding compression,
* that is, writing raw DCT coefficient arrays to an output JPEG file.
* The routines in jcapimin.c will also be needed by a transcoder.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Forward declarations */
LOCAL(void) transencode_master_selection(j_compress_ptr cinfo,
jvirt_barray_ptr *coef_arrays);
LOCAL(void) transencode_coef_controller(j_compress_ptr cinfo,
jvirt_barray_ptr *coef_arrays);
/*
* Compression initialization for writing raw-coefficient data.
* Before calling this, all parameters and a data destination must be set up.
* Call jpeg_finish_compress() to actually write the data.
*
* The number of passed virtual arrays must match cinfo->num_components.
* Note that the virtual arrays need not be filled or even realized at
* the time write_coefficients is called; indeed, if the virtual arrays
* were requested from this compression object's memory manager, they
* typically will be realized during this routine and filled afterwards.
*/
GLOBAL(void)
jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
{
if (cinfo->global_state != CSTATE_START)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Mark all tables to be written */
jpeg_suppress_tables(cinfo, FALSE);
/* (Re)initialize error mgr and destination modules */
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
(*cinfo->dest->init_destination) (cinfo);
/* Perform master selection of active modules */
transencode_master_selection(cinfo, coef_arrays);
/* Wait for jpeg_finish_compress() call */
cinfo->next_scanline = 0; /* so jpeg_write_marker works */
cinfo->global_state = CSTATE_WRCOEFS;
}
/*
* Initialize the compression object with default parameters,
* then copy from the source object all parameters needed for lossless
* transcoding. Parameters that can be varied without loss (such as
* scan script and Huffman optimization) are left in their default states.
*/
GLOBAL(void)
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
{
JQUANT_TBL **qtblptr;
jpeg_component_info *incomp, *outcomp;
JQUANT_TBL *c_quant, *slot_quant;
int tblno, ci, coefi;
/* Safety check to ensure start_compress not called yet. */
if (dstinfo->global_state != CSTATE_START)
ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
/* Copy fundamental image dimensions */
dstinfo->image_width = srcinfo->image_width;
dstinfo->image_height = srcinfo->image_height;
dstinfo->input_components = srcinfo->num_components;
dstinfo->in_color_space = srcinfo->jpeg_color_space;
#if JPEG_LIB_VERSION >= 70
dstinfo->jpeg_width = srcinfo->output_width;
dstinfo->jpeg_height = srcinfo->output_height;
dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;
dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;
#endif
/* Initialize all parameters to default values */
jpeg_set_defaults(dstinfo);
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
* Fix it to get the right header markers for the image colorspace.
*/
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
dstinfo->data_precision = srcinfo->data_precision;
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
/* Copy the source's quantization tables. */
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
qtblptr = &dstinfo->quant_tbl_ptrs[tblno];
if (*qtblptr == NULL)
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)dstinfo);
MEMCOPY((*qtblptr)->quantval, srcinfo->quant_tbl_ptrs[tblno]->quantval,
sizeof((*qtblptr)->quantval));
(*qtblptr)->sent_table = FALSE;
}
}
/* Copy the source's per-component info.
* Note we assume jpeg_set_defaults has allocated the dest comp_info array.
*/
dstinfo->num_components = srcinfo->num_components;
if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
MAX_COMPONENTS);
for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
outcomp->component_id = incomp->component_id;
outcomp->h_samp_factor = incomp->h_samp_factor;
outcomp->v_samp_factor = incomp->v_samp_factor;
outcomp->quant_tbl_no = incomp->quant_tbl_no;
/* Make sure saved quantization table for component matches the qtable
* slot. If not, the input file re-used this qtable slot.
* IJG encoder currently cannot duplicate this.
*/
tblno = outcomp->quant_tbl_no;
if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
srcinfo->quant_tbl_ptrs[tblno] == NULL)
ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
slot_quant = srcinfo->quant_tbl_ptrs[tblno];
c_quant = incomp->quant_table;
if (c_quant != NULL) {
for (coefi = 0; coefi < DCTSIZE2; coefi++) {
if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
}
}
/* Note: we do not copy the source's Huffman table assignments;
* instead we rely on jpeg_set_colorspace to have made a suitable choice.
*/
}
/* Also copy JFIF version and resolution information, if available.
* Strictly speaking this isn't "critical" info, but it's nearly
* always appropriate to copy it if available. In particular,
* if the application chooses to copy JFIF 1.02 extension markers from
* the source file, we need to copy the version to make sure we don't
* emit a file that has 1.02 extensions but a claimed version of 1.01.
* We will *not*, however, copy version info from mislabeled "2.01" files.
*/
if (srcinfo->saw_JFIF_marker) {
if (srcinfo->JFIF_major_version == 1) {
dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
}
dstinfo->density_unit = srcinfo->density_unit;
dstinfo->X_density = srcinfo->X_density;
dstinfo->Y_density = srcinfo->Y_density;
}
}
/*
* Master selection of compression modules for transcoding.
* This substitutes for jcinit.c's initialization of the full compressor.
*/
LOCAL(void)
transencode_master_selection(j_compress_ptr cinfo,
jvirt_barray_ptr *coef_arrays)
{
/* Although we don't actually use input_components for transcoding,
* jcmaster.c's initial_setup will complain if input_components is 0.
*/
cinfo->input_components = 1;
/* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, TRUE /* transcode only */);
/* Entropy encoding: either Huffman or arithmetic coding. */
if (cinfo->arith_code) {
#ifdef C_ARITH_CODING_SUPPORTED
jinit_arith_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
#endif
} else {
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
jinit_phuff_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else
jinit_huff_encoder(cinfo);
}
/* We need a special coefficient buffer controller. */
transencode_coef_controller(cinfo, coef_arrays);
jinit_marker_writer(cinfo);
/* We can now tell the memory manager to allocate virtual arrays. */
(*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
/* Write the datastream header (SOI, JFIF) immediately.
* Frame and scan headers are postponed till later.
* This lets application insert special markers after the SOI.
*/
(*cinfo->marker->write_file_header) (cinfo);
}
/*
* The rest of this file is a special implementation of the coefficient
* buffer controller. This is similar to jccoefct.c, but it handles only
* output from presupplied virtual arrays. Furthermore, we generate any
* dummy padding blocks on-the-fly rather than expecting them to be present
* in the arrays.
*/
/* Private buffer controller object */
typedef struct {
struct jpeg_c_coef_controller pub; /* public fields */
JDIMENSION iMCU_row_num; /* iMCU row # within image */
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
/* Virtual block array for each component. */
jvirt_barray_ptr *whole_image;
/* Workspace for constructing dummy blocks at right/bottom edges. */
JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
} my_coef_controller;
typedef my_coef_controller *my_coef_ptr;
LOCAL(void)
start_iMCU_row(j_compress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row */
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
/* In an interleaved scan, an MCU row is the same as an iMCU row.
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
* But at the bottom of the image, process only what's left.
*/
if (cinfo->comps_in_scan > 1) {
coef->MCU_rows_per_iMCU_row = 1;
} else {
if (coef->iMCU_row_num < (cinfo->total_iMCU_rows - 1))
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
else
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
coef->mcu_ctr = 0;
coef->MCU_vert_offset = 0;
}
/*
* Initialize for a processing pass.
*/
METHODDEF(void)
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
if (pass_mode != JBUF_CRANK_DEST)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->iMCU_row_num = 0;
start_iMCU_row(cinfo);
}
/*
* Process some data.
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
* per call, ie, v_samp_factor block rows for each component in the scan.
* The data is obtained from the virtual arrays and fed to the entropy coder.
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
*
* NB: input_buf is ignored; it is likely to be a NULL pointer.
*/
METHODDEF(boolean)
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int blkn, ci, xindex, yindex, yoffset, blockcnt;
JDIMENSION start_col;
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
JBLOCKROW buffer_ptr;
jpeg_component_info *compptr;
/* Align the virtual buffers for the components used in this scan. */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
buffer[ci] = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
coef->iMCU_row_num * compptr->v_samp_factor,
(JDIMENSION)compptr->v_samp_factor, FALSE);
}
/* Loop to process one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
compptr->last_col_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yindex + yoffset < compptr->last_row_height) {
/* Fill in pointers to real blocks in this row */
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
for (xindex = 0; xindex < blockcnt; xindex++)
MCU_buffer[blkn++] = buffer_ptr++;
} else {
/* At bottom of image, need a whole row of dummy blocks */
xindex = 0;
}
/* Fill in any dummy blocks needed in this row.
* Dummy blocks are filled in the same way as in jccoefct.c:
* all zeroes in the AC entries, DC entries equal to previous
* block's DC value. The init routine has already zeroed the
* AC entries, so we need only set the DC entries correctly.
*/
for (; xindex < compptr->MCU_width; xindex++) {
MCU_buffer[blkn] = coef->dummy_buffer[blkn];
MCU_buffer[blkn][0][0] = MCU_buffer[blkn - 1][0][0];
blkn++;
}
}
}
/* Try to write the MCU. */
if (!(*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
coef->mcu_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
start_iMCU_row(cinfo);
return TRUE;
}
/*
* Initialize coefficient buffer controller.
*
* Each passed coefficient array must be the right size for that
* coefficient: width_in_blocks wide and height_in_blocks high,
* with unitheight at least v_samp_factor.
*/
LOCAL(void)
transencode_coef_controller(j_compress_ptr cinfo,
jvirt_barray_ptr *coef_arrays)
{
my_coef_ptr coef;
JBLOCKROW buffer;
int i;
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_coef_controller));
cinfo->coef = (struct jpeg_c_coef_controller *)coef;
coef->pub.start_pass = start_pass_coef;
coef->pub.compress_data = compress_output;
/* Save pointer to virtual arrays */
coef->whole_image = coef_arrays;
/* Allocate and pre-zero space for dummy DCT blocks. */
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
jzero_far((void *)buffer, C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
coef->dummy_buffer[i] = buffer + i;
}
}
+407
View File
@@ -0,0 +1,407 @@
/*
* jdapimin.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1998, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2016, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains application interface code for the decompression half
* of the JPEG library. These are the "minimum" API routines that may be
* needed in either the normal full-decompression case or the
* transcoding-only case.
*
* Most of the routines intended to be called directly by an application
* are in this file or in jdapistd.c. But also see jcomapi.c for routines
* shared by compression and decompression, and jdtrans.c for the transcoding
* case.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdmaster.h"
/*
* Initialization of a JPEG decompression object.
* The error manager must already be set up (in case memory manager fails).
*/
GLOBAL(void)
jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize)
{
int i;
/* Guard against version mismatches between library and caller. */
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != sizeof(struct jpeg_decompress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int)sizeof(struct jpeg_decompress_struct), (int)structsize);
/* For debugging purposes, we zero the whole master structure.
* But the application has already set the err pointer, and may have set
* client_data, so we have to save and restore those fields.
* Note: if application hasn't set client_data, tools like Purify may
* complain here.
*/
{
struct jpeg_error_mgr *err = cinfo->err;
void *client_data = cinfo->client_data; /* ignore Purify complaint here */
MEMZERO(cinfo, sizeof(struct jpeg_decompress_struct));
cinfo->err = err;
cinfo->client_data = client_data;
}
cinfo->is_decompressor = TRUE;
/* Initialize a memory manager instance for this object */
jinit_memory_mgr((j_common_ptr)cinfo);
/* Zero out pointers to permanent structures. */
cinfo->progress = NULL;
cinfo->src = NULL;
for (i = 0; i < NUM_QUANT_TBLS; i++)
cinfo->quant_tbl_ptrs[i] = NULL;
for (i = 0; i < NUM_HUFF_TBLS; i++) {
cinfo->dc_huff_tbl_ptrs[i] = NULL;
cinfo->ac_huff_tbl_ptrs[i] = NULL;
}
/* Initialize marker processor so application can override methods
* for COM, APPn markers before calling jpeg_read_header.
*/
cinfo->marker_list = NULL;
jinit_marker_reader(cinfo);
/* And initialize the overall input controller. */
jinit_input_controller(cinfo);
/* OK, I'm ready */
cinfo->global_state = DSTATE_START;
/* The master struct is used to store extension parameters, so we allocate it
* here.
*/
cinfo->master = (struct jpeg_decomp_master *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
sizeof(my_decomp_master));
MEMZERO(cinfo->master, sizeof(my_decomp_master));
}
/*
* Destruction of a JPEG decompression object
*/
GLOBAL(void)
jpeg_destroy_decompress(j_decompress_ptr cinfo)
{
jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
}
/*
* Abort processing of a JPEG decompression operation,
* but don't destroy the object itself.
*/
GLOBAL(void)
jpeg_abort_decompress(j_decompress_ptr cinfo)
{
jpeg_abort((j_common_ptr)cinfo); /* use common routine */
}
/*
* Set default decompression parameters.
*/
LOCAL(void)
default_decompress_parms(j_decompress_ptr cinfo)
{
/* Guess the input colorspace, and set output colorspace accordingly. */
/* (Wish JPEG committee had provided a real way to specify this...) */
/* Note application may override our guesses. */
switch (cinfo->num_components) {
case 1:
cinfo->jpeg_color_space = JCS_GRAYSCALE;
cinfo->out_color_space = JCS_GRAYSCALE;
break;
case 3:
if (cinfo->saw_JFIF_marker) {
cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
} else if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
case 0:
cinfo->jpeg_color_space = JCS_RGB;
break;
case 1:
cinfo->jpeg_color_space = JCS_YCbCr;
break;
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
break;
}
} else {
/* Saw no special markers, try to guess from the component IDs */
int cid0 = cinfo->comp_info[0].component_id;
int cid1 = cinfo->comp_info[1].component_id;
int cid2 = cinfo->comp_info[2].component_id;
if (cid0 == 1 && cid1 == 2 && cid2 == 3)
cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
else {
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
}
}
/* Always guess RGB is proper output colorspace. */
cinfo->out_color_space = JCS_RGB;
break;
case 4:
if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
case 0:
cinfo->jpeg_color_space = JCS_CMYK;
break;
case 2:
cinfo->jpeg_color_space = JCS_YCCK;
break;
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
break;
}
} else {
/* No special markers, assume straight CMYK. */
cinfo->jpeg_color_space = JCS_CMYK;
}
cinfo->out_color_space = JCS_CMYK;
break;
default:
cinfo->jpeg_color_space = JCS_UNKNOWN;
cinfo->out_color_space = JCS_UNKNOWN;
break;
}
/* Set defaults for other decompression parameters. */
cinfo->scale_num = 1; /* 1:1 scaling */
cinfo->scale_denom = 1;
cinfo->output_gamma = 1.0;
cinfo->buffered_image = FALSE;
cinfo->raw_data_out = FALSE;
cinfo->dct_method = JDCT_DEFAULT;
cinfo->do_fancy_upsampling = TRUE;
cinfo->do_block_smoothing = TRUE;
cinfo->quantize_colors = FALSE;
/* We set these in case application only sets quantize_colors. */
cinfo->dither_mode = JDITHER_FS;
#ifdef QUANT_2PASS_SUPPORTED
cinfo->two_pass_quantize = TRUE;
#else
cinfo->two_pass_quantize = FALSE;
#endif
cinfo->desired_number_of_colors = 256;
cinfo->colormap = NULL;
/* Initialize for no mode change in buffered-image mode. */
cinfo->enable_1pass_quant = FALSE;
cinfo->enable_external_quant = FALSE;
cinfo->enable_2pass_quant = FALSE;
}
/*
* Decompression startup: read start of JPEG datastream to see what's there.
* Need only initialize JPEG object and supply a data source before calling.
*
* This routine will read as far as the first SOS marker (ie, actual start of
* compressed data), and will save all tables and parameters in the JPEG
* object. It will also initialize the decompression parameters to default
* values, and finally return JPEG_HEADER_OK. On return, the application may
* adjust the decompression parameters and then call jpeg_start_decompress.
* (Or, if the application only wanted to determine the image parameters,
* the data need not be decompressed. In that case, call jpeg_abort or
* jpeg_destroy to release any temporary space.)
* If an abbreviated (tables only) datastream is presented, the routine will
* return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then
* re-use the JPEG object to read the abbreviated image datastream(s).
* It is unnecessary (but OK) to call jpeg_abort in this case.
* The JPEG_SUSPENDED return code only occurs if the data source module
* requests suspension of the decompressor. In this case the application
* should load more source data and then re-call jpeg_read_header to resume
* processing.
* If a non-suspending data source is used and require_image is TRUE, then the
* return code need not be inspected since only JPEG_HEADER_OK is possible.
*
* This routine is now just a front end to jpeg_consume_input, with some
* extra error checking.
*/
GLOBAL(int)
jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
{
int retcode;
if (cinfo->global_state != DSTATE_START &&
cinfo->global_state != DSTATE_INHEADER)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
retcode = jpeg_consume_input(cinfo);
switch (retcode) {
case JPEG_REACHED_SOS:
retcode = JPEG_HEADER_OK;
break;
case JPEG_REACHED_EOI:
if (require_image) /* Complain if application wanted an image */
ERREXIT(cinfo, JERR_NO_IMAGE);
/* Reset to start state; it would be safer to require the application to
* call jpeg_abort, but we can't change it now for compatibility reasons.
* A side effect is to free any temporary memory (there shouldn't be any).
*/
jpeg_abort((j_common_ptr)cinfo); /* sets state = DSTATE_START */
retcode = JPEG_HEADER_TABLES_ONLY;
break;
case JPEG_SUSPENDED:
/* no work */
break;
}
return retcode;
}
/*
* Consume data in advance of what the decompressor requires.
* This can be called at any time once the decompressor object has
* been created and a data source has been set up.
*
* This routine is essentially a state machine that handles a couple
* of critical state-transition actions, namely initial setup and
* transition from header scanning to ready-for-start_decompress.
* All the actual input is done via the input controller's consume_input
* method.
*/
GLOBAL(int)
jpeg_consume_input(j_decompress_ptr cinfo)
{
int retcode = JPEG_SUSPENDED;
/* NB: every possible DSTATE value should be listed in this switch */
switch (cinfo->global_state) {
case DSTATE_START:
/* Start-of-datastream actions: reset appropriate modules */
(*cinfo->inputctl->reset_input_controller) (cinfo);
/* Initialize application's data source module */
(*cinfo->src->init_source) (cinfo);
cinfo->global_state = DSTATE_INHEADER;
/*FALLTHROUGH*/
case DSTATE_INHEADER:
retcode = (*cinfo->inputctl->consume_input) (cinfo);
if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
/* Set up default parameters based on header data */
default_decompress_parms(cinfo);
/* Set global state: ready for start_decompress */
cinfo->global_state = DSTATE_READY;
}
break;
case DSTATE_READY:
/* Can't advance past first SOS until start_decompress is called */
retcode = JPEG_REACHED_SOS;
break;
case DSTATE_PRELOAD:
case DSTATE_PRESCAN:
case DSTATE_SCANNING:
case DSTATE_RAW_OK:
case DSTATE_BUFIMAGE:
case DSTATE_BUFPOST:
case DSTATE_STOPPING:
retcode = (*cinfo->inputctl->consume_input) (cinfo);
break;
default:
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
}
return retcode;
}
/*
* Have we finished reading the input file?
*/
GLOBAL(boolean)
jpeg_input_complete(j_decompress_ptr cinfo)
{
/* Check for valid jpeg object */
if (cinfo->global_state < DSTATE_START ||
cinfo->global_state > DSTATE_STOPPING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
return cinfo->inputctl->eoi_reached;
}
/*
* Is there more than one scan?
*/
GLOBAL(boolean)
jpeg_has_multiple_scans(j_decompress_ptr cinfo)
{
/* Only valid after jpeg_read_header completes */
if (cinfo->global_state < DSTATE_READY ||
cinfo->global_state > DSTATE_STOPPING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
return cinfo->inputctl->has_multiple_scans;
}
/*
* Finish JPEG decompression.
*
* This will normally just verify the file trailer and release temp storage.
*
* Returns FALSE if suspended. The return value need be inspected only if
* a suspending data source is used.
*/
GLOBAL(boolean)
jpeg_finish_decompress(j_decompress_ptr cinfo)
{
if ((cinfo->global_state == DSTATE_SCANNING ||
cinfo->global_state == DSTATE_RAW_OK) && !cinfo->buffered_image) {
/* Terminate final pass of non-buffered mode */
if (cinfo->output_scanline < cinfo->output_height)
ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
(*cinfo->master->finish_output_pass) (cinfo);
cinfo->global_state = DSTATE_STOPPING;
} else if (cinfo->global_state == DSTATE_BUFIMAGE) {
/* Finishing after a buffered-image operation */
cinfo->global_state = DSTATE_STOPPING;
} else if (cinfo->global_state != DSTATE_STOPPING) {
/* STOPPING = repeat call after a suspension, anything else is error */
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
}
/* Read until EOI */
while (!cinfo->inputctl->eoi_reached) {
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
return FALSE; /* Suspend, come back later */
}
/* Do final cleanup */
(*cinfo->src->term_source) (cinfo);
/* We can use jpeg_abort to release memory and reset global_state */
jpeg_abort((j_common_ptr)cinfo);
return TRUE;
}
+639
View File
@@ -0,0 +1,639 @@
/*
* jdapistd.c
*
* 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) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains application interface code for the decompression half
* of the JPEG library. These are the "standard" API routines that are
* used in the normal full-decompression case. They are not used by a
* transcoding-only application. Note that if an application links in
* jpeg_start_decompress, it will end up linking in the entire decompressor.
* We thus must separate this file from jdapimin.c to avoid linking the
* whole decompression library into a transcoder.
*/
#include "jinclude.h"
#include "jdmainct.h"
#include "jdcoefct.h"
#include "jdsample.h"
#include "jmemsys.h"
/* Forward declarations */
LOCAL(boolean) output_pass_setup(j_decompress_ptr cinfo);
/*
* Decompression initialization.
* jpeg_read_header must be completed before calling this.
*
* If a multipass operating mode was selected, this will do all but the
* last pass, and thus may take a great deal of time.
*
* Returns FALSE if suspended. The return value need be inspected only if
* a suspending data source is used.
*/
GLOBAL(boolean)
jpeg_start_decompress(j_decompress_ptr cinfo)
{
if (cinfo->global_state == DSTATE_READY) {
/* First call: initialize master control, select active modules */
jinit_master_decompress(cinfo);
if (cinfo->buffered_image) {
/* No more work here; expecting jpeg_start_output next */
cinfo->global_state = DSTATE_BUFIMAGE;
return TRUE;
}
cinfo->global_state = DSTATE_PRELOAD;
}
if (cinfo->global_state == DSTATE_PRELOAD) {
/* If file has multiple scans, absorb them all into the coef buffer */
if (cinfo->inputctl->has_multiple_scans) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
for (;;) {
int retcode;
/* Call progress monitor hook if present */
if (cinfo->progress != NULL)
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
/* Absorb some more input */
retcode = (*cinfo->inputctl->consume_input) (cinfo);
if (retcode == JPEG_SUSPENDED)
return FALSE;
if (retcode == JPEG_REACHED_EOI)
break;
/* Advance progress counter if appropriate */
if (cinfo->progress != NULL &&
(retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
/* jdmaster underestimated number of scans; ratchet up one scan */
cinfo->progress->pass_limit += (long)cinfo->total_iMCU_rows;
}
}
}
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* D_MULTISCAN_FILES_SUPPORTED */
}
cinfo->output_scan_number = cinfo->input_scan_number;
} else if (cinfo->global_state != DSTATE_PRESCAN)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Perform any dummy output passes, and set up for the final pass */
return output_pass_setup(cinfo);
}
/*
* Set up for an output pass, and perform any dummy pass(es) needed.
* Common subroutine for jpeg_start_decompress and jpeg_start_output.
* Entry: global_state = DSTATE_PRESCAN only if previously suspended.
* Exit: If done, returns TRUE and sets global_state for proper output mode.
* If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
*/
LOCAL(boolean)
output_pass_setup(j_decompress_ptr cinfo)
{
if (cinfo->global_state != DSTATE_PRESCAN) {
/* First call: do pass setup */
(*cinfo->master->prepare_for_output_pass) (cinfo);
cinfo->output_scanline = 0;
cinfo->global_state = DSTATE_PRESCAN;
}
/* Loop over any required dummy passes */
while (cinfo->master->is_dummy_pass) {
#ifdef QUANT_2PASS_SUPPORTED
/* Crank through the dummy pass */
while (cinfo->output_scanline < cinfo->output_height) {
JDIMENSION last_scanline;
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
cinfo->progress->pass_limit = (long)cinfo->output_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* Process some data */
last_scanline = cinfo->output_scanline;
(*cinfo->main->process_data) (cinfo, (JSAMPARRAY)NULL,
&cinfo->output_scanline, (JDIMENSION)0);
if (cinfo->output_scanline == last_scanline)
return FALSE; /* No progress made, must suspend */
}
/* Finish up dummy pass, and set up for another one */
(*cinfo->master->finish_output_pass) (cinfo);
(*cinfo->master->prepare_for_output_pass) (cinfo);
cinfo->output_scanline = 0;
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* QUANT_2PASS_SUPPORTED */
}
/* Ready for application to drive output pass through
* jpeg_read_scanlines or jpeg_read_raw_data.
*/
cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
return TRUE;
}
/*
* Enable partial scanline decompression
*
* Must be called after jpeg_start_decompress() and before any calls to
* jpeg_read_scanlines() or jpeg_skip_scanlines().
*
* Refer to libjpeg.txt for more information.
*/
GLOBAL(void)
jpeg_crop_scanline(j_decompress_ptr cinfo, JDIMENSION *xoffset,
JDIMENSION *width)
{
int ci, align, orig_downsampled_width;
JDIMENSION input_xoffset;
boolean reinit_upsampler = FALSE;
jpeg_component_info *compptr;
if (cinfo->global_state != DSTATE_SCANNING || cinfo->output_scanline != 0)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (!xoffset || !width)
ERREXIT(cinfo, JERR_BAD_CROP_SPEC);
/* xoffset and width must fall within the output image dimensions. */
if (*width == 0 || *xoffset + *width > cinfo->output_width)
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
/* No need to do anything if the caller wants the entire width. */
if (*width == cinfo->output_width)
return;
/* Ensuring the proper alignment of xoffset is tricky. At minimum, it
* must align with an MCU boundary, because:
*
* (1) The IDCT is performed in blocks, and it is not feasible to modify
* the algorithm so that it can transform partial blocks.
* (2) Because of the SIMD extensions, any input buffer passed to the
* upsampling and color conversion routines must be aligned to the
* SIMD word size (for instance, 128-bit in the case of SSE2.) The
* easiest way to accomplish this without copying data is to ensure
* that upsampling and color conversion begin at the start of the
* first MCU column that will be inverse transformed.
*
* In practice, we actually impose a stricter alignment requirement. We
* require that xoffset be a multiple of the maximum MCU column width of all
* of the components (the "iMCU column width.") This is to simplify the
* single-pass decompression case, allowing us to use the same MCU column
* width for all of the components.
*/
if (cinfo->comps_in_scan == 1 && cinfo->num_components == 1)
align = cinfo->_min_DCT_scaled_size;
else
align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor;
/* Adjust xoffset to the nearest iMCU boundary <= the requested value */
input_xoffset = *xoffset;
*xoffset = (input_xoffset / align) * align;
/* Adjust the width so that the right edge of the output image is as
* requested (only the left edge is altered.) It is important that calling
* programs check this value after this function returns, so that they can
* allocate an output buffer with the appropriate size.
*/
*width = *width + input_xoffset - *xoffset;
cinfo->output_width = *width;
/* Set the first and last iMCU columns that we must decompress. These values
* will be used in single-scan decompressions.
*/
cinfo->master->first_iMCU_col = (JDIMENSION)(long)(*xoffset) / (long)align;
cinfo->master->last_iMCU_col =
(JDIMENSION)jdiv_round_up((long)(*xoffset + cinfo->output_width),
(long)align) - 1;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
int hsf = (cinfo->comps_in_scan == 1 && cinfo->num_components == 1) ?
1 : compptr->h_samp_factor;
/* Set downsampled_width to the new output width. */
orig_downsampled_width = compptr->downsampled_width;
compptr->downsampled_width =
(JDIMENSION)jdiv_round_up((long)(cinfo->output_width *
compptr->h_samp_factor),
(long)cinfo->max_h_samp_factor);
if (compptr->downsampled_width < 2 && orig_downsampled_width >= 2)
reinit_upsampler = TRUE;
/* Set the first and last iMCU columns that we must decompress. These
* values will be used in multi-scan decompressions.
*/
cinfo->master->first_MCU_col[ci] =
(JDIMENSION)(long)(*xoffset * hsf) / (long)align;
cinfo->master->last_MCU_col[ci] =
(JDIMENSION)jdiv_round_up((long)((*xoffset + cinfo->output_width) * hsf),
(long)align) - 1;
}
if (reinit_upsampler) {
cinfo->master->jinit_upsampler_no_alloc = TRUE;
jinit_upsampler(cinfo);
cinfo->master->jinit_upsampler_no_alloc = FALSE;
}
}
/*
* Read some scanlines of data from the JPEG decompressor.
*
* The return value will be the number of lines actually read.
* This may be less than the number requested in several cases,
* including bottom of image, data source suspension, and operating
* modes that emit multiple scanlines at a time.
*
* Note: we warn about excess calls to jpeg_read_scanlines() since
* this likely signals an application programmer error. However,
* an oversize buffer (max_lines > scanlines remaining) is not an error.
*/
GLOBAL(JDIMENSION)
jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines,
JDIMENSION max_lines)
{
JDIMENSION row_ctr;
if (cinfo->global_state != DSTATE_SCANNING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (cinfo->output_scanline >= cinfo->output_height) {
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
return 0;
}
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
cinfo->progress->pass_limit = (long)cinfo->output_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* Process some data */
row_ctr = 0;
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
cinfo->output_scanline += row_ctr;
return row_ctr;
}
/* Dummy color convert function used by jpeg_skip_scanlines() */
LOCAL(void)
noop_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
}
/* Dummy quantize function used by jpeg_skip_scanlines() */
LOCAL(void)
noop_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows)
{
}
/*
* In some cases, it is best to call jpeg_read_scanlines() and discard the
* output, rather than skipping the scanlines, because this allows us to
* maintain the internal state of the context-based upsampler. In these cases,
* we set up and tear down a dummy color converter in order to avoid valgrind
* errors and to achieve the best possible performance.
*/
LOCAL(void)
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{
JDIMENSION n;
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows) = NULL;
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows) = NULL;
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
color_convert = cinfo->cconvert->color_convert;
cinfo->cconvert->color_convert = noop_convert;
}
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
color_quantize = cinfo->cquantize->color_quantize;
cinfo->cquantize->color_quantize = noop_quantize;
}
for (n = 0; n < num_lines; n++)
jpeg_read_scanlines(cinfo, NULL, 1);
if (color_convert)
cinfo->cconvert->color_convert = color_convert;
if (color_quantize)
cinfo->cquantize->color_quantize = color_quantize;
}
/*
* Called by jpeg_skip_scanlines(). This partially skips a decompress block by
* incrementing the rowgroup counter.
*/
LOCAL(void)
increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
{
JDIMENSION rows_left;
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
/* Increment the counter to the next row group after the skipped rows. */
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
/* Partially skipping a row group would involve modifying the internal state
* of the upsampler, so read the remaining rows into a dummy buffer instead.
*/
rows_left = rows % cinfo->max_v_samp_factor;
cinfo->output_scanline += rows - rows_left;
read_and_discard_scanlines(cinfo, rows_left);
}
/*
* Skips some scanlines of data from the JPEG decompressor.
*
* The return value will be the number of lines actually skipped. If skipping
* num_lines would move beyond the end of the image, then the actual number of
* lines remaining in the image is returned. Otherwise, the return value will
* be equal to num_lines.
*
* Refer to libjpeg.txt for more information.
*/
GLOBAL(JDIMENSION)
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_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;
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) {
cinfo->output_scanline = cinfo->output_height;
(*cinfo->inputctl->finish_input_pass) (cinfo);
cinfo->inputctl->eoi_reached = TRUE;
return cinfo->output_height - cinfo->output_scanline;
}
if (num_lines == 0)
return 0;
lines_per_iMCU_row = cinfo->_min_DCT_scaled_size * cinfo->max_v_samp_factor;
lines_left_in_iMCU_row =
(lines_per_iMCU_row - (cinfo->output_scanline % lines_per_iMCU_row)) %
lines_per_iMCU_row;
lines_after_iMCU_row = num_lines - lines_left_in_iMCU_row;
/* Skip the lines remaining in the current iMCU row. When upsampling
* requires context rows, we need the previous and next rows in order to read
* the current row. This adds some complexity.
*/
if (cinfo->upsample->need_context_rows) {
/* If the skipped lines would not move us past the current iMCU row, we
* read the lines and ignore them. There might be a faster way of doing
* this, but we are facing increasing complexity for diminishing returns.
* The increasing complexity would be a by-product of meddling with the
* state machine used to skip context rows. Near the end of an iMCU row,
* the next iMCU row may have already been entropy-decoded. In this unique
* case, we will read the next iMCU row if we cannot skip past it as well.
*/
if ((num_lines < lines_left_in_iMCU_row + 1) ||
(lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full &&
lines_after_iMCU_row < lines_per_iMCU_row + 1)) {
read_and_discard_scanlines(cinfo, num_lines);
return num_lines;
}
/* If the next iMCU row has already been entropy-decoded, make sure that
* we do not skip too far.
*/
if (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full) {
cinfo->output_scanline += lines_left_in_iMCU_row + lines_per_iMCU_row;
lines_after_iMCU_row -= lines_per_iMCU_row;
} else {
cinfo->output_scanline += lines_left_in_iMCU_row;
}
/* If we have just completed the first block, adjust the buffer pointers */
if (main_ptr->iMCU_row_ctr == 0 ||
(main_ptr->iMCU_row_ctr == 1 && lines_left_in_iMCU_row > 2))
set_wraparound_pointers(cinfo);
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;
}
/* Skipping is much simpler when context rows are not required. */
else {
if (num_lines < lines_left_in_iMCU_row) {
increment_simple_rowgroup_ctr(cinfo, num_lines);
return num_lines;
} else {
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;
}
}
/* Calculate how many full iMCU rows we can skip. */
if (cinfo->upsample->need_context_rows)
lines_to_skip = ((lines_after_iMCU_row - 1) / lines_per_iMCU_row) *
lines_per_iMCU_row;
else
lines_to_skip = (lines_after_iMCU_row / lines_per_iMCU_row) *
lines_per_iMCU_row;
/* Calculate the number of lines that remain to be skipped after skipping all
* of the full iMCU rows that we can. We will not read these lines unless we
* have to.
*/
lines_to_read = lines_after_iMCU_row - lines_to_skip;
/* For images requiring multiple scans (progressive, non-interleaved, etc.),
* all of the entropy decoding occurs in jpeg_start_decompress(), assuming
* that the input data source is non-suspending. This makes skipping easy.
*/
if (cinfo->inputctl->has_multiple_scans) {
if (cinfo->upsample->need_context_rows) {
cinfo->output_scanline += lines_to_skip;
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;
/* It is complex to properly move to the middle of a context block, so
* read the remaining lines instead of skipping them.
*/
read_and_discard_scanlines(cinfo, lines_to_read);
} else {
cinfo->output_scanline += lines_to_skip;
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;
return num_lines;
}
/* Skip the iMCU rows that we can safely skip. */
for (i = 0; i < lines_to_skip; i += lines_per_iMCU_row) {
for (y = 0; y < coef->MCU_rows_per_iMCU_row; y++) {
for (x = 0; x < cinfo->MCUs_per_row; x++) {
/* Calling decode_mcu() with a NULL pointer causes it to discard the
* decoded coefficients. This is ~5% faster for large subsets, but
* it's tough to tell a difference for smaller images.
*/
(*cinfo->entropy->decode_mcu) (cinfo, NULL);
}
}
cinfo->input_iMCU_row++;
cinfo->output_iMCU_row++;
if (cinfo->input_iMCU_row < cinfo->total_iMCU_rows)
start_iMCU_row(cinfo);
else
(*cinfo->inputctl->finish_input_pass) (cinfo);
}
cinfo->output_scanline += lines_to_skip;
if (cinfo->upsample->need_context_rows) {
/* Context-based upsampling keeps track of iMCU rows. */
main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;
/* It is complex to properly move to the middle of a context block, so
* read the remaining lines instead of skipping them.
*/
read_and_discard_scanlines(cinfo, lines_to_read);
} else {
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
}
/* Since skipping lines involves skipping the upsampling step, the value of
* "rows_to_go" will become invalid unless we set it here. NOTE: This is a
* 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;
/* Always skip the requested number of lines. */
return num_lines;
}
/*
* Alternate entry point to read raw data.
* Processes exactly one iMCU row per call, unless suspended.
*/
GLOBAL(JDIMENSION)
jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data,
JDIMENSION max_lines)
{
JDIMENSION lines_per_iMCU_row;
if (cinfo->global_state != DSTATE_RAW_OK)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
if (cinfo->output_scanline >= cinfo->output_height) {
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
return 0;
}
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
cinfo->progress->pass_limit = (long)cinfo->output_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
}
/* Verify that at least one iMCU row can be returned. */
lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size;
if (max_lines < lines_per_iMCU_row)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
/* Decompress directly into user's buffer. */
if (!(*cinfo->coef->decompress_data) (cinfo, data))
return 0; /* suspension forced, can do nothing more */
/* OK, we processed one iMCU row. */
cinfo->output_scanline += lines_per_iMCU_row;
return lines_per_iMCU_row;
}
/* Additional entry points for buffered-image mode. */
#ifdef D_MULTISCAN_FILES_SUPPORTED
/*
* Initialize for an output pass in buffered-image mode.
*/
GLOBAL(boolean)
jpeg_start_output(j_decompress_ptr cinfo, int scan_number)
{
if (cinfo->global_state != DSTATE_BUFIMAGE &&
cinfo->global_state != DSTATE_PRESCAN)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Limit scan number to valid range */
if (scan_number <= 0)
scan_number = 1;
if (cinfo->inputctl->eoi_reached && scan_number > cinfo->input_scan_number)
scan_number = cinfo->input_scan_number;
cinfo->output_scan_number = scan_number;
/* Perform any dummy output passes, and set up for the real pass */
return output_pass_setup(cinfo);
}
/*
* Finish up after an output pass in buffered-image mode.
*
* Returns FALSE if suspended. The return value need be inspected only if
* a suspending data source is used.
*/
GLOBAL(boolean)
jpeg_finish_output(j_decompress_ptr cinfo)
{
if ((cinfo->global_state == DSTATE_SCANNING ||
cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
/* Terminate this pass. */
/* We do not require the whole pass to have been completed. */
(*cinfo->master->finish_output_pass) (cinfo);
cinfo->global_state = DSTATE_BUFPOST;
} else if (cinfo->global_state != DSTATE_BUFPOST) {
/* BUFPOST = repeat call after a suspension, anything else is error */
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
}
/* Read markers looking for SOS or EOI */
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
!cinfo->inputctl->eoi_reached) {
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
return FALSE; /* Suspend, come back later */
}
cinfo->global_state = DSTATE_BUFIMAGE;
return TRUE;
}
#endif /* D_MULTISCAN_FILES_SUPPORTED */
+773
View File
@@ -0,0 +1,773 @@
/*
* jdarith.c
*
* 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.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains portable arithmetic entropy encoding routines for JPEG
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
*
* Both sequential and progressive modes are supported in this single module.
*
* Suspension is not currently supported in this module.
*
* NOTE: All referenced figures are from
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#define NEG_1 ((unsigned int)-1)
/* Expanded entropy decoder object for arithmetic decoding. */
typedef struct {
struct jpeg_entropy_decoder pub; /* public fields */
JLONG c; /* C register, base of coding interval + input bit buffer */
JLONG a; /* A register, normalized size of coding interval */
int ct; /* bit shift counter, # of bits left in bit buffer part of C */
/* init: ct = -16 */
/* run: ct = 0..7 */
/* error: ct = -1 */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
unsigned int restarts_to_go; /* MCUs left in this restart interval */
/* Pointers to statistics areas (these workspaces have image lifespan) */
unsigned char *dc_stats[NUM_ARITH_TBLS];
unsigned char *ac_stats[NUM_ARITH_TBLS];
/* Statistics bin for coding with fixed probability 0.5 */
unsigned char fixed_bin[4];
} arith_entropy_decoder;
typedef arith_entropy_decoder *arith_entropy_ptr;
/* The following two definitions specify the allocation chunk size
* for the statistics area.
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
*
* We use a compact representation with 1 byte per statistics bin,
* thus the numbers directly represent byte sizes.
* This 1 byte per statistics bin contains the meaning of the MPS
* (more probable symbol) in the highest bit (mask 0x80), and the
* index into the probability estimation state machine table
* in the lower bits (mask 0x7F).
*/
#define DC_STAT_BINS 64
#define AC_STAT_BINS 256
LOCAL(int)
get_byte(j_decompress_ptr cinfo)
/* Read next input byte; we do not support suspension in this module. */
{
struct jpeg_source_mgr *src = cinfo->src;
if (src->bytes_in_buffer == 0)
if (!(*src->fill_input_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
src->bytes_in_buffer--;
return GETJOCTET(*src->next_input_byte++);
}
/*
* The core arithmetic decoding routine (common in JPEG and JBIG).
* This needs to go as fast as possible.
* Machine-dependent optimization facilities
* are not utilized in this portable implementation.
* However, this code should be fairly efficient and
* may be a good base for further optimizations anyway.
*
* Return value is 0 or 1 (binary decision).
*
* Note: I've changed the handling of the code base & bit
* buffer register C compared to other implementations
* based on the standards layout & procedures.
* While it also contains both the actual base of the
* coding interval (16 bits) and the next-bits buffer,
* the cut-point between these two parts is floating
* (instead of fixed) with the bit shift counter CT.
* Thus, we also need only one (variable instead of
* fixed size) shift for the LPS/MPS decision, and
* we can do away with any renormalization update
* of C (except for new data insertion, of course).
*
* I've also introduced a new scheme for accessing
* the probability estimation state machine table,
* derived from Markus Kuhn's JBIG implementation.
*/
LOCAL(int)
arith_decode(j_decompress_ptr cinfo, unsigned char *st)
{
register arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
register unsigned char nl, nm;
register JLONG qe, temp;
register int sv, data;
/* Renormalization & data input per section D.2.6 */
while (e->a < 0x8000L) {
if (--e->ct < 0) {
/* Need to fetch next data byte */
if (cinfo->unread_marker)
data = 0; /* stuff zero data */
else {
data = get_byte(cinfo); /* read next input byte */
if (data == 0xFF) { /* zero stuff or marker code */
do data = get_byte(cinfo);
while (data == 0xFF); /* swallow extra 0xFF bytes */
if (data == 0)
data = 0xFF; /* discard stuffed zero byte */
else {
/* Note: Different from the Huffman decoder, hitting
* a marker while processing the compressed data
* segment is legal in arithmetic coding.
* The convention is to supply zero data
* then until decoding is complete.
*/
cinfo->unread_marker = data;
data = 0;
}
}
}
e->c = (e->c << 8) | data; /* insert data into C register */
if ((e->ct += 8) < 0) /* update bit shift counter */
/* Need more initial bytes */
if (++e->ct == 0)
/* Got 2 initial bytes -> re-init A and exit loop */
e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */
}
e->a <<= 1;
}
/* Fetch values from our compact representation of Table D.2:
* Qe values and probability estimation state machine
*/
sv = *st;
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
/* Decode & estimation procedures per sections D.2.4 & D.2.5 */
temp = e->a - qe;
e->a = temp;
temp <<= e->ct;
if (e->c >= temp) {
e->c -= temp;
/* Conditional LPS (less probable symbol) exchange */
if (e->a < qe) {
e->a = qe;
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
} else {
e->a = qe;
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
sv ^= 0x80; /* Exchange LPS/MPS */
}
} else if (e->a < 0x8000L) {
/* Conditional MPS (more probable symbol) exchange */
if (e->a < qe) {
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
sv ^= 0x80; /* Exchange LPS/MPS */
} else {
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
}
}
return sv >> 7;
}
/*
* Check for a restart marker & resynchronize decoder.
*/
LOCAL(void)
process_restart(j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
int ci;
jpeg_component_info *compptr;
/* Advance past the RSTn marker */
if (!(*cinfo->marker->read_restart_marker) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
/* Re-initialize statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
/* Reset DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
if (!cinfo->progressive_mode || cinfo->Ss) {
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
}
}
/* Reset arithmetic decoding variables */
entropy->c = 0;
entropy->a = 0;
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
/* Reset restart counter */
entropy->restarts_to_go = cinfo->restart_interval;
}
/*
* Arithmetic MCU decoding.
* Each of these routines decodes and returns one MCU's worth of
* arithmetic-compressed coefficients.
* The coefficients are reordered from zigzag order into natural array order,
* but are not dequantized.
*
* The i'th block of the MCU is stored into the block pointed to by
* MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
*/
/*
* MCU decoding for DC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, sign;
int v, m;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.19: Decode_DC_DIFF */
if (arith_decode(cinfo, st) == 0)
entropy->dc_context[ci] = 0;
else {
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, st + 1);
st += 2; st += sign;
/* Figure F.23: Decoding the magnitude category of v */
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) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
else
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
}
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
(*block)[0] = (JCOEF)LEFT_SHIFT(entropy->last_dc_val[ci], cinfo->Al);
}
return TRUE;
}
/*
* MCU decoding for AC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, sign, k;
int v, m;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
/* There is always only one block per MCU */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
/* Figure F.20: Decode_AC_coefficients */
for (k = cinfo->Ss; k <= cinfo->Se; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
if (arith_decode(cinfo, st)) break; /* EOB flag */
while (arith_decode(cinfo, st + 1) == 0) {
st += 3; k++;
if (k > cinfo->Se) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, entropy->fixed_bin);
st += 2;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
if (arith_decode(cinfo, st)) {
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
}
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
/* Scale and output coefficient in natural (dezigzagged) order */
(*block)[jpeg_natural_order[k]] = (JCOEF)((unsigned)v << cinfo->Al);
}
return TRUE;
}
/*
* MCU decoding for DC successive approximation refinement scan.
*/
METHODDEF(boolean)
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;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
st = entropy->fixed_bin; /* use fixed probability estimation */
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
/* Encoded data is simply the next bit of the two's-complement DC value */
if (arith_decode(cinfo, st))
MCU_data[blkn][0][0] |= p1;
}
return TRUE;
}
/*
* MCU decoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
JBLOCKROW block;
JCOEFPTR thiscoef;
unsigned char *st;
int tbl, k, kex;
int p1, m1;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
/* There is always only one block per MCU */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (NEG_1) << cinfo->Al; /* -1 in the bit position being coded */
/* Establish EOBx (previous stage end-of-block) index */
for (kex = cinfo->Se; kex > 0; kex--)
if ((*block)[jpeg_natural_order[kex]]) break;
for (k = cinfo->Ss; k <= cinfo->Se; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
if (k > kex)
if (arith_decode(cinfo, st)) break; /* EOB flag */
for (;;) {
thiscoef = *block + jpeg_natural_order[k];
if (*thiscoef) { /* previously nonzero coef */
if (arith_decode(cinfo, st + 2)) {
if (*thiscoef < 0)
*thiscoef += m1;
else
*thiscoef += p1;
}
break;
}
if (arith_decode(cinfo, st + 1)) { /* newly nonzero coef */
if (arith_decode(cinfo, entropy->fixed_bin))
*thiscoef = m1;
else
*thiscoef = p1;
break;
}
st += 3; k++;
if (k > cinfo->Se) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
}
return TRUE;
}
/*
* Decode one MCU's worth of arithmetic-compressed coefficients.
*/
METHODDEF(boolean)
decode_mcu(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
jpeg_component_info *compptr;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, sign, k;
int v, m;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data ? MCU_data[blkn] : NULL;
ci = cinfo->MCU_membership[blkn];
compptr = cinfo->cur_comp_info[ci];
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
tbl = compptr->dc_tbl_no;
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.19: Decode_DC_DIFF */
if (arith_decode(cinfo, st) == 0)
entropy->dc_context[ci] = 0;
else {
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, st + 1);
st += 2; st += sign;
/* Figure F.23: Decoding the magnitude category of v */
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) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
else
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
}
if (block)
(*block)[0] = (JCOEF)entropy->last_dc_val[ci];
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
tbl = compptr->ac_tbl_no;
/* Figure F.20: Decode_AC_coefficients */
for (k = 1; k <= DCTSIZE2 - 1; k++) {
st = entropy->ac_stats[tbl] + 3 * (k - 1);
if (arith_decode(cinfo, st)) break; /* EOB flag */
while (arith_decode(cinfo, st + 1) == 0) {
st += 3; k++;
if (k > DCTSIZE2 - 1) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, entropy->fixed_bin);
st += 2;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
if (arith_decode(cinfo, st)) {
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
}
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
if (block)
(*block)[jpeg_natural_order[k]] = (JCOEF)v;
}
}
return TRUE;
}
/*
* Initialize for an arithmetic-compressed scan.
*/
METHODDEF(void)
start_pass(j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
int ci, tbl;
jpeg_component_info *compptr;
if (cinfo->progressive_mode) {
/* Validate progressive scan parameters */
if (cinfo->Ss == 0) {
if (cinfo->Se != 0)
goto bad;
} else {
/* need not check Ss/Se < 0 since they came from unsigned bytes */
if (cinfo->Se < cinfo->Ss || cinfo->Se > DCTSIZE2 - 1)
goto bad;
/* AC scans may have only one component */
if (cinfo->comps_in_scan != 1)
goto bad;
}
if (cinfo->Ah != 0) {
/* Successive approximation refinement scan: must have Al = Ah-1. */
if (cinfo->Ah - 1 != cinfo->Al)
goto bad;
}
if (cinfo->Al > 13) { /* need not check for < 0 */
bad:
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
}
/* Update progression status, and verify that scan order is legal.
* Note that inter-scan inconsistencies are treated as warnings
* not fatal errors ... not clear if this is right way to behave.
*/
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];
if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 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)
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
coef_bit_ptr[coefi] = cinfo->Al;
}
}
/* Select MCU decoding routine */
if (cinfo->Ah == 0) {
if (cinfo->Ss == 0)
entropy->pub.decode_mcu = decode_mcu_DC_first;
else
entropy->pub.decode_mcu = decode_mcu_AC_first;
} else {
if (cinfo->Ss == 0)
entropy->pub.decode_mcu = decode_mcu_DC_refine;
else
entropy->pub.decode_mcu = decode_mcu_AC_refine;
}
} else {
/* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
* This ought to be an error condition, but we make it a warning.
*/
if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
(cinfo->Se < DCTSIZE2 && cinfo->Se != DCTSIZE2 - 1))
WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
/* Select MCU decoding routine */
entropy->pub.decode_mcu = decode_mcu;
}
/* Allocate & initialize requested statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
tbl = compptr->dc_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->dc_stats[tbl] == NULL)
entropy->dc_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
/* Initialize DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
if (!cinfo->progressive_mode || cinfo->Ss) {
tbl = compptr->ac_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->ac_stats[tbl] == NULL)
entropy->ac_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
}
}
/* Initialize arithmetic decoding variables */
entropy->c = 0;
entropy->a = 0;
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
/* Initialize restart counter */
entropy->restarts_to_go = cinfo->restart_interval;
}
/*
* Module initialization routine for arithmetic entropy decoding.
*/
GLOBAL(void)
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));
cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
entropy->pub.start_pass = start_pass;
/* Mark tables unallocated */
for (i = 0; i < NUM_ARITH_TBLS; i++) {
entropy->dc_stats[i] = NULL;
entropy->ac_stats[i] = NULL;
}
/* Initialize index for fixed probability estimation */
entropy->fixed_bin[0] = 113;
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));
coef_bit_ptr = &cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (i = 0; i < DCTSIZE2; i++)
*coef_bit_ptr++ = -1;
}
}
+293
View File
@@ -0,0 +1,293 @@
/*
* jdatadst.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2012 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2013, 2016, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains compression data destination routines for the case of
* emitting JPEG data to memory or to a file (or any stdio stream).
* While these routines are sufficient for most applications,
* some will want to use a different destination manager.
* IMPORTANT: we assume that fwrite() will correctly transcribe an array of
* JOCTETs into 8-bit-wide elements on external storage. If char is wider
* than 8 bits on your machine, you may need to do some tweaking.
*/
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
#include "jinclude.h"
#include "jpeglib.h"
#include "jerror.h"
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
extern void *malloc(size_t size);
extern void free(void *ptr);
#endif
/* Expanded data destination object for stdio output */
typedef struct {
struct jpeg_destination_mgr pub; /* public fields */
FILE *outfile; /* target stream */
JOCTET *buffer; /* start of buffer */
} my_destination_mgr;
typedef my_destination_mgr *my_dest_ptr;
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/* Expanded data destination object for memory output */
typedef struct {
struct jpeg_destination_mgr pub; /* public fields */
unsigned char **outbuffer; /* target buffer */
unsigned long *outsize;
unsigned char *newbuffer; /* newly allocated buffer */
JOCTET *buffer; /* start of buffer */
size_t bufsize;
} my_mem_destination_mgr;
typedef my_mem_destination_mgr *my_mem_dest_ptr;
#endif
/*
* Initialize destination --- called by jpeg_start_compress
* before any data is actually written.
*/
METHODDEF(void)
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->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
init_mem_destination(j_compress_ptr cinfo)
{
/* no work necessary here */
}
#endif
/*
* Empty the output buffer --- called whenever buffer fills up.
*
* In typical applications, this should write the entire output buffer
* (ignoring the current state of next_output_byte & free_in_buffer),
* reset the pointer & count to the start of the buffer, and return TRUE
* indicating that the buffer has been dumped.
*
* In applications that need to be able to suspend compression due to output
* overrun, a FALSE return indicates that the buffer cannot be emptied now.
* In this situation, the compressor will return to its caller (possibly with
* an indication that it has not accepted all the supplied scanlines). The
* application should resume compression after it has made more room in the
* output buffer. Note that there are substantial restrictions on the use of
* suspension --- see the documentation.
*
* When suspending, the compressor will back up to a convenient restart point
* (typically the start of the current MCU). next_output_byte & free_in_buffer
* indicate where the restart point will be if the current call returns FALSE.
* Data beyond this point will be regenerated after resumption, so do not
* write it out when emptying the buffer externally.
*/
METHODDEF(boolean)
empty_output_buffer(j_compress_ptr cinfo)
{
my_dest_ptr dest = (my_dest_ptr)cinfo->dest;
if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
(size_t)OUTPUT_BUF_SIZE)
ERREXIT(cinfo, JERR_FILE_WRITE);
dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
return TRUE;
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(boolean)
empty_mem_output_buffer(j_compress_ptr cinfo)
{
size_t nextsize;
JOCTET *nextbuffer;
my_mem_dest_ptr dest = (my_mem_dest_ptr)cinfo->dest;
/* Try to allocate new buffer with double size */
nextsize = dest->bufsize * 2;
nextbuffer = (JOCTET *)malloc(nextsize);
if (nextbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
if (dest->newbuffer != NULL)
free(dest->newbuffer);
dest->newbuffer = nextbuffer;
dest->pub.next_output_byte = nextbuffer + dest->bufsize;
dest->pub.free_in_buffer = dest->bufsize;
dest->buffer = nextbuffer;
dest->bufsize = nextsize;
return TRUE;
}
#endif
/*
* Terminate destination --- called by jpeg_finish_compress
* after all data has been written. Usually needs to flush buffer.
*
* NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
* application must deal with any cleanup that should happen even
* for error exit.
*/
METHODDEF(void)
term_destination(j_compress_ptr cinfo)
{
my_dest_ptr dest = (my_dest_ptr)cinfo->dest;
size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
/* Write any data remaining in the buffer */
if (datacount > 0) {
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
ERREXIT(cinfo, JERR_FILE_WRITE);
}
fflush(dest->outfile);
/* Make sure we wrote the output file OK */
if (ferror(dest->outfile))
ERREXIT(cinfo, JERR_FILE_WRITE);
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
term_mem_destination(j_compress_ptr cinfo)
{
my_mem_dest_ptr dest = (my_mem_dest_ptr)cinfo->dest;
*dest->outbuffer = dest->buffer;
*dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);
}
#endif
/*
* Prepare for output to a stdio stream.
* The caller must have already opened the stream, and is responsible
* for closing it after finishing compression.
*/
GLOBAL(void)
jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile)
{
my_dest_ptr dest;
/* The destination object is made permanent so that multiple JPEG images
* can be written to the same file without re-executing jpeg_stdio_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_destination_mgr));
} else if (cinfo->dest->init_destination != init_destination) {
/* It is unsafe to reuse the existing destination manager unless it was
* created by this function. Otherwise, there is no guarantee that the
* opaque structure is the right size. Note that we could just create a
* new structure, but the old structure would not be freed until
* jpeg_destroy_compress() was called.
*/
ERREXIT(cinfo, JERR_BUFFER_SIZE);
}
dest = (my_dest_ptr)cinfo->dest;
dest->pub.init_destination = init_destination;
dest->pub.empty_output_buffer = empty_output_buffer;
dest->pub.term_destination = term_destination;
dest->outfile = outfile;
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/*
* Prepare for output to a memory buffer.
* The caller may supply an own initial buffer with appropriate size.
* Otherwise, or when the actual data output exceeds the given size,
* the library adapts the buffer size as necessary.
* The standard library functions malloc/free are used for allocating
* larger memory, so the buffer is available to the application after
* finishing compression, and then the application is responsible for
* freeing the requested memory.
* Note: An initial buffer supplied by the caller is expected to be
* managed by the application. The library does not free such buffer
* when allocating a larger buffer.
*/
GLOBAL(void)
jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
unsigned long *outsize)
{
my_mem_dest_ptr dest;
if (outbuffer == NULL || outsize == NULL) /* sanity check */
ERREXIT(cinfo, JERR_BUFFER_SIZE);
/* The destination object is made permanent so that multiple JPEG images
* 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));
} else if (cinfo->dest->init_destination != init_mem_destination) {
/* It is unsafe to reuse the existing destination manager unless it was
* created by this function.
*/
ERREXIT(cinfo, JERR_BUFFER_SIZE);
}
dest = (my_mem_dest_ptr)cinfo->dest;
dest->pub.init_destination = init_mem_destination;
dest->pub.empty_output_buffer = empty_mem_output_buffer;
dest->pub.term_destination = term_mem_destination;
dest->outbuffer = outbuffer;
dest->outsize = outsize;
dest->newbuffer = NULL;
if (*outbuffer == NULL || *outsize == 0) {
/* Allocate initial buffer */
dest->newbuffer = *outbuffer = (unsigned char *)malloc(OUTPUT_BUF_SIZE);
if (dest->newbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
*outsize = OUTPUT_BUF_SIZE;
}
dest->pub.next_output_byte = dest->buffer = *outbuffer;
dest->pub.free_in_buffer = dest->bufsize = *outsize;
}
#endif
+295
View File
@@ -0,0 +1,295 @@
/*
* jdatasrc.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2011 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2013, 2016, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains decompression data source routines for the case of
* reading JPEG data from memory or from a file (or any stdio stream).
* While these routines are sufficient for most applications,
* some will want to use a different source manager.
* IMPORTANT: we assume that fread() will correctly transcribe an array of
* JOCTETs from 8-bit-wide elements on external storage. If char is wider
* than 8 bits on your machine, you may need to do some tweaking.
*/
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
#include "jinclude.h"
#include "jpeglib.h"
#include "jerror.h"
/* Expanded data source object for stdio input */
typedef struct {
struct jpeg_source_mgr pub; /* public fields */
FILE *infile; /* source stream */
JOCTET *buffer; /* start of buffer */
boolean start_of_file; /* have we gotten any data yet? */
} my_source_mgr;
typedef my_source_mgr *my_src_ptr;
#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */
/*
* Initialize source --- called by jpeg_read_header
* before any data is actually read.
*/
METHODDEF(void)
init_source(j_decompress_ptr cinfo)
{
my_src_ptr src = (my_src_ptr)cinfo->src;
/* We reset the empty-input-file flag for each image,
* but we don't clear the input buffer.
* This is correct behavior for reading a series of images from one source.
*/
src->start_of_file = TRUE;
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
init_mem_source(j_decompress_ptr cinfo)
{
/* no work necessary here */
}
#endif
/*
* Fill the input buffer --- called whenever buffer is emptied.
*
* In typical applications, this should read fresh data into the buffer
* (ignoring the current state of next_input_byte & bytes_in_buffer),
* reset the pointer & count to the start of the buffer, and return TRUE
* indicating that the buffer has been reloaded. It is not necessary to
* fill the buffer entirely, only to obtain at least one more byte.
*
* There is no such thing as an EOF return. If the end of the file has been
* reached, the routine has a choice of ERREXIT() or inserting fake data into
* the buffer. In most cases, generating a warning message and inserting a
* fake EOI marker is the best course of action --- this will allow the
* decompressor to output however much of the image is there. However,
* the resulting error message is misleading if the real problem is an empty
* input file, so we handle that case specially.
*
* In applications that need to be able to suspend compression due to input
* not being available yet, a FALSE return indicates that no more data can be
* obtained right now, but more may be forthcoming later. In this situation,
* the decompressor will return to its caller (with an indication of the
* number of scanlines it has read, if any). The application should resume
* decompression after it has loaded more data into the input buffer. Note
* that there are substantial restrictions on the use of suspension --- see
* the documentation.
*
* When suspending, the decompressor will back up to a convenient restart point
* (typically the start of the current MCU). next_input_byte & bytes_in_buffer
* indicate where the restart point will be if the current call returns FALSE.
* Data beyond this point must be rescanned after resumption, so move it to
* the front of the buffer rather than discarding it.
*/
METHODDEF(boolean)
fill_input_buffer(j_decompress_ptr cinfo)
{
my_src_ptr src = (my_src_ptr)cinfo->src;
size_t nbytes;
nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
if (nbytes <= 0) {
if (src->start_of_file) /* Treat empty input file as fatal error */
ERREXIT(cinfo, JERR_INPUT_EMPTY);
WARNMS(cinfo, JWRN_JPEG_EOF);
/* Insert a fake EOI marker */
src->buffer[0] = (JOCTET)0xFF;
src->buffer[1] = (JOCTET)JPEG_EOI;
nbytes = 2;
}
src->pub.next_input_byte = src->buffer;
src->pub.bytes_in_buffer = nbytes;
src->start_of_file = FALSE;
return TRUE;
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(boolean)
fill_mem_input_buffer(j_decompress_ptr cinfo)
{
static const JOCTET mybuffer[4] = {
(JOCTET)0xFF, (JOCTET)JPEG_EOI, 0, 0
};
/* The whole JPEG data is expected to reside in the supplied memory
* buffer, so any request for more data beyond the given buffer size
* is treated as an error.
*/
WARNMS(cinfo, JWRN_JPEG_EOF);
/* Insert a fake EOI marker */
cinfo->src->next_input_byte = mybuffer;
cinfo->src->bytes_in_buffer = 2;
return TRUE;
}
#endif
/*
* Skip data --- used to skip over a potentially large amount of
* uninteresting data (such as an APPn marker).
*
* Writers of suspendable-input applications must note that skip_input_data
* is not granted the right to give a suspension return. If the skip extends
* beyond the data currently in the buffer, the buffer can be marked empty so
* that the next read will cause a fill_input_buffer call that can suspend.
* Arranging for additional bytes to be discarded before reloading the input
* buffer is the application writer's problem.
*/
METHODDEF(void)
skip_input_data(j_decompress_ptr cinfo, long num_bytes)
{
struct jpeg_source_mgr *src = cinfo->src;
/* 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;
(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;
}
}
/*
* An additional method that can be provided by data source modules is the
* resync_to_restart method for error recovery in the presence of RST markers.
* For the moment, this source module just uses the default resync method
* provided by the JPEG library. That method assumes that no backtracking
* is possible.
*/
/*
* Terminate source --- called by jpeg_finish_decompress
* after all data has been read. Often a no-op.
*
* NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
* application must deal with any cleanup that should happen even
* for error exit.
*/
METHODDEF(void)
term_source(j_decompress_ptr cinfo)
{
/* no work necessary here */
}
/*
* Prepare for input from a stdio stream.
* The caller must have already opened the stream, and is responsible
* for closing it after finishing decompression.
*/
GLOBAL(void)
jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile)
{
my_src_ptr src;
/* The source object and input buffer are made permanent so that a series
* of JPEG images can be read from the same file by calling jpeg_stdio_src
* only before the first one. (If we discarded the buffer at the end of
* one image, we'd likely lose the start of the next 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(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));
} else if (cinfo->src->init_source != init_source) {
/* It is unsafe to reuse the existing source manager unless it was created
* by this function. Otherwise, there is no guarantee that the opaque
* structure is the right size. Note that we could just create a new
* structure, but the old structure would not be freed until
* jpeg_destroy_decompress() was called.
*/
ERREXIT(cinfo, JERR_BUFFER_SIZE);
}
src = (my_src_ptr)cinfo->src;
src->pub.init_source = init_source;
src->pub.fill_input_buffer = fill_input_buffer;
src->pub.skip_input_data = skip_input_data;
src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
src->pub.term_source = term_source;
src->infile = infile;
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
src->pub.next_input_byte = NULL; /* until buffer loaded */
}
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/*
* Prepare for input from a supplied memory buffer.
* The buffer must contain the whole JPEG data.
*/
GLOBAL(void)
jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *inbuffer,
unsigned long insize)
{
struct jpeg_source_mgr *src;
if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */
ERREXIT(cinfo, JERR_INPUT_EMPTY);
/* The source object is made permanent so that a series of JPEG images
* can be read from the same buffer by calling jpeg_mem_src only before
* 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));
} else if (cinfo->src->init_source != init_mem_source) {
/* It is unsafe to reuse the existing source manager unless it was created
* by this function.
*/
ERREXIT(cinfo, JERR_BUFFER_SIZE);
}
src = cinfo->src;
src->init_source = init_mem_source;
src->fill_input_buffer = fill_mem_input_buffer;
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->next_input_byte = (const JOCTET *)inbuffer;
}
#endif
+692
View File
@@ -0,0 +1,692 @@
/*
* jdcoefct.c
*
* This file was part of the Independent JPEG Group's software:
* 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.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains the coefficient buffer controller for decompression.
* This controller is the top level of the JPEG decompressor proper.
* The coefficient buffer lies between entropy decoding and inverse-DCT steps.
*
* In buffered-image mode, this controller is the interface between
* input-oriented processing and output-oriented processing.
* Also, the input side (only) is used when reading a file for transcoding.
*/
#include "jinclude.h"
#include "jdcoefct.h"
#include "jpegcomp.h"
/* Forward declarations */
METHODDEF(int) decompress_onepass(j_decompress_ptr cinfo,
JSAMPIMAGE output_buf);
#ifdef D_MULTISCAN_FILES_SUPPORTED
METHODDEF(int) decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
#endif
#ifdef BLOCK_SMOOTHING_SUPPORTED
LOCAL(boolean) smoothing_ok(j_decompress_ptr cinfo);
METHODDEF(int) decompress_smooth_data(j_decompress_ptr cinfo,
JSAMPIMAGE output_buf);
#endif
/*
* Initialize for an input processing pass.
*/
METHODDEF(void)
start_input_pass(j_decompress_ptr cinfo)
{
cinfo->input_iMCU_row = 0;
start_iMCU_row(cinfo);
}
/*
* Initialize for an output processing pass.
*/
METHODDEF(void)
start_output_pass(j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
/* If multipass, check to see whether to use block smoothing on this pass */
if (coef->pub.coef_arrays != NULL) {
if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
coef->pub.decompress_data = decompress_smooth_data;
else
coef->pub.decompress_data = decompress_data;
}
#endif
cinfo->output_iMCU_row = 0;
}
/*
* Decompress and return some data in the single-pass case.
* Always attempts to emit one fully interleaved MCU row ("iMCU" row).
* Input and output must run in lockstep since we have only a one-MCU buffer.
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
*
* NB: output_buf contains a plane for each component in image,
* which we index according to the component's SOF position.
*/
METHODDEF(int)
decompress_onepass(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int blkn, ci, xindex, yindex, yoffset, useful_width;
JSAMPARRAY output_ptr;
JDIMENSION start_col, output_col;
jpeg_component_info *compptr;
inverse_DCT_method_ptr inverse_DCT;
/* Loop to process as much as one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* 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->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
}
/* Only perform the IDCT on blocks that are contained within the desired
* cropping region.
*/
if (MCU_col_num >= cinfo->master->first_iMCU_col &&
MCU_col_num <= cinfo->master->last_iMCU_col) {
/* Determine where data should go in output_buf and do the IDCT thing.
* We skip dummy blocks at the right and bottom edges (but blkn gets
* incremented past them!). Note the inner loop relies on having
* allocated the MCU_buffer[] blocks sequentially.
*/
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Don't bother to IDCT an uninteresting component. */
if (!compptr->component_needed) {
blkn += compptr->MCU_blocks;
continue;
}
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
useful_width = (MCU_col_num < last_MCU_col) ?
compptr->MCU_width : compptr->last_col_width;
output_ptr = output_buf[compptr->component_index] +
yoffset * compptr->_DCT_scaled_size;
start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *
compptr->MCU_sample_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (cinfo->input_iMCU_row < last_iMCU_row ||
yoffset + yindex < compptr->last_row_height) {
output_col = start_col;
for (xindex = 0; xindex < useful_width; xindex++) {
(*inverse_DCT) (cinfo, compptr,
(JCOEFPTR)coef->MCU_buffer[blkn + xindex],
output_ptr, output_col);
output_col += compptr->_DCT_scaled_size;
}
}
blkn += compptr->MCU_width;
output_ptr += compptr->_DCT_scaled_size;
}
}
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
coef->MCU_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
cinfo->output_iMCU_row++;
if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
start_iMCU_row(cinfo);
return JPEG_ROW_COMPLETED;
}
/* Completed the scan */
(*cinfo->inputctl->finish_input_pass) (cinfo);
return JPEG_SCAN_COMPLETED;
}
/*
* Dummy consume-input routine for single-pass operation.
*/
METHODDEF(int)
dummy_consume_data(j_decompress_ptr cinfo)
{
return JPEG_SUSPENDED; /* Always indicate nothing was done */
}
#ifdef D_MULTISCAN_FILES_SUPPORTED
/*
* Consume input data and store it in the full-image coefficient buffer.
* We read as much as one fully interleaved MCU row ("iMCU" row) per call,
* ie, v_samp_factor block rows for each component in the scan.
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
*/
METHODDEF(int)
consume_data(j_decompress_ptr cinfo)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
int blkn, ci, xindex, yindex, yoffset;
JDIMENSION start_col;
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
JBLOCKROW buffer_ptr;
jpeg_component_info *compptr;
/* Align the virtual buffers for the components used in this scan. */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
buffer[ci] = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
cinfo->input_iMCU_row * compptr->v_samp_factor,
(JDIMENSION)compptr->v_samp_factor, TRUE);
/* Note: entropy decoder expects buffer to be zeroed,
* but this is handled automatically by the memory manager
* because we requested a pre-zeroed array.
*/
}
/* Loop to process one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
}
/* Try to fetch the MCU. */
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
coef->MCU_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
start_iMCU_row(cinfo);
return JPEG_ROW_COMPLETED;
}
/* Completed the scan */
(*cinfo->inputctl->finish_input_pass) (cinfo);
return JPEG_SCAN_COMPLETED;
}
/*
* Decompress and return some data in the multi-pass case.
* Always attempts to emit one fully interleaved MCU row ("iMCU" row).
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
*
* NB: output_buf contains a plane for each component in image.
*/
METHODDEF(int)
decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
JDIMENSION block_num;
int ci, block_row, block_rows;
JBLOCKARRAY buffer;
JBLOCKROW buffer_ptr;
JSAMPARRAY output_ptr;
JDIMENSION output_col;
jpeg_component_info *compptr;
inverse_DCT_method_ptr inverse_DCT;
/* Force some input to be done if we are getting ahead of the input. */
while (cinfo->input_scan_number < cinfo->output_scan_number ||
(cinfo->input_scan_number == cinfo->output_scan_number &&
cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
return JPEG_SUSPENDED;
}
/* OK, output from the virtual arrays. */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Don't bother to IDCT an uninteresting component. */
if (!compptr->component_needed)
continue;
/* Align the virtual buffer for this component. */
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr)cinfo, coef->whole_image[ci],
cinfo->output_iMCU_row * compptr->v_samp_factor,
(JDIMENSION)compptr->v_samp_factor, FALSE);
/* Count non-dummy DCT block rows in this iMCU row. */
if (cinfo->output_iMCU_row < last_iMCU_row)
block_rows = compptr->v_samp_factor;
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;
}
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];
output_col = 0;
for (block_num = cinfo->master->first_MCU_col[ci];
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)buffer_ptr, output_ptr,
output_col);
buffer_ptr++;
output_col += compptr->_DCT_scaled_size;
}
output_ptr += compptr->_DCT_scaled_size;
}
}
if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
return JPEG_ROW_COMPLETED;
return JPEG_SCAN_COMPLETED;
}
#endif /* D_MULTISCAN_FILES_SUPPORTED */
#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.
* 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 */
#define Q01_POS 1
#define Q10_POS 8
#define Q20_POS 16
#define Q11_POS 9
#define Q02_POS 2
/*
* Determine whether block smoothing is applicable and safe.
* We also latch the current states of the coef_bits[] entries for the
* AC coefficients; otherwise, if the input side of the decompressor
* advances into a new scan, we might think the coefficients are known
* more accurately than they really are.
*/
LOCAL(boolean)
smoothing_ok(j_decompress_ptr cinfo)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
boolean smoothing_useful = FALSE;
int ci, coefi;
jpeg_component_info *compptr;
JQUANT_TBL *qtable;
int *coef_bits;
int *coef_bits_latch;
if (!cinfo->progressive_mode || cinfo->coef_bits == NULL)
return FALSE;
/* Allocate latch area if not already done */
if (coef->coef_bits_latch == NULL)
coef->coef_bits_latch = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
cinfo->num_components *
(SAVED_COEFS * sizeof(int)));
coef_bits_latch = coef->coef_bits_latch;
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. */
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)
return FALSE;
/* DC values must be at least partly known for all components. */
coef_bits = cinfo->coef_bits[ci];
if (coef_bits[0] < 0)
return FALSE;
/* Block smoothing is helpful if some AC coefficients remain inaccurate. */
for (coefi = 1; coefi <= 5; coefi++) {
coef_bits_latch[coefi] = coef_bits[coefi];
if (coef_bits[coefi] != 0)
smoothing_useful = TRUE;
}
coef_bits_latch += SAVED_COEFS;
}
return smoothing_useful;
}
/*
* Variant of decompress_data for use when doing block smoothing.
*/
METHODDEF(int)
decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
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;
JSAMPARRAY output_ptr;
JDIMENSION output_col;
jpeg_component_info *compptr;
inverse_DCT_method_ptr inverse_DCT;
boolean first_row, last_row;
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;
int Al, pred;
/* Keep a local variable to avoid looking it up more than once */
workspace = coef->workspace;
/* Force some input to be done if we are getting ahead of the input. */
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
!cinfo->inputctl->eoi_reached) {
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
* values are up to date.
*/
JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
if (cinfo->input_iMCU_row > cinfo->output_iMCU_row + delta)
break;
}
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
return JPEG_SUSPENDED;
}
/* OK, output from the virtual arrays. */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Don't bother to IDCT an uninteresting component. */
if (!compptr->component_needed)
continue;
/* Count non-dummy DCT block rows in this iMCU row. */
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 */
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);
quanttbl = compptr->quant_table;
Q00 = quanttbl->quantval[0];
Q01 = quanttbl->quantval[Q01_POS];
Q10 = quanttbl->quantval[Q10_POS];
Q20 = quanttbl->quantval[Q20_POS];
Q11 = quanttbl->quantval[Q11_POS];
Q02 = quanttbl->quantval[Q02_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)
prev_block_row = buffer_ptr;
else
prev_block_row = buffer[block_row - 1];
if (last_row && block_row == block_rows - 1)
next_block_row = buffer_ptr;
else
next_block_row = buffer[block_row + 1];
/* 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.
*/
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];
output_col = 0;
last_block_column = compptr->width_in_blocks - 1;
for (block_num = cinfo->master->first_MCU_col[ci];
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
/* 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];
}
/* Compute coefficient estimates per K.8.
* An estimate is applied only if 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);
if (num >= 0) {
pred = (int)(((Q01 << 7) + num) / (Q01 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q01 << 7) - num) / (Q01 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[1] = (JCOEF)pred;
}
/* AC10 */
if ((Al = coef_bits[2]) != 0 && workspace[8] == 0) {
num = 36 * Q00 * (DC2 - DC8);
if (num >= 0) {
pred = (int)(((Q10 << 7) + num) / (Q10 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q10 << 7) - num) / (Q10 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[8] = (JCOEF)pred;
}
/* AC20 */
if ((Al = coef_bits[3]) != 0 && workspace[16] == 0) {
num = 9 * Q00 * (DC2 + DC8 - 2 * DC5);
if (num >= 0) {
pred = (int)(((Q20 << 7) + num) / (Q20 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q20 << 7) - num) / (Q20 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[16] = (JCOEF)pred;
}
/* AC11 */
if ((Al = coef_bits[4]) != 0 && workspace[9] == 0) {
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
if (num >= 0) {
pred = (int)(((Q11 << 7) + num) / (Q11 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q11 << 7) - num) / (Q11 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[9] = (JCOEF)pred;
}
/* AC02 */
if ((Al = coef_bits[5]) != 0 && workspace[2] == 0) {
num = 9 * Q00 * (DC4 + DC6 - 2 * DC5);
if (num >= 0) {
pred = (int)(((Q02 << 7) + num) / (Q02 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
} else {
pred = (int)(((Q02 << 7) - num) / (Q02 << 8));
if (Al > 0 && pred >= (1 << Al))
pred = (1 << Al) - 1;
pred = -pred;
}
workspace[2] = (JCOEF)pred;
}
/* 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++;
output_col += compptr->_DCT_scaled_size;
}
output_ptr += compptr->_DCT_scaled_size;
}
}
if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
return JPEG_ROW_COMPLETED;
return JPEG_SCAN_COMPLETED;
}
#endif /* BLOCK_SMOOTHING_SUPPORTED */
/*
* Initialize coefficient buffer controller.
*/
GLOBAL(void)
jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
{
my_coef_ptr coef;
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_coef_controller));
cinfo->coef = (struct jpeg_d_coef_controller *)coef;
coef->pub.start_input_pass = start_input_pass;
coef->pub.start_output_pass = start_output_pass;
#ifdef BLOCK_SMOOTHING_SUPPORTED
coef->coef_bits_latch = NULL;
#endif
/* Create the coefficient buffer. */
if (need_full_buffer) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
/* Allocate a full-image virtual array for each component, */
/* padded to a multiple of samp_factor DCT blocks in each direction. */
/* Note we ask for a pre-zeroed array. */
int ci, access_rows;
jpeg_component_info *compptr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
access_rows = compptr->v_samp_factor;
#ifdef BLOCK_SMOOTHING_SUPPORTED
/* If block smoothing could be used, need a bigger window */
if (cinfo->progressive_mode)
access_rows *= 3;
#endif
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
(JDIMENSION)jround_up((long)compptr->width_in_blocks,
(long)compptr->h_samp_factor),
(JDIMENSION)jround_up((long)compptr->height_in_blocks,
(long)compptr->v_samp_factor),
(JDIMENSION)access_rows);
}
coef->pub.consume_data = consume_data;
coef->pub.decompress_data = decompress_data;
coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else {
/* We only need a single-MCU buffer. */
JBLOCKROW buffer;
int i;
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
D_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
coef->MCU_buffer[i] = buffer + i;
}
coef->pub.consume_data = dummy_consume_data;
coef->pub.decompress_data = decompress_onepass;
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
}
/* Allocate the workspace buffer */
coef->workspace = (JCOEF *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(JCOEF) * DCTSIZE2);
}
+82
View File
@@ -0,0 +1,82 @@
/*
* jdcoefct.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*/
#define JPEG_INTERNALS
#include "jpeglib.h"
/* Block smoothing is only applicable for progressive JPEG, so: */
#ifndef D_PROGRESSIVE_SUPPORTED
#undef BLOCK_SMOOTHING_SUPPORTED
#endif
/* Private buffer controller object */
typedef struct {
struct jpeg_d_coef_controller pub; /* public fields */
/* These variables keep track of the current location of the input side. */
/* cinfo->input_iMCU_row is also used for this. */
JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
/* The output side's location is represented by cinfo->output_iMCU_row. */
/* In single-pass modes, it's sufficient to buffer just one MCU.
* We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
* and let the entropy decoder write into that workspace each time.
* In multi-pass modes, this array points to the current MCU's blocks
* within the virtual arrays; it is used only by the input side.
*/
JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
/* Temporary workspace for one MCU */
JCOEF *workspace;
#ifdef D_MULTISCAN_FILES_SUPPORTED
/* In multi-pass modes, we need a virtual block array for each component. */
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
#endif
#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] */
#endif
} my_coef_controller;
typedef my_coef_controller *my_coef_ptr;
LOCAL(void)
start_iMCU_row(j_decompress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row (input side) */
{
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
/* In an interleaved scan, an MCU row is the same as an iMCU row.
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
* But at the bottom of the image, process only what's left.
*/
if (cinfo->comps_in_scan > 1) {
coef->MCU_rows_per_iMCU_row = 1;
} else {
if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows - 1))
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
else
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
coef->MCU_ctr = 0;
coef->MCU_vert_offset = 0;
}
+384
View File
@@ -0,0 +1,384 @@
/*
* jdcol565.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modifications:
* Copyright (C) 2013, Linaro Limited.
* Copyright (C) 2014-2015, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains output colorspace conversion routines.
*/
/* This file is included by jdcolor.c */
INLINE
LOCAL(void)
ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int y, cb, cr;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */
register JSAMPLE *range_limit = cinfo->sample_range_limit;
register int *Crrtab = cconvert->Cr_r_tab;
register int *Cbbtab = cconvert->Cb_b_tab;
register JLONG *Crgtab = cconvert->Cr_g_tab;
register JLONG *Cbgtab = cconvert->Cb_g_tab;
SHIFT_TEMPS
while (--num_rows >= 0) {
JLONG rgb;
unsigned int r, g, b;
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*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);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*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++);
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_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
outptr += 4;
}
if (num_cols & 1) {
y = GETJSAMPLE(*inptr0);
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*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);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
INLINE
LOCAL(void)
ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int y, cb, cr;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */
register JSAMPLE *range_limit = cinfo->sample_range_limit;
register int *Crrtab = cconvert->Cr_r_tab;
register int *Cbbtab = cconvert->Cb_b_tab;
register JLONG *Crgtab = cconvert->Cr_g_tab;
register JLONG *Cbgtab = cconvert->Cb_g_tab;
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
SHIFT_TEMPS
while (--num_rows >= 0) {
JLONG rgb;
unsigned int r, g, b;
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*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],
SCALEBITS)), d0)];
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*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],
SCALEBITS)), d0)];
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_SHORT_565(r, g, b);
y = GETJSAMPLE(*inptr0++);
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*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],
SCALEBITS)), d0)];
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
outptr += 4;
}
if (num_cols & 1) {
y = GETJSAMPLE(*inptr0);
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*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],
SCALEBITS)), d0)];
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
INLINE
LOCAL(void)
rgb_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
SHIFT_TEMPS
while (--num_rows >= 0) {
JLONG rgb;
unsigned int r, g, b;
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
r = GETJSAMPLE(*inptr0++);
g = GETJSAMPLE(*inptr1++);
b = GETJSAMPLE(*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++);
rgb = PACK_SHORT_565(r, g, b);
r = GETJSAMPLE(*inptr0++);
g = GETJSAMPLE(*inptr1++);
b = GETJSAMPLE(*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);
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
INLINE
LOCAL(void)
rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
register JSAMPLE *range_limit = cinfo->sample_range_limit;
JDIMENSION num_cols = cinfo->output_width;
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
SHIFT_TEMPS
while (--num_rows >= 0) {
JLONG rgb;
unsigned int r, g, b;
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
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)];
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)];
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)];
d0 = DITHER_ROTATE(d0);
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
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)];
rgb = PACK_SHORT_565(r, g, b);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
INLINE
LOCAL(void)
gray_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW inptr, outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
JLONG rgb;
unsigned int g;
inptr = input_buf[0][input_row++];
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
g = *inptr++;
rgb = PACK_SHORT_565(g, g, g);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
g = *inptr++;
rgb = PACK_SHORT_565(g, g, g);
g = *inptr++;
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
outptr += 4;
}
if (num_cols & 1) {
g = *inptr;
rgb = PACK_SHORT_565(g, g, g);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
INLINE
LOCAL(void)
gray_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW inptr, outptr;
register JDIMENSION col;
register JSAMPLE *range_limit = cinfo->sample_range_limit;
JDIMENSION num_cols = cinfo->output_width;
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
while (--num_rows >= 0) {
JLONG rgb;
unsigned int g;
inptr = input_buf[0][input_row++];
outptr = *output_buf++;
if (PACK_NEED_ALIGNMENT(outptr)) {
g = *inptr++;
g = range_limit[DITHER_565_R(g, d0)];
rgb = PACK_SHORT_565(g, g, g);
*(INT16 *)outptr = (INT16)rgb;
outptr += 2;
num_cols--;
}
for (col = 0; col < (num_cols >> 1); col++) {
g = *inptr++;
g = range_limit[DITHER_565_R(g, d0)];
rgb = PACK_SHORT_565(g, g, g);
d0 = DITHER_ROTATE(d0);
g = *inptr++;
g = range_limit[DITHER_565_R(g, d0)];
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));
d0 = DITHER_ROTATE(d0);
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
outptr += 4;
}
if (num_cols & 1) {
g = *inptr;
g = range_limit[DITHER_565_R(g, d0)];
rgb = PACK_SHORT_565(g, g, g);
*(INT16 *)outptr = (INT16)rgb;
}
}
}
+143
View File
@@ -0,0 +1,143 @@
/*
* jdcolext.c
*
* 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, 2015, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains output colorspace conversion routines.
*/
/* This file is included by jdcolor.c */
/*
* Convert some rows of samples to the output colorspace.
*
* 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.
*/
INLINE
LOCAL(void)
ycc_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int y, cb, cr;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */
register JSAMPLE *range_limit = cinfo->sample_range_limit;
register int *Crrtab = cconvert->Cr_r_tab;
register int *Cbbtab = cconvert->Cb_b_tab;
register JLONG *Crgtab = cconvert->Cr_g_tab;
register JLONG *Cbgtab = cconvert->Cb_g_tab;
SHIFT_TEMPS
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
y = GETJSAMPLE(inptr0[col]);
cb = GETJSAMPLE(inptr1[col]);
cr = GETJSAMPLE(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 +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
/* alpha channel value */
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
}
}
/*
* Convert grayscale to RGB: just duplicate the graylevel three times.
* This is provided to support applications that don't want to cope
* with grayscale as a separate case.
*/
INLINE
LOCAL(void)
gray_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW inptr, outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
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 */
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
}
}
/*
* Convert RGB to extended RGB: just swap the order of source pixels
*/
INLINE
LOCAL(void)
rgb_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
register JSAMPROW inptr0, inptr1, inptr2;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
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];
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
/* alpha channel value */
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
}
}
+883
View File
@@ -0,0 +1,883 @@
/*
* jdcolor.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009, 2011-2012, 2014-2015, D. R. Commander.
* Copyright (C) 2013, Linaro Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains output colorspace conversion routines.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "jconfigint.h"
/* Private subobject */
typedef struct {
struct jpeg_color_deconverter pub; /* public fields */
/* 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 */
/* Private state for RGB->Y conversion */
JLONG *rgb_y_tab; /* => table for RGB to Y conversion */
} my_color_deconverter;
typedef my_color_deconverter *my_cconvert_ptr;
/**************** YCbCr -> RGB conversion: most common case **************/
/**************** RGB -> Y conversion: less common case **************/
/*
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
* The conversion equations to be implemented are therefore
*
* R = Y + 1.40200 * Cr
* G = Y - 0.34414 * Cb - 0.71414 * Cr
* B = Y + 1.77200 * Cb
*
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
*
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
*
* To avoid floating-point arithmetic, we represent the fractional constants
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
* the products by 2^16, with appropriate rounding, to get the correct answer.
* Notice that Y, being an integral input, does not contribute any fraction
* so it need not participate in the rounding.
*
* For even more speed, we avoid doing any multiplications in the inner loop
* by precalculating the constants times Cb and Cr for all possible values.
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
* for 12-bit samples it is still acceptable. It's not very reasonable for
* 16-bit samples, but if you want lossless storage you shouldn't be changing
* colorspace anyway.
* The Cr=>R and Cb=>B values can be rounded to integers in advance; the
* values for the G calculation are left scaled up, since we must add them
* together before rounding.
*/
#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))
/* We allocate one big table for RGB->Y conversion and divide it up into
* three parts, instead of doing three alloc_small requests. This lets us
* use a single table base address, which can be held in a register in the
* inner loops on many machines (more than can hold all three addresses,
* anyway).
*/
#define R_Y_OFF 0 /* offset to R => Y section */
#define G_Y_OFF (1 * (MAXJSAMPLE + 1)) /* offset to G => Y section */
#define B_Y_OFF (2 * (MAXJSAMPLE + 1)) /* etc. */
#define TABLE_SIZE (3 * (MAXJSAMPLE + 1))
/* Include inline routines for colorspace extensions */
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#define RGB_RED EXT_RGB_RED
#define RGB_GREEN EXT_RGB_GREEN
#define RGB_BLUE EXT_RGB_BLUE
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extrgb_convert_internal
#define gray_rgb_convert_internal gray_extrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
#define RGB_BLUE EXT_RGBX_BLUE
#define RGB_ALPHA 3
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal
#define gray_rgb_convert_internal gray_extrgbx_convert_internal
#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGR_RED
#define RGB_GREEN EXT_BGR_GREEN
#define RGB_BLUE EXT_BGR_BLUE
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extbgr_convert_internal
#define gray_rgb_convert_internal gray_extbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
#define RGB_BLUE EXT_BGRX_BLUE
#define RGB_ALPHA 3
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal
#define gray_rgb_convert_internal gray_extbgrx_convert_internal
#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
#define RGB_BLUE EXT_XBGR_BLUE
#define RGB_ALPHA 0
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal
#define gray_rgb_convert_internal gray_extxbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
#define RGB_BLUE EXT_XRGB_BLUE
#define RGB_ALPHA 0
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal
#define gray_rgb_convert_internal gray_extxrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
/*
* Initialize tables for YCC->RGB colorspace conversion.
*/
LOCAL(void)
build_ycc_rgb_table(j_decompress_ptr cinfo)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
int i;
JLONG 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 = (JLONG *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(MAXJSAMPLE + 1) * sizeof(JLONG));
cconvert->Cb_g_tab = (JLONG *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(MAXJSAMPLE + 1) * sizeof(JLONG));
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.40200 * x */
cconvert->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
/* Cb=>B value is nearest int to 1.77200 * x */
cconvert->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
/* Cr=>G value is scaled-up -0.71414 * x */
cconvert->Cr_g_tab[i] = (-FIX(0.71414)) * x;
/* Cb=>G value is scaled-up -0.34414 * x */
/* We also add in ONE_HALF so that need not do it in inner loop */
cconvert->Cb_g_tab[i] = (-FIX(0.34414)) * x + ONE_HALF;
}
}
/*
* Convert some rows of samples to the output colorspace.
*/
METHODDEF(void)
ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
switch (cinfo->out_color_space) {
case JCS_EXT_RGB:
ycc_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGR:
ycc_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
default:
ycc_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
}
}
/**************** Cases other than YCbCr -> RGB **************/
/*
* Initialize for RGB->grayscale colorspace conversion.
*/
LOCAL(void)
build_rgb_y_table(j_decompress_ptr cinfo)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
JLONG *rgb_y_tab;
JLONG i;
/* Allocate and fill in the conversion tables. */
cconvert->rgb_y_tab = rgb_y_tab = (JLONG *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
(TABLE_SIZE * sizeof(JLONG)));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_y_tab[i + R_Y_OFF] = FIX(0.29900) * i;
rgb_y_tab[i + G_Y_OFF] = FIX(0.58700) * i;
rgb_y_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
}
}
/*
* Convert RGB to grayscale.
*/
METHODDEF(void)
rgb_gray_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int r, g, b;
register JLONG *ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr0[col]);
g = GETJSAMPLE(inptr1[col]);
b = GETJSAMPLE(inptr2[col]);
/* Y */
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
ctab[b + B_Y_OFF]) >> SCALEBITS);
}
}
}
/*
* Color conversion for no colorspace change: just copy the data,
* converting from separate-planes to interleaved representation.
*/
METHODDEF(void)
null_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;
register JDIMENSION col;
register int num_components = cinfo->num_components;
JDIMENSION num_cols = cinfo->output_width;
int ci;
if (num_components == 3) {
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
*outptr++ = inptr0[col];
*outptr++ = inptr1[col];
*outptr++ = inptr2[col];
}
}
} else if (num_components == 4) {
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
inptr3 = input_buf[3][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
*outptr++ = inptr0[col];
*outptr++ = inptr1[col];
*outptr++ = inptr2[col];
*outptr++ = inptr3[col];
}
}
} else {
while (--num_rows >= 0) {
for (ci = 0; ci < num_components; ci++) {
inptr = input_buf[ci][input_row];
outptr = *output_buf;
for (col = 0; col < num_cols; col++) {
outptr[ci] = inptr[col];
outptr += num_components;
}
}
output_buf++;
input_row++;
}
}
}
/*
* Color conversion for grayscale: just copy the data.
* This also works for YCbCr -> grayscale conversion, in which
* we just copy the Y (luminance) component and ignore chrominance.
*/
METHODDEF(void)
grayscale_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
jcopy_sample_rows(input_buf[0], (int)input_row, output_buf, 0, num_rows,
cinfo->output_width);
}
/*
* Convert grayscale to RGB
*/
METHODDEF(void)
gray_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
switch (cinfo->out_color_space) {
case JCS_EXT_RGB:
gray_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGR:
gray_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
default:
gray_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
}
}
/*
* Convert plain RGB to extended RGB
*/
METHODDEF(void)
rgb_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
switch (cinfo->out_color_space) {
case JCS_EXT_RGB:
rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGR:
rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
default:
rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
}
}
/*
* 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.
* We assume build_ycc_rgb_table has been called.
*/
METHODDEF(void)
ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
register int y, cb, cr;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2, inptr3;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */
register JSAMPLE *range_limit = cinfo->sample_range_limit;
register int *Crrtab = cconvert->Cr_r_tab;
register int *Cbbtab = cconvert->Cb_b_tab;
register JLONG *Crgtab = cconvert->Cr_g_tab;
register JLONG *Cbgtab = cconvert->Cb_g_tab;
SHIFT_TEMPS
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
inptr3 = input_buf[3][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
y = GETJSAMPLE(inptr0[col]);
cb = GETJSAMPLE(inptr1[col]);
cr = GETJSAMPLE(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 */
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS)))];
outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
/* K passes through unchanged */
outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
outptr += 4;
}
}
}
/*
* 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_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(int *)(addr)) = pixels)
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
/* Declarations for ordered dithering
*
* We use a 4x4 ordered dither array packed into 32 bits. This array is
* sufficient for dithering RGB888 to RGB565.
*/
#define DITHER_MASK 0x3
#define DITHER_ROTATE(x) ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF))
static const JLONG dither_matrix[4] = {
0x0008020A,
0x0C040E06,
0x030B0109,
0x0F070D05
};
static INLINE boolean is_big_endian(void)
{
int test_value = 1;
if (*(char *)&test_value != 1)
return TRUE;
return FALSE;
}
/* Include inline routines for RGB565 conversion */
#define PACK_SHORT_565 PACK_SHORT_565_LE
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE
#define ycc_rgb565_convert_internal ycc_rgb565_convert_le
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_le
#define rgb_rgb565_convert_internal rgb_rgb565_convert_le
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_le
#define gray_rgb565_convert_internal gray_rgb565_convert_le
#define gray_rgb565D_convert_internal gray_rgb565D_convert_le
#include "jdcol565.c"
#undef PACK_SHORT_565
#undef PACK_TWO_PIXELS
#undef ycc_rgb565_convert_internal
#undef ycc_rgb565D_convert_internal
#undef rgb_rgb565_convert_internal
#undef rgb_rgb565D_convert_internal
#undef gray_rgb565_convert_internal
#undef gray_rgb565D_convert_internal
#define PACK_SHORT_565 PACK_SHORT_565_BE
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE
#define ycc_rgb565_convert_internal ycc_rgb565_convert_be
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_be
#define rgb_rgb565_convert_internal rgb_rgb565_convert_be
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_be
#define gray_rgb565_convert_internal gray_rgb565_convert_be
#define gray_rgb565D_convert_internal gray_rgb565D_convert_be
#include "jdcol565.c"
#undef PACK_SHORT_565
#undef PACK_TWO_PIXELS
#undef ycc_rgb565_convert_internal
#undef ycc_rgb565D_convert_internal
#undef rgb_rgb565_convert_internal
#undef rgb_rgb565D_convert_internal
#undef gray_rgb565_convert_internal
#undef gray_rgb565D_convert_internal
METHODDEF(void)
ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
ycc_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
METHODDEF(void)
ycc_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
ycc_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
METHODDEF(void)
rgb_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
rgb_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
METHODDEF(void)
rgb_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
rgb_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
METHODDEF(void)
gray_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
gray_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
METHODDEF(void)
gray_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
{
if (is_big_endian())
gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
else
gray_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
}
/*
* Empty method for start_pass.
*/
METHODDEF(void)
start_pass_dcolor(j_decompress_ptr cinfo)
{
/* no work needed */
}
/*
* Module initialization routine for output colorspace conversion.
*/
GLOBAL(void)
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));
cinfo->cconvert = (struct jpeg_color_deconverter *)cconvert;
cconvert->pub.start_pass = start_pass_dcolor;
/* Make sure num_components agrees with jpeg_color_space */
switch (cinfo->jpeg_color_space) {
case JCS_GRAYSCALE:
if (cinfo->num_components != 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
case JCS_RGB:
case JCS_YCbCr:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
case JCS_CMYK:
case JCS_YCCK:
if (cinfo->num_components != 4)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
default: /* JCS_UNKNOWN can be anything */
if (cinfo->num_components < 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
break;
}
/* Set out_color_components and conversion method based on requested space.
* Also clear the component_needed flags for any unused components,
* so that earlier pipeline stages can avoid useless computation.
*/
switch (cinfo->out_color_space) {
case JCS_GRAYSCALE:
cinfo->out_color_components = 1;
if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
cinfo->jpeg_color_space == JCS_YCbCr) {
cconvert->pub.color_convert = grayscale_convert;
/* For color->grayscale conversion, only the Y (0) component is needed */
for (ci = 1; ci < cinfo->num_components; ci++)
cinfo->comp_info[ci].component_needed = FALSE;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
cconvert->pub.color_convert = rgb_gray_convert;
build_rgb_y_table(cinfo);
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_RGB:
case JCS_EXT_RGB:
case JCS_EXT_RGBX:
case JCS_EXT_BGR:
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
if (cinfo->jpeg_color_space == JCS_YCbCr) {
if (jsimd_can_ycc_rgb())
cconvert->pub.color_convert = jsimd_ycc_rgb_convert;
else {
cconvert->pub.color_convert = ycc_rgb_convert;
build_ycc_rgb_table(cinfo);
}
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
cconvert->pub.color_convert = gray_rgb_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
if (rgb_red[cinfo->out_color_space] == 0 &&
rgb_green[cinfo->out_color_space] == 1 &&
rgb_blue[cinfo->out_color_space] == 2 &&
rgb_pixelsize[cinfo->out_color_space] == 3)
cconvert->pub.color_convert = null_convert;
else
cconvert->pub.color_convert = rgb_rgb_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_RGB565:
cinfo->out_color_components = 3;
if (cinfo->dither_mode == JDITHER_NONE) {
if (cinfo->jpeg_color_space == JCS_YCbCr) {
if (jsimd_can_ycc_rgb565())
cconvert->pub.color_convert = jsimd_ycc_rgb565_convert;
else {
cconvert->pub.color_convert = ycc_rgb565_convert;
build_ycc_rgb_table(cinfo);
}
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
cconvert->pub.color_convert = gray_rgb565_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
cconvert->pub.color_convert = rgb_rgb565_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
} else {
/* only ordered dithering is supported */
if (cinfo->jpeg_color_space == JCS_YCbCr) {
cconvert->pub.color_convert = ycc_rgb565D_convert;
build_ycc_rgb_table(cinfo);
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
cconvert->pub.color_convert = gray_rgb565D_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
cconvert->pub.color_convert = rgb_rgb565D_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
break;
case JCS_CMYK:
cinfo->out_color_components = 4;
if (cinfo->jpeg_color_space == JCS_YCCK) {
cconvert->pub.color_convert = ycck_cmyk_convert;
build_ycc_rgb_table(cinfo);
} else if (cinfo->jpeg_color_space == JCS_CMYK) {
cconvert->pub.color_convert = null_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
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 */
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
}
if (cinfo->quantize_colors)
cinfo->output_components = 1; /* single colormapped output component */
else
cinfo->output_components = cinfo->out_color_components;
}
+208
View File
@@ -0,0 +1,208 @@
/*
* jdct.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This include file contains common declarations for the forward and
* inverse DCT modules. These declarations are private to the DCT managers
* (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
* The individual DCT algorithms are kept in separate files to ease
* machine-dependent tuning (e.g., assembly coding).
*/
/*
* A forward DCT routine is given a pointer to a work area of type DCTELEM[];
* the DCT is to be performed in-place in that buffer. Type DCTELEM is int
* for 8-bit samples, JLONG for 12-bit samples. (NOTE: Floating-point DCT
* implementations use an array of type FAST_FLOAT, instead.)
* The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
* The DCT outputs are returned scaled up by a factor of 8; they therefore
* have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
* convention improves accuracy in integer implementations and saves some
* work in floating-point ones.
* Quantization of the output coefficients is done by jcdctmgr.c. This
* step requires an unsigned type and also one with twice the bits.
*/
#if BITS_IN_JSAMPLE == 8
#ifndef WITH_SIMD
typedef int DCTELEM; /* 16 or 32 bits is fine */
typedef unsigned int UDCTELEM;
typedef unsigned long long UDCTELEM2;
#else
typedef short DCTELEM; /* prefer 16 bit with SIMD for parellelism */
typedef unsigned short UDCTELEM;
typedef unsigned int UDCTELEM2;
#endif
#else
typedef JLONG DCTELEM; /* must have 32 bits */
typedef unsigned long long UDCTELEM2;
#endif
/*
* An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
* to an output sample array. The routine must dequantize the input data as
* well as perform the IDCT; for dequantization, it uses the multiplier table
* pointed to by compptr->dct_table. The output data is to be placed into the
* sample array starting at a specified column. (Any row offset needed will
* be applied to the array pointer before it is passed to the IDCT code.)
* Note that the number of samples emitted by the IDCT routine is
* DCT_scaled_size * DCT_scaled_size.
*/
/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
/*
* Each IDCT routine has its own ideas about the best dct_table element type.
*/
typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
#if BITS_IN_JSAMPLE == 8
typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
#else
typedef JLONG IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
#endif
typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
/*
* Each IDCT routine is responsible for range-limiting its results and
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
* be quite far out of range if the input data is corrupt, so a bulletproof
* range-limiting step is required. We use a mask-and-table-lookup method
* to do the combined operations quickly. See the comments with
* prepare_range_limit_table (in jdmaster.c) for more info.
*/
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
/* Extern declarations for the forward and inverse DCT routines. */
EXTERN(void) jpeg_fdct_islow(DCTELEM *data);
EXTERN(void) jpeg_fdct_ifast(DCTELEM *data);
EXTERN(void) jpeg_fdct_float(FAST_FLOAT *data);
EXTERN(void) jpeg_idct_islow(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_ifast(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_float(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_7x7(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_6x6(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_5x5(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_4x4(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_3x3(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_2x2(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_1x1(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_9x9(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_10x10(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_11x11(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_12x12(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_13x13(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_14x14(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_15x15(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
EXTERN(void) jpeg_idct_16x16(j_decompress_ptr cinfo,
jpeg_component_info *compptr, JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col);
/*
* Macros for handling fixed-point arithmetic; these are used by many
* but not all of the DCT/IDCT modules.
*
* All values are expected to be of type JLONG.
* Fractional constants are scaled left by CONST_BITS bits.
* CONST_BITS is defined within each module using these macros,
* and may differ from one module to the next.
*/
#define ONE ((JLONG)1)
#define CONST_SCALE (ONE << CONST_BITS)
/* Convert a positive real constant to an integer scaled by CONST_SCALE.
* Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
* thus causing a lot of useless floating-point operations at run time.
*/
#define FIX(x) ((JLONG)((x) * CONST_SCALE + 0.5))
/* Descale and correctly round a JLONG 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 a JLONG variable by a JLONG constant to yield a JLONG 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
* full 32x32 multiply. This provides a useful speedup on many machines.
* Unfortunately there is no way to specify a 16x16->32 multiply portably
* in C, but some C compilers will do the right thing if you provide the
* correct combination of casts.
*/
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
#define MULTIPLY16C16(var, const) (((INT16)(var)) * ((INT16)(const)))
#endif
#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
#define MULTIPLY16C16(var, const) (((INT16)(var)) * ((JLONG)(const)))
#endif
#ifndef MULTIPLY16C16 /* default definition */
#define MULTIPLY16C16(var, const) ((var) * (const))
#endif
/* Same except both inputs are variables. */
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
#define MULTIPLY16V16(var1, var2) (((INT16)(var1)) * ((INT16)(var2)))
#endif
#ifndef MULTIPLY16V16 /* default definition */
#define MULTIPLY16V16(var1, var2) ((var1) * (var2))
#endif

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