(4.x) reduce binaries size of FFmpeg Windows wrapper#19606
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Mar 2, 2021
Merged
(4.x) reduce binaries size of FFmpeg Windows wrapper#19606opencv-pushbot merged 1 commit intoopencv:masterfrom
opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
Merged
Member
Author
|
@vpisarev @asmorkalov @mshabunin Please add feedback which changes are excessive and should be reverted (see the list in PR's description). Does it makes sense to move |
Contributor
|
I think the changes are fine. I'd move any function larger than 300-500 lines (CPU+OCL) to separate file, 1k-line files are not particularly convenient. |
mshabunin
approved these changes
Mar 1, 2021
- to reduce binaries size of FFmpeg Windows wrapper - MinGW linker doesn't support -ffunction-sections (used for FFmpeg Windows wrapper) - move code to improve locality with its used dependencies - move UMat::dot() to matmul.dispatch.cpp (Mat::dot() is already there) - move UMat::inv() to lapack.cpp - move UMat::mul() to arithm.cpp - move UMat:eye() to matrix_operations.cpp (near setIdentity() implementation) - move normalize(): convert_scale.cpp => norm.cpp - move convertAndUnrollScalar(): arithm.cpp => copy.cpp - move scalarToRawData(): array.cpp => copy.cpp - move transpose(): matrix_operations.cpp => matrix_transform.cpp - move flip(), rotate(): copy.cpp => matrix_transform.cpp (rotate90 uses flip and transpose) - add 'OPENCV_CORE_EXCLUDE_C_API' CMake variable to exclude compilation of C-API functions from the core module - matrix_wrap.cpp: add compile-time checks for CUDA/OpenGL calls - the steps above allow to reduce FFmpeg wrapper size for ~1.5Mb (initial size of OpenCV part is about 3Mb)
Member
Author
Done @vpisarev @asmorkalov ping ^^^ |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FFmpeg wrapper side without and with this patch:
Reduced used opencv files from 51 to 16:
Details