mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 13:23:02 +04:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5199850039 | |||
| 4ddd1181df | |||
| f11c74d52a | |||
| 5d591b2a17 | |||
| 31c803d15e |
@@ -15,12 +15,12 @@ body:
|
||||
Please provide the following system information to help us diagnose the bug. For example:
|
||||
|
||||
// example for c++ user
|
||||
OpenCV version: 4.8.0
|
||||
OpenCV version: 4.6.0
|
||||
Operating System / Platform: Ubuntu 20.04
|
||||
Compiler & compiler version: GCC 9.3.0
|
||||
|
||||
// example for python user
|
||||
OpenCV python version: 4.8.0.74
|
||||
OpenCV python version: 4.6.0.66
|
||||
Operating System / Platform: Ubuntu 20.04
|
||||
Python version: 3.9.6
|
||||
validations:
|
||||
|
||||
@@ -12,7 +12,7 @@ body:
|
||||
attributes:
|
||||
label: Describe the doc issue
|
||||
description: >
|
||||
Please provide a clear and concise description of what content in https://docs.opencv.org/ is an issue. Note that there are multiple active branches, such as 4.x and 5.x, so please specify the branch with the problem.
|
||||
Please provide a clear and concise description of what content in https://docs.opencv.org/ is an issue. Note that there are multiple active branches, such as 3.4, 4.x and 5.x, so please specify the branch with the problem.
|
||||
placeholder: |
|
||||
A clear and concise description of what content in https://docs.opencv.org/ is an issue.
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
|
||||
|
||||
- [x] I agree to contribute to the project under Apache 2 License.
|
||||
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
|
||||
- [ ] I agree to contribute to the project under Apache 2 License.
|
||||
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
|
||||
- [ ] The PR is proposed to the proper branch
|
||||
- [ ] There is a reference to the original bug report and related work
|
||||
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
|
||||
|
||||
@@ -1,56 +1,47 @@
|
||||
name: PR:4.x
|
||||
name: PR:4.8.x
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 4.x
|
||||
- 4.8.x
|
||||
|
||||
jobs:
|
||||
|
||||
Linux:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-Linux.yaml@main
|
||||
with:
|
||||
workflow_branch: main
|
||||
|
||||
Ubuntu2004-ARM64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64.yaml@release_4.8.x
|
||||
|
||||
Ubuntu2004-ARM64-Debug:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64-Debug.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64-Debug.yaml@release_4.8.x
|
||||
|
||||
Ubuntu2004-x64-OpenVINO:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-OpenVINO.yaml@main
|
||||
Ubuntu2004-x64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20.yaml@release_4.8.x
|
||||
|
||||
Ubuntu2004-x64-CUDA:
|
||||
if: "${{ contains(github.event.pull_request.labels.*.name, 'category: dnn') }} || ${{ contains(github.event.pull_request.labels.*.name, 'category: dnn (onnx)') }}"
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-Cuda.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-Cuda.yaml@release_4.8.x
|
||||
|
||||
Windows10-x64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10.yaml@release_4.8.x
|
||||
|
||||
Windows10-x64-Vulkan:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10-Vulkan.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10-Vulkan.yaml@release_4.8.x
|
||||
|
||||
macOS-ARM64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64.yaml@release_4.8.x
|
||||
|
||||
macOS-x64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-x86_64.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-x86_64.yaml@release_4.8.x
|
||||
|
||||
macOS-ARM64-Vulkan:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64-Vulkan.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64-Vulkan.yaml@release_4.8.x
|
||||
|
||||
iOS:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-iOS.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-iOS.yaml@release_4.8.x
|
||||
|
||||
Android-SDK:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-4.x-Android-SDK.yaml@main
|
||||
Android:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-Android.yaml@release_4.8.x
|
||||
|
||||
TIM-VX:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-timvx-backend-tests-4.x.yml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-timvx-backend-tests-4.x.yml@release_4.8.x
|
||||
|
||||
docs:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-docs.yaml@main
|
||||
|
||||
Linux-RISC-V-Clang:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-RISCV.yaml@main
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-docs.yaml@release_4.8.x
|
||||
|
||||
@@ -44,9 +44,5 @@ if(WITH_NEON)
|
||||
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
target_compile_definitions(carotene_objs PRIVATE "-D_USE_MATH_DEFINES=1")
|
||||
endif()
|
||||
|
||||
# we add dummy file to fix XCode build
|
||||
add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
|
||||
@@ -119,7 +119,7 @@ private: \
|
||||
#define TEGRA_BINARYOP(type, op, src1, sz1, src2, sz2, dst, sz, w, h) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_##op##_Invoker<const type, type>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -154,7 +154,7 @@ TegraUnaryOp_Invoker(bitwiseNot, bitwiseNot)
|
||||
#define TEGRA_UNARYOP(type, op, src1, sz1, dst, sz, w, h) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_##op##_Invoker<const type, type>(src1, sz1, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -254,32 +254,32 @@ TegraGenOp_Invoker(cmpLE, cmpGE, 2, 1, 0, RANGE_DATA(ST, src2_data, src2_step),
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
((op) == cv::CMP_EQ) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpEQ_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((op) == cv::CMP_NE) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpNE_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((op) == cv::CMP_GT) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpGT_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((op) == cv::CMP_GE) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpGE_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((op) == cv::CMP_LT) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpLT_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((op) == cv::CMP_LE) ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_cmpLE_Invoker<const type, CAROTENE_NS::u8>(src1, sz1, src2, sz2, dst, sz, w, h), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -310,7 +310,7 @@ TegraGenOp_Invoker(cmpLE, cmpGE, 2, 1, 0, RANGE_DATA(ST, src2_data, src2_step),
|
||||
#define TEGRA_BINARYOPSCALE(type, op, src1, sz1, src2, sz2, dst, sz, w, h, scales) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_##op##_Invoker<const type, type>(src1, sz1, src2, sz2, dst, sz, w, h, scales), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -332,7 +332,7 @@ TegraBinaryOpScale_Invoker(divf, div, 1, scale)
|
||||
#define TEGRA_UNARYOPSCALE(type, op, src1, sz1, dst, sz, w, h, scales) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, h), \
|
||||
parallel_for_(Range(0, h), \
|
||||
TegraGenOp_##op##_Invoker<const type, type>(src1, sz1, dst, sz, w, h, scales), \
|
||||
(w * h) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -928,17 +928,17 @@ TegraRowOp_Invoker(split4, split4, 1, 4, 0, RANGE_DATA(ST, src1_data, 4*sizeof(S
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
cn == 2 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_split2_Invoker<const type, type>(src, dst[0], dst[1]), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
cn == 3 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_split3_Invoker<const type, type>(src, dst[0], dst[1], dst[2]), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
cn == 4 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_split4_Invoker<const type, type>(src, dst[0], dst[1], dst[2], dst[3]), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -990,17 +990,17 @@ TegraRowOp_Invoker(combine4, combine4, 4, 1, 0, RANGE_DATA(ST, src1_data, sizeof
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
cn == 2 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_combine2_Invoker<const type, type>(src[0], src[1], dst), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
cn == 3 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_combine3_Invoker<const type, type>(src[0], src[1], src[2], dst), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
cn == 4 ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_combine4_Invoker<const type, type>(src[0], src[1], src[2], src[3], dst), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1033,7 +1033,7 @@ TegraRowOp_Invoker(phase, phase, 2, 1, 1, RANGE_DATA(ST, src1_data, sizeof(CAROT
|
||||
#define TEGRA_FASTATAN(y, x, dst, len, angleInDegrees) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_phase_Invoker<const CAROTENE_NS::f32, CAROTENE_NS::f32>(x, y, dst, angleInDegrees ? 1.0f : M_PI/180), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -1049,7 +1049,7 @@ TegraRowOp_Invoker(magnitude, magnitude, 2, 1, 0, RANGE_DATA(ST, src1_data, size
|
||||
#define TEGRA_MAGNITUDE(x, y, dst, len) \
|
||||
( \
|
||||
CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
parallel_for_(cv::Range(0, len), \
|
||||
parallel_for_(Range(0, len), \
|
||||
TegraRowOp_magnitude_Invoker<const CAROTENE_NS::f32, CAROTENE_NS::f32>(x, y, dst), \
|
||||
(len) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK \
|
||||
@@ -1286,6 +1286,7 @@ inline int TEGRA_SEPFILTERFREE(cvhalFilter2D *context)
|
||||
#undef cv_hal_sepFilterFree
|
||||
#define cv_hal_sepFilterFree TEGRA_SEPFILTERFREE
|
||||
|
||||
|
||||
struct MorphCtx
|
||||
{
|
||||
int operation;
|
||||
@@ -1563,17 +1564,17 @@ TegraCvtColor_Invoker(rgbx2bgrx, rgbx2bgrx, src_data + static_cast<size_t>(range
|
||||
scn == 3 ? \
|
||||
dcn == 3 ? \
|
||||
swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2bgr_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
CV_HAL_ERROR_NOT_IMPLEMENTED : \
|
||||
dcn == 4 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2bgrx_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2rgbx_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1581,16 +1582,16 @@ TegraCvtColor_Invoker(rgbx2bgrx, rgbx2bgrx, src_data + static_cast<size_t>(range
|
||||
scn == 4 ? \
|
||||
dcn == 3 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2bgr_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2rgb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
dcn == 4 ? \
|
||||
swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2bgrx_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1613,19 +1614,19 @@ TegraCvtColor_Invoker(rgbx2rgb565, rgbx2rgb565, src_data + static_cast<size_t>(r
|
||||
greenBits == 6 && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
scn == 3 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2bgr565_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2rgb565_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
scn == 4 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2bgr565_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2rgb565_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1646,19 +1647,19 @@ TegraCvtColor_Invoker(bgrx2gray, bgrx2gray, CAROTENE_NS::COLOR_SPACE_BT601, src_
|
||||
depth == CV_8U && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
scn == 3 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2gray_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgr2gray_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
scn == 4 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2gray_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgrx2gray_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1674,12 +1675,12 @@ TegraCvtColor_Invoker(gray2rgbx, gray2rgbx, src_data + static_cast<size_t>(range
|
||||
( \
|
||||
depth == CV_8U && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
dcn == 3 ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_gray2rgb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
dcn == 4 ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_gray2rgbx_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1700,19 +1701,19 @@ TegraCvtColor_Invoker(bgrx2ycrcb, bgrx2ycrcb, src_data + static_cast<size_t>(ran
|
||||
isCbCr && depth == CV_8U && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
scn == 3 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2ycrcb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgr2ycrcb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
scn == 4 ? \
|
||||
(swapBlue ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2ycrcb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgrx2ycrcb_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1742,34 +1743,34 @@ TegraCvtColor_Invoker(bgrx2hsvf, bgrx2hsv, src_data + static_cast<size_t>(range.
|
||||
scn == 3 ? \
|
||||
(swapBlue ? \
|
||||
isFullRange ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2hsvf_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgb2hsv_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
isFullRange ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgr2hsvf_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgr2hsv_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
scn == 4 ? \
|
||||
(swapBlue ? \
|
||||
isFullRange ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2hsvf_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_rgbx2hsv_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
isFullRange ? \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgrx2hsvf_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) : \
|
||||
parallel_for_(cv::Range(0, height), \
|
||||
parallel_for_(Range(0, height), \
|
||||
TegraCvtColor_bgrx2hsv_Invoker(src_data, src_step, dst_data, dst_step, width, height), \
|
||||
(width * height) / static_cast<double>(1<<16)) ), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
@@ -1856,126 +1857,6 @@ TegraCvtColor_Invoker(bgrx2hsvf, bgrx2hsv, src_data + static_cast<size_t>(range.
|
||||
#define cv_hal_cvtTwoPlaneYUVtoBGREx TEGRA_CVT2PYUVTOBGR_EX
|
||||
#endif
|
||||
|
||||
// The optimized branch was developed for old armv7 processors and leads to perf degradation on armv8
|
||||
#if defined(__ARM_ARCH) && (__ARM_ARCH == 7)
|
||||
inline CAROTENE_NS::BORDER_MODE borderCV2Carotene(int borderType)
|
||||
{
|
||||
switch(borderType)
|
||||
{
|
||||
case CV_HAL_BORDER_CONSTANT:
|
||||
return CAROTENE_NS::BORDER_MODE_CONSTANT;
|
||||
case CV_HAL_BORDER_REPLICATE:
|
||||
return CAROTENE_NS::BORDER_MODE_REPLICATE;
|
||||
case CV_HAL_BORDER_REFLECT:
|
||||
return CAROTENE_NS::BORDER_MODE_REFLECT;
|
||||
case CV_HAL_BORDER_WRAP:
|
||||
return CAROTENE_NS::BORDER_MODE_WRAP;
|
||||
case CV_HAL_BORDER_REFLECT_101:
|
||||
return CAROTENE_NS::BORDER_MODE_REFLECT101;
|
||||
}
|
||||
|
||||
return CAROTENE_NS::BORDER_MODE_UNDEFINED;
|
||||
}
|
||||
|
||||
inline int TEGRA_GaussianBlurBinomial(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step,
|
||||
int width, int height, int depth, int cn, size_t margin_left, size_t margin_top,
|
||||
size_t margin_right, size_t margin_bottom, size_t ksize, int border_type)
|
||||
{
|
||||
CAROTENE_NS::Size2D sz(width, height);
|
||||
CAROTENE_NS::BORDER_MODE border = borderCV2Carotene(border_type);
|
||||
CAROTENE_NS::Margin mg(margin_left, margin_right, margin_top, margin_bottom);
|
||||
|
||||
if (ksize == 3)
|
||||
{
|
||||
if ((depth != CV_8U) || (cn != 1))
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
if (CAROTENE_NS::isGaussianBlur3x3MarginSupported(sz, border, mg))
|
||||
{
|
||||
CAROTENE_NS::gaussianBlur3x3Margin(sz, src_data, src_step, dst_data, dst_step,
|
||||
border, 0, mg);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
}
|
||||
else if (ksize == 5)
|
||||
{
|
||||
if (!CAROTENE_NS::isGaussianBlur5x5Supported(sz, cn, border))
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
if (depth == CV_8U)
|
||||
{
|
||||
CAROTENE_NS::gaussianBlur5x5(sz, cn, (uint8_t*)src_data, src_step,
|
||||
(uint8_t*)dst_data, dst_step, border, 0, mg);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
else if (depth == CV_16U)
|
||||
{
|
||||
CAROTENE_NS::gaussianBlur5x5(sz, cn, (uint16_t*)src_data, src_step,
|
||||
(uint16_t*)dst_data, dst_step, border, 0, mg);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
else if (depth == CV_16S)
|
||||
{
|
||||
CAROTENE_NS::gaussianBlur5x5(sz, cn, (int16_t*)src_data, src_step,
|
||||
(int16_t*)dst_data, dst_step, border, 0, mg);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
#undef cv_hal_gaussianBlurBinomial
|
||||
#define cv_hal_gaussianBlurBinomial TEGRA_GaussianBlurBinomial
|
||||
|
||||
#endif // __ARM_ARCH=7
|
||||
|
||||
#endif // OPENCV_IMGPROC_HAL_INTERFACE_H
|
||||
|
||||
// The optimized branch was developed for old armv7 processors
|
||||
#if defined(__ARM_ARCH) && (__ARM_ARCH == 7)
|
||||
inline int TEGRA_LKOpticalFlowLevel(const uchar *prev_data, size_t prev_data_step,
|
||||
const short* prev_deriv_data, size_t prev_deriv_step,
|
||||
const uchar* next_data, size_t next_step,
|
||||
int width, int height, int cn,
|
||||
const float *prev_points, float *next_points, size_t point_count,
|
||||
uchar *status, float *err,
|
||||
const int win_width, const int win_height,
|
||||
int termination_count, double termination_epsilon,
|
||||
bool get_min_eigen_vals,
|
||||
float min_eigen_vals_threshold)
|
||||
{
|
||||
if (!CAROTENE_NS::isSupportedConfiguration())
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
CAROTENE_NS::pyrLKOptFlowLevel(CAROTENE_NS::Size2D(width, height), cn,
|
||||
prev_data, prev_data_step, prev_deriv_data, prev_deriv_step,
|
||||
next_data, next_step,
|
||||
point_count, prev_points, next_points,
|
||||
status, err, CAROTENE_NS::Size2D(win_width, win_height),
|
||||
termination_count, termination_epsilon,
|
||||
get_min_eigen_vals, min_eigen_vals_threshold);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
|
||||
#undef cv_hal_LKOpticalFlowLevel
|
||||
#define cv_hal_LKOpticalFlowLevel TEGRA_LKOpticalFlowLevel
|
||||
#endif // __ARM_ARCH=7
|
||||
|
||||
#if 0 // OpenCV provides fater parallel implementation
|
||||
inline int TEGRA_ScharrDeriv(const uchar* src_data, size_t src_step,
|
||||
short* dst_data, size_t dst_step,
|
||||
int width, int height, int cn)
|
||||
{
|
||||
if (!CAROTENE_NS::isSupportedConfiguration())
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
CAROTENE_NS::ScharrDeriv(CAROTENE_NS::Size2D(width, height), cn, src_data, src_step, dst_data, dst_step);
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
|
||||
#undef cv_hal_ScharrDeriv
|
||||
#define cv_hal_ScharrDeriv TEGRA_ScharrDeriv
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
Vendored
+4
-4
@@ -359,7 +359,7 @@ namespace CAROTENE_NS {
|
||||
|
||||
/*
|
||||
For each point `p` within `size`, do:
|
||||
dst[p] = src0[p] * scale / src1[p]
|
||||
dst[p] = src0[p] * scale / src1[p]
|
||||
|
||||
NOTE: ROUND_TO_ZERO convert policy is used
|
||||
*/
|
||||
@@ -420,7 +420,7 @@ namespace CAROTENE_NS {
|
||||
|
||||
/*
|
||||
For each point `p` within `size`, do:
|
||||
dst[p] = scale / src[p]
|
||||
dst[p] = scale / src[p]
|
||||
|
||||
NOTE: ROUND_TO_ZERO convert policy is used
|
||||
*/
|
||||
@@ -1040,7 +1040,7 @@ namespace CAROTENE_NS {
|
||||
s32 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity);
|
||||
|
||||
/*
|
||||
Among each pixel `p` within `src` find min and max values and its first occurrences
|
||||
Among each pixel `p` within `src` find min and max values and its first occurences
|
||||
*/
|
||||
void minMaxLoc(const Size2D &size,
|
||||
const s8 * srcBase, ptrdiff_t srcStride,
|
||||
@@ -2485,7 +2485,7 @@ namespace CAROTENE_NS {
|
||||
u8 *status, f32 *err,
|
||||
const Size2D &winSize,
|
||||
u32 terminationCount, f64 terminationEpsilon,
|
||||
bool getMinEigenVals,
|
||||
u32 level, u32 maxLevel, bool useInitialFlow, bool getMinEigenVals,
|
||||
f32 minEigThreshold);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "common.hpp"
|
||||
#include "vtransform.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
namespace CAROTENE_NS {
|
||||
|
||||
@@ -107,7 +106,7 @@ template <> struct wAdd<s32>
|
||||
{
|
||||
valpha = vdupq_n_f32(_alpha);
|
||||
vbeta = vdupq_n_f32(_beta);
|
||||
vgamma = vdupq_n_f32(_gamma);
|
||||
vgamma = vdupq_n_f32(_gamma + 0.5);
|
||||
}
|
||||
|
||||
void operator() (const VecTraits<s32>::vec128 & v_src0,
|
||||
@@ -119,7 +118,7 @@ template <> struct wAdd<s32>
|
||||
|
||||
vs1 = vmlaq_f32(vgamma, vs1, valpha);
|
||||
vs1 = vmlaq_f32(vs1, vs2, vbeta);
|
||||
v_dst = vroundq_s32_f32(vs1);
|
||||
v_dst = vcvtq_s32_f32(vs1);
|
||||
}
|
||||
|
||||
void operator() (const VecTraits<s32>::vec64 & v_src0,
|
||||
@@ -131,7 +130,7 @@ template <> struct wAdd<s32>
|
||||
|
||||
vs1 = vmla_f32(vget_low(vgamma), vs1, vget_low(valpha));
|
||||
vs1 = vmla_f32(vs1, vs2, vget_low(vbeta));
|
||||
v_dst = vround_s32_f32(vs1);
|
||||
v_dst = vcvt_s32_f32(vs1);
|
||||
}
|
||||
|
||||
void operator() (const s32 * src0, const s32 * src1, s32 * dst) const
|
||||
@@ -151,7 +150,7 @@ template <> struct wAdd<u32>
|
||||
{
|
||||
valpha = vdupq_n_f32(_alpha);
|
||||
vbeta = vdupq_n_f32(_beta);
|
||||
vgamma = vdupq_n_f32(_gamma);
|
||||
vgamma = vdupq_n_f32(_gamma + 0.5);
|
||||
}
|
||||
|
||||
void operator() (const VecTraits<u32>::vec128 & v_src0,
|
||||
@@ -163,7 +162,7 @@ template <> struct wAdd<u32>
|
||||
|
||||
vs1 = vmlaq_f32(vgamma, vs1, valpha);
|
||||
vs1 = vmlaq_f32(vs1, vs2, vbeta);
|
||||
v_dst = vroundq_u32_f32(vs1);
|
||||
v_dst = vcvtq_u32_f32(vs1);
|
||||
}
|
||||
|
||||
void operator() (const VecTraits<u32>::vec64 & v_src0,
|
||||
@@ -175,7 +174,7 @@ template <> struct wAdd<u32>
|
||||
|
||||
vs1 = vmla_f32(vget_low(vgamma), vs1, vget_low(valpha));
|
||||
vs1 = vmla_f32(vs1, vs2, vget_low(vbeta));
|
||||
v_dst = vround_u32_f32(vs1);
|
||||
v_dst = vcvt_u32_f32(vs1);
|
||||
}
|
||||
|
||||
void operator() (const u32 * src0, const u32 * src1, u32 * dst) const
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "common.hpp"
|
||||
#include "saturate_cast.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
namespace CAROTENE_NS {
|
||||
|
||||
@@ -199,6 +198,7 @@ void blur3x3(const Size2D &size, s32 cn,
|
||||
//#define FLOAT_VARIANT_1_9
|
||||
#ifdef FLOAT_VARIANT_1_9
|
||||
float32x4_t v1_9 = vdupq_n_f32 (1.0/9.0);
|
||||
float32x4_t v0_5 = vdupq_n_f32 (.5);
|
||||
#else
|
||||
const int16x8_t vScale = vmovq_n_s16(3640);
|
||||
#endif
|
||||
@@ -283,8 +283,8 @@ void blur3x3(const Size2D &size, s32 cn,
|
||||
uint32x4_t tres2 = vmovl_u16(vget_high_u16(t0));
|
||||
float32x4_t vf1 = vmulq_f32(v1_9, vcvtq_f32_u32(tres1));
|
||||
float32x4_t vf2 = vmulq_f32(v1_9, vcvtq_f32_u32(tres2));
|
||||
tres1 = internal::vroundq_u32_f32(vf1);
|
||||
tres2 = internal::vroundq_u32_f32(vf2);
|
||||
tres1 = vcvtq_u32_f32(vaddq_f32(vf1, v0_5));
|
||||
tres2 = vcvtq_u32_f32(vaddq_f32(vf2, v0_5));
|
||||
t0 = vcombine_u16(vmovn_u32(tres1),vmovn_u32(tres2));
|
||||
vst1_u8(drow + x - 8, vmovn_u16(t0));
|
||||
#else
|
||||
@@ -445,8 +445,8 @@ void blur3x3(const Size2D &size, s32 cn,
|
||||
uint32x4_t tres2 = vmovl_u16(vget_high_u16(t0));
|
||||
float32x4_t vf1 = vmulq_f32(v1_9, vcvtq_f32_u32(tres1));
|
||||
float32x4_t vf2 = vmulq_f32(v1_9, vcvtq_f32_u32(tres2));
|
||||
tres1 = internal::vroundq_u32_f32(vf1);
|
||||
tres2 = internal::vroundq_u32_f32(vf2);
|
||||
tres1 = vcvtq_u32_f32(vaddq_f32(vf1, v0_5));
|
||||
tres2 = vcvtq_u32_f32(vaddq_f32(vf2, v0_5));
|
||||
t0 = vcombine_u16(vmovn_u32(tres1),vmovn_u32(tres2));
|
||||
vst1_u8(drow + x - 8, vmovn_u16(t0));
|
||||
#else
|
||||
@@ -508,6 +508,7 @@ void blur5x5(const Size2D &size, s32 cn,
|
||||
#define FLOAT_VARIANT_1_25
|
||||
#ifdef FLOAT_VARIANT_1_25
|
||||
float32x4_t v1_25 = vdupq_n_f32 (1.0f/25.0f);
|
||||
float32x4_t v0_5 = vdupq_n_f32 (.5f);
|
||||
#else
|
||||
const int16x8_t vScale = vmovq_n_s16(1310);
|
||||
#endif
|
||||
@@ -751,8 +752,8 @@ void blur5x5(const Size2D &size, s32 cn,
|
||||
uint32x4_t tres2 = vmovl_u16(vget_high_u16(t0));
|
||||
float32x4_t vf1 = vmulq_f32(v1_25, vcvtq_f32_u32(tres1));
|
||||
float32x4_t vf2 = vmulq_f32(v1_25, vcvtq_f32_u32(tres2));
|
||||
tres1 = internal::vroundq_u32_f32(vf1);
|
||||
tres2 = internal::vroundq_u32_f32(vf2);
|
||||
tres1 = vcvtq_u32_f32(vaddq_f32(vf1, v0_5));
|
||||
tres2 = vcvtq_u32_f32(vaddq_f32(vf2, v0_5));
|
||||
t0 = vcombine_u16(vmovn_u32(tres1),vmovn_u32(tres2));
|
||||
vst1_u8(drow + x - 8, vmovn_u16(t0));
|
||||
#else
|
||||
+1
-1
@@ -378,7 +378,7 @@ void extract4(const Size2D &size,
|
||||
vst1q_##sgn##bits(dst1 + d1j, vals.v4.val[3]); \
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SPLIT4ALPHA(sgn,bits) void split4(const Size2D &_size, \
|
||||
const sgn##bits * srcBase, ptrdiff_t srcStride, \
|
||||
+11
-5
@@ -40,7 +40,6 @@
|
||||
#include "common.hpp"
|
||||
|
||||
#include "saturate_cast.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
namespace CAROTENE_NS {
|
||||
|
||||
@@ -1167,10 +1166,17 @@ inline uint8x8x3_t convertToHSV(const uint8x8_t vR, const uint8x8_t vG, const ui
|
||||
vSt3 = vmulq_f32(vHF1, vDivTab);
|
||||
vSt4 = vmulq_f32(vHF2, vDivTab);
|
||||
|
||||
uint32x4_t vRes1 = internal::vroundq_u32_f32(vSt1);
|
||||
uint32x4_t vRes2 = internal::vroundq_u32_f32(vSt2);
|
||||
uint32x4_t vRes3 = internal::vroundq_u32_f32(vSt3);
|
||||
uint32x4_t vRes4 = internal::vroundq_u32_f32(vSt4);
|
||||
float32x4_t bias = vdupq_n_f32(0.5f);
|
||||
|
||||
vSt1 = vaddq_f32(vSt1, bias);
|
||||
vSt2 = vaddq_f32(vSt2, bias);
|
||||
vSt3 = vaddq_f32(vSt3, bias);
|
||||
vSt4 = vaddq_f32(vSt4, bias);
|
||||
|
||||
uint32x4_t vRes1 = vcvtq_u32_f32(vSt1);
|
||||
uint32x4_t vRes2 = vcvtq_u32_f32(vSt2);
|
||||
uint32x4_t vRes3 = vcvtq_u32_f32(vSt3);
|
||||
uint32x4_t vRes4 = vcvtq_u32_f32(vSt4);
|
||||
|
||||
int32x4_t vH_L = vmovl_s16(vget_low_s16(vDiff4));
|
||||
int32x4_t vH_H = vmovl_s16(vget_high_s16(vDiff4));
|
||||
+107
-108
@@ -38,7 +38,6 @@
|
||||
*/
|
||||
|
||||
#include "common.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
namespace CAROTENE_NS {
|
||||
|
||||
@@ -186,7 +185,7 @@ CVTS_FUNC1(u8, 16,
|
||||
#else
|
||||
CVTS_FUNC1(u8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -210,10 +209,10 @@ CVTS_FUNC1(u8, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
uint16x8_t vRes1_u16 = vcombine_u16(vqmovun_s32(vline1_s32), vqmovun_s32(vline2_s32));
|
||||
uint16x8_t vRes2_u16 = vcombine_u16(vqmovun_s32(vline3_s32), vqmovun_s32(vline4_s32));
|
||||
vst1q_u8(_dst + i, vcombine_u8(vqmovn_u16(vRes1_u16), vqmovn_u16(vRes2_u16)));
|
||||
@@ -271,7 +270,7 @@ CVTS_FUNC(u8, s8, 16,
|
||||
#else
|
||||
CVTS_FUNC(u8, s8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -295,10 +294,10 @@ CVTS_FUNC(u8, s8, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
int16x8_t vRes1_u16 = vcombine_s16(vqmovn_s32(vline1_s32), vqmovn_s32(vline2_s32));
|
||||
int16x8_t vRes2_u16 = vcombine_s16(vqmovn_s32(vline3_s32), vqmovn_s32(vline4_s32));
|
||||
vst1q_s8(_dst + i, vcombine_s8(vqmovn_s16(vRes1_u16), vqmovn_s16(vRes2_u16)));
|
||||
@@ -356,7 +355,7 @@ CVTS_FUNC(u8, u16, 16,
|
||||
#else
|
||||
CVTS_FUNC(u8, u16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -380,10 +379,10 @@ CVTS_FUNC(u8, u16, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
vst1q_u16(_dst + i + 0, vcombine_u16(vqmovun_s32(vline1_s32), vqmovun_s32(vline2_s32)));
|
||||
vst1q_u16(_dst + i + 8, vcombine_u16(vqmovun_s32(vline3_s32), vqmovun_s32(vline4_s32)));
|
||||
}
|
||||
@@ -440,7 +439,7 @@ CVTS_FUNC(u8, s16, 16,
|
||||
#else
|
||||
CVTS_FUNC(u8, s16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -464,10 +463,10 @@ CVTS_FUNC(u8, s16, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
vst1q_s16(_dst + i + 0, vcombine_s16(vqmovn_s32(vline1_s32), vqmovn_s32(vline2_s32)));
|
||||
vst1q_s16(_dst + i + 8, vcombine_s16(vqmovn_s32(vline3_s32), vqmovn_s32(vline4_s32)));
|
||||
}
|
||||
@@ -527,7 +526,7 @@ CVTS_FUNC(u8, s32, 16,
|
||||
#else
|
||||
CVTS_FUNC(u8, s32, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -551,10 +550,10 @@ CVTS_FUNC(u8, s32, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int32x4_t vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
int32x4_t vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
vst1q_s32(_dst + i + 8, vline3_s32);
|
||||
@@ -694,7 +693,7 @@ CVTS_FUNC(s8, u8, 16,
|
||||
#else
|
||||
CVTS_FUNC(s8, u8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -718,10 +717,10 @@ CVTS_FUNC(s8, u8, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
uint16x8_t vRes1_u16 = vcombine_u16(vqmovun_s32(vline1_s32), vqmovun_s32(vline2_s32));
|
||||
uint16x8_t vRes2_u16 = vcombine_u16(vqmovun_s32(vline3_s32), vqmovun_s32(vline4_s32));
|
||||
vst1q_u8(_dst + i, vcombine_u8(vqmovn_u16(vRes1_u16), vqmovn_u16(vRes2_u16)));
|
||||
@@ -779,7 +778,7 @@ CVTS_FUNC1(s8, 16,
|
||||
#else
|
||||
CVTS_FUNC1(s8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -803,10 +802,10 @@ CVTS_FUNC1(s8, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
int16x8_t vRes1_s16 = vcombine_s16(vqmovn_s32(vline1_s32), vqmovn_s32(vline2_s32));
|
||||
int16x8_t vRes2_s16 = vcombine_s16(vqmovn_s32(vline3_s32), vqmovn_s32(vline4_s32));
|
||||
vst1q_s8(_dst + i, vcombine_s8(vqmovn_s16(vRes1_s16), vqmovn_s16(vRes2_s16)));
|
||||
@@ -864,7 +863,7 @@ CVTS_FUNC(s8, u16, 16,
|
||||
#else
|
||||
CVTS_FUNC(s8, u16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -888,10 +887,10 @@ CVTS_FUNC(s8, u16, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
uint16x8_t vRes1_u16 = vcombine_u16(vqmovun_s32(vline1_s32), vqmovun_s32(vline2_s32));
|
||||
uint16x8_t vRes2_u16 = vcombine_u16(vqmovun_s32(vline3_s32), vqmovun_s32(vline4_s32));
|
||||
vst1q_u16(_dst + i + 0, vRes1_u16);
|
||||
@@ -950,7 +949,7 @@ CVTS_FUNC(s8, s16, 16,
|
||||
#else
|
||||
CVTS_FUNC(s8, s16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -974,10 +973,10 @@ CVTS_FUNC(s8, s16, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
int16x8_t vRes1_s16 = vcombine_s16(vqmovn_s32(vline1_s32), vqmovn_s32(vline2_s32));
|
||||
int16x8_t vRes2_s16 = vcombine_s16(vqmovn_s32(vline3_s32), vqmovn_s32(vline4_s32));
|
||||
vst1q_s16(_dst + i + 0, vRes1_s16);
|
||||
@@ -1039,7 +1038,7 @@ CVTS_FUNC(s8, s32, 16,
|
||||
#else
|
||||
CVTS_FUNC(s8, s32, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 16)
|
||||
{
|
||||
@@ -1063,10 +1062,10 @@ CVTS_FUNC(s8, s32, 16,
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline3_f32 = vaddq_f32(vline3_f32, vshift);
|
||||
vline4_f32 = vaddq_f32(vline4_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline3_s32 = internal::vroundq_s32_f32(vline3_f32);
|
||||
vline4_s32 = internal::vroundq_s32_f32(vline4_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vline3_s32 = vcvtq_s32_f32(vline3_f32);
|
||||
vline4_s32 = vcvtq_s32_f32(vline4_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
vst1q_s32(_dst + i + 8, vline3_s32);
|
||||
@@ -1191,7 +1190,7 @@ CVTS_FUNC(u16, u8, 16,
|
||||
#else
|
||||
CVTS_FUNC(u16, u8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1205,8 +1204,8 @@ CVTS_FUNC(u16, u8, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
uint8x8_t vRes = vqmovun_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -1250,7 +1249,7 @@ CVTS_FUNC(u16, s8, 16,
|
||||
#else
|
||||
CVTS_FUNC(u16, s8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1264,8 +1263,8 @@ CVTS_FUNC(u16, s8, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
int8x8_t vRes = vqmovn_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -1308,7 +1307,7 @@ CVTS_FUNC1(u16, 16,
|
||||
#else
|
||||
CVTS_FUNC1(u16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1322,8 +1321,8 @@ CVTS_FUNC1(u16, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
uint16x4_t vRes1 = vqmovun_s32(vline1_s32);
|
||||
uint16x4_t vRes2 = vqmovun_s32(vline2_s32);
|
||||
vst1q_u16(_dst + i, vcombine_u16(vRes1, vRes2));
|
||||
@@ -1365,7 +1364,7 @@ CVTS_FUNC(u16, s16, 8,
|
||||
#else
|
||||
CVTS_FUNC(u16, s16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1379,8 +1378,8 @@ CVTS_FUNC(u16, s16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
vst1q_s16(_dst + i, vcombine_s16(vRes1, vRes2));
|
||||
@@ -1422,7 +1421,7 @@ CVTS_FUNC(u16, s32, 8,
|
||||
#else
|
||||
CVTS_FUNC(u16, s32, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1436,8 +1435,8 @@ CVTS_FUNC(u16, s32, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
}
|
||||
@@ -1531,7 +1530,7 @@ CVTS_FUNC(s16, u8, 16,
|
||||
#else
|
||||
CVTS_FUNC(s16, u8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1545,8 +1544,8 @@ CVTS_FUNC(s16, u8, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
uint8x8_t vRes = vqmovun_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -1590,7 +1589,7 @@ CVTS_FUNC(s16, s8, 16,
|
||||
#else
|
||||
CVTS_FUNC(s16, s8, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1604,8 +1603,8 @@ CVTS_FUNC(s16, s8, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
int8x8_t vRes = vqmovn_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -1648,7 +1647,7 @@ CVTS_FUNC(s16, u16, 8,
|
||||
#else
|
||||
CVTS_FUNC(s16, u16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1662,8 +1661,8 @@ CVTS_FUNC(s16, u16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
uint16x4_t vRes1 = vqmovun_s32(vline1_s32);
|
||||
uint16x4_t vRes2 = vqmovun_s32(vline2_s32);
|
||||
vst1q_u16(_dst + i, vcombine_u16(vRes1, vRes2));
|
||||
@@ -1705,7 +1704,7 @@ CVTS_FUNC1(s16, 16,
|
||||
#else
|
||||
CVTS_FUNC1(s16, 16,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1719,8 +1718,8 @@ CVTS_FUNC1(s16, 16,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
vst1q_s16(_dst + i, vcombine_s16(vRes1, vRes2));
|
||||
@@ -1762,7 +1761,7 @@ CVTS_FUNC(s16, s32, 8,
|
||||
#else
|
||||
CVTS_FUNC(s16, s32, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1776,8 +1775,8 @@ CVTS_FUNC(s16, s32, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
}
|
||||
@@ -1871,7 +1870,7 @@ CVTS_FUNC(s32, u8, 8,
|
||||
#else
|
||||
CVTS_FUNC(s32, u8, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1884,8 +1883,8 @@ CVTS_FUNC(s32, u8, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
uint16x4_t vRes1 = vqmovun_s32(vline1_s32);
|
||||
uint16x4_t vRes2 = vqmovun_s32(vline2_s32);
|
||||
uint8x8_t vRes = vqmovn_u16(vcombine_u16(vRes1, vRes2));
|
||||
@@ -1929,7 +1928,7 @@ CVTS_FUNC(s32, s8, 8,
|
||||
#else
|
||||
CVTS_FUNC(s32, s8, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1942,8 +1941,8 @@ CVTS_FUNC(s32, s8, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
int8x8_t vRes = vqmovn_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -1986,7 +1985,7 @@ CVTS_FUNC(s32, u16, 8,
|
||||
#else
|
||||
CVTS_FUNC(s32, u16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -1999,8 +1998,8 @@ CVTS_FUNC(s32, u16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
uint16x4_t vRes1 = vqmovun_s32(vline1_s32);
|
||||
uint16x4_t vRes2 = vqmovun_s32(vline2_s32);
|
||||
vst1q_u16(_dst + i, vcombine_u16(vRes1, vRes2));
|
||||
@@ -2042,7 +2041,7 @@ CVTS_FUNC(s32, s16, 8,
|
||||
#else
|
||||
CVTS_FUNC(s32, s16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2055,8 +2054,8 @@ CVTS_FUNC(s32, s16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
vst1q_s16(_dst + i, vcombine_s16(vRes1, vRes2));
|
||||
@@ -2098,7 +2097,7 @@ CVTS_FUNC1(s32, 8,
|
||||
#else
|
||||
CVTS_FUNC1(s32, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2111,8 +2110,8 @@ CVTS_FUNC1(s32, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
}
|
||||
@@ -2273,7 +2272,7 @@ CVTS_FUNC(f32, s8, 8,
|
||||
#else
|
||||
CVTS_FUNC(f32, s8, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2284,8 +2283,8 @@ CVTS_FUNC(f32, s8, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
int8x8_t vRes = vqmovn_s16(vcombine_s16(vRes1, vRes2));
|
||||
@@ -2326,7 +2325,7 @@ CVTS_FUNC(f32, u16, 8,
|
||||
#else
|
||||
CVTS_FUNC(f32, u16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2337,8 +2336,8 @@ CVTS_FUNC(f32, u16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
uint32x4_t vline1_u32 = internal::vroundq_u32_f32(vline1_f32);
|
||||
uint32x4_t vline2_u32 = internal::vroundq_u32_f32(vline2_f32);
|
||||
uint32x4_t vline1_u32 = vcvtq_u32_f32(vline1_f32);
|
||||
uint32x4_t vline2_u32 = vcvtq_u32_f32(vline2_f32);
|
||||
uint16x4_t vRes1 = vqmovn_u32(vline1_u32);
|
||||
uint16x4_t vRes2 = vqmovn_u32(vline2_u32);
|
||||
vst1q_u16(_dst + i, vcombine_u16(vRes1, vRes2));
|
||||
@@ -2378,7 +2377,7 @@ CVTS_FUNC(f32, s16, 8,
|
||||
#else
|
||||
CVTS_FUNC(f32, s16, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2389,8 +2388,8 @@ CVTS_FUNC(f32, s16, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
int16x4_t vRes1 = vqmovn_s32(vline1_s32);
|
||||
int16x4_t vRes2 = vqmovn_s32(vline2_s32);
|
||||
vst1q_s16(_dst + i, vcombine_s16(vRes1, vRes2));
|
||||
@@ -2430,7 +2429,7 @@ CVTS_FUNC(f32, s32, 8,
|
||||
#else
|
||||
CVTS_FUNC(f32, s32, 8,
|
||||
float32x4_t vscale = vdupq_n_f32((f32)alpha);
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta);,
|
||||
float32x4_t vshift = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
{
|
||||
for (size_t i = 0; i < w; i += 8)
|
||||
{
|
||||
@@ -2441,8 +2440,8 @@ CVTS_FUNC(f32, s32, 8,
|
||||
vline2_f32 = vmulq_f32(vline2_f32, vscale);
|
||||
vline1_f32 = vaddq_f32(vline1_f32, vshift);
|
||||
vline2_f32 = vaddq_f32(vline2_f32, vshift);
|
||||
int32x4_t vline1_s32 = internal::vroundq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = internal::vroundq_s32_f32(vline2_f32);
|
||||
int32x4_t vline1_s32 = vcvtq_s32_f32(vline1_f32);
|
||||
int32x4_t vline2_s32 = vcvtq_s32_f32(vline2_f32);
|
||||
vst1q_s32(_dst + i + 0, vline1_s32);
|
||||
vst1q_s32(_dst + i + 4, vline2_s32);
|
||||
}
|
||||
+20
-7
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "common.hpp"
|
||||
#include "vtransform.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <cfloat>
|
||||
@@ -52,6 +51,13 @@ namespace {
|
||||
|
||||
#ifdef CAROTENE_NEON
|
||||
|
||||
inline float32x4_t vroundq(const float32x4_t& v)
|
||||
{
|
||||
const int32x4_t signMask = vdupq_n_s32(1 << 31), half = vreinterpretq_s32_f32(vdupq_n_f32(0.5f));
|
||||
float32x4_t v_addition = vreinterpretq_f32_s32(vorrq_s32(half, vandq_s32(signMask, vreinterpretq_s32_f32(v))));
|
||||
return vaddq_f32(v, v_addition);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T divSaturateQ(const T &v1, const T &v2, const float scale)
|
||||
{
|
||||
@@ -63,10 +69,17 @@ inline T divSaturateQ(const T &v1, const T &v2, const float scale)
|
||||
}
|
||||
template <>
|
||||
inline int32x4_t divSaturateQ<int32x4_t>(const int32x4_t &v1, const int32x4_t &v2, const float scale)
|
||||
{ return internal::vroundq_s32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_s32(v1), scale), internal::vrecpq_f32(vcvtq_f32_s32(v2)))); }
|
||||
{ return vcvtq_s32_f32(vroundq(vmulq_f32(vmulq_n_f32(vcvtq_f32_s32(v1), scale), internal::vrecpq_f32(vcvtq_f32_s32(v2))))); }
|
||||
template <>
|
||||
inline uint32x4_t divSaturateQ<uint32x4_t>(const uint32x4_t &v1, const uint32x4_t &v2, const float scale)
|
||||
{ return internal::vroundq_u32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_u32(v1), scale), internal::vrecpq_f32(vcvtq_f32_u32(v2)))); }
|
||||
{ return vcvtq_u32_f32(vroundq(vmulq_f32(vmulq_n_f32(vcvtq_f32_u32(v1), scale), internal::vrecpq_f32(vcvtq_f32_u32(v2))))); }
|
||||
|
||||
inline float32x2_t vround(const float32x2_t& v)
|
||||
{
|
||||
const int32x2_t signMask = vdup_n_s32(1 << 31), half = vreinterpret_s32_f32(vdup_n_f32(0.5f));
|
||||
float32x2_t v_addition = vreinterpret_f32_s32(vorr_s32(half, vand_s32(signMask, vreinterpret_s32_f32(v))));
|
||||
return vadd_f32(v, v_addition);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T divSaturate(const T &v1, const T &v2, const float scale)
|
||||
@@ -75,10 +88,10 @@ inline T divSaturate(const T &v1, const T &v2, const float scale)
|
||||
}
|
||||
template <>
|
||||
inline int32x2_t divSaturate<int32x2_t>(const int32x2_t &v1, const int32x2_t &v2, const float scale)
|
||||
{ return internal::vround_s32_f32(vmul_f32(vmul_n_f32(vcvt_f32_s32(v1), scale), internal::vrecp_f32(vcvt_f32_s32(v2)))); }
|
||||
{ return vcvt_s32_f32(vround(vmul_f32(vmul_n_f32(vcvt_f32_s32(v1), scale), internal::vrecp_f32(vcvt_f32_s32(v2))))); }
|
||||
template <>
|
||||
inline uint32x2_t divSaturate<uint32x2_t>(const uint32x2_t &v1, const uint32x2_t &v2, const float scale)
|
||||
{ return internal::vround_u32_f32(vmul_f32(vmul_n_f32(vcvt_f32_u32(v1), scale), internal::vrecp_f32(vcvt_f32_u32(v2)))); }
|
||||
{ return vcvt_u32_f32(vround(vmul_f32(vmul_n_f32(vcvt_f32_u32(v1), scale), internal::vrecp_f32(vcvt_f32_u32(v2))))); }
|
||||
|
||||
|
||||
template <typename T>
|
||||
@@ -144,8 +157,8 @@ void div(const Size2D &size,
|
||||
|
||||
if (scale == 0.0f ||
|
||||
(std::numeric_limits<T>::is_integer &&
|
||||
(scale * static_cast<float>(std::numeric_limits<T>::max())) < 1.0f &&
|
||||
(scale * static_cast<float>(std::numeric_limits<T>::max())) > -1.0f))
|
||||
(scale * std::numeric_limits<T>::max()) < 1.0f &&
|
||||
(scale * std::numeric_limits<T>::max()) > -1.0f))
|
||||
{
|
||||
for (size_t y = 0; y < size.height; ++y)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
u8 *status, f32 *err,
|
||||
const Size2D &winSize,
|
||||
u32 terminationCount, f64 terminationEpsilon,
|
||||
bool getMinEigenVals,
|
||||
u32 level, u32 maxLevel, bool useInitialFlow, bool getMinEigenVals,
|
||||
f32 minEigThreshold)
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
@@ -74,11 +74,32 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
|
||||
for( u32 ptidx = 0; ptidx < ptCount; ptidx++ )
|
||||
{
|
||||
f32 levscale = (1./(1 << level));
|
||||
u32 ptref = ptidx << 1;
|
||||
f32 prevPtX = prevPts[ptref+0];
|
||||
f32 prevPtY = prevPts[ptref+1];
|
||||
f32 nextPtX = nextPts[ptref+0];
|
||||
f32 nextPtY = nextPts[ptref+1];
|
||||
f32 prevPtX = prevPts[ptref+0]*levscale;
|
||||
f32 prevPtY = prevPts[ptref+1]*levscale;
|
||||
f32 nextPtX;
|
||||
f32 nextPtY;
|
||||
if( level == maxLevel )
|
||||
{
|
||||
if( useInitialFlow )
|
||||
{
|
||||
nextPtX = nextPts[ptref+0]*levscale;
|
||||
nextPtY = nextPts[ptref+1]*levscale;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextPtX = prevPtX;
|
||||
nextPtY = prevPtY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nextPtX = nextPts[ptref+0]*2.f;
|
||||
nextPtY = nextPts[ptref+1]*2.f;
|
||||
}
|
||||
nextPts[ptref+0] = nextPtX;
|
||||
nextPts[ptref+1] = nextPtY;
|
||||
|
||||
s32 iprevPtX, iprevPtY;
|
||||
s32 inextPtX, inextPtY;
|
||||
@@ -90,10 +111,13 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
if( iprevPtX < -(s32)winSize.width || iprevPtX >= (s32)size.width ||
|
||||
iprevPtY < -(s32)winSize.height || iprevPtY >= (s32)size.height )
|
||||
{
|
||||
if( status )
|
||||
status[ptidx] = false;
|
||||
if( err )
|
||||
err[ptidx] = 0;
|
||||
if( level == 0 )
|
||||
{
|
||||
if( status )
|
||||
status[ptidx] = false;
|
||||
if( err )
|
||||
err[ptidx] = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -309,7 +333,7 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
|
||||
if( minEig < minEigThreshold || D < FLT_EPSILON )
|
||||
{
|
||||
if( status )
|
||||
if( level == 0 && status )
|
||||
status[ptidx] = false;
|
||||
continue;
|
||||
}
|
||||
@@ -329,7 +353,7 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
if( inextPtX < -(s32)winSize.width || inextPtX >= (s32)size.width ||
|
||||
inextPtY < -(s32)winSize.height || inextPtY >= (s32)size.height )
|
||||
{
|
||||
if( status )
|
||||
if( level == 0 && status )
|
||||
status[ptidx] = false;
|
||||
break;
|
||||
}
|
||||
@@ -445,7 +469,8 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
prevDeltaX = deltaX;
|
||||
prevDeltaY = deltaY;
|
||||
}
|
||||
if( status && status[ptidx] && err && !getMinEigenVals )
|
||||
|
||||
if( status && status[ptidx] && err && level == 0 && !getMinEigenVals )
|
||||
{
|
||||
f32 nextPointX = nextPts[ptref+0] - halfWinX;
|
||||
f32 nextPointY = nextPts[ptref+1] - halfWinY;
|
||||
@@ -501,6 +526,9 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
(void)winSize;
|
||||
(void)terminationCount;
|
||||
(void)terminationEpsilon;
|
||||
(void)level;
|
||||
(void)maxLevel;
|
||||
(void)useInitialFlow;
|
||||
(void)getMinEigenVals;
|
||||
(void)minEigThreshold;
|
||||
(void)ptCount;
|
||||
@@ -508,3 +536,4 @@ void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
|
||||
}
|
||||
|
||||
}//CAROTENE_NS
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "common.hpp"
|
||||
#include "vround_helper.hpp"
|
||||
|
||||
namespace CAROTENE_NS {
|
||||
|
||||
@@ -122,6 +121,8 @@ void phase(const Size2D &size,
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
|
||||
float32x4_t v_05 = vdupq_n_f32(0.5f);
|
||||
|
||||
for (size_t i = 0; i < size.height; ++i)
|
||||
{
|
||||
const s16 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
|
||||
@@ -148,8 +149,8 @@ void phase(const Size2D &size,
|
||||
float32x4_t v_dst32f1;
|
||||
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
|
||||
|
||||
uint16x8_t v_dst16s0 = vcombine_u16(vmovn_u32(internal::vroundq_u32_f32(v_dst32f0)),
|
||||
vmovn_u32(internal::vroundq_u32_f32(v_dst32f1)));
|
||||
uint16x8_t v_dst16s0 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
|
||||
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
|
||||
|
||||
// 1
|
||||
v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src01)));
|
||||
@@ -160,8 +161,8 @@ void phase(const Size2D &size,
|
||||
v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src11)));
|
||||
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
|
||||
|
||||
uint16x8_t v_dst16s1 = vcombine_u16(vmovn_u32(internal::vroundq_u32_f32(v_dst32f0)),
|
||||
vmovn_u32(internal::vroundq_u32_f32(v_dst32f1)));
|
||||
uint16x8_t v_dst16s1 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
|
||||
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
|
||||
|
||||
vst1q_u8(dst + j, vcombine_u8(vmovn_u16(v_dst16s0),
|
||||
vmovn_u16(v_dst16s1)));
|
||||
@@ -181,8 +182,8 @@ void phase(const Size2D &size,
|
||||
float32x4_t v_dst32f1;
|
||||
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
|
||||
|
||||
uint16x8_t v_dst = vcombine_u16(vmovn_u32(internal::vroundq_u32_f32(v_dst32f0)),
|
||||
vmovn_u32(internal::vroundq_u32_f32(v_dst32f1)));
|
||||
uint16x8_t v_dst = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
|
||||
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
|
||||
|
||||
vst1_u8(dst + j, vmovn_u16(v_dst));
|
||||
}
|
||||
Vendored
-44
@@ -1,44 +0,0 @@
|
||||
function(download_fastcv root_dir)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(FASTCV_COMMIT "2265e79b3b9a8512a9c615b8c4d0244e88f45a9d")
|
||||
|
||||
# Define actual FastCV versions
|
||||
if(ANDROID)
|
||||
if(AARCH64)
|
||||
message(STATUS "Download FastCV for Android aarch64")
|
||||
set(FCV_PACKAGE_NAME "fastcv_android_aarch64_2025_04_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "d9172a9a3e5d92d080a4192cc5691001")
|
||||
else()
|
||||
message(STATUS "Download FastCV for Android armv7")
|
||||
set(FCV_PACKAGE_NAME "fastcv_android_arm32_2025_04_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "246b5253233391cd2c74d01d49aee9c3")
|
||||
endif()
|
||||
elseif(UNIX AND NOT APPLE AND NOT IOS AND NOT XROS)
|
||||
if(AARCH64)
|
||||
set(FCV_PACKAGE_NAME "fastcv_linux_aarch64_2025_05_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "decd490524f786e103125b8b948151f3")
|
||||
else()
|
||||
message("FastCV: fastcv lib for 32-bit Linux is not supported for now!")
|
||||
endif()
|
||||
endif(ANDROID)
|
||||
|
||||
# Download Package
|
||||
|
||||
set(OPENCV_FASTCV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FASTCV_COMMIT}/fastcv/")
|
||||
|
||||
ocv_download( FILENAME ${FCV_PACKAGE_NAME}
|
||||
HASH ${FCV_PACKAGE_HASH}
|
||||
URL ${OPENCV_FASTCV_URL}
|
||||
DESTINATION_DIR ${root_dir}
|
||||
ID FASTCV
|
||||
STATUS res
|
||||
UNPACK
|
||||
RELATIVE_URL)
|
||||
if(res)
|
||||
set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status")
|
||||
else()
|
||||
message(WARNING "FastCV: package download failed!")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
# Binaries branch name: ffmpeg/4.x_20250625
|
||||
# Binaries were created for OpenCV: e9f1da7e8e977a65b8bf8fe7ea8b92eef9171f19
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "ea9240e39bc0d6a69d2b1f0ba4513bdc7612a41e")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "2821ea672a11147a70974d760a54e9bc")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "e5c6936240201064b15bcecf1816e8f4")
|
||||
# Binaries branch name: ffmpeg/4.x_20230622
|
||||
# Binaries were created for OpenCV: 61d48dd0f8d1cc1a115d26998705a61478f64a3c
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "7da61f0695eabf8972a2c302bf1632a3d99fb0d5")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "4aaef1456e282e5ef665d65555f47f56")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "38a638851e064c591ce812e27ed43f1f")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "8862c87496e2e8c375965e1277dee1c7")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ if(HAVE_IPP_ICV)
|
||||
add_definitions(-DICV_BASE)
|
||||
endif()
|
||||
|
||||
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c ${IPP_IW_PATH}/src/*.cpp)
|
||||
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
|
||||
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+11
-20
@@ -2,41 +2,32 @@ function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "767426b2a40a011eb2fa7f44c677c13e60e205ad")
|
||||
set(IPPICV_COMMIT "1224f78da6684df04397ac0f40c961ed37f79ccb")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(IPPICV_COMMIT "0cc4aa06bf2bef4b05d237c69a5a96b9cd0cb85a")
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.9.1_mac_intel64_20230919_general.tgz")
|
||||
set(OPENCV_ICV_HASH "14f01c5a4780bfae9dde9b0aaf5e56fc")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.8_mac_intel64_20230330_general.tgz")
|
||||
set(OPENCV_ICV_HASH "d2b234a86af1b616958619a4560356d9")
|
||||
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_2022.1.0_lnx_intel64_20250130_general.tgz")
|
||||
set(OPENCV_ICV_HASH "98ff71fc242d52db9cc538388e502f57")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.8_lnx_intel64_20230330_general.tgz")
|
||||
set(OPENCV_ICV_HASH "43219bdc7e3805adcbe3a1e2f1f3ef3b")
|
||||
else()
|
||||
if(ANDROID)
|
||||
set(IPPICV_COMMIT "c7c6d527dde5fee7cb914ee9e4e20f7436aab3a1")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.10.1_lnx_ia32_20231206_general.tgz")
|
||||
set(OPENCV_ICV_HASH "d9510f3ce08f6074aac472a5c19a3b53")
|
||||
else()
|
||||
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.12.0_lnx_ia32_20240425_general.tgz")
|
||||
set(OPENCV_ICV_HASH "85ffa2b9ed7802b93c23fa27b0097d36")
|
||||
endif()
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.8_lnx_ia32_20230330_general.tgz")
|
||||
set(OPENCV_ICV_HASH "165875443d72faa3fd2146869da90d07")
|
||||
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_2022.1.0_win_intel64_20250130_general.zip")
|
||||
set(OPENCV_ICV_HASH "67a611ab22410f392239bddff6f91df7")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.8_win_intel64_20230330_general.zip")
|
||||
set(OPENCV_ICV_HASH "71e4f58de939f0348ec7fb58ffb17dbf")
|
||||
else()
|
||||
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.12.0_win_ia32_20240425_general.zip")
|
||||
set(OPENCV_ICV_HASH "8b1d2a23957d57624d0de8f2a5cae5f1")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.8_win_ia32_20230330_general.zip")
|
||||
set(OPENCV_ICV_HASH "57fd4648cfe64eae9e2ad9d50173a553")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
|
||||
Vendored
+2
-6
@@ -24,6 +24,7 @@ set(ITT_PUBLIC_HDRS
|
||||
include/ittnotify.h
|
||||
include/jitprofiling.h
|
||||
include/libittnotify.h
|
||||
include/llvm_jit_event_listener.hpp
|
||||
)
|
||||
set(ITT_PRIVATE_HDRS
|
||||
src/ittnotify/disable_warnings.h
|
||||
@@ -38,11 +39,6 @@ set(ITT_SRCS
|
||||
|
||||
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
|
||||
file(STRINGS "src/ittnotify/ittnotify_config.h" API_VERSION_NUM REGEX "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]+)")
|
||||
if(API_VERSION_NUM MATCHES "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]*)")
|
||||
set(ITTNOTIFY_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(HAVE_DL_LIBRARY)
|
||||
target_link_libraries(${ITT_LIBRARY} dl)
|
||||
@@ -68,4 +64,4 @@ if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/BSD-3-Clause.txt src/ittnotify/GPL-2.0-only.txt)
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
|
||||
+101
-643
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
#ifndef _ITTNOTIFY_H_
|
||||
#define _ITTNOTIFY_H_
|
||||
|
||||
@@ -11,8 +63,7 @@
|
||||
@brief Public User API functions and types
|
||||
@mainpage
|
||||
|
||||
The Instrumentation and Tracing Technology API (ITT API) is used to
|
||||
annotate a user's program with additional information
|
||||
The ITT API is used to annotate a user's program with additional information
|
||||
that can be used by correctness and performance tools. The user inserts
|
||||
calls in their program. Those calls generate information that is collected
|
||||
at runtime, and used by Intel(R) Threading Tools.
|
||||
@@ -90,10 +141,6 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -101,8 +148,6 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__)
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -124,10 +169,6 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -135,8 +176,6 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -189,12 +228,7 @@ The same ID may not be reused for different instances, unless a previous
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE __forceinline
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -255,20 +289,20 @@ The same ID may not be reused for different instances, unless a previous
|
||||
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
|
||||
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
|
||||
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
@@ -306,7 +340,7 @@ extern "C" {
|
||||
* only pauses tracing and analyzing memory access.
|
||||
* It does not pause tracing or analyzing threading APIs.
|
||||
* .
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
@@ -321,143 +355,35 @@ void ITTAPI __itt_resume(void);
|
||||
/** @brief Detach collection */
|
||||
void ITTAPI __itt_detach(void);
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_scope
|
||||
* @brief Enumerator for collection scopes
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_scope_host = 1 << 0,
|
||||
__itt_collection_scope_offload = 1 << 1,
|
||||
__itt_collection_scope_all = 0x7FFFFFFF
|
||||
} __itt_collection_scope;
|
||||
|
||||
/** @brief Pause scoped collection */
|
||||
void ITTAPI __itt_pause_scoped(__itt_collection_scope);
|
||||
/** @brief Resume scoped collection */
|
||||
void ITTAPI __itt_resume_scoped(__itt_collection_scope);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, pause, (void))
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, resume, (void))
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, detach, (void))
|
||||
#define __itt_pause ITTNOTIFY_VOID(pause)
|
||||
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
|
||||
#define __itt_pause_scoped ITTNOTIFY_VOID(pause_scoped)
|
||||
#define __itt_pause_scoped_ptr ITTNOTIFY_NAME(pause_scoped)
|
||||
#define __itt_resume ITTNOTIFY_VOID(resume)
|
||||
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
|
||||
#define __itt_resume_scoped ITTNOTIFY_VOID(resume_scoped)
|
||||
#define __itt_resume_scoped_ptr ITTNOTIFY_NAME(resume_scoped)
|
||||
#define __itt_detach ITTNOTIFY_VOID(detach)
|
||||
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
|
||||
ITT_STUBV(ITTAPI, void, pause, (void))
|
||||
ITT_STUBV(ITTAPI, void, resume, (void))
|
||||
ITT_STUBV(ITTAPI, void, detach, (void))
|
||||
#define __itt_pause ITTNOTIFY_VOID(pause)
|
||||
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
|
||||
#define __itt_resume ITTNOTIFY_VOID(resume)
|
||||
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
|
||||
#define __itt_detach ITTNOTIFY_VOID(detach)
|
||||
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_pause()
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_scoped(scope)
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_resume()
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped(scope)
|
||||
#define __itt_resume_scoped_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_detach()
|
||||
#define __itt_detach_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
/** @} control group */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @defgroup Intel Processor Trace control
|
||||
* API from this group provides control over collection and analysis of Intel Processor Trace (Intel PT) data
|
||||
* Information about Intel Processor Trace technology can be found here (Volume 3 chapter 35):
|
||||
* https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
|
||||
* Use this API to mark particular code regions for loading detailed performance statistics.
|
||||
* This mode makes your analysis faster and more accurate.
|
||||
* @{
|
||||
*/
|
||||
typedef unsigned char __itt_pt_region;
|
||||
|
||||
/**
|
||||
* @brief function saves a region name marked with Intel PT API and returns a region id.
|
||||
* Only 7 names can be registered. Attempts to register more names will be ignored and a region id with auto names will be returned.
|
||||
* For automatic naming of regions pass NULL as function parameter
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);
|
||||
__itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_pt_region_create __itt_pt_region_createW
|
||||
#else /* UNICODE */
|
||||
# define __itt_pt_region_create __itt_pt_region_createA
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_pt_region ITTAPI __itt_pt_region_create(const char *name);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)
|
||||
#define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)
|
||||
#define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)
|
||||
#define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)
|
||||
#define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_createA_ptr 0
|
||||
#define __itt_pt_region_createW(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA_ptr 0
|
||||
#define __itt_pt_region_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief function contains a special code pattern identified on the post-processing stage and
|
||||
* marks the beginning of a code region targeted for Intel PT analysis
|
||||
* @param[in] region - region id, 0 <= region < 8
|
||||
*/
|
||||
void __itt_mark_pt_region_begin(__itt_pt_region region);
|
||||
/**
|
||||
* @brief function contains a special code pattern identified on the post-processing stage and
|
||||
* marks the end of a code region targeted for Intel PT analysis
|
||||
* @param[in] region - region id, 0 <= region < 8
|
||||
*/
|
||||
void __itt_mark_pt_region_end(__itt_pt_region region);
|
||||
/** @} Intel PT control group*/
|
||||
|
||||
/**
|
||||
* @defgroup threads Threads
|
||||
* @ingroup public
|
||||
@@ -615,26 +541,14 @@ ITT_STUBV(ITTAPI, void, suppress_pop, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @enum __itt_suppress_mode
|
||||
* @brief Enumerator for the suppressing modes
|
||||
* @enum __itt_model_disable
|
||||
* @brief Enumerator for the disable methods
|
||||
*/
|
||||
typedef enum __itt_suppress_mode {
|
||||
__itt_unsuppress_range,
|
||||
__itt_suppress_range
|
||||
} __itt_suppress_mode_t;
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_state
|
||||
* @brief Enumerator for collection state.
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_uninitialized = 0, /* uninitialized */
|
||||
__itt_collection_init_fail = 1, /* failed to init */
|
||||
__itt_collection_collector_absent = 2, /* non work state collector is absent */
|
||||
__itt_collection_collector_exists = 3, /* work state collector exists */
|
||||
__itt_collection_init_successful = 4 /* success to init */
|
||||
} __itt_collection_state;
|
||||
|
||||
/**
|
||||
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
|
||||
*/
|
||||
@@ -1582,7 +1496,7 @@ ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr,
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record a free begin occurrence.
|
||||
* @brief Record an free begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
|
||||
|
||||
@@ -1602,7 +1516,7 @@ ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record a free end occurrence.
|
||||
* @brief Record an free end occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
|
||||
|
||||
@@ -1622,7 +1536,7 @@ ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record a reallocation begin occurrence.
|
||||
* @brief Record an reallocation begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
|
||||
|
||||
@@ -1642,7 +1556,7 @@ ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* add
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record a reallocation end occurrence.
|
||||
* @brief Record an reallocation end occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized);
|
||||
|
||||
@@ -2778,7 +2692,7 @@ ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info
|
||||
|
||||
/**
|
||||
* @ingroup clockdomains
|
||||
* @brief Recalculate clock domains frequencies and clock base timestamps.
|
||||
* @brief Recalculate clock domains frequences and clock base timestamps.
|
||||
*/
|
||||
void ITTAPI __itt_clock_domain_reset(void);
|
||||
|
||||
@@ -3683,12 +3597,11 @@ ITT_STUBV(ITTAPI, void, enable_attach, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Module load notification
|
||||
* This API is used to report necessary information in case of bypassing default system loader.
|
||||
* Notification should be done immidiatelly after this module is loaded to process memory.
|
||||
* @param[in] start_addr - module start address
|
||||
* @param[in] end_addr - module end address
|
||||
* @param[in] path - file system full path to the module
|
||||
* @brief Module load info
|
||||
* This API is used to report necessary information in case of module relocation
|
||||
* @param[in] start_addr - relocated module start address
|
||||
* @param[in] end_addr - relocated module end address
|
||||
* @param[in] path - file system path to the module
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path);
|
||||
@@ -3743,462 +3656,7 @@ ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const ch
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Report module unload
|
||||
* This API is used to report necessary information in case of bypassing default system loader.
|
||||
* Notification should be done just before the module is unloaded from process memory.
|
||||
* @param[in] addr - base address of loaded module
|
||||
*/
|
||||
void ITTAPI __itt_module_unload(void *addr);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_unload, (void *addr))
|
||||
#define __itt_module_unload ITTNOTIFY_VOID(module_unload)
|
||||
#define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_unload(addr)
|
||||
#define __itt_module_unload_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_unload_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
typedef enum
|
||||
{
|
||||
__itt_module_type_unknown = 0,
|
||||
__itt_module_type_elf,
|
||||
__itt_module_type_coff
|
||||
} __itt_module_type;
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
typedef enum
|
||||
{
|
||||
itt_section_type_unknown,
|
||||
itt_section_type_bss, /* notifies that the section contains uninitialized data. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_NOBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_UNINITIALIZED_DATA section type
|
||||
*/
|
||||
itt_section_type_data, /* notifies that section contains initialized data. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_PROGBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA section type
|
||||
*/
|
||||
itt_section_type_text /* notifies that the section contains executable code. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_PROGBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_CODE section type
|
||||
*/
|
||||
} __itt_section_type;
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be executed as code:
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_X section attribute
|
||||
* COFF module: IMAGE_SCN_MEM_EXECUTE attribute
|
||||
*/
|
||||
#define __itt_section_exec 0x20000000
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be read.
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_R attribute
|
||||
* COFF module: IMAGE_SCN_MEM_READ attribute
|
||||
*/
|
||||
#define __itt_section_read 0x40000000
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be written to.
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_W attribute
|
||||
* COFF module: IMAGE_SCN_MEM_WRITE attribute
|
||||
*/
|
||||
#define __itt_section_write 0x80000000
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_section_info
|
||||
{
|
||||
const char* name; /*!< Section name in UTF8 */
|
||||
__itt_section_type type; /*!< Section content and semantics description */
|
||||
size_t flags; /*!< Section bit flags that describe attributes using bit mask
|
||||
* Zero if disabled, non-zero if enabled
|
||||
*/
|
||||
void* start_addr; /*!< Section load(relocated) start address */
|
||||
size_t size; /*!< Section file offset */
|
||||
size_t file_offset; /*!< Section size */
|
||||
} __itt_section_info;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_module_object
|
||||
{
|
||||
unsigned int version; /*!< API version*/
|
||||
__itt_id module_id; /*!< Unique identifier. This is unchanged for sections that belong to the same module */
|
||||
__itt_module_type module_type; /*!< Binary module format */
|
||||
const char* module_name; /*!< Unique module name or path to module in UTF8
|
||||
* Contains module name when module_bufer and module_size exist
|
||||
* Contains module path when module_bufer and module_size absent
|
||||
* module_name remains the same for the certain module_id
|
||||
*/
|
||||
void* module_buffer; /*!< Module buffer content */
|
||||
size_t module_size; /*!< Module buffer size */
|
||||
/*!< If module_buffer and module_size exist, the binary module is dumped onto the system.
|
||||
* If module_buffer and module_size do not exist,
|
||||
* the binary module exists on the system already.
|
||||
* The module_name parameter contains the path to the module.
|
||||
*/
|
||||
__itt_section_info* section_array; /*!< Reference to section information */
|
||||
size_t section_number;
|
||||
} __itt_module_object;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Load module content and its loaded(relocated) sections.
|
||||
* This API is useful to save a module, or specify its location on the system and report information about loaded sections.
|
||||
* The target module is saved on the system if module buffer content and size are available.
|
||||
* If module buffer content and size are unavailable, the module name contains the path to the existing binary module.
|
||||
* @param[in] module_obj - provides module and section information, along with unique module identifiers (name,module ID)
|
||||
* which bind the binary module to particular sections.
|
||||
*/
|
||||
void ITTAPI __itt_module_load_with_sections(__itt_module_object* module_obj);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj))
|
||||
#define __itt_module_load_with_sections ITTNOTIFY_VOID(module_load_with_sections)
|
||||
#define __itt_module_load_with_sections_ptr ITTNOTIFY_NAME(module_load_with_sections)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_load_with_sections(module_obj)
|
||||
#define __itt_module_load_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_load_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Unload a module and its loaded(relocated) sections.
|
||||
* This API notifies that the module and its sections were unloaded.
|
||||
* @param[in] module_obj - provides module and sections information, along with unique module identifiers (name,module ID)
|
||||
* which bind the binary module to particular sections.
|
||||
*/
|
||||
void ITTAPI __itt_module_unload_with_sections(__itt_module_object* module_obj);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj))
|
||||
#define __itt_module_unload_with_sections ITTNOTIFY_VOID(module_unload_with_sections)
|
||||
#define __itt_module_unload_with_sections_ptr ITTNOTIFY_NAME(module_unload_with_sections)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_unload_with_sections(module_obj)
|
||||
#define __itt_module_unload_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_unload_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_histogram
|
||||
{
|
||||
const __itt_domain* domain; /*!< Domain of the histogram*/
|
||||
const char* nameA; /*!< Name of the histogram */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
__itt_metadata_type x_type; /*!< Type of the histogram X axis */
|
||||
__itt_metadata_type y_type; /*!< Type of the histogram Y axis */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_histogram* next;
|
||||
} __itt_histogram;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed histogram instance with given name/domain.
|
||||
* @param[in] domain The domain controlling the call.
|
||||
* @param[in] name The name of the histogram.
|
||||
* @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
|
||||
* @param[in] y_type The type of the Y axis in histogram.
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_histogram_create __itt_histogram_createW
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_histogram_create __itt_histogram_createA
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
|
||||
#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
|
||||
#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
|
||||
#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
|
||||
#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Submit statistics for a histogram instance.
|
||||
* @param[in] hist Pointer to the histogram instance to which the histogram statistic is to be dumped.
|
||||
* @param[in] length The number of elements in dumped axis data array.
|
||||
* @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
|
||||
* @param[in] y_data The Y axis dumped data itself.
|
||||
*/
|
||||
void ITTAPI __itt_histogram_submit(__itt_histogram* hist, size_t length, void* x_data, void* y_data);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data))
|
||||
#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
|
||||
#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_histogram_submit(hist, length, x_data, y_data)
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
|
||||
/**
|
||||
* @brief function allows to obtain the current collection state at the moment
|
||||
* @return collection state as a enum __itt_collection_state
|
||||
*/
|
||||
__itt_collection_state __itt_get_collection_state(void);
|
||||
|
||||
/**
|
||||
* @brief function releases resources allocated by ITT API static part
|
||||
* this API should be called from the library destructor
|
||||
* @return void
|
||||
*/
|
||||
void __itt_release_resources(void);
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed counter with given domain pointer, string name and counter type
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_counter ITTAPI __itt_counter_createA_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
|
||||
__itt_counter ITTAPI __itt_counter_createW_v3(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_counter_create_v3 __itt_counter_createW_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createW_v3_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_counter_create_v3 __itt_counter_createA_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createA_v3_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_counter ITTAPI __itt_counter_create_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3 ITTNOTIFY_DATA(counter_createA_v3)
|
||||
#define __itt_counter_createA_v3_ptr ITTNOTIFY_NAME(counter_createA_v3)
|
||||
#define __itt_counter_createW_v3 ITTNOTIFY_DATA(counter_createW_v3)
|
||||
#define __itt_counter_createW_v3_ptr ITTNOTIFY_NAME(counter_createW_v3)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3 ITTNOTIFY_DATA(counter_create_v3)
|
||||
#define __itt_counter_create_v3_ptr ITTNOTIFY_NAME(counter_create_v3)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_createA_v3_ptr 0
|
||||
#define __itt_counter_createW_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_typedW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_v3_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3_ptr 0
|
||||
#define __itt_counter_createW_v3_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Set the counter value api
|
||||
*/
|
||||
void ITTAPI __itt_counter_set_value_v3(__itt_counter counter, void *value_ptr);
|
||||
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr))
|
||||
#define __itt_counter_set_value_v3 ITTNOTIFY_VOID(counter_set_value_v3)
|
||||
#define __itt_counter_set_value_v3_ptr ITTNOTIFY_NAME(counter_set_value_v3)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_counter_set_value_v3(counter, value_ptr)
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief describes the type of context metadata
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_context_unknown = 0, /*!< Undefined type */
|
||||
__itt_context_nameA, /*!< ASCII string char* type */
|
||||
__itt_context_nameW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_deviceA, /*!< ASCII string char* type */
|
||||
__itt_context_deviceW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_unitsA, /*!< ASCII string char* type */
|
||||
__itt_context_unitsW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_pci_addrA, /*!< ASCII string char* type */
|
||||
__itt_context_pci_addrW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_tid, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_max_val, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_bandwidth_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_latency_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_occupancy_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_on_thread_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_is_abs_val_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_instructions_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_cycles_flag /*!< Unsigned 64-bit integer type */
|
||||
} __itt_context_type;
|
||||
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_context_name __itt_context_nameW
|
||||
# define __itt_context_device __itt_context_deviceW
|
||||
# define __itt_context_units __itt_context_unitsW
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrW
|
||||
#else /* UNICODE || _UNICODE */
|
||||
# define __itt_context_name __itt_context_nameA
|
||||
# define __itt_context_device __itt_context_deviceA
|
||||
# define __itt_context_units __itt_context_unitsA
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrA
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_context_metadata
|
||||
{
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
void* value; /*!< Pointer to context metadata value itself */
|
||||
} __itt_context_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_counter_metadata
|
||||
{
|
||||
__itt_counter counter; /*!< Associated context metadata counter */
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
const char* str_valueA; /*!< String context metadata value */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* str_valueW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* str_valueW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
unsigned long long value; /*!< Numeric context metadata value */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_counter_metadata* next;
|
||||
} __itt_counter_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Bind context metadata to counter instance
|
||||
* @param[in] counter Pointer to the counter instance to which the context metadata is to be associated.
|
||||
* @param[in] length The number of elements in context metadata array.
|
||||
* @param[in] metadata The context metadata itself.
|
||||
*/
|
||||
void ITTAPI __itt_bind_context_metadata_to_counter(__itt_counter counter, size_t length, __itt_context_metadata* metadata);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata))
|
||||
#define __itt_bind_context_metadata_to_counter ITTNOTIFY_VOID(bind_context_metadata_to_counter)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr ITTNOTIFY_NAME(bind_context_metadata_to_counter)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_bind_context_metadata_to_counter(counter, length, metadata)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -4547,7 +4005,7 @@ ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Destroy the information about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
|
||||
* @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
|
||||
*/
|
||||
void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
|
||||
|
||||
|
||||
+75
-23
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#ifndef __JITPROFILING_H__
|
||||
#define __JITPROFILING_H__
|
||||
@@ -14,7 +66,7 @@
|
||||
* generated code that can be used by performance tools. The user inserts
|
||||
* calls in the code generator to report information before JIT-compiled
|
||||
* code goes to execution. This information is collected at runtime and used
|
||||
* by tools like Intel(R) VTune(TM) Profiler to display performance metrics
|
||||
* by tools like Intel(R) VTune(TM) Amplifier to display performance metrics
|
||||
* associated with JIT-compiled code.
|
||||
*
|
||||
* These APIs can be used to\n
|
||||
@@ -45,16 +97,16 @@
|
||||
* * Expected behavior:
|
||||
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and its
|
||||
* memory region is treated as unloaded. VTune Profiler displays the metrics
|
||||
* memory region is treated as unloaded. VTune Amplifier displays the metrics
|
||||
* collected by the method until it is overwritten.
|
||||
* * If supplied line number information contains multiple source lines for
|
||||
* the same assembly instruction (code location), then VTune Profiler picks up
|
||||
* the same assembly instruction (code location), then VTune Amplifier picks up
|
||||
* the first line number.
|
||||
* * Dynamically generated code can be associated with a module name.
|
||||
* Use the iJIT_Method_Load_V2 structure.\n
|
||||
* Clarification of some cases:
|
||||
* * If you register a function with the same method ID multiple times,
|
||||
* specifying different module names, then the VTune Profiler picks up
|
||||
* specifying different module names, then the VTune Amplifier picks up
|
||||
* the module name registered first. If you want to distinguish the same
|
||||
* function between different JIT engines, supply different method IDs for
|
||||
* each function. Other symbolic information (for example, source file)
|
||||
@@ -91,18 +143,18 @@
|
||||
* belonging to the same method. Symbolic information (method name,
|
||||
* source file name) will be taken from the first notification, and all
|
||||
* subsequent notifications with the same method ID will be processed
|
||||
* only for line number table information. So, the VTune Profiler will map
|
||||
* only for line number table information. So, the VTune Amplifier will map
|
||||
* samples to a source line using the line number table from the current
|
||||
* notification while taking the source file name from the very first one.\n
|
||||
* Clarification of some cases:\n
|
||||
* * If you register a second code region with a different source file
|
||||
* name and the same method ID, then this information will be saved and
|
||||
* will not be considered as an extension of the first code region, but
|
||||
* VTune Profiler will use the source file of the first code region and map
|
||||
* VTune Amplifier will use the source file of the first code region and map
|
||||
* performance metrics incorrectly.
|
||||
* * If you register a second code region with the same source file as
|
||||
* for the first region and the same method ID, then the source file will be
|
||||
* discarded but VTune Profiler will map metrics to the source file correctly.
|
||||
* discarded but VTune Amplifier will map metrics to the source file correctly.
|
||||
* * If you register a second code region with a null source file and
|
||||
* the same method ID, then provided line number info will be associated
|
||||
* with the source file of the first code region.
|
||||
@@ -241,7 +293,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
|
||||
* @brief Description of a single entry in the line number information of a code region.
|
||||
* @details A table of line number entries gives information about how the reported code region
|
||||
* is mapped to source file.
|
||||
* Intel(R) VTune(TM) Profiler uses line number information to attribute
|
||||
* Intel(R) VTune(TM) Amplifier uses line number information to attribute
|
||||
* the samples (virtual address) to a line number. \n
|
||||
* It is acceptable to report different code addresses for the same source line:
|
||||
* @code
|
||||
@@ -252,7 +304,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
|
||||
* 18 1
|
||||
* 21 30
|
||||
*
|
||||
* VTune Profiler constructs the following table using the client data
|
||||
* VTune Amplifier constructs the following table using the client data
|
||||
*
|
||||
* Code subrange Line number
|
||||
* 0-1 2
|
||||
@@ -376,7 +428,7 @@ typedef struct _iJIT_Method_Load_V2
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
The module name can be useful for distinguishing among
|
||||
different JIT engines. VTune Profiler will display
|
||||
different JIT engines. VTune Amplifier will display
|
||||
reported methods grouped by specific module. */
|
||||
|
||||
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
|
||||
@@ -428,7 +480,7 @@ typedef struct _iJIT_Method_Load_V3
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
* The module name can be useful for distinguishing among
|
||||
* different JIT engines. VTune Profiler will display
|
||||
* different JIT engines. VTune Amplifier will display
|
||||
* reported methods grouped by specific module. */
|
||||
|
||||
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
|
||||
@@ -438,9 +490,9 @@ typedef struct _iJIT_Method_Load_V3
|
||||
* engine generates 64-bit code.
|
||||
*
|
||||
* If JIT engine reports both 32-bit and 64-bit types
|
||||
* of methods then VTune Profiler splits the methods
|
||||
* of methods then VTune Amplifier splits the methods
|
||||
* with the same module name but with different
|
||||
* architectures in two different modules. VTune Profiler
|
||||
* architectures in two different modules. VTune Amplifier
|
||||
* modifies the original name provided with a 64-bit method
|
||||
* version by ending it with '(64)' */
|
||||
|
||||
@@ -509,9 +561,9 @@ typedef enum _iJIT_SegmentType
|
||||
iJIT_CT_CODE, /**<\brief Executable code. */
|
||||
|
||||
iJIT_CT_DATA, /**<\brief Data (not executable code).
|
||||
* VTune Profiler uses the format string
|
||||
* VTune Amplifier uses the format string
|
||||
* (see iJIT_Method_Update) to represent
|
||||
* this data in the VTune Profiler GUI */
|
||||
* this data in the VTune Amplifier GUI */
|
||||
|
||||
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
|
||||
* Can be used for the following
|
||||
@@ -528,11 +580,11 @@ typedef enum _iJIT_SegmentType
|
||||
* structure to describe the update of the content within a JIT-compiled method,
|
||||
* use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it.
|
||||
*
|
||||
* On the first Update event, VTune Profiler copies the original code range reported by
|
||||
* On the first Update event, VTune Amplifier copies the original code range reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and
|
||||
* adds the modified range to the original method. For next update events, VTune Profiler
|
||||
* adds the modified range to the original method. For next update events, VTune Amplifier
|
||||
* does the same but it uses the latest modified version of a code region for update.
|
||||
* Eventually, VTune Profiler GUI displays multiple code ranges for the method reported by
|
||||
* Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event.
|
||||
* Notes:
|
||||
* - Multiple update events with different types for the same trace are allowed
|
||||
@@ -621,7 +673,7 @@ iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);
|
||||
* @brief Reports infomation about JIT-compiled code to the agent.
|
||||
*
|
||||
* The reported information is used to attribute samples obtained from any
|
||||
* Intel(R) VTune(TM) Profiler collector. This API needs to be called
|
||||
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
|
||||
* after JIT compilation and before the first entry into the JIT-compiled
|
||||
* code.
|
||||
*
|
||||
|
||||
+74
-39
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
#ifndef _LEGACY_ITTNOTIFY_H_
|
||||
#define _LEGACY_ITTNOTIFY_H_
|
||||
|
||||
@@ -28,10 +80,6 @@
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -39,8 +87,6 @@
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -62,10 +108,6 @@
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -73,8 +115,6 @@
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -127,12 +167,7 @@
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE __forceinline
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -184,20 +219,20 @@
|
||||
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
|
||||
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
|
||||
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
@@ -234,7 +269,7 @@ extern "C" {
|
||||
* only pauses tracing and analyzing memory access.
|
||||
* It does not pause tracing or analyzing threading APIs.
|
||||
* .
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
@@ -970,9 +1005,9 @@ ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain))
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @brief Record a frame begin occurrence. */
|
||||
/** @brief Record an frame begin occurrence. */
|
||||
void ITTAPI __itt_frame_begin(__itt_frame frame);
|
||||
/** @brief Record a frame end occurrence. */
|
||||
/** @brief Record an frame end occurrence. */
|
||||
void ITTAPI __itt_frame_end (__itt_frame frame);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
|
||||
+56
-4
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#ifndef _LIBITTNOTIFY_H_
|
||||
#define _LIBITTNOTIFY_H_
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
/*
|
||||
* This file implements an interface bridge from Low-Level Virtual Machine
|
||||
* llvm::JITEventListener to Intel JIT Profiling API. It passes the function
|
||||
* and line information to the appropriate functions in the JIT profiling
|
||||
* interface so that any LLVM-based JIT engine can emit the JIT code
|
||||
* notifications that the profiler will receive.
|
||||
*
|
||||
* Usage model:
|
||||
*
|
||||
* 1. Register the listener implementation instance with the execution engine:
|
||||
*
|
||||
* #include <llvm_jit_event_listener.hpp>
|
||||
* ...
|
||||
* ExecutionEngine *TheExecutionEngine;
|
||||
* ...
|
||||
* TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
* ...
|
||||
* __itt_llvm_jit_event_listener jitListener;
|
||||
* TheExecutionEngine->RegisterJITEventListener(&jitListener);
|
||||
* ...
|
||||
*
|
||||
* 2. When compiling make sure to add the ITT API include directory to the
|
||||
* compiler include directories, ITT API library directory to the linker
|
||||
* library directories and link with jitprofling static library.
|
||||
*/
|
||||
|
||||
#ifndef __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
#define __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
#include <llvm/Function.h>
|
||||
#include <llvm/ExecutionEngine/JITEventListener.h>
|
||||
#include <llvm/ADT/StringRef.h>
|
||||
#include <llvm/Analysis/DebugInfo.h>
|
||||
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
|
||||
// Uncomment the line below to turn on logging to stderr
|
||||
#define JITPROFILING_DEBUG_ENABLE
|
||||
|
||||
// Some elementary logging support
|
||||
#ifdef JITPROFILING_DEBUG_ENABLE
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
static void _jit_debug(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
// Use the macro as JITDEBUG(("foo: %d", foo_val));
|
||||
#define JITDEBUG(x) \
|
||||
do { \
|
||||
_jit_debug("jit-listener: "); \
|
||||
_jit_debug x; \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define JITDEBUG(x)
|
||||
#endif
|
||||
|
||||
// LLVM JIT event listener, translates the notifications to the JIT profiling
|
||||
// API information.
|
||||
class __itt_llvm_jit_event_listener : public llvm::JITEventListener
|
||||
{
|
||||
public:
|
||||
__itt_llvm_jit_event_listener() {}
|
||||
|
||||
public:
|
||||
virtual void NotifyFunctionEmitted(const llvm::Function &F,
|
||||
void *Code, size_t Size, const EmittedFunctionDetails &Details)
|
||||
{
|
||||
std::string name = F.getName().str();
|
||||
JITDEBUG(("function jitted:\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)Code));
|
||||
JITDEBUG((" name=`%s'\n", name.c_str()));
|
||||
JITDEBUG((" code-size=%d\n", (int)Size));
|
||||
JITDEBUG((" line-infos-count=%d\n", Details.LineStarts.size()));
|
||||
|
||||
// The method must not be in the map - the entry must have been cleared
|
||||
// from the map in NotifyFreeingMachineCode in case of rejitting.
|
||||
assert(m_addr2MethodId.find(Code) == m_addr2MethodId.end());
|
||||
|
||||
int mid = iJIT_GetNewMethodID();
|
||||
m_addr2MethodId[Code] = mid;
|
||||
|
||||
iJIT_Method_Load mload;
|
||||
memset(&mload, 0, sizeof mload);
|
||||
mload.method_id = mid;
|
||||
|
||||
// Populate the method size and name information
|
||||
// TODO: The JIT profiling API should have members as const char pointers.
|
||||
mload.method_name = (char*)name.c_str();
|
||||
mload.method_load_address = Code;
|
||||
mload.method_size = (unsigned int)Size;
|
||||
|
||||
// Populate line information now.
|
||||
// From the JIT API documentation it is not quite clear whether the
|
||||
// line information can be given in ranges, so we'll populate it for
|
||||
// every byte of the function, hmm.
|
||||
std::string srcFilePath;
|
||||
std::vector<LineNumberInfo> lineInfos;
|
||||
char *addr = (char*)Code;
|
||||
char *lineAddr = addr; // Exclusive end point at which current
|
||||
// line info changes.
|
||||
const llvm::DebugLoc* loc = 0; // Current line info
|
||||
int lineIndex = -1; // Current index into the line info table
|
||||
for (int i = 0; i < Size; ++i, ++addr) {
|
||||
while (addr >= lineAddr) {
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
loc = &Details.LineStarts[lineIndex].Loc;
|
||||
std::string p = getSrcFilePath(F.getContext(), *loc);
|
||||
assert(srcFilePath.empty() || p == srcFilePath);
|
||||
srcFilePath = p;
|
||||
} else {
|
||||
loc = NULL;
|
||||
}
|
||||
lineIndex++;
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
lineAddr = (char*)Details.LineStarts[lineIndex].Address;
|
||||
} else {
|
||||
lineAddr = addr + Size;
|
||||
}
|
||||
}
|
||||
if (loc) {
|
||||
int line = loc->getLine();
|
||||
LineNumberInfo info = { i, line };
|
||||
lineInfos.push_back(info);
|
||||
JITDEBUG((" addr 0x%08x -> line %d\n", addr, line));
|
||||
}
|
||||
}
|
||||
if (!lineInfos.empty()) {
|
||||
mload.line_number_size = lineInfos.size();
|
||||
JITDEBUG((" translated to %d line infos to JIT", (int)lineInfos.size()));
|
||||
mload.line_number_table = &lineInfos[0];
|
||||
mload.source_file_name = (char*)srcFilePath.c_str();
|
||||
}
|
||||
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &mload);
|
||||
}
|
||||
|
||||
virtual void NotifyFreeingMachineCode(void *OldPtr)
|
||||
{
|
||||
JITDEBUG(("function unjitted\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)OldPtr));
|
||||
Addr2MethodId::iterator it = m_addr2MethodId.find(OldPtr);
|
||||
assert(it != m_addr2MethodId.end());
|
||||
iJIT_Method_Id mid = { it->second };
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, &mid);
|
||||
m_addr2MethodId.erase(it);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string getSrcFilePath(const llvm::LLVMContext& ctx, const llvm::DebugLoc& loc)
|
||||
{
|
||||
llvm::MDNode* node = loc.getAsMDNode(ctx);
|
||||
llvm::DILocation srcLoc(node);
|
||||
return srcLoc.getDirectory().str() + "/" + srcLoc.getFilename().str();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Don't copy
|
||||
__itt_llvm_jit_event_listener(const __itt_llvm_jit_event_listener&);
|
||||
__itt_llvm_jit_event_listener& operator=(const __itt_llvm_jit_event_listener&);
|
||||
|
||||
private:
|
||||
typedef std::vector<LineNumberInfo> LineInfoList;
|
||||
|
||||
// The method unload notification in VTune JIT profiling API takes the
|
||||
// method ID, not method address so have to maintain the mapping. Is
|
||||
// there a more efficient and simple way to do this like attaching the
|
||||
// method ID information somehow to the LLVM function instance?
|
||||
//
|
||||
// TODO: It would be more convenient for the JIT API to take the method
|
||||
// address, not method ID.
|
||||
typedef std::map<const void*, int> Addr2MethodId;
|
||||
Addr2MethodId m_addr2MethodId;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
Vendored
+5
-6
@@ -1,8 +1,7 @@
|
||||
Copyright (c) 2019 Intel Corporation. All rights reserved.
|
||||
|
||||
Copyright (c) 2011, Intel Corporation
|
||||
All rights reserved.
|
||||
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. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
• 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 Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Vendored
+11
-49
@@ -1,103 +1,65 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
The GNU General Public License (GPL)
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
Copyright (C) < yyyy> <name of author>
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
Copyright (C) <year> <name of author>
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
+56
-8
@@ -1,23 +1,71 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
|
||||
#if defined _MSC_VER
|
||||
|
||||
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
|
||||
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
|
||||
#pragma warning (disable: 174) /* expression has no effect */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if defined __INTEL_COMPILER
|
||||
|
||||
+80
-197
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
#ifndef _ITTNOTIFY_CONFIG_H_
|
||||
#define _ITTNOTIFY_CONFIG_H_
|
||||
|
||||
@@ -23,10 +75,6 @@
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -34,8 +82,6 @@
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -57,10 +103,6 @@
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -68,8 +110,6 @@
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -122,12 +162,7 @@
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE __forceinline
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -153,10 +188,6 @@
|
||||
# define ITT_ARCH_IA32E 2
|
||||
#endif /* ITT_ARCH_IA32E */
|
||||
|
||||
#ifndef ITT_ARCH_IA64
|
||||
# define ITT_ARCH_IA64 3
|
||||
#endif /* ITT_ARCH_IA64 */
|
||||
|
||||
#ifndef ITT_ARCH_ARM
|
||||
# define ITT_ARCH_ARM 4
|
||||
#endif /* ITT_ARCH_ARM */
|
||||
@@ -165,9 +196,9 @@
|
||||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH_ARM64
|
||||
# define ITT_ARCH_ARM64 6
|
||||
#endif /* ITT_ARCH_ARM64 */
|
||||
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
|
||||
# define ITT_ARCH_AARCH64 6
|
||||
#endif /* ITT_ARCH_AARCH64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
@@ -179,7 +210,7 @@
|
||||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __aarch64__
|
||||
# define ITT_ARCH ITT_ARCH_ARM64
|
||||
# define ITT_ARCH ITT_ARCH_AARCH64
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
@@ -208,10 +239,10 @@
|
||||
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
|
||||
|
||||
/* Replace with snapshot date YYYYMMDD for promotion build. */
|
||||
#define API_VERSION_BUILD 20250113
|
||||
#define API_VERSION_BUILD 20151119
|
||||
|
||||
#ifndef API_VERSION_NUM
|
||||
#define API_VERSION_NUM 3.25.4
|
||||
#define API_VERSION_NUM 0.0.0
|
||||
#endif /* API_VERSION_NUM */
|
||||
|
||||
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
|
||||
@@ -223,11 +254,7 @@
|
||||
typedef HMODULE lib_t;
|
||||
typedef DWORD TIDT;
|
||||
typedef CRITICAL_SECTION mutex_t;
|
||||
#ifdef __cplusplus
|
||||
#define MUTEX_INITIALIZER {}
|
||||
#else
|
||||
#define MUTEX_INITIALIZER { 0 }
|
||||
#endif
|
||||
#define strong_alias(name, aliasname) /* empty for Windows */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <dlfcn.h>
|
||||
@@ -255,13 +282,13 @@ typedef pthread_mutex_t mutex_t;
|
||||
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
|
||||
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
|
||||
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
|
||||
#define __itt_mutex_destroy(mutex) DeleteCriticalSection(mutex)
|
||||
#define __itt_load_lib(name) LoadLibraryA(name)
|
||||
#define __itt_unload_lib(handle) FreeLibrary(handle)
|
||||
#define __itt_system_error() (int)GetLastError()
|
||||
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
|
||||
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
|
||||
#define __itt_fstrdup(s) _strdup(s)
|
||||
#define __itt_thread_id() GetCurrentThreadId()
|
||||
#define __itt_thread_yield() SwitchToThread()
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
@@ -271,13 +298,6 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return InterlockedIncrement(ptr);
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return InterlockedCompareExchange(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
#define DL_SYMBOLS (1)
|
||||
@@ -307,7 +327,6 @@ __itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long compe
|
||||
}
|
||||
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
|
||||
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
|
||||
#define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex)
|
||||
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
|
||||
#define __itt_unload_lib(handle) dlclose(handle)
|
||||
#define __itt_system_error() errno
|
||||
@@ -322,18 +341,10 @@ __itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long compe
|
||||
#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) { \
|
||||
if (b > 0) { \
|
||||
/* 'volatile' is used to suppress the warning that a destination */ \
|
||||
/* bound depends on the length of the source. */ \
|
||||
volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \
|
||||
(size_t)(b - 1) : (size_t)(l); \
|
||||
strncpy(s1, s2, num_to_copy); \
|
||||
s1[num_to_copy] = 0; \
|
||||
} \
|
||||
}
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
|
||||
#endif /* SDL_STRNCPY_S */
|
||||
|
||||
#define __itt_fstrdup(s) strdup(s)
|
||||
#define __itt_thread_id() pthread_self()
|
||||
#define __itt_thread_yield() sched_yield()
|
||||
#if ITT_ARCH==ITT_ARCH_IA64
|
||||
@@ -349,12 +360,12 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
||||
{
|
||||
long result;
|
||||
__asm__ __volatile__("lock\nxadd %0,%1"
|
||||
: "=r"(result),"=m"(*(volatile int*)ptr)
|
||||
: "0"(addend), "m"(*(volatile int*)ptr)
|
||||
: "=r"(result),"=m"(*(int*)ptr)
|
||||
: "0"(addend), "m"(*(int*)ptr)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
@@ -364,13 +375,6 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return __sync_val_compare_and_swap(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
void* dlopen(const char*, int) __attribute__((weak));
|
||||
@@ -390,20 +394,10 @@ pthread_t pthread_self(void) __attribute__((weak));
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/* strdup() is not included into C99 which results in a compiler warning about
|
||||
* implicitly declared symbol. To avoid the issue strdup is implemented
|
||||
* manually.
|
||||
*/
|
||||
#define ITT_STRDUP_MAX_STRING_SIZE 4096
|
||||
#define __itt_fstrdup(s, new_s) do { \
|
||||
if (s != NULL) { \
|
||||
size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE); \
|
||||
new_s = (char *)malloc(s_len + 1); \
|
||||
if (new_s != NULL) { \
|
||||
__itt_fstrcpyn(new_s, s_len + 1, s, s_len); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
typedef enum {
|
||||
__itt_collection_normal = 0,
|
||||
__itt_collection_paused = 1
|
||||
} __itt_collection_state;
|
||||
|
||||
typedef enum {
|
||||
__itt_thread_normal = 0,
|
||||
@@ -469,10 +463,6 @@ typedef struct __itt_counter_info
|
||||
|
||||
struct ___itt_domain;
|
||||
struct ___itt_string_handle;
|
||||
struct ___itt_histogram;
|
||||
struct ___itt_counter_metadata;
|
||||
|
||||
#include "ittnotify.h"
|
||||
|
||||
typedef struct ___itt_global
|
||||
{
|
||||
@@ -494,10 +484,7 @@ typedef struct ___itt_global
|
||||
struct ___itt_domain* domain_list;
|
||||
struct ___itt_string_handle* string_list;
|
||||
__itt_collection_state state;
|
||||
__itt_counter_info_t* counter_list;
|
||||
unsigned int ipt_collect_events;
|
||||
struct ___itt_histogram* histogram_list;
|
||||
struct ___itt_counter_metadata* counter_metadata_list;
|
||||
__itt_counter_info_t* counter_list;
|
||||
} __itt_global;
|
||||
|
||||
#pragma pack(pop)
|
||||
@@ -523,9 +510,7 @@ typedef struct ___itt_global
|
||||
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
|
||||
if (h != NULL) { \
|
||||
h->tid = t; \
|
||||
char *n_copy = NULL; \
|
||||
__itt_fstrdup(n, n_copy); \
|
||||
h->nameA = n_copy; \
|
||||
h->nameA = n ? __itt_fstrdup(n) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->state = s; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
@@ -558,9 +543,7 @@ typedef struct ___itt_global
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
@@ -590,9 +573,7 @@ typedef struct ___itt_global
|
||||
#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \
|
||||
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
|
||||
if (h != NULL) { \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->strA = name_copy; \
|
||||
h->strA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->strW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
@@ -610,7 +591,7 @@ typedef struct ___itt_global
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->domainA = NULL; \
|
||||
h->domainW = domain ? _wcsdup(domain) : NULL; \
|
||||
h->domainW = name ? _wcsdup(domain) : NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
@@ -624,13 +605,9 @@ typedef struct ___itt_global
|
||||
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
h->nameW = NULL; \
|
||||
char *domain_copy = NULL; \
|
||||
__itt_fstrdup(domain, domain_copy); \
|
||||
h->domainA = domain_copy; \
|
||||
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
|
||||
h->domainW = NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
@@ -642,98 +619,4 @@ typedef struct ___itt_global
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_W(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_A(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_NUM(gptr,h,h_tail,counter,type,value) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = value; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_A(gptr,h,h_tail,counter,type,str_valueA) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
char *str_value_copy = NULL; \
|
||||
__itt_fstrdup(str_valueA, str_value_copy); \
|
||||
h->str_valueA = str_value_copy; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_W(gptr,h,h_tail,counter,type,str_valueW) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = str_valueW ? _wcsdup(str_valueW) : NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_CONFIG_H_ */
|
||||
|
||||
+252
-699
File diff suppressed because it is too large
Load Diff
+61
-40
@@ -1,8 +1,60 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
@@ -29,9 +81,6 @@ ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORM
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_load_with_sections, __itt_group_module, "%p")
|
||||
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_unload_with_sections, __itt_group_module, "%p")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"")
|
||||
@@ -56,8 +105,6 @@ ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, con
|
||||
|
||||
ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), pause_scoped, __itt_group_control, "%d")
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), resume_scoped, __itt_group_control, "%d")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"")
|
||||
@@ -74,23 +121,6 @@ ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (IT
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createA, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createW, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_create, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createA_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createW_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_create_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata), (ITT_FORMAT counter, length, metadata), bind_context_metadata_to_counter, __itt_group_structure, "%p, %lu, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
|
||||
@@ -266,13 +296,6 @@ ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMA
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name), (ITT_FORMAT name), pt_region_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name), (ITT_FORMAT name), pt_region_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name), (ITT_FORMAT name), pt_region_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p")
|
||||
@@ -353,16 +376,14 @@ ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, in
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_module, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_module, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_none, "%p, %p, %p")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_module, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_none, "%p, %p, %p")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p")
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data), (ITT_FORMAT hist, length, x_data, y_data), histogram_submit, __itt_group_structure, "%p, %lu, %p, %p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr), (ITT_FORMAT counter, value_ptr), counter_set_value_v3, __itt_group_counter, "%p, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_INIT */
|
||||
|
||||
+75
-25
@@ -1,34 +1,85 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#ifndef _ITTNOTIFY_TYPES_H_
|
||||
#define _ITTNOTIFY_TYPES_H_
|
||||
|
||||
typedef enum ___itt_group_id
|
||||
{
|
||||
__itt_group_none = 0,
|
||||
__itt_group_legacy = 1<<0,
|
||||
__itt_group_control = 1<<1,
|
||||
__itt_group_thread = 1<<2,
|
||||
__itt_group_mark = 1<<3,
|
||||
__itt_group_sync = 1<<4,
|
||||
__itt_group_fsync = 1<<5,
|
||||
__itt_group_jit = 1<<6,
|
||||
__itt_group_model = 1<<7,
|
||||
__itt_group_splitter_min = 1<<7,
|
||||
__itt_group_counter = 1<<8,
|
||||
__itt_group_frame = 1<<9,
|
||||
__itt_group_stitch = 1<<10,
|
||||
__itt_group_heap = 1<<11,
|
||||
__itt_group_splitter_max = 1<<12,
|
||||
__itt_group_structure = 1<<12,
|
||||
__itt_group_suppress = 1<<13,
|
||||
__itt_group_arrays = 1<<14,
|
||||
__itt_group_module = 1<<15,
|
||||
__itt_group_all = -1
|
||||
__itt_group_none = 0,
|
||||
__itt_group_legacy = 1<<0,
|
||||
__itt_group_control = 1<<1,
|
||||
__itt_group_thread = 1<<2,
|
||||
__itt_group_mark = 1<<3,
|
||||
__itt_group_sync = 1<<4,
|
||||
__itt_group_fsync = 1<<5,
|
||||
__itt_group_jit = 1<<6,
|
||||
__itt_group_model = 1<<7,
|
||||
__itt_group_splitter_min = 1<<7,
|
||||
__itt_group_counter = 1<<8,
|
||||
__itt_group_frame = 1<<9,
|
||||
__itt_group_stitch = 1<<10,
|
||||
__itt_group_heap = 1<<11,
|
||||
__itt_group_splitter_max = 1<<12,
|
||||
__itt_group_structure = 1<<12,
|
||||
__itt_group_suppress = 1<<13,
|
||||
__itt_group_arrays = 1<<14,
|
||||
__itt_group_all = -1
|
||||
} __itt_group_id;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
@@ -58,7 +109,6 @@ typedef struct ___itt_group_list
|
||||
{ __itt_group_structure, "structure" }, \
|
||||
{ __itt_group_suppress, "suppress" }, \
|
||||
{ __itt_group_arrays, "arrays" }, \
|
||||
{ __itt_group_module, "module" }, \
|
||||
{ __itt_group_none, NULL } \
|
||||
}
|
||||
|
||||
|
||||
+95
-45
@@ -1,24 +1,76 @@
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
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 Intel Corporation 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
|
||||
OWNER 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.
|
||||
</copyright> */
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD && ITT_PLATFORM != ITT_PLATFORM_OPENBSD
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
static const char rcsid[] = "\n@(#) $Revision$\n";
|
||||
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
|
||||
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
|
||||
|
||||
#ifndef NEW_DLL_ENVIRONMENT_VAR
|
||||
#if ITT_ARCH==ITT_ARCH_IA32
|
||||
@@ -29,10 +81,13 @@ static const char rcsid[] = "\n@(#) $Revision$\n";
|
||||
#endif /* NEW_DLL_ENVIRONMENT_VAR */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define DEFAULT_DLLNAME "JitPI.dll"
|
||||
HINSTANCE m_libHandle = NULL;
|
||||
#elif ITT_PLATFORM==ITT_PLATFORM_MAC
|
||||
#define DEFAULT_DLLNAME "libJitPI.dylib"
|
||||
void* m_libHandle = NULL;
|
||||
#else
|
||||
#define DEFAULT_DLLNAME "libJitPI.so"
|
||||
void* m_libHandle = NULL;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
@@ -114,38 +169,6 @@ ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
||||
return executionMode;
|
||||
}
|
||||
|
||||
#if ITT_PLATFORM == ITT_PLATFORM_WIN
|
||||
static int isValidAbsolutePath(char *path, size_t maxPathLength)
|
||||
{
|
||||
if (path == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t pathLength = strnlen(path, maxPathLength);
|
||||
if (pathLength == maxPathLength)
|
||||
{
|
||||
/* The strnlen() function returns maxPathLength if there is no null terminating
|
||||
* among the first maxPathLength characters in the string pointed to by path.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pathLength > 2)
|
||||
{
|
||||
if (isalpha(path[0]) && path[1] == ':' && path[2] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (path[0] == '\\' && path[1] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function loads the collector dll and the relevant functions.
|
||||
* on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1
|
||||
* on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0
|
||||
@@ -189,7 +212,7 @@ static int loadiJIT_Funcs()
|
||||
{
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret && isValidAbsolutePath(dllName, dNameLength))
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
@@ -197,9 +220,30 @@ static int loadiJIT_Funcs()
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
} else {
|
||||
/* Try to use old VS_PROFILER variable */
|
||||
dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0);
|
||||
if (dNameLength)
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
if(dllName != NULL)
|
||||
{
|
||||
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryA(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
|
||||
if (!dllName)
|
||||
dllName = getenv(DLL_ENVIRONMENT_VAR);
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
if (!dllName)
|
||||
dllName = ANDROID_JIT_AGENT_PATH;
|
||||
@@ -207,13 +251,19 @@ static int loadiJIT_Funcs()
|
||||
if (dllName)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
if (DL_SYMBOLS)
|
||||
{
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
}
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
}
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
if (!m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
m_libHandle = LoadLibraryA(DEFAULT_DLLNAME);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/* if the dll wasn't loaded - exit. */
|
||||
if (!m_libHandle)
|
||||
{
|
||||
|
||||
Vendored
+1
-1
@@ -889,7 +889,7 @@ int jas_stream_copy(jas_stream_t *out, jas_stream_t *in, int n)
|
||||
while (all || m > 0) {
|
||||
if ((c = jas_stream_getc_macro(in)) == EOF) {
|
||||
/* The next character of input could not be read. */
|
||||
/* Return with an error if an I/O error occurred
|
||||
/* Return with an error if an I/O error occured
|
||||
(not including EOF) or if an explicit copy count
|
||||
was specified. */
|
||||
return (!all || jas_stream_error(in)) ? (-1) : 0;
|
||||
|
||||
Vendored
+1
-1
@@ -100,7 +100,7 @@
|
||||
#define JPC_BITSTREAM_NOCLOSE 0x01
|
||||
/* End of file has been reached while reading. */
|
||||
#define JPC_BITSTREAM_EOF 0x02
|
||||
/* An I/O error has occurerd. */
|
||||
/* An I/O error has occured. */
|
||||
#define JPC_BITSTREAM_ERR 0x04
|
||||
|
||||
/******************************************************************************\
|
||||
|
||||
+35
-81
@@ -1,43 +1,12 @@
|
||||
project(${JPEG_LIBRARY} C)
|
||||
|
||||
macro(boolean_number var)
|
||||
if(${var})
|
||||
set(${var} 1 ${ARGN})
|
||||
else()
|
||||
set(${var} 0 ${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||
if(APPLE)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable) # NEON flags are not used on Mac
|
||||
endif()
|
||||
|
||||
if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||
# src/jchuff.c:1042:22: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wstringop-overflow)
|
||||
endif()
|
||||
|
||||
set(VERSION 3.1.0)
|
||||
set(COPYRIGHT_YEAR "1991-2024")
|
||||
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
|
||||
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
|
||||
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
|
||||
list(GET VERSION_TRIPLET 2 VERSION_REVISION)
|
||||
function(pad_number NUMBER OUTPUT_LEN)
|
||||
string(LENGTH "${${NUMBER}}" INPUT_LEN)
|
||||
if(INPUT_LEN LESS OUTPUT_LEN)
|
||||
math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
|
||||
set(NUM ${${NUMBER}})
|
||||
foreach(C RANGE ${ZEROES})
|
||||
set(NUM "0${NUM}")
|
||||
endforeach()
|
||||
set(${NUMBER} ${NUM} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
pad_number(VERSION_MINOR 3)
|
||||
pad_number(VERSION_REVISION 3)
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 1)
|
||||
set(VERSION_REVISION 3)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2001003)
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -47,7 +16,7 @@ endif()
|
||||
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LC)
|
||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
|
||||
@@ -87,7 +56,8 @@ if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")
|
||||
set(CPU_TYPE arm64)
|
||||
endif()
|
||||
|
||||
OCV_OPTION(ENABLE_LIBJPEG_TURBO_SIMD "Include SIMD extensions for libjpeg-turbo, if available for this platform" (NOT CV_DISABLE_OPTIMIZATION))
|
||||
OCV_OPTION(ENABLE_LIBJPEG_TURBO_SIMD "Include SIMD extensions for libjpeg-turbo, if available for this platform" (NOT CV_DISABLE_OPTIMIZATION)
|
||||
VISIBLE_IF BUILD_JPEG)
|
||||
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)
|
||||
set(WITH_SIMD 1)
|
||||
@@ -97,8 +67,8 @@ include(CheckCSourceCompiles)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
check_type_size("size_t" SIZE_T)
|
||||
check_type_size("unsigned long" UNSIGNED_LONG)
|
||||
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); }"
|
||||
@@ -134,34 +104,33 @@ if(WITH_ARITH_DEC)
|
||||
set(D_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB_VERSION 70)
|
||||
set(JPEG_LIB_VERSION 62)
|
||||
|
||||
# OpenCV
|
||||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
||||
|
||||
set(THREAD_LOCAL "") # WITH_TURBOJPEG is not used
|
||||
|
||||
add_definitions(-DNO_GETENV -DNO_PUTENV)
|
||||
|
||||
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(JPEG16_SOURCES jcapistd.c jccolor.c jcdiffct.c jclossls.c jcmainct.c
|
||||
jcprepct.c jcsample.c jdapistd.c jdcolor.c jddiffct.c jdlossls.c jdmainct.c
|
||||
jdpostct.c jdsample.c jutils.c)
|
||||
|
||||
set(JPEG12_SOURCES ${JPEG16_SOURCES} jccoefct.c jcdctmgr.c jdcoefct.c
|
||||
jddctmgr.c jdmerge.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c
|
||||
jidctred.c jquant1.c jquant2.c)
|
||||
|
||||
set(JPEG_SOURCES ${JPEG12_SOURCES} jcapimin.c jchuff.c jcicc.c jcinit.c
|
||||
jclhuff.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c jctrans.c
|
||||
jdapimin.c jdatadst.c jdatasrc.c jdhuff.c jdicc.c jdinput.c jdlhuff.c
|
||||
jdmarker.c jdmaster.c jdphuff.c jdtrans.c jerror.c jfdctflt.c jmemmgr.c
|
||||
jmemnobs.c jpeg_nbits.c)
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jcicc.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
|
||||
jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
|
||||
jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
|
||||
jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
|
||||
jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
@@ -175,7 +144,7 @@ if(WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
# Use the maximum optimization level for release builds
|
||||
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
if(${var} MATCHES "-O2")
|
||||
@@ -198,12 +167,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckTypeSize)
|
||||
check_type_size("size_t" SIZE_T)
|
||||
check_type_size("unsigned long" UNSIGNED_LONG)
|
||||
|
||||
if(ENABLE_LIBJPEG_TURBO_SIMD)
|
||||
add_subdirectory(simd)
|
||||
add_subdirectory(src/simd)
|
||||
if(NEON_INTRINSICS)
|
||||
add_definitions(-DNEON_INTRINSICS)
|
||||
endif()
|
||||
@@ -217,28 +182,19 @@ if(WITH_SIMD)
|
||||
if(MSVC_IDE OR XCODE)
|
||||
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
|
||||
endif()
|
||||
set(SIMD_TARGET_OBJECTS $<TARGET_OBJECTS:simd>)
|
||||
else()
|
||||
add_library(jsimd OBJECT src/jsimd_none.c)
|
||||
set_target_properties(jsimd PROPERTIES FOLDER "3rdparty")
|
||||
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
|
||||
set_target_properties(jsimd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
configure_file(jversion.h.in jversion.h)
|
||||
configure_file(jconfig.h.in jconfig.h)
|
||||
configure_file(jconfigint.h.in jconfigint.h)
|
||||
|
||||
ocv_list_add_prefix(JPEG16_SOURCES src/)
|
||||
ocv_list_add_prefix(JPEG12_SOURCES src/)
|
||||
ocv_list_add_prefix(JPEG_SOURCES src/)
|
||||
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
|
||||
add_library(jpeg12-static OBJECT ${JPEG12_SOURCES})
|
||||
set_property(TARGET jpeg12-static PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=12")
|
||||
add_library(jpeg16-static OBJECT ${JPEG16_SOURCES})
|
||||
set_property(TARGET jpeg16-static PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=16")
|
||||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_TARGET_OBJECTS}
|
||||
${SIMD_OBJS} $<TARGET_OBJECTS:jpeg12-static>
|
||||
$<TARGET_OBJECTS:jpeg16-static>)
|
||||
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} $<TARGET_OBJECTS:jsimd> ${SIMD_OBJS})
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
@@ -249,9 +205,7 @@ set_target_properties(${JPEG_LIBRARY}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(jpeg12-static PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(jpeg16-static PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
|
||||
Vendored
+15
-18
@@ -1,33 +1,30 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by two compatible BSD-style open source 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,
|
||||
including any code inherited from libjpeg and any modifications to that
|
||||
code. Note that the libjpeg-turbo SIMD source code bears the
|
||||
[zlib License](https://opensource.org/licenses/Zlib), but in the context of
|
||||
the overall libjpeg API library, the terms of the zlib License are subsumed
|
||||
by the terms of the IJG License.
|
||||
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 applies to the TurboJPEG API library and associated programs, as
|
||||
well as the build system. Note that the TurboJPEG API library wraps the
|
||||
libjpeg API library, so in the context of the overall TurboJPEG API library,
|
||||
both the terms of the IJG License and the terms of the Modified (3-clause)
|
||||
BSD License apply.
|
||||
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. This is not a license in and of itself. It is
|
||||
intended solely for clarification.
|
||||
best of our understanding.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
@@ -41,7 +38,7 @@ intended solely for clarification.
|
||||
- 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
|
||||
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.)
|
||||
|
||||
@@ -94,7 +91,7 @@ intended solely for clarification.
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.<br>
|
||||
Copyright (C)2009-2022 D. R. Commander. All Rights Reserved.<br>
|
||||
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -122,8 +119,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Why Two Licenses?
|
||||
=================
|
||||
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
|
||||
|
||||
Vendored
+23
-25
@@ -36,18 +36,16 @@ TO DO Plans for future IJG releases.
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
doc/*.1 Unix-style man pages for programs (same info as
|
||||
usage.txt).
|
||||
doc/wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
doc/change.log Version-to-version change highlights.
|
||||
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:
|
||||
doc/libjpeg.txt How to use the JPEG library in your own programs.
|
||||
src/example.c Sample code for calling the JPEG library.
|
||||
doc/structure.txt Overview of the JPEG library's internal structure.
|
||||
doc/coderules.txt Coding style rules --- please read if you contribute
|
||||
code.
|
||||
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
|
||||
@@ -70,17 +68,17 @@ 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 normally 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.)
|
||||
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, progressive, and
|
||||
lossless 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
|
||||
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,
|
||||
@@ -91,9 +89,9 @@ 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. These
|
||||
extra functions can be compiled out of the library if not required for a
|
||||
particular application.
|
||||
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
|
||||
@@ -243,7 +241,7 @@ 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 original JPEG standard or with JFIF (for instance,
|
||||
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
|
||||
|
||||
Vendored
+41
-59
@@ -21,26 +21,7 @@ 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. libjpeg-turbo is an ISO/IEC and ITU-T
|
||||
reference implementation of the JPEG standard.
|
||||
|
||||
More information about libjpeg-turbo can be found at
|
||||
<https://libjpeg-turbo.org>.
|
||||
|
||||
|
||||
Funding
|
||||
=======
|
||||
|
||||
libjpeg-turbo is an independent open source project, but we rely on patronage
|
||||
and funded development in order to maintain that independence. The easiest way
|
||||
to ensure that libjpeg-turbo remains community-focused and free of any one
|
||||
organization's agenda is to
|
||||
[sponsor our project through GitHub](https://github.com/sponsors/libjpeg-turbo).
|
||||
All sponsorship money goes directly toward funding the labor necessary to
|
||||
maintain libjpeg-turbo, support the user community, and implement bug fixes and
|
||||
strategically important features.
|
||||
|
||||
[](https://github.com/sponsors/libjpeg-turbo)
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
License
|
||||
@@ -69,12 +50,9 @@ JPEG images:
|
||||
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 [tjcomp.c](src/tjcomp.c),
|
||||
[tjdecomp.c](src/tjdecomp.c), [tjtran.c](src/tjtran.c),
|
||||
[TJComp.java](java/TJComp.java), [TJDecomp.java](java/TJDecomp.java), and
|
||||
[TJTran.java](java/TJTran.java) for examples of its usage and to
|
||||
<https://libjpeg-turbo.org/Documentation/Documentation> for API
|
||||
documentation.
|
||||
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
|
||||
@@ -82,9 +60,8 @@ JPEG images:
|
||||
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](src/cjpeg.c) and [djpeg.c](src/djpeg.c) for
|
||||
examples of its usage and to [libjpeg.txt](doc/libjpeg.txt) for API
|
||||
documentation.
|
||||
(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.
|
||||
@@ -136,9 +113,9 @@ extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
[jcstest.c](src/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.
|
||||
[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
|
||||
-----------------------------------
|
||||
@@ -203,7 +180,7 @@ supported and which aren't.
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. Readers are invited to peruse the research at
|
||||
<https://libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
@@ -268,6 +245,16 @@ 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 `-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.2.0 to 62.3.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
@@ -287,35 +274,30 @@ Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. There are two exceptions:
|
||||
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:
|
||||
|
||||
1. When decompressing a JPEG image that uses 4:4:0 chrominance subsampling, the
|
||||
outputs of libjpeg v6b and libjpeg-turbo can differ because libjpeg-turbo
|
||||
implements a "fancy" (smooth) 4:4:0 upsampling algorithm and libjpeg did not.
|
||||
- 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.)
|
||||
|
||||
2. When using the floating point DCT/IDCT, the outputs of libjpeg v6b and
|
||||
libjpeg-turbo can differ for the following reasons:
|
||||
- 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 accurate integer IDCT. The
|
||||
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
|
||||
not produce significantly more accuracy than the accurate integer algorithms
|
||||
(to put numbers on this, the typical difference in PNSR between the two
|
||||
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
|
||||
the upper range of the quality scale is typically more like a 1.0 dB
|
||||
difference.)
|
||||
|
||||
- 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 accurate integer
|
||||
IDCT. The floating point DCT/IDCT algorithms are mainly a legacy
|
||||
feature, and they do not produce significantly more accuracy than the
|
||||
accurate integer algorithms. (To put numbers on this, the typical
|
||||
difference in PNSR between the two algorithms is less than 0.10 dB,
|
||||
whereas changing the quality level by 1 in the upper range of the quality
|
||||
scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented
|
||||
using SIMD instructions on a particular platform, then the accuracy of
|
||||
the floating point DCT/IDCT can depend on the compiler settings.
|
||||
- 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
|
||||
|
||||
Vendored
+38
-30
@@ -9,52 +9,60 @@
|
||||
/* libjpeg-turbo version in integer form */
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
/* Support arithmetic encoding when using 8-bit samples */
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding when using 8-bit samples */
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#define MEM_SRCDST_SUPPORTED 1
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines when using 8-bit samples */
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
/* This version of libjpeg-turbo supports run-time selection of data precision,
|
||||
* so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
|
||||
* time. However, some downstream software expects the macro to be defined.
|
||||
* Since 12-bit data precision is an opt-in feature that requires explicitly
|
||||
* calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
|
||||
* types, the unmodified portion of the libjpeg API still behaves as if it were
|
||||
* built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
|
||||
* type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
#ifndef BITS_IN_JSAMPLE
|
||||
#define BITS_IN_JSAMPLE 8
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
|
||||
/* 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 to 1 if you have the <stddef.h> header file. */
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
|
||||
/* 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 */
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
|
||||
#else
|
||||
/* 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
|
||||
|
||||
#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 */
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#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
|
||||
|
||||
/* 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 */
|
||||
+10
-34
@@ -1,14 +1,19 @@
|
||||
/* libjpeg-turbo build number */
|
||||
#define BUILD "@BUILD@"
|
||||
|
||||
/* How to hide global symbols. */
|
||||
#define HIDDEN @HIDDEN@
|
||||
|
||||
/* Compiler's inline keyword */
|
||||
#undef inline
|
||||
|
||||
/* How to obtain function inlining. */
|
||||
#define INLINE @INLINE@
|
||||
#ifndef INLINE
|
||||
#if defined(__GNUC__)
|
||||
#define INLINE inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define INLINE __forceinline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* How to obtain thread-local storage */
|
||||
#define THREAD_LOCAL @THREAD_LOCAL@
|
||||
@@ -20,7 +25,7 @@
|
||||
#define VERSION "@VERSION@"
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T @SIZE_T@
|
||||
#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
|
||||
@@ -45,32 +50,3 @@
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
#ifndef BITS_IN_JSAMPLE
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
#endif
|
||||
|
||||
#undef C_ARITH_CODING_SUPPORTED
|
||||
#undef D_ARITH_CODING_SUPPORTED
|
||||
#undef WITH_SIMD
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
#endif
|
||||
|
||||
+3
-26
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, 2024, D. R. Commander.
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -23,7 +23,6 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jcmaster.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -91,18 +90,8 @@ jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
|
||||
|
||||
cinfo->input_gamma = 1.0; /* in case application forgets */
|
||||
|
||||
cinfo->data_precision = BITS_IN_JSAMPLE;
|
||||
|
||||
/* OK, I'm ready */
|
||||
cinfo->global_state = CSTATE_START;
|
||||
|
||||
/* The master struct is used to store extension parameters, so we allocate it
|
||||
* here.
|
||||
*/
|
||||
cinfo->master = (struct jpeg_comp_master *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_comp_master));
|
||||
memset(cinfo->master, 0, sizeof(my_comp_master));
|
||||
}
|
||||
|
||||
|
||||
@@ -194,20 +183,8 @@ jpeg_finish_compress(j_compress_ptr cinfo)
|
||||
/* We bypass the main controller and invoke coef controller directly;
|
||||
* all work is being done from the coefficient buffer.
|
||||
*/
|
||||
if (cinfo->data_precision <= 8) {
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE)NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
} else if (cinfo->data_precision <= 12) {
|
||||
if (!(*cinfo->coef->compress_data_12) (cinfo, (J12SAMPIMAGE)NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
} else {
|
||||
#ifdef C_LOSSLESS_SUPPORTED
|
||||
if (!(*cinfo->coef->compress_data_16) (cinfo, (J16SAMPIMAGE)NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
#else
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
#endif
|
||||
}
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE)NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
(*cinfo->master->finish_pass) (cinfo);
|
||||
}
|
||||
|
||||
+14
-52
@@ -1,10 +1,8 @@
|
||||
/*
|
||||
* jcapistd.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, 2024, D. R. Commander.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -20,11 +18,8 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsamplecomp.h"
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/*
|
||||
* Compression initialization.
|
||||
* Before calling this, all parameters and a data destination must be set up.
|
||||
@@ -56,15 +51,13 @@ jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
|
||||
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.
|
||||
/* 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);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write some scanlines of data to the JPEG compressor.
|
||||
@@ -74,7 +67,7 @@ jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
|
||||
* 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
|
||||
* 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
|
||||
@@ -82,28 +75,11 @@ jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
_jpeg_write_scanlines(j_compress_ptr cinfo, _JSAMPARRAY scanlines,
|
||||
JDIMENSION num_lines)
|
||||
jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines,
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
#if BITS_IN_JSAMPLE != 16 || defined(C_LOSSLESS_SUPPORTED)
|
||||
JDIMENSION row_ctr, rows_left;
|
||||
|
||||
#ifdef C_LOSSLESS_SUPPORTED
|
||||
if (cinfo->master->lossless) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if (cinfo->data_precision > BITS_IN_JSAMPLE || cinfo->data_precision < 2)
|
||||
#else
|
||||
if (cinfo->data_precision > BITS_IN_JSAMPLE ||
|
||||
cinfo->data_precision < BITS_IN_JSAMPLE - 3)
|
||||
#endif
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
}
|
||||
|
||||
if (cinfo->global_state != CSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->next_scanline >= cinfo->image_height)
|
||||
@@ -117,9 +93,9 @@ _jpeg_write_scanlines(j_compress_ptr cinfo, _JSAMPARRAY scanlines,
|
||||
}
|
||||
|
||||
/* Give master control module another chance if this is first call to
|
||||
* _jpeg_write_scanlines. This lets output of the frame/scan headers be
|
||||
* 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.
|
||||
* jpeg_start_compress and jpeg_write_scanlines.
|
||||
*/
|
||||
if (cinfo->master->call_pass_startup)
|
||||
(*cinfo->master->pass_startup) (cinfo);
|
||||
@@ -130,35 +106,23 @@ _jpeg_write_scanlines(j_compress_ptr cinfo, _JSAMPARRAY scanlines,
|
||||
num_lines = rows_left;
|
||||
|
||||
row_ctr = 0;
|
||||
(*cinfo->main->_process_data) (cinfo, scanlines, &row_ctr, num_lines);
|
||||
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
|
||||
cinfo->next_scanline += row_ctr;
|
||||
return row_ctr;
|
||||
#else
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE != 16
|
||||
|
||||
/*
|
||||
* 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)
|
||||
jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data,
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION lines_per_iMCU_row;
|
||||
|
||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
|
||||
if (cinfo->master->lossless)
|
||||
ERREXIT(cinfo, JERR_NOTIMPL);
|
||||
|
||||
if (cinfo->global_state != CSTATE_RAW_OK)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->next_scanline >= cinfo->image_height) {
|
||||
@@ -174,9 +138,9 @@ _jpeg_write_raw_data(j_compress_ptr cinfo, _JSAMPIMAGE data,
|
||||
}
|
||||
|
||||
/* 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
|
||||
* 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.
|
||||
* jpeg_start_compress and jpeg_write_raw_data.
|
||||
*/
|
||||
if (cinfo->master->call_pass_startup)
|
||||
(*cinfo->master->pass_startup) (cinfo);
|
||||
@@ -187,7 +151,7 @@ _jpeg_write_raw_data(j_compress_ptr cinfo, _JSAMPIMAGE data,
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
|
||||
/* Directly compress the row. */
|
||||
if (!(*cinfo->coef->_compress_data) (cinfo, data)) {
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, data)) {
|
||||
/* If compressor did not consume the whole row, suspend processing. */
|
||||
return 0;
|
||||
}
|
||||
@@ -196,5 +160,3 @@ _jpeg_write_raw_data(j_compress_ptr cinfo, _JSAMPIMAGE data,
|
||||
cinfo->next_scanline += lines_per_iMCU_row;
|
||||
return lines_per_iMCU_row;
|
||||
}
|
||||
|
||||
#endif /* BITS_IN_JSAMPLE != 16 */
|
||||
|
||||
+21
-26
@@ -3,20 +3,19 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* 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 lossy JPEG compressor proper.
|
||||
* 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"
|
||||
#include "jsamplecomp.h"
|
||||
|
||||
|
||||
/* We use a full-image coefficient buffer when doing Huffman optimization,
|
||||
@@ -59,12 +58,11 @@ typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(boolean) compress_data(j_compress_ptr cinfo, _JSAMPIMAGE input_buf);
|
||||
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);
|
||||
JSAMPIMAGE input_buf);
|
||||
METHODDEF(boolean) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -108,18 +106,18 @@ start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
case JBUF_PASS_THRU:
|
||||
if (coef->whole_image[0] != NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
coef->pub._compress_data = compress_data;
|
||||
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;
|
||||
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;
|
||||
coef->pub.compress_data = compress_output;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -140,7 +138,7 @@ start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_data(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
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 */
|
||||
@@ -174,10 +172,10 @@ compress_data(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
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);
|
||||
(*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],
|
||||
@@ -244,7 +242,7 @@ compress_data(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_first_pass(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
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;
|
||||
@@ -281,10 +279,10 @@ compress_first_pass(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
*/
|
||||
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);
|
||||
(*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 */
|
||||
@@ -340,7 +338,7 @@ compress_first_pass(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_output(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
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 */
|
||||
@@ -404,13 +402,10 @@ compress_output(j_compress_ptr cinfo, _JSAMPIMAGE input_buf)
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
_jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_coef_ptr coef;
|
||||
|
||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
|
||||
coef = (my_coef_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_coef_controller));
|
||||
|
||||
+28
-36
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2012, 2015, 2022, D. R. Commander.
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -29,16 +29,15 @@
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_ycc_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
_JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
#if BITS_IN_JSAMPLE != 16
|
||||
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 JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
@@ -49,29 +48,26 @@ rgb_ycc_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = RANGE_LIMIT(inptr[RGB_RED]);
|
||||
g = RANGE_LIMIT(inptr[RGB_GREEN]);
|
||||
b = RANGE_LIMIT(inptr[RGB_BLUE]);
|
||||
r = inptr[RGB_RED];
|
||||
g = inptr[RGB_GREEN];
|
||||
b = inptr[RGB_BLUE];
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* If the inputs are 0.._MAXJSAMPLE, the outputs of these equations
|
||||
/* 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);
|
||||
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);
|
||||
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);
|
||||
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
|
||||
ctab[b + B_CR_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -87,16 +83,15 @@ rgb_ycc_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_gray_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
_JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
#if BITS_IN_JSAMPLE != 16
|
||||
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 JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
@@ -105,18 +100,15 @@ rgb_gray_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = RANGE_LIMIT(inptr[RGB_RED]);
|
||||
g = RANGE_LIMIT(inptr[RGB_GREEN]);
|
||||
b = RANGE_LIMIT(inptr[RGB_BLUE]);
|
||||
r = inptr[RGB_RED];
|
||||
g = inptr[RGB_GREEN];
|
||||
b = inptr[RGB_BLUE];
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* Y */
|
||||
outptr[col] = (_JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -127,12 +119,12 @@ rgb_gray_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb_convert_internal(j_compress_ptr cinfo, _JSAMPARRAY input_buf,
|
||||
_JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
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 JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user