1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-23 12:23:02 +04:00

Compare commits

..

672 Commits

Author SHA1 Message Date
Vadim Pisarevsky 2154e6251f fixed typo in CMakeLists.txt 2011-08-17 19:54:50 +00:00
Vadim Pisarevsky aea4486cde made "make package_source" work on Mac too. 2011-08-17 19:05:10 +00:00
Vadim Pisarevsky bd2185dbe8 regenerated PDFs one more time 2011-08-17 17:32:18 +00:00
Vadim Pisarevsky 98a8c2170d copied the latest tutorials & find_obj.py sample from trunk to 2.3 branch 2011-08-17 17:28:58 +00:00
Vadim Pisarevsky d040791dd9 copied the latest tutorials & find_obj.py sample from trunk to 2.3 branch 2011-08-17 13:09:53 +00:00
Vadim Pisarevsky 57ce8ee687 fixed multi-scale Hough transform (ticket #1320) 2011-08-17 09:18:08 +00:00
Vadim Pisarevsky e71745a390 disabled fast-math by default. 2011-08-17 09:01:25 +00:00
Vadim Pisarevsky 8d6d592c0b updated Python samples from trunk 2011-08-16 18:31:43 +00:00
Vadim Pisarevsky 280012472b backported updated ffmpeg from trunk to 2.3 2011-08-16 13:45:55 +00:00
Vadim Pisarevsky 94de7d3f3f fixed crashes in parallel HOG detector; avoid use of new POPCNT instruction in ORB (to make it compatible with older CPUs). 2011-08-16 13:34:56 +00:00
Vadim Pisarevsky 14a35a8d7b fixed Ximea constructor call 2011-08-15 14:16:22 +00:00
Vadim Pisarevsky f779a85a99 added tests for Vec & Matx multiplication 2011-08-15 13:08:46 +00:00
Vadim Pisarevsky 41a35c3c95 fixed bug #1306 (Vec assignment) 2011-08-15 12:29:39 +00:00
Vadim Pisarevsky 14c05d9bcf updated PDFs (fixed many broken links) 2011-08-15 12:18:41 +00:00
Andrey Kamaev ed349fc3b5 Fixed Android build 2011-08-15 09:11:29 +00:00
Andrey Kamaev d3b14b7111 Documenation: merged recent changes from trunk 2011-08-15 08:13:53 +00:00
Vadim Pisarevsky 567949e2c4 fixed tickets #1301, #1303, #1305 2011-08-14 19:43:59 +00:00
Vadim Pisarevsky 574a961cc1 added cv.py micro-module for backward compatibility with existing Python scripts using prev-gen Python API. 2011-08-12 18:00:35 +00:00
Vadim Pisarevsky b206f9c269 another attempt to fix #1299 2011-08-12 15:16:54 +00:00
Vadim Pisarevsky 4e85c7dbda Branch 2.3 is overridden with the latest copy from trunk. 2011-08-12 12:56:59 +00:00
Vadim Pisarevsky d37beb4074 fixed Matx33 * Point3 and Matx22 * Point operators (ticket #1299) 2011-08-12 12:54:38 +00:00
Vadim Pisarevsky 50d70cf9c6 made retina code compile with VS2005/VS2008 2011-08-12 11:28:17 +00:00
Vadim Pisarevsky 6b162ea211 improved list formatting in opencv refman. Updated PDFs. 2011-08-12 10:52:06 +00:00
Andrey Kamaev 6c767b281e Java API: generated test stubs for 2 new functions 2011-08-12 08:14:51 +00:00
Vadim Pisarevsky 02c98152d7 export HOGDescriptor::getDefaultPeopleDetector() to Python (ticket #1298) 2011-08-12 07:50:55 +00:00
Andrey Kamaev 67a98bfd24 Fixed search in html documentation (ticket #1232) 2011-08-12 07:23:54 +00:00
Ana Huaman ea971df8bf Added SURF_Homography sample codee 2011-08-12 03:33:52 +00:00
Alexander Mordvintsev d80a41a543 comment 2011-08-12 03:23:44 +00:00
Alexander Mordvintsev d7a2081230 peopledetect.py sample added (TODO: use builtin svm data instead of people_hog.txt)
some old cv api use cleaning
2011-08-12 03:05:31 +00:00
Ana Huaman 9fba5e8d8c Added code for SURF using FLANN Matcher and drawMatches options 2011-08-12 00:19:42 +00:00
Vadim Pisarevsky c65c67eff4 preserve alpha channel in PNG, when imread(..., -1) is called (ticket #1107) 2011-08-11 22:38:09 +00:00
Vadim Pisarevsky 6942799669 fixed kmeans center initialization in the case of huge matrices (ticket #1291); fixed warinings in libtiff. 2011-08-11 22:27:18 +00:00
Vadim Pisarevsky 1e6f1cc15c another attempt to fix IPP detection on x64 (ticket #1294) 2011-08-11 22:18:51 +00:00
Vadim Pisarevsky 2fe3ed75c1 fixed building retina code on Windows 2011-08-11 22:02:52 +00:00
Vadim Pisarevsky 411f51367e raised threshold in ORB test; temporarily disabled always failing Opponent SIFT test 2011-08-11 21:35:04 +00:00
Vadim Pisarevsky 907fafce5a fixed retinaDemo compile errors 2011-08-11 20:45:51 +00:00
Vadim Pisarevsky 2842d34611 added retina model, by Alexander Benoit 2011-08-11 20:42:08 +00:00
Ana Huaman 04ebef1be2 Added two sample code for features 2D - SURF descriptor and detector 2011-08-11 20:30:25 +00:00
Andrey Kamaev 8442dab01d Html documentation: fixed text wrapping for sidebar 2011-08-11 19:06:41 +00:00
Vadim Pisarevsky d1588c0439 added support for Ximea cameras (missing parts in the prev. commit) 2011-08-11 18:06:09 +00:00
Vadim Pisarevsky bd0d8429ee added support for Ximea cameras (patch by Marian Zajko), fixed GCC warnings in MOG2 background subtractor. 2011-08-11 17:59:30 +00:00
Vadim Pisarevsky d58459ccdd fixed default maxSize case in cvHaarDetectObjects (ticket #1296) 2011-08-11 13:16:00 +00:00
Vadim Pisarevsky d3350b50aa avoid infinite loops when 0-area image is filtered (ticket #1295) 2011-08-11 13:12:59 +00:00
Vadim Pisarevsky c3caaf3b88 fixed IPP detection on 64-bit Windows (ticket #1294) 2011-08-11 11:47:54 +00:00
Bernat Gabor a0a46b0d70 Added a video input tutorial with PSNR and SSIM. 2011-08-11 09:34:03 +00:00
Andrey Kamaev caec96a199 Fixed libraries order in Android.mk (thanks to Anush Moorthy for the report) 2011-08-11 08:28:05 +00:00
Andrey Kamaev 7c8a49b475 Java API: Removed meaningless tests 2011-08-11 07:21:28 +00:00
Andrey Morozov c0cd317284 fixed compile errors in samples 2011-08-11 07:04:27 +00:00
itsyplen bc64567d37 Update samples using cmd parser 2011-08-11 06:46:09 +00:00
Andrey Kamaev 1863f58a67 Java API: generated test stubs for recently added functions/classes 2011-08-10 16:57:15 +00:00
Andrey Kamaev ebb08bc015 Java API: Fixed bug in Mat port; fixed/implemented all java tests for core module 2011-08-10 15:56:47 +00:00
Maria Dimashova 04e4eaabaf updated openni finding by cmake (#1190, #1252); updated doc on kinect 2011-08-10 14:58:55 +00:00
Leonid Beynenson aa78754720 Changed tabulation. 2011-08-10 14:21:20 +00:00
Andrey Kamaev 92afe9e40a Java API: fixed input List<List<smth>> arguments 2011-08-10 14:09:22 +00:00
Vadim Pisarevsky f9ef92d45a multilib support added (ticket #363) 2011-08-10 12:49:52 +00:00
Vadim Pisarevsky 645bb0bfbc added size check to static Mat::diag() 2011-08-10 12:40:41 +00:00
Andrey Kamaev 25261e6ebc Added new tests written by Hussein Abdinoor; Added support for new classes in features2d and imgproc 2011-08-10 12:35:22 +00:00
itsyplen d3f8b2eeb7 Updated using new cmd parser 2011-08-10 12:33:03 +00:00
Vadim Pisarevsky 5678464f7d fixed OpenCVConfig.cmake for statically built OpenCV on Mac 2011-08-10 12:08:58 +00:00
Vladislav Vinogradov bad7dadb75 added remap test, fix compilation error 2011-08-10 12:05:24 +00:00
Maria Dimashova 7f1995f19a fixed cmake status of openni 2011-08-10 11:59:37 +00:00
Maria Dimashova 1d69a3bc6a fixed compile error on ubuntu64 2011-08-10 11:49:10 +00:00
Maria Dimashova 3569e18f0e fixed compile errors and warning on ubuntu64 2011-08-10 11:36:55 +00:00
Vladislav Vinogradov 8bb9e4302e added registerPageLocked/unregisterPageLocked functions
added convert functions to BruteForceMatcher_GPU
other minor fixes
2011-08-10 11:32:48 +00:00
itsyplen 24279c2c11 Updated sample using new cmd parser 2011-08-10 11:29:32 +00:00
itsyplen 49fb4ecbc1 Updated samples using new cmd parser 2011-08-10 10:41:38 +00:00
Vadim Pisarevsky c9ed7fee34 fixed C++ implementation of Delaunay triangulation and moved it from sample to imgproc. 2011-08-10 10:28:01 +00:00
Anatoly Baksheev edcfa64d99 experimental kernels for cuda 2011-08-10 09:51:36 +00:00
Andrey Kamaev 50d1d711de Added reference to Nvidia TADP into Android tutorial; refactored both Android tutorials; fixed some rst warnings 2011-08-10 09:45:17 +00:00
Maria Dimashova 6287c113c8 fixed compile errors 2011-08-10 09:43:44 +00:00
Anatoly Baksheev b535356ec7 experimental kernels for cuda 2011-08-10 09:35:57 +00:00
Maria Dimashova 81cb7b2c5e added read/write methods for SimpleBlobDetector and DenseFeatureDetector; added their creation to FeatureDetector::create method (#1290) 2011-08-10 09:17:37 +00:00
itsyplen 7f32e8131d Updating samples using cmd parser 2011-08-10 08:56:27 +00:00
itsyplen 86cd9fadf3 Fixed some grammatical errors 2011-08-10 08:52:52 +00:00
Maria Dimashova 999481273e fixed memory leak in SIFT wrapper (#1288) 2011-08-10 07:02:50 +00:00
Vladislav Vinogradov ff1fb9f7cc minor stitching optimization (use cpu matchers instead of gpu matchers on multicore processors) 2011-08-10 06:53:24 +00:00
Vadim Pisarevsky cfdf464052 initial (buggy) C++ version of Delaunay triangulation 2011-08-09 15:11:32 +00:00
Andrey Kamaev 1248775177 Java API: added JNI_OnLoad to eliminate jvm warnings 2011-08-09 14:58:24 +00:00
Maria Dimashova 1d7877eeaf added doc on supported Kinect properties (#1251) 2011-08-09 14:00:11 +00:00
Maria Dimashova ec150c24e3 added CV_CAP_PROP_OPENNI_REGISTRATION property for getting 2011-08-09 13:58:05 +00:00
Vladislav Vinogradov c5adaa717b minor stitching optimization (improve buffer reuse) 2011-08-09 13:08:54 +00:00
Andrey Kamaev b319e7f403 Java API: added support for BruteforceMatcher-SL2 2011-08-09 12:52:47 +00:00
Andrey Kamaev e553a37fe7 Removed outdated android-opencv subproject 2011-08-09 11:55:43 +00:00
Andrey Kamaev d9d74678a9 Java API: corrected names of methods in Utils class; fixed bug in DMatch (thank for Hussein Abdinoor); added new utility method loadResource 2011-08-09 11:46:27 +00:00
Vladislav Vinogradov 13e392763b fixed compilation error without cuda 2011-08-09 11:35:42 +00:00
Maria Dimashova abd12c052a fixed doc warning 2011-08-09 09:59:44 +00:00
Andrey Kamaev 0a78cdf264 Updated Android tutorials 2011-08-09 09:56:16 +00:00
Maria Dimashova fd27ba248b added doc on CvERTrees 2011-08-09 09:52:08 +00:00
Vladislav Vinogradov 36bfa6ea1c minor 2011-08-09 09:15:04 +00:00
Vladislav Vinogradov b2b1d41da8 moved GpuMat class to separate header file 2011-08-09 07:51:48 +00:00
Vladislav Vinogradov f4f38fcced fixed gpu test failure on empty test data 2011-08-09 06:25:01 +00:00
Bernat Gabor a5f38806ab Small modifications to the scan tutorial and added the video-input-psnr-ssim sample file. 2011-08-09 05:43:58 +00:00
Maria Dimashova 1f07209f6c fixed CvCapture_OpenNI constructor (removed all exceptions) (#1237) 2011-08-08 15:47:52 +00:00
Maria Dimashova 4839bfb1a5 fixed grammar of the comment 2011-08-08 14:03:37 +00:00
Andrey Kamaev 2ec815be89 Updated android tutorial for native development 2011-08-08 13:26:23 +00:00
Maria Dimashova fcd999ae6e added SL2 (squared L2 distance) and implemented the descriptors matching in L2 using SL2 2011-08-08 13:18:12 +00:00
Vladislav Vinogradov a9fdc1bdff added buffered version of cornerHarris, cornerMinEigenVal, histEven and histRange 2011-08-08 13:05:50 +00:00
Vladislav Vinogradov 12b7090a6f fixed some warnings under win64 2011-08-08 13:03:18 +00:00
Maria Dimashova dc14b45617 minor changes 2011-08-08 12:47:04 +00:00
Anatoly Baksheev 5c691907ed minor improvements in cmake-file for gpu samples 2011-08-08 12:16:23 +00:00
Vladislav Vinogradov 42ced17c2c fixed some warnings under win64 2011-08-08 11:28:14 +00:00
Anatoly Baksheev 7d82a14d1a ticket 1280 2011-08-08 09:23:44 +00:00
Vladislav Vinogradov 767ac9aa10 added gpu::Canny function 2011-08-08 08:53:55 +00:00
Andrey Kamaev 0a2c7803b6 Fixed mixChannels argument types 2011-08-08 07:08:58 +00:00
Vladislav Vinogradov dfaa8af6ee fixed #1279 2011-08-08 05:59:09 +00:00
Bernat Gabor ed801d3e65 Added the "Interoperability with OpenCV 1" tutorial. 2011-08-08 05:58:10 +00:00
Andrey Kamaev b486a96601 Java API: refactored Core tests 2011-08-08 05:16:31 +00:00
Leonid Beynenson 93a0237b64 Added the tutorial "Using OpenCV Android binary package to compile applications, which use OpenCV from native level". 2011-08-07 20:46:51 +00:00
Vadim Pisarevsky 8ceda8372c corrected PCA::PCA and PCA::operator () description (thanks to Adrian Kaehler) 2011-08-07 17:12:09 +00:00
Vadim Pisarevsky e5c66b5ed4 fixed pointPolygonTest(). Now it returns -1, 0, 1 when measureDist=false (ticket #1285) 2011-08-07 16:58:29 +00:00
Andrey Kamaev 99e3b5a24e Java API: cleaned imgproc tests; changed signatures of several java functions 2011-08-06 21:19:23 +00:00
Vadim Pisarevsky e2e4ee2f53 disable implicit numpy array use in old-style Python bindings because of hard-to-fix memory leaks (ticket #1177) 2011-08-06 20:15:29 +00:00
Vadim Pisarevsky 3f40a1d8c3 fixed KeyPoint::convert(keypoints,point2f) (ticket #1282; thanks to cooperz for the patch) 2011-08-06 19:42:29 +00:00
Vadim Pisarevsky dd1315b22a fixed rank check in 8-point Fundamental Matrix algorithm (patch by F. Devernay; ticket #1273) 2011-08-06 19:38:09 +00:00
Vadim Pisarevsky 04a4e51920 fixed parallel block matching stereo correspondence algorithm (ticket #997; thanks to jbieger for the patch) 2011-08-06 19:28:20 +00:00
Vadim Pisarevsky cffd89f88f added some missing declarations of the functions, noticed in the ticket ##229 2011-08-06 19:17:14 +00:00
Vadim Pisarevsky 4b94d91955 added _InputArray::_InputArray(const Scalar& s) constructor (ticket #1214) 2011-08-06 18:52:05 +00:00
Vadim Pisarevsky fc4d64ae6b temporarily fixed #1279 2011-08-06 18:03:08 +00:00
Andrey Kamaev 6aa1eafc27 Java API: added ticket number to failed test 2011-08-06 12:17:00 +00:00
Andrey Kamaev c16f018afd mc 2011-08-06 10:03:24 +00:00
Anatoly Baksheev 7e2fffb194 ticket #1280 2011-08-06 09:59:51 +00:00
Alexander Mordvintsev 6fdbf15aed updated lt_track.py sample
- continuous feature detection
- track verification by reverse tracking
2011-08-06 09:56:42 +00:00
Andrey Kamaev 1991440cf7 Java API:
* fixed manually ported classes;
* added vector<vector<Point>> support;
* changed argument types for 3 functions;
* finished tests for org.opencv.core.Core class.
2011-08-06 09:22:07 +00:00
Andrey Kamaev 6d9075812f Java tests: fixed 1 test in core and 1 disabled 2011-08-05 16:33:46 +00:00
Andrey Kamaev cb2b28636f Java tests: removed test_1 2011-08-05 15:49:08 +00:00
Andrey Kamaev ccc356829c Fixed color conversion bug 2011-08-05 15:46:13 +00:00
Maria Dimashova 7db3dd4f0a fixed comment and doc on L2 2011-08-05 14:05:41 +00:00
Maria Dimashova 0d55ccac74 added check of output image in drawKeypoints() 2011-08-05 14:04:38 +00:00
Andrey Kamaev a46da86325 Java API: fixed script for coverage calculation 2011-08-05 13:04:14 +00:00
Andrey Kamaev 39c5eb2f66 Java API: new tests for Core and Imgproc from Hussein Abdinoor 2011-08-05 11:59:45 +00:00
Andrey Kamaev a0590273e9 Java API: fixed problems in video and ml modules; generated test stubs for all exported functions (now we have 1701 tests). 2011-08-05 08:39:28 +00:00
itsyplen 9b1cb7227a fixed errors in cmdparser 2011-08-04 16:12:55 +00:00
itsyplen 6d3e92517c new version of command line parser 2011-08-04 16:09:04 +00:00
Andrey Pavlenko 10444f4e50 Java API: vector_vector support for KeyPoint/DMatch/char
Testing: 1178/4/576
2011-08-04 14:24:30 +00:00
Andrey Kamaev 874196e384 Implemented read/write methods for FlannBasedMatcher; fixed features2d wrappers for java 2011-08-04 14:13:07 +00:00
Vadim Pisarevsky 16b0fcf083 fixed CvHomographyEstimator::runKernel (ticket #1275) 2011-08-04 13:06:08 +00:00
Andrey Pavlenko 70caece001 Java API: fitEllipse arg type is changed to List<Point>, test is updated as well
Testing: 1176/4/580
2011-08-04 12:00:53 +00:00
Andrey Pavlenko 024482adac Java API: (per code review) adding check (data.length % CvType.channels(t) != 0) for Mat:: put/get, adding 2 tests for them
Testing: 1176/4/580
2011-08-04 11:45:48 +00:00
Andrey Pavlenko 3f22bd6dff Java API: fixed wrong JNI name for native delete() 2011-08-04 11:13:09 +00:00
Andrey Kamaev 13185ad8f7 Implemented read/write methods for BriefDescriptorExtractor class 2011-08-04 09:56:10 +00:00
Andrey Kamaev 28732d4300 Java API: added tests for SiftDescriptorExtractor and OrbDescriptorExtractor 2011-08-04 06:21:17 +00:00
Andrey Kamaev 1523cb04d1 Added CV_EXPORTS to OrbDescriptorExtractor (ticket #1276) 2011-08-04 06:19:52 +00:00
Andrey Kamaev be5328178f Fixed reading/writing parameters for OrbDescriptorExtractor 2011-08-04 06:18:24 +00:00
Andrey Kamaev ff9da914ec Fixed bug in checkRange - integer Mats were always in range 2011-08-04 06:17:23 +00:00
Andrey Kamaev 6944c0dba4 JavaAPI: fixed typo; some constants are moved to private section; added tests for BruteForceMatcher-Hamming 2011-08-03 19:46:30 +00:00
Andrey Kamaev cc6b7edf95 Java API: added wrapper for GenericDescriptorMatcher 2011-08-03 16:17:33 +00:00
Kirill Kornyakov c44cdef24c android tutorial updated: spelling and note about spaces in path to OpenCV package 2011-08-03 16:06:17 +00:00
Andrey Pavlenko 790ff8f42a Java API: minEnclosingCircle() fixed (float& -> float[])
Testing: 1130/0/584
2011-08-03 15:23:33 +00:00
Andrey Kamaev e1cd84bb25 Java API: added and fixed several tests 2011-08-03 15:14:55 +00:00
Kirill Kornyakov 19c3cf45cc java tests: deleted image writing to sdcard 2011-08-03 14:59:30 +00:00
Kirill Kornyakov 66e79167ee java tests: updated testFillConvexPolyMatMatScalarIntInt, testFitEllipse colorWhite added 2011-08-03 14:18:26 +00:00
Vadim Pisarevsky c57799a877 fixed 8-point case in findFundamentalMat (ticket #1262). findFundamentalMat needs to be rewritten actually (as well as findHomography) 2011-08-03 14:04:14 +00:00
Andrey Pavlenko 8b16dbe791 Java API: calcOpticalFlowPyrLK() args types are changed to vector<>
Testing: 1130/0/585
2011-08-03 13:31:51 +00:00
Kirill Kornyakov 0595ca7454 reverted 2011-08-03 13:21:21 +00:00
Andrey Kamaev 7d513a6671 Java API: added tests for FlannBased DescriptorMatcher 2011-08-03 13:20:01 +00:00
Kirill Kornyakov 2a47ab6e08 java tests: minor updates 2011-08-03 13:12:39 +00:00
Andrey Kamaev 2d820d2321 Java API: added tests for BruteForceMatcher (L1) 2011-08-03 12:57:19 +00:00
Andrey Kamaev 472820d889 Java API: added tests for BruteForceMatcher (L2) 2011-08-03 12:49:52 +00:00
Vladislav Vinogradov 3fac5d54ca minor fix 2011-08-03 12:30:40 +00:00
Vladislav Vinogradov 5f03548530 minor fix 2011-08-03 12:18:17 +00:00
Vladislav Vinogradov 3ab2728da1 gpu device layer code refactoring 2011-08-03 12:10:36 +00:00
Andrey Pavlenko fa0daa4809 Java API: fixing converters (copyData=true) and samples compilation
Testing: 1079/0/592
2011-08-03 11:57:00 +00:00
Andrey Kamaev 6935e95c2a Fixed crash in BruteForceMatcher::clone 2011-08-03 11:30:09 +00:00
Kirill Kornyakov 43628ab868 java: bugfix in RotatedRect, one test fixed 2011-08-03 09:43:36 +00:00
Andrey Kamaev 69588dfabf Java API: fixed bugs; added tests for SURF and BRIEF descriptor extractors 2011-08-03 09:27:50 +00:00
Kirill Kornyakov f81e6f82f5 Android.mk now automatically founds all cpp-files 2011-08-03 09:11:13 +00:00
Andrey Pavlenko 25db453812 Java API: (per code review) renaming and moving utility classes
Testing: 1079/0/584
2011-08-03 08:53:27 +00:00
Andrey Pavlenko 02d5d93c3a Java API: code clean-up
Testing: total 1079, failures 584, errors 0.
2011-08-03 08:19:06 +00:00
Vadim Pisarevsky 29bf7384dc fixed useOptimized(); added checkHardwareSupport description (ticket #1258) 2011-08-03 08:17:58 +00:00
Vadim Pisarevsky 217f345e66 updated libtiff to 3.9.5 (ticket #1271) 2011-08-03 07:51:40 +00:00
Vadim Pisarevsky c8378fa4c4 added "inclusive" & "exclusive" adjectives to startrow, endrow, startcol, endcol parameter descriptions (ticket #1272) 2011-08-02 19:50:13 +00:00
Andrey Kamaev 1890a0ae9a Java API: added new tests for SURF and STAR feature detectors 2011-08-02 16:10:58 +00:00
Andrey Kamaev 257c0bf413 Java API: Fixed typo 2011-08-02 15:14:13 +00:00
Andrey Pavlenko f1d24e1868 Java API: adding missing class 2011-08-02 15:00:00 +00:00
Andrey Kamaev 2a6dd2e807 Fixed Android build 2011-08-02 14:56:51 +00:00
Andrey Pavlenko 2c5e79507d Java API: new types and converters are added, jni suffixes changed 2011-08-02 14:56:47 +00:00
Andrey Kamaev 99b8e2db14 Java API: added tests for FAST feature detector 2011-08-02 14:32:43 +00:00
Andrey Morozov bba4f9e5d6 removed property. added automatically define number of cpus for decoding video 2011-08-02 14:27:21 +00:00
Kirill Kornyakov d87f513b4f java tests: addede tests for Converter and core classes by Hussein Abdinoor 2011-08-02 13:47:40 +00:00
Andrey Pavlenko f4e28f87d8 Java API: new converters, findFundamentalMat/cornerSubPix/findHomography/solvePnP/solvePnPRansac and their tests are updated 2011-08-02 13:10:23 +00:00
Vadim Pisarevsky ce2f4c6a4d propagated fix for EXR from 2.3 branch to trunk 2011-08-02 12:55:05 +00:00
Vadim Pisarevsky f0b3cb1845 added getNumberOfCPUs() function 2011-08-02 12:42:58 +00:00
Andrey Kamaev 6be846aa52 Java API: string constants for features2d classes are converted to enums 2011-08-02 11:40:41 +00:00
Vadim Pisarevsky 4884c911fb fixed compile warnings in FLANN about too long integer constants 2011-08-02 11:39:31 +00:00
Andrey Kamaev d5d897b7cb Java API: added support for read/write functions in features2d 2011-08-02 10:58:26 +00:00
Andrey Pavlenko d86605f6a7 Java API: class KDTree is added to ignore list, JNI funcs names for renamed classes are fixed 2011-08-02 08:45:06 +00:00
Vladislav Vinogradov 6ff975af9e added gpu::equalizeHist function 2011-08-02 08:33:27 +00:00
Andrey Pavlenko 36a5b6e215 Java API: tests are updated after randu/randn args types changes 2011-08-02 07:57:09 +00:00
Andrey Pavlenko 96ca253a00 Java API: added class pointer ret type support, CV_EXPORTS_AS(x) support for classes, vector<T> as ret type support, randu/randn params type changed to double 2011-08-01 16:11:24 +00:00
Andrey Morozov d0176d69f2 fixed property for ffmpeg 2011-08-01 16:05:34 +00:00
Andrey Kamaev d8b93b3569 Minor bugfix. 2011-08-01 15:06:11 +00:00
Andrey Kamaev 10ea580fa8 Java API: Added more classes from features2d. 2011-08-01 14:31:38 +00:00
Vladislav Vinogradov 33df5ea07b added gpu::calcHist function 2011-08-01 13:15:37 +00:00
Andrey Kamaev 69352e5241 Java API: Added base port of features2d.DescriptorMatcher class 2011-08-01 12:47:04 +00:00
Vadim Pisarevsky f85b9754e0 fixed Vec*scalar operations, fixed minEnclosingCircle Python interface. 2011-08-01 12:01:43 +00:00
Kirill Kornyakov 5868875ab9 doc: added maxSize parameter to CascadeClassifier::detectMultiScale 2011-08-01 08:23:03 +00:00
Vladislav Vinogradov e746b3e8ae added buffered version of pyrDown and pyrUp
added stream support to downsample, upsample, pyrUp and pyrDown
2011-08-01 08:15:31 +00:00
Vladislav Vinogradov cf42f3088d fixed doc bug in gpu/introduction (ticket #1260) 2011-08-01 05:35:34 +00:00
Andrey Kamaev 5041773f0d Java API: updated Mat port 2011-07-31 20:23:23 +00:00
Andrey Morozov c697f6a3f8 fixed build ffmpeg v0.8.1 2011-07-31 17:34:31 +00:00
Vadim Pisarevsky a826a983d3 added EMD to ch7 hist sample, fixed bug with cv::min/cv::max (ticket #1270), fixed mixChannels description 2011-07-31 09:23:05 +00:00
Kirill Kornyakov edead9a2c2 java tests: added some new asserts, and new tests by Hussein Abdinoor 2011-07-30 12:01:00 +00:00
Kirill Kornyakov c11a7184c9 minarea.cpp sample reformatted 2011-07-30 11:59:09 +00:00
Andrey Morozov c55a37ad7c fixed build with ffmpeg 0.5.X 2011-07-30 10:26:37 +00:00
Andrey Morozov c0a0c881ee minor fix 2011-07-30 07:52:06 +00:00
Andrey Pavlenko b99c5db124 Java API: tests for polylines() and goodFeaturesToTrack(), fix of GFTT corners arg type 2011-07-29 15:18:04 +00:00
Andrey Morozov 418bc6dbe9 minor fix for ffmpeg 2011-07-29 14:37:54 +00:00
Andrey Pavlenko 750c56cc0e adding arg name (to fix doc reference and wrappers consistency) 2011-07-29 14:31:28 +00:00
Leonid Beynenson dc13ec205d Made additional internal header modules/objdetect/src/cascadedetect.hpp, and moved
some internal classes and template functions from cascadedetect.cpp to this header.
This will allow to make a child class for such classes as LBPEvaluator, etc.
Also made all "private" fields in LBPEvaluator and HaarEvaluator to be "protected".
2011-07-29 14:18:45 +00:00
Andrey Morozov d87a56a639 added support new ffmpeg (0.8.X) 2011-07-29 14:17:42 +00:00
Andrey Kamaev 680ec04b53 Fixed regex bug in script for java tests coverage calculation 2011-07-29 14:06:02 +00:00
Andrey Kamaev 387e8c9ef5 Java API: star detector is covered by tests 2011-07-29 12:42:23 +00:00
Andrey Pavlenko f5008f9cdf Java API generator changes randu/randn/inRange args to Scalar; Java tests are updated. 2011-07-29 08:12:00 +00:00
Andrey Kamaev b7fc94c251 Java API: Finished SURF tests. 2011-07-29 07:39:56 +00:00
Vadim Pisarevsky db19eb1586 converted part of ch12 2011-07-28 20:51:05 +00:00
Andrey Kamaev 754a8c1b66 Java API: added more tests 2011-07-28 16:03:16 +00:00
Andrey Pavlenko 6b888ada8a Java API tests are added: fillConvexPoly, mixChannels, drawContours 2011-07-28 15:48:08 +00:00
Andrey Pavlenko 8c328a9e3b Java API: typo in converter is fixed 2011-07-28 15:37:46 +00:00
Vadim Pisarevsky 0c096b3dc2 fixed floodfill with mask parameter when no mask is passed 2011-07-28 14:10:17 +00:00
Andrey Pavlenko d2080a117e Java API: converter for vector<KeyPoint> is fixed; test for inRange() improved 2011-07-28 14:08:55 +00:00
Vadim Pisarevsky f278dd782d fixed loading floating-point EXR images. 32-bit integer EXR are still to be checked. 2011-07-28 13:34:37 +00:00
Andrey Pavlenko ec1023813f Java API: KeyPoint::toString() is added 2011-07-28 13:09:58 +00:00
Andrey Pavlenko d2233f9de2 Java API: converters vector<> to/from Mat are fixed 2011-07-28 12:43:22 +00:00
Andrey Kamaev 954f3c1eb9 Java: fixed Mats comparison; added resahpe mathod to core.Mat; fixed test resources extraction. 2011-07-28 12:13:11 +00:00
Andrey Pavlenko 3f5089411a 2 'findContours(...)' tests are added 2011-07-28 11:28:33 +00:00
Vadim Pisarevsky 7c54ebfe1b corrected OpenEXR status in CMakeLists.txt 2011-07-27 20:53:19 +00:00
Vadim Pisarevsky 3636eec789 fixed flow matrix dimensionality in EMD 2011-07-27 20:13:50 +00:00
Vadim Pisarevsky eebe4860da added minEigThreshold parameter to calcOpticalFlowPyrLK to filter out bad points earlier. 2011-07-27 19:07:45 +00:00
Bernat Gabor 6b5ea5931d Added the "Mask operations on matrices" tutorial (with its sample). Plus modified some other core tutorials. 2011-07-27 17:52:27 +00:00
Andrey Kamaev eb61a62dbc Added missed import 2011-07-27 17:17:32 +00:00
Andrey Kamaev eff9eda9a6 Added some new tests for Java API 2011-07-27 17:06:33 +00:00
Andrey Kamaev e3ede92db6 Added vector_Point3f_to_Mat converter and some java API tests 2011-07-27 16:26:46 +00:00
Andrey Pavlenko 9235a80109 Java API generator: KeyPoint converters from/to Mat 2011-07-27 15:16:24 +00:00
Andrey Kamaev 20b4d0fae9 Added vector_Point2f_to_Mat converter 2011-07-27 15:03:16 +00:00
Andrey Kamaev c966d077c0 Added some tests; Added assertion for comparing Mats with epsilon. 2011-07-27 14:19:45 +00:00
Andrey Pavlenko 5ba826d297 Java API generator: pointers handling fixed, KeyPoint manual port added 2011-07-27 14:09:49 +00:00
Andrey Kamaev 3b558508be TEGRA optimized add8u, sub8u and logical 8u operations 2011-07-27 13:36:53 +00:00
Vadim Pisarevsky eac0309324 converted live camera calibration sample 2011-07-27 13:03:59 +00:00
Andrey Kamaev 039fd554f2 Added several Android tests 2011-07-27 12:55:43 +00:00
Bernat Gabor 26bd6b3f5f Added the File Input and Output using XML and YAML files tutorial. 2011-07-27 11:35:11 +00:00
Kirill Kornyakov f7ff65f5df added java tests for imgproc by Hussein Abdinoor 2011-07-27 07:14:06 +00:00
Andrey Pavlenko 55aab59e26 class & funcs ignore list support is added 2011-07-26 13:40:26 +00:00
Andrey Kamaev a69c29016c Make build log of Android samples and tests less verbose 2011-07-26 12:59:51 +00:00
Kirill Kornyakov 423ecfb42a added stub java tests 2011-07-26 10:27:51 +00:00
Andrey Kamaev e22045502d Fixed module detection in gen_javadoc.py script 2011-07-26 09:13:30 +00:00
Andrey Pavlenko fc7219d1db new tests stubs 2011-07-26 08:17:58 +00:00
Andrey Kamaev a4af33758d Added Android tests coverage calculation into build 2011-07-26 08:17:52 +00:00
Andrey Pavlenko d58a5b269d statistic report improved 2011-07-26 07:50:44 +00:00
Andrey Kamaev 617bb92e8c Fixed dependencies for Android projects 2011-07-26 07:32:33 +00:00
Andrey Kamaev 3b59a51347 Fixed pch support on linux 2011-07-26 07:07:38 +00:00
Marius Muja b5cfe6be32 Specifying correct parameter types for cv::flann::GenericIndex and cv::flann::Index_ 2011-07-25 23:58:54 +00:00
Andrey Pavlenko 55e71a5cd7 a couple of new smoke tests; Mat.java code clean-up 2011-07-25 15:09:16 +00:00
Andrey Kamaev 322b09fc12 Removed outdated stuff from Android build scripts 2011-07-25 13:42:23 +00:00
Andrey Kamaev e7642f66d9 Fixed install terget for Android examples 2011-07-25 13:17:11 +00:00
Andrey Kamaev ac7e16fdf6 Fixed camera output format handling 2011-07-25 12:32:33 +00:00
Andrey Pavlenko 4ddc1a6477 script to find Java API methods that not covered by auto-generated JUnit stubs 2011-07-25 12:13:37 +00:00
Andrey Kamaev b542a38a01 Fixed camera libs setting in Android.mk 2011-07-25 11:18:48 +00:00
Andrey Kamaev 8ab16f66a8 Fixing native camera for Android 2011-07-25 11:16:32 +00:00
Bernat Gabor 2d3606a58f Finished the DFT tutorial for the core section. 2011-07-25 10:06:03 +00:00
Kirill Kornyakov d0cac8a93a bugfix in cmake for java api 2011-07-25 07:47:18 +00:00
Andrey Kamaev ddf48c781a Fixed Android build on linux 2011-07-25 07:36:09 +00:00
Bernat Gabor f25603112a Added Fernandos first tutorial regarding SVMs. Extended the global links (conf.py). Corrected the author names. Minor modification to the dft tutorial. 2011-07-25 07:15:52 +00:00
Andrey Kamaev f91aad326c Fixed precompiled headers support for opencv_test_gpu 2011-07-24 22:07:43 +00:00
Andrey Kamaev 0f6503d9a9 Fixed precompiled headeds for non-windows systems. 2011-07-24 21:08:36 +00:00
Andrey Kamaev a17b693aa9 Fixed build of Android samples and tests 2011-07-24 20:44:20 +00:00
Andrey Kamaev 3aea74d408 Fixed precompiled headers support (fixed formatting, fixed dependencies generation) 2011-07-24 19:22:58 +00:00
Maria Dimashova 221422467e fixed priors usage in ertrees 2011-07-24 18:15:53 +00:00
Vadim Pisarevsky d8417af086 fixed and improving formatting in opencv2refman.pdf. added support for n-channel mask in Mat::copyTo() and n-channel images in cv::compare(). fixed 2 compile warnings in opencv_python. 2011-07-24 10:34:14 +00:00
Vadim Pisarevsky df78bc04d6 converted book samples from ch4; fixed potential alignment problems in QTKit video capturing module 2011-07-23 19:11:17 +00:00
Andrey Kamaev 98375e1d4b Refactoring of native camera implementation 2011-07-22 15:37:01 +00:00
Bernat Gabor ffe7a658fb Sample files for image scanning, basic Mat, file I/O. Added Victors removed tutorials back in the system. Some typo fixing.Expanded conf.py with new global links. 2011-07-22 15:11:59 +00:00
Andrey Pavlenko 3d9cb082c9 making CV data type to be int 2011-07-22 15:11:35 +00:00
Andrey Kamaev 8378ba7554 Fixed Android package build 2011-07-22 14:11:16 +00:00
Kirill Kornyakov 387334e991 java tests: imgproc test cleaned 2011-07-22 13:58:53 +00:00
Andrey Pavlenko e9cd8296af fixed warnings in generated Java code (accurate imports) 2011-07-22 13:53:49 +00:00
Andrey Kamaev ebf9916242 Fixed android samples; fixed cmake files 2011-07-22 13:34:25 +00:00
Anatoly Baksheev cb9dd71f82 compilation 2011-07-22 13:26:31 +00:00
Anatoly Baksheev de204fe413 2011-07-22 13:24:27 +00:00
Andrey Kamaev 712ea05058 Refactored CMakeLists.txt for java module 2011-07-22 13:10:50 +00:00
Vadim Pisarevsky 41df54e75f fixed several typoes and errors in the refman (ticket #1203) 2011-07-22 12:50:49 +00:00
Kirill Kornyakov 1098566a2f java api: fixed ctor in RotatedRect, added 114 tests by Hussein Abdinoor 2011-07-22 12:47:11 +00:00
Andrey Pavlenko 2bc9bca349 classes/files renaming, some code refactoring 2011-07-22 12:35:52 +00:00
Vadim Pisarevsky b700521b95 fixed trim_weights in boosting (thanks to frankman for the patch; ticket #1231) 2011-07-22 12:20:43 +00:00
Vadim Pisarevsky 216fbc004a fixed printing Mx0 matrices (ticket #1247) 2011-07-22 12:15:22 +00:00
Kirill Kornyakov ed96af94cc added mk files for NDK-builder of opencv_java project 2011-07-22 10:44:40 +00:00
Andrey Pavlenko 83e2ecd5e1 renaming the class and file to Tiltle case to meet Java conventions 2011-07-22 07:43:33 +00:00
Andrey Pavlenko e92ad9275d renaming the class and its file 2011-07-22 07:41:22 +00:00
Andrey Pavlenko a89b4f019c renaming the class and file to Tiltle case to meet Java conventions 2011-07-22 07:40:24 +00:00
Andrey Kamaev e9458c1f6d Errors from javadoc generator are redirected to log file. 2011-07-22 06:13:04 +00:00
Andrey Kamaev bba5653bf0 Added option to automatically move constants to private list 2011-07-22 04:54:19 +00:00
Andrey Kamaev 078eae7154 Added cmake dependency on version.hpp. From now cmake will automatically rerun if version.hpp file is changed. 2011-07-21 21:44:48 +00:00
Andrey Kamaev 0067c755dd Minor android.toolchain.cmake enhancement 2011-07-21 21:43:41 +00:00
Vadim Pisarevsky 0bf4d9ec2b fixed Xcode 4.1 compile errors in png codec in highgui 2011-07-21 19:50:20 +00:00
Andrey Kamaev 6d288978ab Fixed typo 2011-07-21 19:05:21 +00:00
Andrey Pavlenko eb5e22dd74 Java API generator: refactored manual const and funcs handling, collected real 'import' needs for java classes (to eliminate eclipse warnings in java classes) 2011-07-21 17:20:17 +00:00
Vadim Pisarevsky a28112472c put the smaller opencv_tutorials.pdf to SVN 2011-07-21 13:41:40 +00:00
Vadim Pisarevsky 84862ae5a1 fixed 2 typos in linux_eclipse tutorial 2011-07-21 13:36:32 +00:00
Andrey Kamaev 8782914fc8 Aded setPreviewDisplay call to java camera samples 2011-07-21 09:57:46 +00:00
Maria Dimashova 0d7a37c1e7 added an ability to make push_back to the empty matrix 2011-07-21 09:38:25 +00:00
Anatoly Baksheev 3a1beb1c01 added cv::gpu::pow, ticket #1227 2011-07-21 08:47:44 +00:00
Gary Bradski c722128ddd edited another way of using eclipse using cmake 2011-07-21 01:03:41 +00:00
Vadim Pisarevsky bddcc6ffcc fixed xcolor warnings when building opencv_tutorials.pdf 2011-07-20 22:21:32 +00:00
Andrey Kamaev f6647085cd Restored corrupted images in Android binary package tutorial. 2011-07-20 19:24:21 +00:00
Bernat Gabor 43e083f145 Ok, now optimized the tutorial size for real. Made JPG/PNG optimization for all the images. Modified some tutorial files to follow these size optimizations. Now the tutorial PDF generated is 3.95MB, so enjoy! 2011-07-20 18:08:25 +00:00
Alexey Spizhevoy a23406ea6c added missing header 2011-07-20 12:56:21 +00:00
Andrey Kamaev 5a2e493d12 Fixed image positioning in tutorial 2011-07-20 11:21:00 +00:00
Andrey Kamaev 27f060c707 Fixed list formatting 2011-07-20 07:54:08 +00:00
Andrey Kamaev 22dcee47d3 Added Android binary package tutorial 2011-07-20 05:39:55 +00:00
Bernat Gabor a2975f337a 1) Converted all images to JPG to reduce size.
2) Added a raw Latex page break directive after each TOC tree. (For the PDF tutorial look).
3) Two finished tutorials: 
   a) one describing how the Mat data structure works and its output capabilities (format function) (demonstration YouTube video included).
   b) one describing image scanning operations plus the LUT function (demonstration YouTube video included). 
   c) a basic filtering approach (plus multi row image scanning demonstration) in the work.
2011-07-19 22:08:54 +00:00
Andrey Kamaev f503b029a7 Allowed to build html documentation without pdf documentation. 2011-07-19 20:27:58 +00:00
Andrey Kamaev 05ff8217e0 Removed debug print form cmake 2011-07-19 17:09:44 +00:00
Andrey Kamaev 930b2995eb Fixed Android samples; Fixed bugs in cmake (java module). 2011-07-19 17:07:01 +00:00
Andrey Pavlenko fd4fe3ef5a Java API generator: updated CvException class path 2011-07-19 16:59:12 +00:00
Andrey Pavlenko 4df98f2c2c Java API generator: class properties support added 2011-07-19 16:47:49 +00:00
Kirill Kornyakov 6b789dd2ea java tests: adopted for the new package structure 2011-07-19 16:08:26 +00:00
Andrey Kamaev dfdb15be79 Added Java packages support to cmake 2011-07-19 15:37:17 +00:00
Andrey Pavlenko 070579d9c3 Java API generator: fixed consts generation 2011-07-19 15:04:05 +00:00
Andrey Pavlenko 84ec0d2881 Java API packages restructured (require further changes in CMake part to work) 2011-07-19 13:25:40 +00:00
Vadim Pisarevsky f4f2340039 fixed just introduced compile errors on Mac 2011-07-19 13:07:51 +00:00
Vadim Pisarevsky ff5e97c8e4 added COVAR_ and SORT_ enums to core.hpp; fixed many, many VS2005, VS2010 and MinGW (GCC 4.5.2) warnings 2011-07-19 12:27:07 +00:00
Kirill Kornyakov 6bb1c07fd4 java tests: COLOR_RGB2GRAY used instead of CV_BGR2GRAY 2011-07-19 12:25:07 +00:00
Andrey Kamaev 6932203349 Fixed Android samples; updated black list of enums. 2011-07-19 12:10:05 +00:00
Kirill Kornyakov 1fc895ff42 java tests: added tests for calcHist, calcBackProject, Mat.size() method renamed 2011-07-19 11:44:30 +00:00
Kirill Kornyakov e715894ffb fix by Vadim in calcBackProject: additional case is considered 2011-07-19 11:17:03 +00:00
Andrey Kamaev d445903b31 Added FPS measurement to some Android samples 2011-07-19 11:06:27 +00:00
Andrey Kamaev 9e00cc59af Added face datection Android sample 2011-07-19 09:01:36 +00:00
Andrey Pavlenko 343bba93db Java API: added int64 and Vec3d support; small code refactoring performed 2011-07-19 08:56:31 +00:00
Andrey Kamaev 5e3e283e30 Changed labels for some android samples 2011-07-19 07:40:26 +00:00
Marius Muja d8ebf22444 Fixes 2011-07-18 22:01:42 +00:00
Marius Muja ddc1267410 Checking for already defined proprocessor macros 2011-07-18 22:00:06 +00:00
Marius Muja 481256017e Fixing ticket #1230 2011-07-18 21:57:28 +00:00
Kirill Kornyakov 39ec7099e2 java tests: split test, minor improvements 2011-07-18 16:41:17 +00:00
Vadim Pisarevsky 1badec0b2d eliminated opencv_extra_api.hpp (all the functionality is moved to the regular OpenCV headers) 2011-07-18 16:31:30 +00:00
Andrey Kamaev 72541721a1 Added image-manipulations android sample, other samples are updated; added Mat.size method to java API. 2011-07-18 16:17:07 +00:00
Andrey Pavlenko 3119af1c72 Java API: fixed bug in converter vector<Mat> <-> Mat 2011-07-18 16:07:11 +00:00
Andrey Pavlenko 60d59aa9d2 Java API: added missing converter vector<Mat> <-> Mat 2011-07-18 14:23:45 +00:00
Andrey Pavlenko d989b6c89a Java API: added pointers support (Point*, double*) 2011-07-18 13:56:49 +00:00
Kirill Kornyakov 51922658b6 java tests: added test for OFLK, FD, other improvements 2011-07-18 13:50:36 +00:00
Vadim Pisarevsky 16ba62dcd5 added COLOR_... enumeration to imgproc.hpp and EVENT_... enumeration to highgui.hpp 2011-07-18 13:05:34 +00:00
Andrey Pavlenko 86105b8727 Java API: fix in Mat::put(r,c,double[]vals) method 2011-07-18 09:27:48 +00:00
Andrey Kamaev cc3c034cf6 Android samples: class SampleViewBase which uses native camera is renamed. 2011-07-18 09:13:05 +00:00
Andrey Pavlenko 1e2880b7aa Java API: fix in Mat::put methods, general improvements 2011-07-18 07:18:35 +00:00
Alexander Mordvintsev bcac8769b5 fixed broken python cv2.cpp build after rev.6089 2011-07-18 06:48:55 +00:00
Alexander Mordvintsev af99bee344 adjust cosine threshold in squares.py 2011-07-17 19:23:24 +00:00
Marius Muja c071f5487e Fixing ticket #1228 2011-07-17 06:26:40 +00:00
Andrey Kamaev be2c4ddbdd Android:
* Added manual port for getTextSize;
* Fixed bugs in "native camera" sample;
* Added 15-puzzle sample.
2011-07-16 22:31:47 +00:00
Alexander Mordvintsev ae5dd1d748 math.pi -> np.pi
squares.py sample added
2011-07-16 18:29:51 +00:00
Leonid Beynenson 570041fed5 Fixed bug in modules/java/src/cpp/Mat.cpp
Removed some debugging insertions.
Added test for face detector.
Allowed tests to write on sdcard.
2011-07-16 13:29:20 +00:00
Andrey Pavlenko 75bcb1bcfa Java API generator: implementation of vector<> fixed 2011-07-16 11:40:04 +00:00
Leonid Beynenson 3885772f3e Added lbp cascade to the tests res/raw folder 2011-07-16 11:26:57 +00:00
Leonid Beynenson bf40a3a5b8 Added functions required for Java API wrappers generating converting Mat-s to/from vectors. 2011-07-16 11:25:33 +00:00
Kirill Kornyakov e76ad5509c java tests: bugfix in hconcat 2011-07-16 10:35:50 +00:00
Kirill Kornyakov eafa837e34 java tests: commited tests by Hussein Abdinoor 2011-07-16 10:25:05 +00:00
Vadim Pisarevsky f2e1a64c1b fixed "import cv" in the new python samples. corrected Python bindings to match the documentation and vice versa (NOTE: in cv2.stereoCalibrate the parameter ordering has been changed) 2011-07-16 09:35:56 +00:00
Andrey Pavlenko 5a5fe40542 Java API generator: implementation of vector<Point> support 2011-07-16 08:25:05 +00:00
Andrey Pavlenko ecba099754 Java API generator improvements:
- fixed return of complex types (Scalar, Point, etc)
- partial implementation of vector<> support (empty stubs for CPP-side converters)
2011-07-16 07:59:34 +00:00
Kirill Kornyakov 30f265a16a java tests: avoided copy and paste 2011-07-16 07:26:13 +00:00
Vadim Pisarevsky 8f41b2b23b commented off print (due to the report from the mailing list) 2011-07-15 19:43:34 +00:00
Andrey Kamaev 4cf1274327 Finished Android samples renaming 2011-07-15 16:50:41 +00:00
Andrey Kamaev 8288cc108d Continued Android samples renaming 2011-07-15 16:29:10 +00:00
Leonid Beynenson b1ed277110 Added Java functions, converting vectors to Mats and Mats to vectors. 2011-07-15 16:25:47 +00:00
Andrey Kamaev 7c6fc6e18a Android samples are renamed 2011-07-15 15:56:08 +00:00
Andrey Kamaev 39dab5e0cf Headers are included into opencv_java build 2011-07-15 15:26:29 +00:00
Andrey Pavlenko 4deec6f0f0 partial vector<> support in Java API generator 2011-07-15 15:01:25 +00:00
Andrey Kamaev cc447448ff Added native camera Android sample; Added manual port of VideoCapture class. 2011-07-15 14:03:53 +00:00
Leonid Beynenson c3d40ca0dd Changed 2011-07-15 13:59:06 +00:00
Leonid Beynenson 8625b5689d Added setters to Java API 2011-07-15 11:09:23 +00:00
Kirill Kornyakov c1dab7bf6e updated some java tests 2011-07-15 11:00:32 +00:00
Andrey Kamaev fae67e0b46 Refactored Android samples 2011-07-15 09:07:01 +00:00
Andrey Kamaev 72a55a4139 Refactored Android sample (1-java) 2011-07-15 07:18:45 +00:00
Evgeniy Kozinov c3e9d0dd7e fixed parser bug.
fixed TBB version in LatentSVM.
example works ok.
2011-07-15 06:35:12 +00:00
Andrey Kamaev a9508d2f67 Fixed android sample 2011-07-15 04:46:24 +00:00
Leonid Beynenson c8a603d853 Fixed bug in the function of search of Android applicvation path. 2011-07-14 18:41:09 +00:00
Andrey Kamaev b16fb5d518 Fixed Android build. 2011-07-14 16:48:15 +00:00
Vadim Pisarevsky 7702fa4d61 added improved version of the variational stereo correspondence algorithm by Sergey Kosov 2011-07-14 15:30:28 +00:00
Andrey Pavlenko 5f0c312087 - partial 'vector' support in Java API generator
- const ignore mask list added for Java API generator
2011-07-14 15:24:17 +00:00
Vadim Pisarevsky 12715c210d fixed mixed-type arithmetic operations (ticket #1224) 2011-07-14 14:54:05 +00:00
Leonid Beynenson 0db73575a6 Added class TermCriteria. 2011-07-14 14:52:58 +00:00
Vadim Pisarevsky e33bfb5ebf added haarcascades for ears detection (by Modesto Castrillón Santana) 2011-07-14 14:43:25 +00:00
Kirill Kornyakov da64ba1bde java tests: found a reason of crash (addWeighted bug #1224), some tests cleaned and added 2011-07-14 14:25:35 +00:00
Vadim Pisarevsky 2dea07f9f8 repaired Python bindings for functions using InputOutputArray 2011-07-14 14:13:10 +00:00
Andrey Kamaev f97e5f7353 Modified Android samples 2011-07-14 13:39:25 +00:00
Kirill Kornyakov 87ad9b1c3e samples C/C++: fixed compilation problem on Ubuntu 2011-07-14 12:50:07 +00:00
Andrey Kamaev 14bc6e3e6c Modified Android Samples 2011-07-14 12:47:07 +00:00
Vadim Pisarevsky 08f1f5769a ok. enabled TBB in LatentSVM, but need to check if it works 2011-07-14 12:11:18 +00:00
Vadim Pisarevsky 36ba3d691e temporarily switch off TBB 2011-07-14 11:51:43 +00:00
Vadim Pisarevsky ca2433c212 fixed opencv_flann (with flann 1.6) compile errors on Windows (VS2005 & VS2008) 2011-07-14 11:26:13 +00:00
Andrey Kamaev c52ab82bbf Minor Android samples fix 2011-07-14 10:48:48 +00:00
Andrey Kamaev 85c8a69fdf Fixed Android packaging script 2011-07-14 10:03:19 +00:00
Andrey Kamaev 20ec29f22e Android samples are included into the Android package 2011-07-14 09:34:57 +00:00
Andrey Kamaev a70f354c0f Andoid build fixed 2011-07-14 08:57:46 +00:00
Leonid Beynenson 510ca53687 Added the function minMaxLoc to JavaAPI as a manual ported function.
Added test for the function.
2011-07-14 08:36:48 +00:00
Andrey Pavlenko ab1ff12a71 class ignore list added for Java API generator 2011-07-14 08:15:35 +00:00
Andrey Pavlenko a99b80b1a9 funcs ignore list added for Java API generator 2011-07-14 08:10:47 +00:00
Andrey Kamaev 0b57d904db Fixed Android compilation on Windows 2011-07-14 07:44:33 +00:00
Andrey Kamaev 87cfcc8ee2 Fixed Android build 2011-07-14 07:04:36 +00:00
Vadim Pisarevsky 562914e33b upgraded to FLANN 1.6. Added miniflann interface, which is now used in the rest of OpenCV. Added Python bindings for FLANN. 2011-07-13 23:04:39 +00:00
Ana Huaman 4e42bf6308 Added reST tutorials for Contours (6 in imgproc) and for Corner Detection (4 in features2D) + links in conf.py 2011-07-13 17:53:45 +00:00
Maria Dimashova b64bb95860 added ability to reset view point of depth generator to normal one (#1195) 2011-07-13 17:05:57 +00:00
Andrey Kamaev 4d8a261d99 Allowed spaces in path to OpenCV (tested only Android build) 2011-07-13 15:47:04 +00:00
Andrey Kamaev 0b6fed32e3 Allowed spaces in Android NDK path 2011-07-13 14:48:16 +00:00
Andrey Pavlenko 801079e2ba partial implementation of complex out args in Java wrappers 2011-07-13 14:23:47 +00:00
Andrey Kamaev 066039fd15 Improved ANDROID_SDK_TARGET detection; improved NDK detection in android.toolchain.cmake 2011-07-13 13:06:14 +00:00
Ilya Lysenkov 2c2d7d7bbd Fixed findCirclesGrid for the case of working with 'square' asymmetric patterns. 2011-07-13 13:05:41 +00:00
Leonid Beynenson d60349b1fc Added to Java API classes Range and CvSlice. 2011-07-13 11:23:32 +00:00
Vadim Pisarevsky a69bd80b99 fixed opencv_video tests 2011-07-13 10:18:13 +00:00
Andrey Kamaev 6c668dd704 Fixed Android SDK searching 2011-07-13 09:17:41 +00:00
Andrey Kamaev 355f6d0a73 Fixed Android SDK searching 2011-07-13 09:10:21 +00:00
Vadim Pisarevsky baa7a8ca7f fixed INSTALL target build in Visual Studio (ticket #1220) 2011-07-13 09:01:18 +00:00
Vadim Pisarevsky 5352684647 fixed memleak in Python bindings (ticket #1219) 2011-07-13 08:55:06 +00:00
Vadim Pisarevsky 386f147597 a few minor fixes in Python samples 2011-07-13 06:19:21 +00:00
Ana Huaman f098d98908 Added moments_demo.cpp 2011-07-13 03:28:23 +00:00
Ana Huaman bbba2a0608 Added pointPolygonTest_demo code for tutorials 2011-07-13 02:43:02 +00:00
Andrey Pavlenko fbfddbd3ea - 'c_string' support added to Java API
- improved CV_IN_OUT/CV_OUT handling for generated Python/Java wrappers
2011-07-12 21:13:56 +00:00
Ana Huaman 9aa5e5b000 Added generalContours_demo2.cpp 2011-07-12 21:06:36 +00:00
Ana Huaman c21b747733 Added hull_demo.cpp code for tutorials 2011-07-12 20:28:50 +00:00
Ana Huaman edc1bd4c8c Added generalContours_demo1.cpp tutorial code 2011-07-12 19:51:23 +00:00
Evgeniy Kozinov 07eed8c489 refactoring latentSVM 2011-07-12 18:43:41 +00:00
Ana Huaman ea8e27961e Added sample code for tutorial findContours_demo.cpp 2011-07-12 18:40:51 +00:00
Andrey Kamaev ecfc8e97db Android toolchain default NDK path is updated for version r6 2011-07-12 17:20:48 +00:00
Leonid Beynenson 0ddc661882 Fixed bug in the operator of cv::Ranges-s intersection (operator &). 2011-07-12 16:33:26 +00:00
Andrey Kamaev bee4c347ba Fixed bug with ARM_TARGET caching 2011-07-12 16:22:52 +00:00
Andrey Kamaev 6623fe3b08 Added option INSTALL_ANDROID_EXAMPLES (default off); Added option for choosing SDK platform for Android tests and samples. 2011-07-12 15:59:31 +00:00
Vadim Pisarevsky 49c48aabff fixed typo in the license (ticket #1211) 2011-07-12 15:59:15 +00:00
Leonid Beynenson e59f530338 Added the class RotatedRect to Java API.
Added tests for the class.
2011-07-12 15:39:38 +00:00
Kirill Kornyakov b58dc21074 java tests: added 2 tests for calib3d, implemented assertMatNotEqual 2011-07-12 15:10:54 +00:00
Kirill Kornyakov 63f8feb2a1 java tests: added a chessboard image 2011-07-12 14:53:09 +00:00
Andrey Pavlenko 7ca50b2b3d org.opencv.utils renamed to org.opencv.android 2011-07-12 13:31:02 +00:00
Andrey Pavlenko bc9a9b714c adding runtime Android logging in Debug 2011-07-12 13:13:02 +00:00
Andrey Kamaev 7159845021 Added packaging script for Android 2011-07-12 12:59:26 +00:00
Vadim Pisarevsky 569b1ad582 embeded cv Python module into cv2. 2011-07-12 12:56:03 +00:00
Kirill Kornyakov 9b464199d6 java tests: Mat.inv and Mat.cross implemented, almost all Mat tests finished except put, get and dispose 2011-07-12 08:16:01 +00:00
Andrey Kamaev 2dd965b7f5 minor cmake corrections 2011-07-12 07:40:29 +00:00
Ana Huaman 7386269943 Added cornerDetector_Demo.cpp sample for tutorial of cornerMinEigenVal and cornerEigenValsAndVecs 2011-07-12 00:20:06 +00:00
Vadim Pisarevsky 21409de176 optimized sparse LK optical flow (tickets #1062 and #1210) 2011-07-11 23:03:05 +00:00
Ana Huaman 442f6b4100 Added cornerSubPix_Demo.cpp tutorial sample code 2011-07-11 22:03:23 +00:00
Ana Huaman 6c9f4d6423 Added goodFeaturesToTrack_Demo.cpp code for tutorials 2011-07-11 21:08:35 +00:00
Ana Huaman e2da35dc6e Added Harris corner detection sample tutorial 2011-07-11 19:59:17 +00:00
Andrey Pavlenko 4033d8324c native exception handling added 2011-07-11 15:28:09 +00:00
Kirill Kornyakov d227079753 java tests: added stubs for calib3d, features2d classes, some other updates 2011-07-11 15:19:53 +00:00
Andrey Kamaev ec866c5acd Improved rst_parser and javadoc generation scripts 2011-07-11 15:03:42 +00:00
Andrey Kamaev dfe7708f17 Improved javadoc comments generation scripts; fixed some typos in documentation 2011-07-11 13:33:05 +00:00
Andrey Pavlenko eea62ca6fb - added missing loadLibrary for inner classes
- added zero check for pointers in utils.cpp
2011-07-11 12:21:58 +00:00
Alexander Mordvintsev 3511bf81de help message printing 2011-07-11 09:59:23 +00:00
Alexander Mordvintsev c053532be1 sobel -> Sobel 2011-07-11 09:46:36 +00:00
Alexander Mordvintsev 0217ae3a70 faster detection and timing in facedetect.py 2011-07-11 09:21:27 +00:00
Andrey Pavlenko b5d864f579 'clib3d' support added 2011-07-11 08:33:12 +00:00
Alexander Mordvintsev 2a19db61e7 command line option for avi output in turing.py 2011-07-11 08:06:51 +00:00
Alexander Mordvintsev 848fa23a07 made boundingRects argument of segmentMotion CV_OUT
updated documentation
2011-07-11 07:51:15 +00:00
Alexander Mordvintsev c9d9d1ec92 lk_track.py window renamed 2011-07-11 07:47:56 +00:00
Alexander Mordvintsev b175348d93 motempl.py sample works 2011-07-11 07:42:37 +00:00
Alexander Mordvintsev b509cc2a4d contours.py sample added 2011-07-10 22:06:33 +00:00
Alexander Mordvintsev 514711af14 work on motempl.py sample 2011-07-10 21:23:32 +00:00
Alexey Spizhevoy 8a3d1937c3 fixed BFM GPU test compile-time error on ubuntu x64 in debug mode 2011-07-09 07:32:14 +00:00
Bernat Gabor 4168b75edc Some tutorial extending of the Windows install and usage. Display Image retouching. 2011-07-08 19:43:29 +00:00
Vadim Pisarevsky 6f6c1c75ba use Euler font for the formulas in the online docs too. 2011-07-08 16:25:09 +00:00
Vadim Pisarevsky 3f0c17b592 re-added the opencv_flann documentation 2011-07-08 16:14:13 +00:00
Anatoly Baksheev e1dd41d1e2 - fixed SetTo tests for GPU (a problem in test code)
- minor refactoring
2011-07-08 16:08:58 +00:00
Maria Dimashova 0b1575c485 fixed SIFT when keypoints vector is empty (#1162) 2011-07-08 15:54:57 +00:00
Andrey Kamaev fbed6d1d44 Javadoc comments genearion is integrated into the Java API build 2011-07-08 15:29:59 +00:00
Vadim Pisarevsky eff35f2341 fixed timeScale formula in CvCapture_FFMPEG::setProperty(... CV_CAP_PROP_POS_...) (ticket #1207) 2011-07-08 15:03:28 +00:00
Andrey Kamaev 7c43e7e7e0 Improved rst_parser; added javadoc comments generator; added javadoc markers to handwritten .java files 2011-07-08 15:00:11 +00:00
Alexander Mordvintsev 4151a4590e added lk_track.py sample (currently as a comparison between flow tracker implementations) 2011-07-08 14:58:22 +00:00
Andrey Pavlenko 086643f5a7 finalize() added to ported classes; javadoc anchor added to ported funcs 2011-07-08 14:46:41 +00:00
Maria Dimashova 370130e464 fixed PyramidAdaptedFeatureDetector (when mask is not empty) (#1206) 2011-07-08 14:41:43 +00:00
Maria Dimashova c380dd579b updated whitelist 2011-07-08 14:34:03 +00:00
Alexey Spizhevoy abe34e3b33 removed debug func. call 2011-07-08 14:00:54 +00:00
Alexey Spizhevoy e9837b0aa9 added support of old CC into GPU mean shift routines 2011-07-08 13:59:23 +00:00
Alexander Shishkov b50428bf65 removed -static-libstdc++ flag for compatibility with old MinGW version 2011-07-08 07:10:37 +00:00
Alexander Shishkov 3a8a729a52 removed CPack
added target package_source (tar or zip)
2011-07-08 07:08:59 +00:00
Vadim Pisarevsky 4e099d2e5c fixed memory leak in CvKNearest::train() and the constructor. 2011-07-08 06:48:18 +00:00
Andrey Kamaev 2cf34c7f46 Fixed few more bugs in rst_parser. Fixed small typos in documentation. 2011-07-08 04:31:13 +00:00
Vadim Pisarevsky ddd57e7496 commented off debugging print in cap_libv4l.cpp (ticket #807) 2011-07-07 22:58:20 +00:00
Vadim Pisarevsky b0aae19fb4 probably fixed parallel face detector (i.e. built with TBB), ticket #1185. Thanks to mengw for the patch 2011-07-07 22:52:54 +00:00
Vadim Pisarevsky af00cd5b75 Disabled -ffast-math in the case of GCC 4.6.x (ticket #1201) 2011-07-07 22:35:34 +00:00
Alexander Mordvintsev c3ef6e866f facedetect.py sample works 2011-07-07 22:33:36 +00:00
Vadim Pisarevsky db0dcaffeb fixed #1204 2011-07-07 22:10:13 +00:00
Vadim Pisarevsky 5bb8076d7d added centerPrincipalPoint=false to getOptimalNewCameraMatrix (ticket #1199) 2011-07-07 21:38:21 +00:00
Vadim Pisarevsky 38e0f84876 corrected css style - use the same background color for all text elements. 2011-07-07 17:00:09 +00:00
Vadim Pisarevsky 0940573e8b fixed a few more typos in the docs. 2011-07-07 16:59:09 +00:00
Vadim Pisarevsky 462d4a1dae opencl module is not ready for trunk yet 2011-07-07 16:40:44 +00:00
salmanulhaq 1e691daab4 ocl folder contains the gpu implementations 2011-07-07 16:35:20 +00:00
Andrey Kamaev 426c358352 Fixed bugs in rst_parser.py; added parsing of 'seealso' blocks 2011-07-07 16:33:02 +00:00
salmanulhaq fe86d25694 renamed gpu to ocl 2011-07-07 16:21:20 +00:00
salmanulhaq e22ad8050b OclMat implementation 2011-07-07 16:20:43 +00:00
Alexander Mordvintsev 9af213bf60 work on facedetect sample 2011-07-07 16:14:49 +00:00
salmanulhaq 64de562db2 Update OclMat to match GpuMat. Include ref counting, opearators, Scalar initialization. Tested for Intel OCL SDK. 2011-07-07 16:06:26 +00:00
Andrey Pavlenko 7432fc1d2d - 'String' (that is synonym of std::string) is added
- report generation added (<module>.txt)
2011-07-07 15:40:54 +00:00
Andrey Kamaev ed8a2af9b6 Improved rst parser; fixed bug in hdr_parser; some small fixes in documentation 2011-07-07 14:49:24 +00:00
Kirill Kornyakov 72cc69e431 java tests: split into packages, tests for VideoCapture implemented 2011-07-07 14:35:12 +00:00
Vadim Pisarevsky 5649f35757 some more bugfixed in 2.3 propagated to trunk 2011-07-07 11:43:21 +00:00
Vadim Pisarevsky a2287affb7 a few more fixes from Gabor 2011-07-07 11:36:40 +00:00
Andrey Kamaev 58b5256e05 Fixed C functions parsing in rst parser 2011-07-07 11:32:22 +00:00
Andrey Kamaev 741a689f65 Improved RST parser; fixed small typos found by new parser 2011-07-07 11:23:51 +00:00
Alexander Mordvintsev edf0b40d42 opt_flow.py demo 2011-07-07 07:55:49 +00:00
Alexander Mordvintsev 136d5b534a work on optical flow sample 2011-07-06 19:02:40 +00:00
Ana Huaman ff326988a5 Added histogram comparison tutorial in reST 2011-07-06 18:57:39 +00:00
Andrey Pavlenko 9f4df42e24 Initial classes support, improved generated java & cpp code formatting. 2011-07-06 18:56:09 +00:00
Vadim Pisarevsky 38afa582b0 possibly fixed problem reported in #1198 2011-07-06 18:45:11 +00:00
Ana Huaman 89115f0fcc Added BackProjection reST tutorial 2011-07-06 17:57:19 +00:00
itsyplen 6aab128afe Java tests: commited some core tests (to be cleaned) 2011-07-06 16:25:33 +00:00
Ana Huaman 9c8aafba27 Fixed small inconsistency in sample code calcBackProject_Demo2.cpp 2011-07-06 14:48:46 +00:00
Ana Huaman cf62a37f87 Added matchTemplate reST tutorial 2011-07-06 14:15:13 +00:00
Ana Huaman eac922ebd7 Added calcHist tutorial in reST 2011-07-06 09:33:03 +00:00
Bernat Gabor 7a7011bd4f Corrected(re-added) and extended the ImgProc Tutorial TOC entry. 2011-07-06 09:15:54 +00:00
Ana Huaman 080c6e817d Added Equalized Histogram reST tutorial + corrected Smoothing tutorial (images reduced and fixed link) 2011-07-06 04:22:00 +00:00
Bernat Gabor e18de3c6ab Added the OpenCV with Visual Studio tutorial. Enhanced, extended the Windows Installation one. Some minor CSS changes to avoid unnecessary large spaces inside enumerations in the tutorials. 2011-07-06 00:01:27 +00:00
Ana Huaman 20dd7b70c0 Added tutorial for BackProject in cpp (demo 2) - tutorial code 2011-07-05 18:08:46 +00:00
Andrey Kamaev 3156f27d41 Added initial version of rst_parser script 2011-07-05 17:29:54 +00:00
Kirill Kornyakov 80f0901dee java tests: merged with new CvType, implemented half of the tests for Mat 2011-07-05 16:26:00 +00:00
Andrey Pavlenko 2ef146c2c6 More code review feedbacks addressed: Mat c-tor and setTo uses Scalar, Java Mat::dispose() calls C++ Mat::release(). 2011-07-05 15:50:54 +00:00
Andrey Pavlenko 2cce7a87b8 Some of code review feedbacks addressed: CvType moved from Mat, new Mat c-tor, samples updated. 2011-07-05 14:50:16 +00:00
Vadim Pisarevsky 9a1ef7272d fixed 2 possible build problems (in opencv_gpu & docs) (ticket #1191 + fix from Steve Macao). removed obsolete stuff from opencv_extra_api.hpp, since with InputArray/OutputArray the existing C++ API can be successfully wrapped for Python. 2011-07-05 14:28:25 +00:00
Kirill Kornyakov ec6fb0bee2 java tests: now only OpenCVTestRunner contains android specific stuff 2011-07-05 14:03:28 +00:00
Andrey Kamaev 3fc879075b Fixed typo in features2d doc 2011-07-05 13:02:29 +00:00
Kirill Kornyakov 5688b014e9 JavaAPI: implemented Mat.dump method (analog for C++ stream <<) 2011-07-05 08:37:49 +00:00
Andrey Kamaev ff8fe39e23 removed duplicated compiler flags assignment 2011-07-05 06:42:56 +00:00
Ana Huaman 4f7a8f6fb0 Added calcBackProject_Demo1.cpp for tutorial sample code 2011-07-05 06:20:39 +00:00
Ana Huaman cc2bfdec30 Added compareHist_demo.cpp code 2011-07-04 23:12:27 +00:00
Ana Huaman 4ae5de7f1e Added MatchTemplate_Demo.cpp to tutorial sample code 2011-07-04 18:58:57 +00:00
Vadim Pisarevsky 5c23d3d96d possibly fixed occasional deletion of mymath.sty in the case of in-source builds (though, in-source builds are still not recommended) - ticket #1163. 2011-07-04 16:33:54 +00:00
Vadim Pisarevsky b33224f0b6 merged the latest fixes in 2.3 to trunk 2011-07-04 16:18:12 +00:00
Alexander Mordvintsev 55ba0af2bc use addWeighted for blending 2011-07-04 14:13:57 +00:00
Kirill Kornyakov 85166360f1 java tests updated: now they independent from android, test methods are sorted alphabetically 2011-07-04 12:21:56 +00:00
Andrey Kamaev f301cda780 Fixed 'Undefined control sequence' error in recently added tutorial 2011-07-04 12:19:40 +00:00
Andrey Kamaev 730622178b Turned off android camera and java wrappers for low Android API levels (android-8 is required for these components) 2011-07-04 11:41:39 +00:00
Andrey Kamaev 53ff93f3f9 Removed unnecessary variable disclosures from version config 2011-07-04 11:40:27 +00:00
Alexander Mordvintsev e9d63665b4 little simplification 2011-07-04 11:38:53 +00:00
Alexander Mordvintsev 15de28b069 turing.py sample added 2011-07-04 11:25:56 +00:00
Bernat Gabor 6be9fbfa6d Reformatted the TOC tables in tutorials to look just as good in PDFs as in HTML. Updated the default.css_t too for this. Added the "Windows Install" tutorial (with videos). 2011-07-04 11:04:56 +00:00
Kirill Kornyakov 43097c6afb lena added 2011-07-04 10:51:06 +00:00
Kirill Kornyakov 1649c8f6d0 some tests for highgui java added 2011-07-04 09:30:55 +00:00
Alexander Mordvintsev 5596c792bc find_obj.py sample added 2011-07-04 09:05:11 +00:00
Andrey Kamaev d96f533784 Instroduced separate option for Android examples - BUILD_ANDROID_EXAMPLES 2011-07-04 08:18:02 +00:00
Andrey Kamaev 65cb53aa1e Fixed Android tests and samples build 2011-07-04 06:33:10 +00:00
Vadim Pisarevsky 24b5be04cc fixed /incremental linker flag & opencv_ffmpeg.dll target dir in the case of static libs 2011-07-04 03:37:13 +00:00
Ana Huaman 6d549490fb Added calcHist_Demo.cpp tutorial code 2011-07-04 03:22:16 +00:00
Ana Huaman 08724393f4 Added tutorial sample code: EqualizeHist_Demo.cpp 2011-07-03 18:55:47 +00:00
Alexander Mordvintsev d3da43c8e5 distrans.py sample added 2011-07-02 22:21:19 +00:00
Alexander Mordvintsev 724cc5b481 floodfill.py sample added 2011-07-02 16:03:17 +00:00
Andrey Kamaev 1c96aac52e Fixed several cross-compiling issues. Fixed cmake status report. 2011-07-02 15:12:07 +00:00
itsyplen e1ad6b27cf several java tests added 2011-07-02 12:17:57 +00:00
Alexander Mordvintsev afad87b5f2 inpaint.py sample added 2011-07-02 07:13:31 +00:00
Alexander Mordvintsev f0a4185b1f cv.Line -> cv2.line 2011-07-01 17:50:07 +00:00
Alexander Mordvintsev 84568cb18e python Sketcher utility class 2011-07-01 17:33:29 +00:00
Andrey Pavlenko ee10a38851 #863: typo fixed, minor changes in cpp generator 2011-07-01 15:58:16 +00:00
Andrey Pavlenko 2b83d416b0 #863: default Mat() c-tor, minor improvements 2011-07-01 15:48:13 +00:00
Alexander Mordvintsev aa695abad2 watershed.py sample added 2011-07-01 15:09:38 +00:00
Vadim Pisarevsky f8e1e88ce2 we do not need strmiids.lib anymore 2011-07-01 14:03:03 +00:00
Kirill Kornyakov e958383225 added some tests to core module 2011-07-01 13:34:23 +00:00
Andrey Kamaev f8e42721d3 HelloAndroid sample is moved to samples/android 2011-07-01 13:12:05 +00:00
Andrey Kamaev e005570719 Fixed versioning bug: FIND_PACKAGE( OpenCV ) errors if no version specified 2011-07-01 13:11:16 +00:00
Kirill Kornyakov 7fed582d9f implemented static Mat.eye method 2011-07-01 13:11:03 +00:00
Andrey Kamaev 837b733a0a Modified cmake status report 2011-07-01 12:23:03 +00:00
Vadim Pisarevsky 3cbe53c5d2 got back to the old DLL naming scheme (opencv_core230_vs2001_64d.dll => opencv_core230[d].dll) 2011-07-01 12:14:51 +00:00
Vadim Pisarevsky a5d53e3e2f some more corrections from Gabor 2011-07-01 12:09:39 +00:00
Andrey Pavlenko c7a3fc5d4e #863: sample text color changed from Green to Red. 2011-07-01 11:12:55 +00:00
Andrey Pavlenko 3159bd1a74 #863: 'string' args support added 2011-07-01 11:10:20 +00:00
Vadim Pisarevsky 6c8a2b8888 propagated fixes in docs and cap_dshow to trunk 2011-07-01 09:39:22 +00:00
Alexander Mordvintsev 382e154cfd morphology python sample 2011-07-01 08:22:45 +00:00
Alexey Spizhevoy ad454d83b9 added gpu::buildWarpPlaneMaps and gpu::buildWarpCylindricalMaps functions, integrated into stitching 2011-07-01 07:07:54 +00:00
Andrey Kamaev 68f5a5a904 Reverted change from r5802 (it breaks install target for Android platform) 2011-07-01 06:58:53 +00:00
Alexey Spizhevoy 5f4ba8055f added tests for pyrDown and pyrUp (gpu) 2011-07-01 05:37:20 +00:00
Vincent Rabaud 3e1b0186fe - make sure we don't crash for an empty image 2011-07-01 01:28:14 +00:00
Ethan Rublee 74cc1803c4 Version modifications. 2011-07-01 01:25:27 +00:00
Ethan Rublee 08d3dcc709 minor edits to cmake. 2011-07-01 00:57:00 +00:00
Ethan Rublee 38b5d4ecc9 Adding namemangling to the opencv.pc file. 2011-07-01 00:14:09 +00:00
Andrey Kamaev 529f103456 Merged name suffixes for windows (from 2.3 branch) 2011-06-30 19:45:52 +00:00
Andrey Kamaev ec90265a08 Fixed compilation problem when building without CUDA 2011-06-30 17:01:15 +00:00
hartmut 7f260a0f0b fix for capture 2011-06-30 14:57:27 +00:00
Andrey Kamaev 01b3266612 Fixed Android target name for Android samples and tests 2011-06-30 14:56:39 +00:00
Kirill Kornyakov 9fbd47ffb1 added several tests for java/core module 2011-06-30 14:47:50 +00:00
Alexey Spizhevoy 5d703abdc2 fix for GPU module compile time (VS2010) error (from 2.3 branch) 2011-06-30 14:47:20 +00:00
Alexey Spizhevoy 674b763395 GPU: updated upsample, downsample functions, added pyrDown, pyrUp, added support of 16S filtering; put spherical warper on GPU (from opencv_stitching) 2011-06-30 14:39:48 +00:00
Andrey Kamaev a44d6aacc8 Android tests are included into cmake build 2011-06-30 14:35:35 +00:00
Alexander Mordvintsev 7f115db7a7 morphology.py sample stub 2011-06-30 14:17:31 +00:00
Andrey Kamaev 150c2215bb Fixed Android tests resources and settings 2011-06-30 14:16:14 +00:00
Ana Huaman 13bbc9ff71 Added Affine Transformation tutorial in reST 2011-06-30 13:42:46 +00:00
Andrey Kamaev 092699783a Added cmake script to build Android samples 2011-06-30 13:37:56 +00:00
Vadim Pisarevsky 995ce4bdcc :ocv:function => :ocv:cfunction for some old API 2011-06-30 12:25:36 +00:00
Kirill Kornyakov daa31a0696 autogenerated JUnit stub tests added 2011-06-30 12:07:31 +00:00
Vadim Pisarevsky cc9a1bb62f propagated some more fixes from 2.3 branch to the trunk 2011-06-30 12:06:26 +00:00
Kirill Kornyakov f4894d57cd opencv_test package renamed to opencv.test 2011-06-30 09:39:30 +00:00
Kirill Kornyakov 217a782d94 opencv_test package renamed to opencv.test 2011-06-30 09:38:07 +00:00
Bernat Gabor 3ff8831ae9 Updated the TOC tree of the imgproc tutorial section. 2011-06-30 09:37:01 +00:00
Kirill Kornyakov 56e26b9624 initial commit of JavaAPI unit tests 2011-06-30 09:29:35 +00:00
Ana Huaman 64c8d8f2a0 Added Remap tutorial in reST 2011-06-30 09:08:04 +00:00
Andrey Kamaev aa47802e88 Modified version section to read version number from version.hpp;
Added search for ant and Android SDK (needed for Android tests and samples).
2011-06-30 07:24:35 +00:00
Bernat Gabor 5ee8293e7b Mixed up the linux_eclipse.rst file in the previous commit. Correcting it. 2011-06-30 00:59:47 +00:00
Bernat Gabor 762bc0f8af Some reST syntax correction. Now the PDF documentation builds correctly under Windows using MIKTEX. Some update on the tutorial structure. Some CSS syntax correction. Windows Install Tutorial v0.4. 2011-06-30 00:41:41 +00:00
Vadim Pisarevsky d8ea8ef98a propagated some more fixes from 2.3 branch to the trunk 2011-06-29 22:34:08 +00:00
Vadim Pisarevsky d5d0a2f8e0 propagated some more fixes from 2.3 branch to the trunk 2011-06-29 22:26:09 +00:00
Vadim Pisarevsky b204e73d9a propagated some more fixes from 2.3 branch to the trunk 2011-06-29 22:06:42 +00:00
Vadim Pisarevsky dacd265424 propagated some more fixes from 2.3 branch to the trunk 2011-06-29 22:04:43 +00:00
Gary Bradski 04830e5dc0 Edit load and save to load, modify and save 2011-06-29 21:34:52 +00:00
Vadim Pisarevsky 7cd48accc2 bump version to 2.3.1 in the header too (ticket #1178) 2011-06-29 17:45:41 +00:00
Ana Huaman 0a14f76731 Added 02 cpp sample files for tutorials: remap and Geometric Transformations (warpAffine and Rotation2D) 2011-06-29 17:39:12 +00:00
Vincent Rabaud b5754550ab fix #1169 2011-06-29 17:01:23 +00:00
Andrey Kamaev 3df6548c4a Android samples fixed - line endings are converted to unix style; autogenerated folders are added to ignore list 2011-06-29 13:42:46 +00:00
Andrey Kamaev 359b76bdad Fixed native camera support in Android.mk 2011-06-29 13:18:20 +00:00
Andrey Kamaev d6b6734619 Added new Android sample (Java API + Native) 2011-06-29 13:17:02 +00:00
Andrey Kamaev 4b61683071 Added one more Android sample (using OpenCV from native) 2011-06-29 12:26:27 +00:00
Vladislav Vinogradov 724a3c1473 added CUDA version info to gpu tests 2011-06-29 12:00:00 +00:00
Vladislav Vinogradov 52bdfbc7fc added OS info to gpu tests 2011-06-29 11:53:15 +00:00
Vladislav Vinogradov e8d2dd212c fixed gpu tests 2011-06-29 11:14:03 +00:00
Vladislav Vinogradov a4182b5da3 fixed build under linux 2011-06-29 10:57:48 +00:00
Vladislav Vinogradov d1b4b5f0de refactored gpu module tests 2011-06-29 10:14:16 +00:00
Andrey Kamaev 6e3142f04b Added second sample for Android Java API 2011-06-29 08:46:29 +00:00
Andrey Kamaev 96d29621b7 Fixes for path mangling feature 2011-06-29 06:27:08 +00:00
Andrey Kamaev 334cb1dcd1 Android sample is refactored according to Google code style guidelines for Android developers 2011-06-29 05:38:51 +00:00
Ana Huaman f27796e8cc Added Hough Circle Tutorial in reST 2011-06-29 04:05:17 +00:00
Ana Huaman d32a134b0f Added Hough Lines Tutorial in reST 2011-06-29 00:20:05 +00:00
James Bowman 1d335bddfc Fix for SSE swapping bug 2011-06-28 23:29:15 +00:00
Ana Huaman 8f01f2cc9f Added 02 tutorials for Hough Lines and Circle detection in tutorial_code -- based on code existent 2011-06-28 19:32:48 +00:00
Ethan Rublee 773654e11a More work on the mangling of install paths. 2011-06-28 19:24:31 +00:00
Ethan Rublee 4f89292aab fix version in version.cmake 2011-06-28 16:19:35 +00:00
Ethan Rublee 6259c9ac6a First pass at name mangling based on version number, to support
side by side installs of OpenCV2.3.0 OpenCV2.3.1 OpenCV2.4.x, etc...
2011-06-28 16:02:09 +00:00
Andrey Kamaev d673197d01 Added base Android Java sample 2011-06-28 15:12:14 +00:00
Andrey Kamaev 820cecfa2d Fixed windows compatibility problems in Android.mk 2011-06-28 11:34:41 +00:00
Andrey Kamaev f60bdb2473 Fixed Android.mk file generation 2011-06-28 08:48:23 +00:00
Andrey Kamaev 822b0bfe22 Minor bugfix 2011-06-28 07:20:30 +00:00
Andrey Kamaev 591cb1b3cf Fixed compiler options in Android build (Windows) 2011-06-28 05:51:41 +00:00
Andrey Kamaev ba7ee71c20 Numerous small fixes in CMakeLists.txt 2011-06-28 05:18:53 +00:00
Vadim Pisarevsky 2776b42a7b propagated fix for Matx(Matx::diag_type) constructor from branch 2.3 to trunk 2011-06-27 20:01:05 +00:00
Vadim Pisarevsky 25887e693b removed the obsolete tests from the trunk as well. 2011-06-27 19:57:56 +00:00
Ana Huaman 832262e376 Added Laplace and Canny reST tutorials and corrected a small bug in Canny sample code 2011-06-27 17:06:54 +00:00
Andrey Kamaev cf28846bce Fixed OpenCVConfig.cmake generation for windows 2011-06-27 16:55:10 +00:00
Andrey Kamaev 31fcd406e1 Eliminated cmake warning for case when python is not found. 2011-06-27 16:21:22 +00:00
Andrey Kamaev b43ae03328 * Install path share/opencv is renamed to share/OpenCV.
* Fixed zlib search.
* Fixed compiler/linker flags caching bug.
* Fixed OpenCVConfig.cmake generation (currently tested only on Unix).
2011-06-27 13:59:03 +00:00
Ana Huaman 20ab3d538b Updated conf.py with the latest added external links for tutorial docs 2011-06-27 13:21:01 +00:00
Ana Huaman e1aa8eead3 Added reST tutorials for copyMakeBorder, Sobel Operator, updated links in conf.py 2011-06-27 08:31:34 +00:00
Andrey Kamaev f0227edd2c Minor python search improvements 2011-06-27 08:24:10 +00:00
Ana Huaman ae649e8c30 Added rst Tutorial for Filter 2D 2011-06-27 04:01:01 +00:00
Ana Huaman 3a0d3ebdde Added Laplace, Canny and Sobel samples in tutorial cpp code 2011-06-26 23:09:04 +00:00
Alexander Mordvintsev 0dbbb89e8d added stereo_match.py sample 2011-06-26 21:34:39 +00:00
Ana Huaman 65575cef7e Added two new sample files for copyMakeBorder and filter2D 2011-06-26 18:36:59 +00:00
Vadim Pisarevsky d195871904 propagated fix for ticket #1168 to trunk 2011-06-25 09:39:41 +00:00
Vincent Rabaud 7c2e74b649 - fix a bug if the descriptor is used for images of different size 2011-06-24 23:21:39 +00:00
Andrey Kamaev c1940b4ec7 Modified install layout for Android 2011-06-24 15:40:27 +00:00
Ilya Lysenkov 10065d3321 Trunk: moved contructors implementations from .hpp to .cpp 2011-06-24 12:48:00 +00:00
Ilya Lysenkov 2c958b2598 Trunk: moved contructors implementations from .hpp to .cpp 2011-06-24 12:25:52 +00:00
Andrey Kamaev 2edf764eee Added video.hpp header (for convenience with other modules); added option to specify list of headers for Java API generator 2011-06-24 08:13:02 +00:00
Andrey Kamaev 69b79f89c1 Updated build scripts for better Java module support 2011-06-24 07:48:04 +00:00
Ethan Rublee 2ee4f0de31 Merging back 2.3 cmake changes. 2011-06-24 07:12:34 +00:00
Bernat Gabor 42bd52f046 Corrected the place of accent in the name of Ana Huamán. 2011-06-23 22:28:27 +00:00
Bernat Gabor 9426249a88 New structure (following the documentation) for the tutorials. Normalized image sizes for TOC display. 2011-06-23 21:55:24 +00:00
Bernat Gabor ea70a5ffd6 Cleaning up the doc/tutorials folder in preparation to add thew new structure. 2011-06-23 21:47:16 +00:00
Andrey Kamaev b5d73111eb Added new module for Java API 2011-06-23 15:51:51 +00:00
Vadim Pisarevsky f0624c08dc propagated some more changes from 2.3 to trunk 2011-06-23 12:15:35 +00:00
Vadim Pisarevsky 6e613bca9b propagated some more changes from 2.3 to trunk 2011-06-23 12:13:33 +00:00
Vadim Pisarevsky 49467947ac propagated some fixes from 2.3 to trunk 2011-06-23 12:00:09 +00:00
Vadim Pisarevsky d4fbb2c4fb added missing bdatypes.h 2011-06-23 11:57:27 +00:00
Vadim Pisarevsky b1bf1deed0 fixed 2 bugs in reference manuals 2011-06-23 11:46:14 +00:00
Andrey Kamaev e60b8dfba0 Fixed numpy search on Windows x64 2011-06-23 09:16:55 +00:00
Andrey Kamaev 725d771570 Fixed output paths for Android build 2011-06-22 13:27:28 +00:00
Andrey Kamaev 9600ebadf2 Main CMakeLists.txt merged with 2.3 branch 2011-06-22 11:53:15 +00:00
Andrey Kamaev 76bc9f8c20 Removed SWIG from Android toolchain; always search for python; find_program/find_package cmake functions wrapped for case of cross-compiling. 2011-06-22 10:38:57 +00:00
Ana Huaman 3ac024ff6c Added tutorial for threshold in reST and fixed broken links from previous ImgProc tutorials 2011-06-22 02:05:49 +00:00
Ana Huaman 22e59e933b Added Threshold.cpp in samples/cpp/tutorial_code/ImgProc 2011-06-21 23:50:02 +00:00
Ana Huaman 9ce4e87507 Added reST tutorial documentation for Pyramids and added a few links to conf.py 2011-06-21 22:22:31 +00:00
Ana Huaman 5df9da1576 Added Pyramids.cpp sample tutorial code 2011-06-21 20:33:35 +00:00
Vadim Pisarevsky 677d2e508f fix for ticket #1153 propagated to trunk 2011-06-21 11:10:45 +00:00
Ana Huaman a8d37509fa Added tutorial in reST for Morphology 2 2011-06-21 08:53:37 +00:00
Ana Huaman 2819438fe6 Reorganized code and added Morphology 2 cpp code 2011-06-21 05:06:25 +00:00
Ana Huaman ae55138a49 Deleting old tutorial files and put them in folders 2011-06-21 03:30:18 +00:00
Ana Huaman 3162b742a3 Folder Intro 2011-06-21 03:27:26 +00:00
Andrey Kamaev ea58cdc71d (trunk) Do not use prebuilt Android camera libs for armeabi hardware target 2011-06-20 15:57:42 +00:00
Andrey Kamaev 9c71134caf Added generation of OpenCV.mk file for Android development with ndk-build tool 2011-06-20 15:35:05 +00:00
Ilya Lysenkov ee2aefc270 Minor doc fix 2011-06-20 13:27:37 +00:00
Ilya Lysenkov fce7ba4eaf Added destroyAllWindows and docs (ticket #957). 2011-06-20 13:24:48 +00:00
Ilya Lysenkov 233dfd252d Qt: fixed signal of a clicked push button (patch #786) 2011-06-20 09:49:21 +00:00
Ilya Lysenkov 3c7055b9ce Qt minor doc enhancement 2011-06-20 09:29:04 +00:00
1488 changed files with 110201 additions and 33517 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lwsock32
set path=c:\apps\mingw64\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lwsock32
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32 -lws2_32
Binary file not shown.
Binary file not shown.
+35
View File
@@ -7,3 +7,38 @@ Otherwise the produced DLL will likely be dependent on libgcc_s_dw2-1.dll or sim
While we want to make the DLLs with minimum dependencies: Win32 libraries + msvcrt.dll.
ffopencv.c is really a C++ source, hence -x c++ is used.
How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of FFMPEG is release?
1. Install 32-bit MinGW + MSYS from
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
Let's assume, it's installed in C:\MSYS32.
2. Install 64-bit MinGW. http://mingw-w64.sourceforge.net/
Let's assume, it's installed in C:\MSYS64
3. Copy C:\MSYS32\msys to C:\MSYS64\msys. Edit C:\MSYS64\msys\etc\fstab, change C:\MSYS32 to C:\MSYS64.
4. Now you have working MSYS32 and MSYS64 environments.
Launch, one by one, C:\MSYS32\msys\msys.bat and C:\MSYS64\msys\msys.bat to create your home directories.
4. Download ffmpeg-x.y.z.tar.gz (where x.y.z denotes the actual ffmpeg version).
Copy it to C:\MSYS{32|64}\msys\home\<loginname> directory.
5. To build 32-bit ffmpeg libraries, run C:\MSYS32\msys\msys.bat and type the following commands:
5.1. tar -xzf ffmpeg-x.y.z.tar.gz
5.2. mkdir build
5.3. cd build
5.4. ../ffmpeg-x.y.z/configure --enable-w32threads
5.5. make
5.6. make install
5.7. cd /local/lib
5.8. strip -g *.a
6. Then repeat the same for 64-bit case. The output libs: libavcodec.a etc. need to be renamed to libavcodec64.a etc.
7. Then, copy all those libs to <opencv>\3rdparty\lib\, copy the headers to <opencv>\3rdparty\include\ffmpeg_.
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -85,7 +85,7 @@ enum DCTTransformType {
};
/**
* Sets up DCT.
* Set up DCT.
* @param nbits size of the input array:
* (1 << nbits) for DCT-II, DCT-III and DST-I
* (1 << nbits) + 1 for DCT-I
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef AVCODEC_DXVA_H
#define AVCODEC_DXVA_H
#include <msc_stdint.h>
#include <stdint.h>
#include <dxva2api.h>
+13 -190
View File
@@ -1,211 +1,34 @@
/*
* AVOptions
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
* This file is part of Libav.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* This header is provided for compatibility only and will be removed
* on next major bump
*/
#ifndef AVCODEC_OPT_H
#define AVCODEC_OPT_H
/**
* @file
* AVOptions
*/
#include "libavcodec/version.h"
#include "libavutil/rational.h"
#include "avcodec.h"
enum AVOptionType{
FF_OPT_TYPE_FLAGS,
FF_OPT_TYPE_INT,
FF_OPT_TYPE_INT64,
FF_OPT_TYPE_DOUBLE,
FF_OPT_TYPE_FLOAT,
FF_OPT_TYPE_STRING,
FF_OPT_TYPE_RATIONAL,
FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
FF_OPT_TYPE_CONST=128,
};
/**
* AVOption
*/
typedef struct AVOption {
const char *name;
/**
* short English help text
* @todo What about other languages?
*/
const char *help;
/**
* The offset relative to the context structure where the option
* value is stored. It should be 0 for named constants.
*/
int offset;
enum AVOptionType type;
/**
* the default value for scalar options
*/
double default_val;
double min; ///< minimum valid value for the option
double max; ///< maximum valid value for the option
int flags;
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
#define AV_OPT_FLAG_AUDIO_PARAM 8
#define AV_OPT_FLAG_VIDEO_PARAM 16
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
//FIXME think about enc-audio, ... style flags
/**
* The logical unit to which the option belongs. Non-constant
* options and corresponding named constants share the same
* unit. May be NULL.
*/
const char *unit;
} AVOption;
/**
* AVOption2.
* THIS IS NOT PART OF THE API/ABI YET!
* This is identical to AVOption except that default_val was replaced by
* an union, it should be compatible with AVOption on normal platforms.
*/
typedef struct AVOption2 {
const char *name;
/**
* short English help text
* @todo What about other languages?
*/
const char *help;
/**
* The offset relative to the context structure where the option
* value is stored. It should be 0 for named constants.
*/
int offset;
enum AVOptionType type;
/**
* the default value for scalar options
*/
union {
double dbl;
const char *str;
} default_val;
double min; ///< minimum valid value for the option
double max; ///< maximum valid value for the option
int flags;
/*
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
#define AV_OPT_FLAG_AUDIO_PARAM 8
#define AV_OPT_FLAG_VIDEO_PARAM 16
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
*/
//FIXME think about enc-audio, ... style flags
/**
* The logical unit to which the option belongs. Non-constant
* options and corresponding named constants share the same
* unit. May be NULL.
*/
const char *unit;
} AVOption2;
/**
* Looks for an option in obj. Looks only for the options which
* have the flags set as specified in mask and flags (that is,
* for which it is the case that opt->flags & mask == flags).
*
* @param[in] obj a pointer to a struct whose first element is a
* pointer to an AVClass
* @param[in] name the name of the option to look for
* @param[in] unit the unit of the option to look for, or any if NULL
* @return a pointer to the option found, or NULL if no option
* has been found
*/
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* @see av_set_string2()
*/
attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
/**
* @return a pointer to the AVOption corresponding to the field set or
* NULL if no matching AVOption exists, or if the value val is not
* valid
* @see av_set_string3()
*/
attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
#if FF_API_OPT_H
#include "libavutil/opt.h"
#endif
/**
* Sets the field of obj with the given name to value.
*
* @param[in] obj A struct whose first element is a pointer to an
* AVClass.
* @param[in] name the name of the field to set
* @param[in] val The value to set. If the field is not of a string
* type, then the given string is parsed.
* SI postfixes and some named scalars are supported.
* If the field is of a numeric type, it has to be a numeric or named
* scalar. Behavior with more than one scalar and +- infix operators
* is undefined.
* If the field is of a flags type, it has to be a sequence of numeric
* scalars or named flags separated by '+' or '-'. Prefixing a flag
* with '+' causes it to be set without affecting the other flags;
* similarly, '-' unsets a flag.
* @param[out] o_out if non-NULL put here a pointer to the AVOption
* found
* @param alloc when 1 then the old value will be av_freed() and the
* new av_strduped()
* when 0 then no av_free() nor av_strdup() will be used
* @return 0 if the value has been set, or an AVERROR code in case of
* error:
* AVERROR(ENOENT) if no matching option exists
* AVERROR(ERANGE) if the value is out of range
* AVERROR(EINVAL) if the value is not valid
*/
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
const AVOption *av_set_double(void *obj, const char *name, double n);
const AVOption *av_set_q(void *obj, const char *name, AVRational n);
const AVOption *av_set_int(void *obj, const char *name, int64_t n);
double av_get_double(void *obj, const char *name, const AVOption **o_out);
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
const AVOption *av_next_option(void *obj, const AVOption *last);
int av_opt_show(void *obj, void *av_log_obj);
void av_opt_set_defaults(void *s);
void av_opt_set_defaults2(void *s, int mask, int flags);
#endif /* AVCODEC_OPT_H */
+1 -1
View File
@@ -24,7 +24,7 @@
#ifndef AVCODEC_VAAPI_H
#define AVCODEC_VAAPI_H
#include <msc_stdint.h>
#include <stdint.h>
/**
* \defgroup VAAPI_Decoding VA API Decoding
+7 -8
View File
@@ -38,7 +38,6 @@
* and rendering (API calls) are done as part of the VDPAU
* presentation (vo_vdpau.c) module.
*
* @{
* \defgroup VDPAU_Decoding VDPAU Decoding
* \ingroup Decoder
* @{
@@ -68,6 +67,13 @@ struct vdpau_render_state {
int state; ///< Holds FF_VDPAU_STATE_* values.
/** Describe size/location of the compressed video data.
Set to 0 when freeing bitstream_buffers. */
int bitstream_buffers_allocated;
int bitstream_buffers_used;
/** The user is responsible for freeing this buffer using av_freep(). */
VdpBitstreamBuffer *bitstream_buffers;
/** picture parameter information for all supported codecs */
union VdpPictureInfo {
VdpPictureInfoH264 h264;
@@ -75,13 +81,6 @@ struct vdpau_render_state {
VdpPictureInfoVC1 vc1;
VdpPictureInfoMPEG4Part2 mpeg4;
} info;
/** Describe size/location of the compressed video data.
Set to 0 when freeing bitstream_buffers. */
int bitstream_buffers_allocated;
int bitstream_buffers_used;
/** The user is responsible for freeing this buffer using av_freep(). */
VdpBitstreamBuffer *bitstream_buffers;
};
/* @}*/
+72
View File
@@ -0,0 +1,72 @@
/*
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VERSION_H
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 7
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
/**
* Those FF_API_* defines are not part of public API.
* They may change, break or disappear at any time.
*/
#ifndef FF_API_PALETTE_CONTROL
#define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_SAMPLE_FMT
#define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_AUDIOCONVERT
#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_ANTIALIAS_ALGO
#define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_REQUEST_CHANNELS
#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OPT_H
#define FF_API_OPT_H (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_THREAD_INIT
#define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_FF_PICT_TYPES
#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_FLAC_GLOBAL_OPTS
#define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_GET_PIX_FMT_NAME
#define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
#endif /* AVCODEC_VERSION_H */
+1 -22
View File
@@ -25,11 +25,6 @@
#include "avcodec.h"
#if LIBAVCODEC_VERSION_MAJOR < 53
#define AV_XVMC_STATE_DISPLAY_PENDING 1 /** the surface should be shown, the video driver manipulates this */
#define AV_XVMC_STATE_PREDICTION 2 /** the surface is needed for prediction, the codec manipulates this */
#define AV_XVMC_STATE_OSD_SOURCE 4 /** the surface is needed for subpicture rendering */
#endif
#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
the number is 1337 speak for the letters IDCT MCo (motion compensation) */
@@ -71,7 +66,7 @@ struct xvmc_pix_fmt {
*/
int allocated_data_blocks;
/** Indicates that the hardware would interpret data_blocks as IDCT
/** Indicate that the hardware would interpret data_blocks as IDCT
coefficients and perform IDCT on them.
- application - set during initialization
- libavcodec - unchanged
@@ -151,22 +146,6 @@ struct xvmc_pix_fmt {
of coded blocks it contains.
*/
int next_free_data_block_num;
/** extensions may be placed here */
#if LIBAVCODEC_VERSION_MAJOR < 53
//@{
/** State flags used to work around limitations in the MPlayer video system.
0 - Surface is not used.
1 - Surface is still held in application to be displayed or is
still visible.
2 - Surface is still held in libavcodec buffer for prediction.
*/
int state;
/** pointer to the surface where the subpicture is rendered */
void* p_osd_target_surface_render;
//}@
#endif
};
#endif /* AVCODEC_XVMC_H */
+11 -6
View File
@@ -20,10 +20,11 @@
#define AVDEVICE_AVDEVICE_H
#include "libavutil/avutil.h"
#include "libavformat/avformat.h"
#define LIBAVDEVICE_VERSION_MAJOR 52
#define LIBAVDEVICE_VERSION_MINOR 2
#define LIBAVDEVICE_VERSION_MICRO 0
#define LIBAVDEVICE_VERSION_MAJOR 53
#define LIBAVDEVICE_VERSION_MINOR 1
#define LIBAVDEVICE_VERSION_MICRO 1
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
@@ -33,18 +34,22 @@
LIBAVDEVICE_VERSION_MICRO)
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
#ifndef FF_API_V4L
#define FF_API_V4L (LIBAVDEVICE_VERSION_MAJOR < 54)
#endif
/**
* Returns the LIBAVDEVICE_VERSION_INT constant.
* Return the LIBAVDEVICE_VERSION_INT constant.
*/
unsigned avdevice_version(void);
/**
* Returns the libavdevice build-time configuration.
* Return the libavdevice build-time configuration.
*/
const char *avdevice_configuration(void);
/**
* Returns the libavdevice license.
* Return the libavdevice license.
*/
const char *avdevice_license(void);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+81
View File
@@ -0,0 +1,81 @@
/*
* Version macros.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_VERSION_H
#define AVFORMAT_VERSION_H
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 4
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MICRO)
#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MICRO)
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
/**
* Those FF_API_* defines are not part of public API.
* They may change, break or disappear at any time.
*/
#ifndef FF_API_OLD_METADATA2
#define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_READ_SEEK
#define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_OLD_AVIO
#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_DUMP_FORMAT
#define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_PARSE_DATE
#define FF_API_PARSE_DATE (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_FIND_INFO_TAG
#define FF_API_FIND_INFO_TAG (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_PKT_DUMP
#define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_GUESS_IMG2_CODEC
#define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_SDP_CREATE
#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_ALLOC_OUTPUT_CONTEXT
#define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_FORMAT_PARAMETERS
#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_FLAG_RTP_HINT
#define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#endif /* AVFORMAT_VERSION_H */
+13 -1
View File
@@ -21,9 +21,21 @@
#ifndef AVUTIL_ADLER32_H
#define AVUTIL_ADLER32_H
#include <msc_stdint.h>
#include <stdint.h>
#include "attributes.h"
/**
* Calculate the Adler32 checksum of a buffer.
*
* Passing the return value to a subsequent av_adler32_update() call
* allows the checksum of multiple buffers to be calculated as though
* they were concatenated.
*
* @param adler initial checksum value
* @param buf pointer to input buffer
* @param len size of input buffer
* @return updated checksum
*/
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
unsigned int len) av_pure;
+47
View File
@@ -0,0 +1,47 @@
/*
* copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_AES_H
#define AVUTIL_AES_H
#include <stdint.h>
extern const int av_aes_size;
struct AVAES;
/**
* Initialize an AVAES context.
* @param key_bits 128, 192 or 256
* @param decrypt 0 for encryption, 1 for decryption
*/
int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
/**
* Encrypt or decrypt a buffer using a previously initialized context.
* @param count number of 16 byte blocks
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
#endif /* AVUTIL_AES_H */
+24 -3
View File
@@ -65,7 +65,7 @@
#endif
#ifndef av_cold
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
#if AV_GCC_VERSION_AT_LEAST(4,3)
# define av_cold __attribute__((cold))
#else
# define av_cold
@@ -73,7 +73,7 @@
#endif
#ifndef av_flatten
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
#if AV_GCC_VERSION_AT_LEAST(4,1)
# define av_flatten __attribute__((flatten))
#else
# define av_flatten
@@ -96,8 +96,29 @@
#endif
#endif
/**
* Mark a variable as used and prevent the compiler from optimizing it
* away. This is useful for variables accessed only from inline
* assembler without the compiler being aware.
*/
#ifndef av_used
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_used __attribute__((used))
#else
# define av_used
#endif
#endif
#ifndef av_alias
#if AV_GCC_VERSION_AT_LEAST(3,3)
# define av_alias __attribute__((may_alias))
#else
# define av_alias
#endif
#endif
#ifndef av_uninit
#if defined(__GNUC__) && !defined(__ICC)
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
# define av_uninit(x) x=x
#else
# define av_uninit(x) x
+95
View File
@@ -0,0 +1,95 @@
/*
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2008 Peter Ross
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_AUDIOCONVERT_H
#define AVUTIL_AUDIOCONVERT_H
#include <stdint.h>
/**
* @file
* audio conversion routines
*/
/* Audio channel masks */
#define AV_CH_FRONT_LEFT 0x00000001
#define AV_CH_FRONT_RIGHT 0x00000002
#define AV_CH_FRONT_CENTER 0x00000004
#define AV_CH_LOW_FREQUENCY 0x00000008
#define AV_CH_BACK_LEFT 0x00000010
#define AV_CH_BACK_RIGHT 0x00000020
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080
#define AV_CH_BACK_CENTER 0x00000100
#define AV_CH_SIDE_LEFT 0x00000200
#define AV_CH_SIDE_RIGHT 0x00000400
#define AV_CH_TOP_CENTER 0x00000800
#define AV_CH_TOP_FRONT_LEFT 0x00001000
#define AV_CH_TOP_FRONT_CENTER 0x00002000
#define AV_CH_TOP_FRONT_RIGHT 0x00004000
#define AV_CH_TOP_BACK_LEFT 0x00008000
#define AV_CH_TOP_BACK_CENTER 0x00010000
#define AV_CH_TOP_BACK_RIGHT 0x00020000
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
/** Channel mask value used for AVCodecContext.request_channel_layout
to indicate that the user requests the channel order of the decoder output
to be the native codec channel order. */
#define AV_CH_LAYOUT_NATIVE 0x8000000000000000LL
/* Audio channel convenience macros */
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
/**
* Return a channel layout id that matches name, 0 if no match.
*/
int64_t av_get_channel_layout(const char *name);
/**
* Return a description of a channel layout.
* If nb_channels is <= 0, it is guessed from the channel_layout.
*
* @param buf put here the string containing the channel layout
* @param buf_size size in bytes of the buffer
*/
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
/**
* Return the number of channels in the channel layout.
*/
int av_get_channel_layout_nb_channels(int64_t channel_layout);
#endif /* AVUTIL_AUDIOCONVERT_H */
+66
View File
@@ -0,0 +1,66 @@
/*
* copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* simple assert() macros that are a bit more flexible than ISO C assert().
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#ifndef AVUTIL_AVASSERT_H
#define AVUTIL_AVASSERT_H
#include <stdlib.h>
#include "avutil.h"
#include "log.h"
/**
* assert() equivalent, that is always enabled.
*/
#define av_assert0(cond) do { \
if (!(cond)) { \
av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n", \
AV_STRINGIFY(cond), __FILE__, __LINE__); \
abort(); \
} \
} while (0)
/**
* assert() equivalent, that does not lie in speed critical code.
* These asserts() thus can be enabled without fearing speedloss.
*/
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
#define av_assert1(cond) av_assert0(cond)
#else
#define av_assert1(cond) ((void)0)
#endif
/**
* assert() equivalent, that does lie in speed critical code.
*/
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
#define av_assert2(cond) av_assert0(cond)
#else
#define av_assert2(cond) ((void)0)
#endif
#endif /* AVUTIL_AVASSERT_H */
+1
View File
@@ -2,4 +2,5 @@
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#endif /* AVUTIL_AVCONFIG_H */
+16
View File
@@ -114,4 +114,20 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
*/
char *av_d2str(double d);
/**
* Unescape the given string until a non escaped terminating char,
* and return the token corresponding to the unescaped string.
*
* The normal \ and ' escaping is supported. Leading and trailing
* whitespaces are removed, unless they are escaped with '\' or are
* enclosed between ''.
*
* @param buf the buffer to parse, buf will be updated to point to the
* terminating char
* @param term a 0-terminated list of terminating chars
* @return the malloced unescaped string, which must be av_freed by
* the user, NULL in case of allocation failure
*/
char *av_get_token(const char **buf, const char *term);
#endif /* AVUTIL_AVSTRING_H */
+50 -5
View File
@@ -39,8 +39,8 @@
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 50
#define LIBAVUTIL_VERSION_MINOR 15
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 9
#define LIBAVUTIL_VERSION_MICRO 1
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -54,17 +54,31 @@
#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
/**
* Returns the LIBAVUTIL_VERSION_INT constant.
* Those FF_API_* defines are not part of public API.
* They may change, break or disappear at any time.
*/
#ifndef FF_API_OLD_EVAL_NAMES
#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
#endif
#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
#endif
#ifndef FF_API_FIND_OPT
#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 52)
#endif
/**
* Return the LIBAVUTIL_VERSION_INT constant.
*/
unsigned avutil_version(void);
/**
* Returns the libavutil build-time configuration.
* Return the libavutil build-time configuration.
*/
const char *avutil_configuration(void);
/**
* Returns the libavutil license.
* Return the libavutil license.
*/
const char *avutil_license(void);
@@ -78,6 +92,37 @@ enum AVMediaType {
AVMEDIA_TYPE_NB
};
#define FF_LAMBDA_SHIFT 7
#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
#define FF_LAMBDA_MAX (256*128-1)
#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
#define AV_TIME_BASE 1000000
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
enum AVPictureType {
AV_PICTURE_TYPE_NONE = 0, ///< Undefined
AV_PICTURE_TYPE_I, ///< Intra
AV_PICTURE_TYPE_P, ///< Predicted
AV_PICTURE_TYPE_B, ///< Bi-dir predicted
AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4
AV_PICTURE_TYPE_SI, ///< Switching Intra
AV_PICTURE_TYPE_SP, ///< Switching Predicted
AV_PICTURE_TYPE_BI, ///< BI type
};
/**
* Return a single letter to describe the given picture type
* pict_type.
*
* @param[in] pict_type the picture type @return a single character
* representing the picture type, '?' if pict_type is unknown
*/
char av_get_picture_type_char(enum AVPictureType pict_type);
#include "common.h"
#include "error.h"
#include "mathematics.h"
+19 -14
View File
@@ -21,29 +21,34 @@
#ifndef AVUTIL_BASE64_H
#define AVUTIL_BASE64_H
#include <msc_stdint.h>
#include <stdint.h>
/**
* Decodes the base64-encoded string in in and puts the decoded
* data in out.
* Decode a base64-encoded string.
*
* @param out_size size in bytes of the out buffer, it should be at
* least 3/4 of the length of in
* @return the number of bytes written, or a negative value in case of
* error
* @param out buffer for decoded data
* @param in null-terminated input string
* @param out_size size in bytes of the out buffer, must be at
* least 3/4 of the length of in
* @return number of bytes written, or a negative value in case of
* invalid input
*/
int av_base64_decode(uint8_t *out, const char *in, int out_size);
/**
* Encodes in base64 the data in in and puts the resulting string
* in out.
* Encode data to base64 and null-terminate.
*
* @param out_size size in bytes of the out string, it should be at
* least ((in_size + 2) / 3) * 4 + 1
* @param in_size size in bytes of the in buffer
* @return the string containing the encoded data, or NULL in case of
* error
* @param out buffer for encoded data
* @param out_size size in bytes of the output buffer, must be at
* least AV_BASE64_SIZE(in_size)
* @param in_size size in bytes of the 'in' buffer
* @return 'out' or NULL in case of error
*/
char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
/**
* Calculate the output size needed to base64-encode x bytes.
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
#endif /* AVUTIL_BASE64_H */
+124
View File
@@ -0,0 +1,124 @@
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* byte swapping routines
*/
#ifndef AVUTIL_BSWAP_H
#define AVUTIL_BSWAP_H
#include <stdint.h>
#include "libavutil/avconfig.h"
#include "attributes.h"
#ifdef HAVE_AV_CONFIG_H
#include "config.h"
#if ARCH_ARM
# include "arm/bswap.h"
#elif ARCH_AVR32
# include "avr32/bswap.h"
#elif ARCH_BFIN
# include "bfin/bswap.h"
#elif ARCH_SH4
# include "sh4/bswap.h"
#elif ARCH_X86
# include "x86/bswap.h"
#endif
#endif /* HAVE_AV_CONFIG_H */
#define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
#ifndef av_bswap16
static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
{
x= (x>>8) | (x<<8);
return x;
}
#endif
#ifndef av_bswap32
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
{
x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
x= (x>>16) | (x<<16);
return x;
}
#endif
#ifndef av_bswap64
static inline uint64_t av_const av_bswap64(uint64_t x)
{
#if 0
x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
return (x>>32) | (x<<32);
#else
union {
uint64_t ll;
uint32_t l[2];
} w, r;
w.ll = x;
r.l[0] = av_bswap32 (w.l[1]);
r.l[1] = av_bswap32 (w.l[0]);
return r.ll;
#endif
}
#endif
// be2ne ... big-endian to native-endian
// le2ne ... little-endian to native-endian
#if AV_HAVE_BIGENDIAN
#define av_be2ne16(x) (x)
#define av_be2ne32(x) (x)
#define av_be2ne64(x) (x)
#define av_le2ne16(x) av_bswap16(x)
#define av_le2ne32(x) av_bswap32(x)
#define av_le2ne64(x) av_bswap64(x)
#define AV_BE2NEC(s, x) (x)
#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
#else
#define av_be2ne16(x) av_bswap16(x)
#define av_be2ne32(x) av_bswap32(x)
#define av_be2ne64(x) av_bswap64(x)
#define av_le2ne16(x) (x)
#define av_le2ne32(x) (x)
#define av_le2ne64(x) (x)
#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
#define AV_LE2NEC(s, x) (x)
#endif
#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
#endif /* AVUTIL_BSWAP_H */
+128 -53
View File
@@ -28,22 +28,27 @@
#include <ctype.h>
#include <errno.h>
#ifdef _MSC_VER
#include <msc_inttypes.h>
#else
#include <inttypes.h>
#endif
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "attributes.h"
#include "libavutil/avconfig.h"
#if AV_HAVE_BIGENDIAN
# define AV_NE(be, le) (be)
#else
# define AV_NE(be, le) (le)
#endif
//rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
/* assume b>0 */
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
@@ -61,7 +66,7 @@ extern const uint8_t ff_log2_tab[256];
extern const uint8_t av_reverse[256];
static inline av_const int av_log2_c(unsigned int v)
static av_always_inline av_const int av_log2_c(unsigned int v)
{
int n = 0;
if (v & 0xffff0000) {
@@ -77,7 +82,7 @@ static inline av_const int av_log2_c(unsigned int v)
return n;
}
static inline av_const int av_log2_16bit_c(unsigned int v)
static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
{
int n = 0;
if (v & 0xff00) {
@@ -94,21 +99,17 @@ static inline av_const int av_log2_16bit_c(unsigned int v)
# include "intmath.h"
#endif
#ifndef av_log2
# define av_log2 av_log2_c
#endif
#ifndef av_log2_16bit
# define av_log2_16bit av_log2_16bit_c
#endif
/* Pull in unguarded fallback defines at the end of this file. */
#include "common.h"
/**
* Clips a signed integer value into the amin-amax range.
* Clip a signed integer value into the amin-amax range.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
* @return clipped value
*/
static inline av_const int av_clip(int a, int amin, int amax)
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
{
if (a < amin) return amin;
else if (a > amax) return amax;
@@ -116,87 +117,122 @@ static inline av_const int av_clip(int a, int amin, int amax)
}
/**
* Clips a signed integer value into the 0-255 range.
* Clip a signed integer value into the 0-255 range.
* @param a value to clip
* @return clipped value
*/
static inline av_const uint8_t av_clip_uint8(int a)
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
{
if (a&(~0xFF)) return (-a)>>31;
else return a;
}
/**
* Clips a signed integer value into the 0-65535 range.
* Clip a signed integer value into the -128,127 range.
* @param a value to clip
* @return clipped value
*/
static inline av_const uint16_t av_clip_uint16(int a)
static av_always_inline av_const int8_t av_clip_int8_c(int a)
{
if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
else return a;
}
/**
* Clip a signed integer value into the 0-65535 range.
* @param a value to clip
* @return clipped value
*/
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
{
if (a&(~0xFFFF)) return (-a)>>31;
else return a;
}
/**
* Clips a signed integer value into the -32768,32767 range.
* Clip a signed integer value into the -32768,32767 range.
* @param a value to clip
* @return clipped value
*/
static inline av_const int16_t av_clip_int16(int a)
static av_always_inline av_const int16_t av_clip_int16_c(int a)
{
if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
else return a;
}
/**
* Clips a signed 64-bit integer value into the -2147483648,2147483647 range.
* Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
* @param a value to clip
* @return clipped value
*/
static inline av_const int32_t av_clipl_int32(int64_t a)
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
{
if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
else return a;
}
/**
* Clips a float value into the amin-amax range.
* Clip a signed integer to an unsigned power of two range.
* @param a value to clip
* @param p bit position to clip at
* @return clipped value
*/
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
{
if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
else return a;
}
/**
* Clip a float value into the amin-amax range.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
* @return clipped value
*/
static inline av_const float av_clipf(float a, float amin, float amax)
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
{
if (a < amin) return amin;
else if (a > amax) return amax;
else return a;
}
/** Computes ceil(log2(x)).
/** Compute ceil(log2(x)).
* @param x value used to compute ceil(log2(x))
* @return computed ceiling of log2(x)
*/
static inline av_const int av_ceil_log2(int x)
static av_always_inline av_const int av_ceil_log2_c(int x)
{
return av_log2((x - 1) << 1);
}
#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
/**
* Count number of bits set to one in x
* @param x value to count bits of
* @return the number of bits set to one in x
*/
static av_always_inline av_const int av_popcount_c(uint32_t x)
{
x -= (x >> 1) & 0x55555555;
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0F0F0F0F;
x += x >> 8;
return (x + (x >> 16)) & 0x3F;
}
/*!
* \def GET_UTF8(val, GET_BYTE, ERROR)
* Converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
* \param val is the output and should be of type uint32_t. It holds the converted
* UCS-4 character and should be a left value.
* \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
* a function or a statement whose return value or evaluated value is of type
* uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
* and up to 7 times in the general case.
* \param ERROR action that should be taken when an invalid UTF-8 byte is returned
* from GET_BYTE. It should be a statement that jumps out of the macro,
* like exit(), goto, return, break, or continue.
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
/**
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
*
* @param val Output value, must be an lvalue of type uint32_t.
* @param GET_BYTE Expression reading one byte from the input.
* Evaluated up to 7 times (4 for the currently
* assigned Unicode range). With a memory buffer
* input, this could be *ptr++.
* @param ERROR Expression to be evaluated on invalid input,
* typically a goto statement.
*/
#define GET_UTF8(val, GET_BYTE, ERROR)\
val= GET_BYTE;\
@@ -213,17 +249,14 @@ static inline av_const int av_ceil_log2(int x)
}\
}
/*!
* \def GET_UTF16(val, GET_16BIT, ERROR)
* Converts a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form
* \param val is the output and should be of type uint32_t. It holds the converted
* UCS-4 character and should be a left value.
* \param GET_16BIT gets two bytes of UTF-16 encoded data converted to native endianness.
* It can be a function or a statement whose return value or evaluated value is of type
* uint16_t. It will be executed up to 2 times.
* \param ERROR action that should be taken when an invalid UTF-16 surrogate is
* returned from GET_BYTE. It should be a statement that jumps out of the macro,
* like exit(), goto, return, break, or continue.
/**
* Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
*
* @param val Output value, must be an lvalue of type uint32_t.
* @param GET_16BIT Expression returning two bytes of UTF-16 data converted
* to native byte order. Evaluated one or two times.
* @param ERROR Expression to be evaluated on invalid input,
* typically a goto statement.
*/
#define GET_UTF16(val, GET_16BIT, ERROR)\
val = GET_16BIT;\
@@ -239,7 +272,7 @@ static inline av_const int av_ceil_log2(int x)
/*!
* \def PUT_UTF8(val, tmp, PUT_BYTE)
* Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
* \param val is an input-only argument and should be of type uint32_t. It holds
* a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
* val is given as a function it is executed only once.
@@ -275,7 +308,7 @@ static inline av_const int av_ceil_log2(int x)
/*!
* \def PUT_UTF16(val, tmp, PUT_16BIT)
* Converts a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
* Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
* \param val is an input-only argument and should be of type uint32_t. It holds
* a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
* val is given as a function it is executed only once.
@@ -310,3 +343,45 @@ static inline av_const int av_ceil_log2(int x)
#endif /* HAVE_AV_CONFIG_H */
#endif /* AVUTIL_COMMON_H */
/*
* The following definitions are outside the multiple inclusion guard
* to ensure they are immediately available in intmath.h.
*/
#ifndef av_log2
# define av_log2 av_log2_c
#endif
#ifndef av_log2_16bit
# define av_log2_16bit av_log2_16bit_c
#endif
#ifndef av_ceil_log2
# define av_ceil_log2 av_ceil_log2_c
#endif
#ifndef av_clip
# define av_clip av_clip_c
#endif
#ifndef av_clip_uint8
# define av_clip_uint8 av_clip_uint8_c
#endif
#ifndef av_clip_int8
# define av_clip_int8 av_clip_int8_c
#endif
#ifndef av_clip_uint16
# define av_clip_uint16 av_clip_uint16_c
#endif
#ifndef av_clip_int16
# define av_clip_int16 av_clip_int16_c
#endif
#ifndef av_clipl_int32
# define av_clipl_int32 av_clipl_int32_c
#endif
#ifndef av_clip_uintp2
# define av_clip_uintp2 av_clip_uintp2_c
#endif
#ifndef av_clipf
# define av_clipf av_clipf_c
#endif
#ifndef av_popcount
# define av_popcount av_popcount_c
#endif
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2000, 2001, 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_CPU_H
#define AVUTIL_CPU_H
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
/* lower 16 bits - CPU features */
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW
#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions
#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions
#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt
#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
#define AV_CPU_FLAG_IWMMXT 0x0100 ///< XScale IWMMXT
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
/**
* Return the flags which specify extensions supported by the CPU.
*/
int av_get_cpu_flags(void);
/**
* Disables cpu detection and forces the specified flags.
*/
void av_force_cpu_flags(int flags);
/* The following CPU-specific functions shall not be called directly. */
int ff_get_cpu_flags_arm(void);
int ff_get_cpu_flags_ppc(void);
int ff_get_cpu_flags_x86(void);
#endif /* AVUTIL_CPU_H */
+1 -1
View File
@@ -21,7 +21,7 @@
#ifndef AVUTIL_CRC_H
#define AVUTIL_CRC_H
#include <msc_stdint.h>
#include <stdint.h>
#include <stddef.h>
#include "attributes.h"
+81
View File
@@ -0,0 +1,81 @@
/*
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Public dictionary API.
*/
#ifndef AVUTIL_DICT_H
#define AVUTIL_DICT_H
#define AV_DICT_MATCH_CASE 1
#define AV_DICT_IGNORE_SUFFIX 2
#define AV_DICT_DONT_STRDUP_KEY 4
#define AV_DICT_DONT_STRDUP_VAL 8
#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no
delimiter is added, the strings are simply concatenated. */
typedef struct {
char *key;
char *value;
} AVDictionaryEntry;
typedef struct AVDictionary AVDictionary;
/**
* Get a dictionary entry with matching key.
*
* @param prev Set to the previous matching element to find the next.
* If set to NULL the first matching element is returned.
* @param flags Allows case as well as suffix-insensitive comparisons.
* @return Found entry or NULL, changing key or value leads to undefined behavior.
*/
AVDictionaryEntry *
av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
/**
* Set the given entry in *pm, overwriting an existing entry.
*
* @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
* a dictionary struct is allocated and put in *pm.
* @param key entry key to add to *pm (will be av_strduped depending on flags)
* @param value entry value to add to *pm (will be av_strduped depending on flags).
* Passing a NULL value will cause an existing tag to be deleted.
* @return >= 0 on success otherwise an error code <0
*/
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
/**
* Copy entries from one AVDictionary struct into another.
* @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
* this function will allocate a struct for you and put it in *dst
* @param src pointer to source AVDictionary struct
* @param flags flags to use when setting entries in *dst
* @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
*/
void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
/**
* Free all the memory allocated for an AVDictionary struct.
*/
void av_dict_free(AVDictionary **m);
#endif // AVUTIL_DICT_H
+16 -20
View File
@@ -37,32 +37,28 @@
#define AVUNERROR(e) (e)
#endif
#if LIBAVUTIL_VERSION_MAJOR < 51
#define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input
#define AVERROR_IO AVERROR(EIO) ///< I/O error
#define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory
#define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format
#define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory
#define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported
#define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename
#define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error
#endif
#define AVERROR_EOF AVERROR(EPIPE) ///< End of file
#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
#if LIBAVUTIL_VERSION_MAJOR > 50
#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
#define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
#endif
#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found
#define AVERROR_EOF (-MKTAG( 'E','O','F',' ')) ///< End of file
#define AVERROR_EXIT (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found
#define AVERROR_INVALIDDATA (-MKTAG( 'I','N','D','A')) ///< Invalid data found when processing input
#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
#define AVERROR_OPTION_NOT_FOUND (-MKTAG(0xF8,'O','P','T')) ///< Option not found
#define AVERROR_PATCHWELCOME (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
/**
* Puts a description of the AVERROR code errnum in errbuf.
* Put a description of the AVERROR code errnum in errbuf.
* In case of failure the global variable errno is set to indicate the
* error. Even in case of failure av_strerror() will print a generic
* error message indicating the errnum provided to errbuf.
*
* @param errnum error code to describe
* @param errbuf buffer to which description is written
* @param errbuf_size the size in bytes of errbuf
* @return 0 on success, a negative value if a description for errnum
* cannot be found
+146
View File
@@ -0,0 +1,146 @@
/*
* Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* simple arithmetic expression evaluator
*/
#ifndef AVUTIL_EVAL_H
#define AVUTIL_EVAL_H
#include "avutil.h"
typedef struct AVExpr AVExpr;
/**
* Parse and evaluate an expression.
* Note, this is significantly slower than av_expr_eval().
*
* @param res a pointer to a double where is put the result value of
* the expression, or NAN in case of error
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
* @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
* @param const_values a zero terminated array of values for the identifiers from const_names
* @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
* @param log_ctx parent logging context
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code otherwise
*/
int av_expr_parse_and_eval(double *res, const char *s,
const char * const *const_names, const double *const_values,
const char * const *func1_names, double (* const *funcs1)(void *, double),
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
void *opaque, int log_offset, void *log_ctx);
/**
* Parse an expression.
*
* @param expr a pointer where is put an AVExpr containing the parsed
* value in case of successfull parsing, or NULL otherwise.
* The pointed to AVExpr must be freed with av_expr_free() by the user
* when it is not needed anymore.
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
* @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
* @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
* @param log_ctx parent logging context
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code otherwise
*/
int av_expr_parse(AVExpr **expr, const char *s,
const char * const *const_names,
const char * const *func1_names, double (* const *funcs1)(void *, double),
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
int log_offset, void *log_ctx);
/**
* Evaluate a previously parsed expression.
*
* @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
* @return the value of the expression
*/
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
/**
* Free a parsed expression previously created with av_expr_parse().
*/
void av_expr_free(AVExpr *e);
#if FF_API_OLD_EVAL_NAMES
/**
* @deprecated Deprecated in favor of av_expr_parse_and_eval().
*/
attribute_deprecated
int av_parse_and_eval_expr(double *res, const char *s,
const char * const *const_names, const double *const_values,
const char * const *func1_names, double (* const *funcs1)(void *, double),
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
void *opaque, int log_offset, void *log_ctx);
/**
* @deprecated Deprecated in favor of av_expr_parse().
*/
attribute_deprecated
int av_parse_expr(AVExpr **expr, const char *s,
const char * const *const_names,
const char * const *func1_names, double (* const *funcs1)(void *, double),
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
int log_offset, void *log_ctx);
/**
* @deprecated Deprecated in favor of av_expr_eval().
*/
attribute_deprecated
double av_eval_expr(AVExpr *e, const double *const_values, void *opaque);
/**
* @deprecated Deprecated in favor of av_expr_free().
*/
attribute_deprecated
void av_free_expr(AVExpr *e);
#endif /* FF_API_OLD_EVAL_NAMES */
/**
* Parse the string in numstr and return its value as a double. If
* the string is empty, contains only whitespaces, or does not contain
* an initial substring that has the expected syntax for a
* floating-point number, no conversion is performed. In this case,
* returns a value of zero and the value returned in tail is the value
* of numstr.
*
* @param numstr a string representing a number, may contain one of
* the International System number postfixes, for example 'K', 'M',
* 'G'. If 'i' is appended after the postfix, powers of 2 are used
* instead of powers of 10. The 'B' postfix multiplies the value for
* 8, and can be appended after another postfix or used alone. This
* allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
* @param tail if non-NULL puts here the pointer to the char next
* after the last parsed character
*/
double av_strtod(const char *numstr, char **tail);
#endif /* AVUTIL_EVAL_H */
+10 -10
View File
@@ -24,7 +24,7 @@
#ifndef AVUTIL_FIFO_H
#define AVUTIL_FIFO_H
#include <msc_stdint.h>
#include <stdint.h>
typedef struct AVFifoBuffer {
uint8_t *buffer;
@@ -33,26 +33,26 @@ typedef struct AVFifoBuffer {
} AVFifoBuffer;
/**
* Initializes an AVFifoBuffer.
* Initialize an AVFifoBuffer.
* @param size of FIFO
* @return AVFifoBuffer or NULL in case of memory allocation failure
*/
AVFifoBuffer *av_fifo_alloc(unsigned int size);
/**
* Frees an AVFifoBuffer.
* Free an AVFifoBuffer.
* @param *f AVFifoBuffer to free
*/
void av_fifo_free(AVFifoBuffer *f);
/**
* Resets the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
* Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
* @param *f AVFifoBuffer to reset
*/
void av_fifo_reset(AVFifoBuffer *f);
/**
* Returns the amount of data in bytes in the AVFifoBuffer, that is the
* Return the amount of data in bytes in the AVFifoBuffer, that is the
* amount of data you can read from it.
* @param *f AVFifoBuffer to read from
* @return size
@@ -60,7 +60,7 @@ void av_fifo_reset(AVFifoBuffer *f);
int av_fifo_size(AVFifoBuffer *f);
/**
* Returns the amount of space in bytes in the AVFifoBuffer, that is the
* Return the amount of space in bytes in the AVFifoBuffer, that is the
* amount of data you can write into it.
* @param *f AVFifoBuffer to write into
* @return size
@@ -68,7 +68,7 @@ int av_fifo_size(AVFifoBuffer *f);
int av_fifo_space(AVFifoBuffer *f);
/**
* Feeds data from an AVFifoBuffer to a user-supplied callback.
* Feed data from an AVFifoBuffer to a user-supplied callback.
* @param *f AVFifoBuffer to read from
* @param buf_size number of bytes to read
* @param *func generic read function
@@ -77,7 +77,7 @@ int av_fifo_space(AVFifoBuffer *f);
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
/**
* Feeds data from a user-supplied callback to an AVFifoBuffer.
* Feed data from a user-supplied callback to an AVFifoBuffer.
* @param *f AVFifoBuffer to write to
* @param *src data source; non-const since it may be used as a
* modifiable context by the function defined in func
@@ -92,7 +92,7 @@ int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
/**
* Resizes an AVFifoBuffer.
* Resize an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
* @return <0 for failure, >=0 otherwise
@@ -100,7 +100,7 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
/**
* Reads and discards the specified amount of data from an AVFifoBuffer.
* Read and discard the specified amount of data from an AVFifoBuffer.
* @param *f AVFifoBuffer to read from
* @param size amount of data to read in bytes
*/
+52
View File
@@ -0,0 +1,52 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_FILE_H
#define AVUTIL_FILE_H
#include "avutil.h"
/**
* @file
* Misc file utilities.
*/
/**
* Read the file with name filename, and put its content in a newly
* allocated buffer or map it with mmap() when available.
* In case of success set *bufptr to the read or mmapped buffer, and
* *size to the size in bytes of the buffer in *bufptr.
* The returned buffer must be released with av_file_unmap().
*
* @param log_offset loglevel offset used for logging
* @param log_ctx context used for logging
* @return a non negative number in case of success, a negative value
* corresponding to an AVERROR error code in case of failure
*/
int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
int log_offset, void *log_ctx);
/**
* Unmap or free the buffer bufptr created by av_file_map().
*
* @param size size in bytes of bufptr, must be the same as returned
* by av_file_map()
*/
void av_file_unmap(uint8_t *bufptr, size_t size);
#endif /* AVUTIL_FILE_H */
+130
View File
@@ -0,0 +1,130 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_IMGUTILS_H
#define AVUTIL_IMGUTILS_H
/**
* @file
* misc image utilities
*/
#include "avutil.h"
#include "pixdesc.h"
/**
* Compute the max pixel step for each plane of an image with a
* format described by pixdesc.
*
* The pixel step is the distance in bytes between the first byte of
* the group of bytes which describe a pixel component and the first
* byte of the successive group in the same plane for the same
* component.
*
* @param max_pixsteps an array which is filled with the max pixel step
* for each plane. Since a plane may contain different pixel
* components, the computed max_pixsteps[plane] is relative to the
* component in the plane with the max pixel step.
* @param max_pixstep_comps an array which is filled with the component
* for each plane which has the max pixel step. May be NULL.
*/
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
const AVPixFmtDescriptor *pixdesc);
/**
* Compute the size of an image line with format pix_fmt and width
* width for the plane plane.
*
* @return the computed size in bytes
*/
int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane);
/**
* Fill plane linesizes for an image with pixel format pix_fmt and
* width width.
*
* @param linesizes array to be filled with the linesize for each plane
* @return >= 0 in case of success, a negative error code otherwise
*/
int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width);
/**
* Fill plane data pointers for an image with pixel format pix_fmt and
* height height.
*
* @param data pointers array to be filled with the pointer for each image plane
* @param ptr the pointer to a buffer which will contain the image
* @param linesizes the array containing the linesize for each
* plane, should be filled by av_image_fill_linesizes()
* @return the size in bytes required for the image buffer, a negative
* error code in case of failure
*/
int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
uint8_t *ptr, const int linesizes[4]);
/**
* Allocate an image with size w and h and pixel format pix_fmt, and
* fill pointers and linesizes accordingly.
* The allocated image buffer has to be freed by using
* av_freep(&pointers[0]).
*
* @param align the value to use for buffer size alignment
* @return the size in bytes required for the image buffer, a negative
* error code in case of failure
*/
int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
int w, int h, enum PixelFormat pix_fmt, int align);
/**
* Copy image plane from src to dst.
* That is, copy "height" number of lines of "bytewidth" bytes each.
* The first byte of each successive line is separated by *_linesize
* bytes.
*
* @param dst_linesize linesize for the image plane in dst
* @param src_linesize linesize for the image plane in src
*/
void av_image_copy_plane(uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize,
int bytewidth, int height);
/**
* Copy image in src_data to dst_data.
*
* @param dst_linesize linesizes for the image in dst_data
* @param src_linesize linesizes for the image in src_data
*/
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
const uint8_t *src_data[4], const int src_linesizes[4],
enum PixelFormat pix_fmt, int width, int height);
/**
* Check if the given dimension of an image is valid, meaning that all
* bytes of the image can be addressed with a signed int.
*
* @param w the width of the picture
* @param h the height of the picture
* @param log_offset the offset to sum to the log level for logging with log_ctx
* @param log_ctx the parent logging context, it may be NULL
* @return >= 0 if valid, a negative error code otherwise
*/
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);
#endif /* AVUTIL_IMGUTILS_H */
+1 -1
View File
@@ -21,7 +21,7 @@
#ifndef AVUTIL_INTFLOAT_READWRITE_H
#define AVUTIL_INTFLOAT_READWRITE_H
#include <msc_stdint.h>
#include <stdint.h>
#include "attributes.h"
/* IEEE 80 bits extended float */
+522
View File
@@ -0,0 +1,522 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_INTREADWRITE_H
#define AVUTIL_INTREADWRITE_H
#include <stdint.h>
#include "libavutil/avconfig.h"
#include "attributes.h"
#include "bswap.h"
typedef union {
uint64_t u64;
uint32_t u32[2];
uint16_t u16[4];
uint8_t u8 [8];
double f64;
float f32[2];
} av_alias av_alias64;
typedef union {
uint32_t u32;
uint16_t u16[2];
uint8_t u8 [4];
float f32;
} av_alias av_alias32;
typedef union {
uint16_t u16;
uint8_t u8 [2];
} av_alias av_alias16;
/*
* Arch-specific headers can provide any combination of
* AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
* Preprocessor symbols must be defined, even if these are implemented
* as inline functions.
*/
#ifdef HAVE_AV_CONFIG_H
#include "config.h"
#if ARCH_ARM
# include "arm/intreadwrite.h"
#elif ARCH_AVR32
# include "avr32/intreadwrite.h"
#elif ARCH_MIPS
# include "mips/intreadwrite.h"
#elif ARCH_PPC
# include "ppc/intreadwrite.h"
#elif ARCH_TOMI
# include "tomi/intreadwrite.h"
#elif ARCH_X86
# include "x86/intreadwrite.h"
#endif
#endif /* HAVE_AV_CONFIG_H */
/*
* Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
*/
#if AV_HAVE_BIGENDIAN
# if defined(AV_RN16) && !defined(AV_RB16)
# define AV_RB16(p) AV_RN16(p)
# elif !defined(AV_RN16) && defined(AV_RB16)
# define AV_RN16(p) AV_RB16(p)
# endif
# if defined(AV_WN16) && !defined(AV_WB16)
# define AV_WB16(p, v) AV_WN16(p, v)
# elif !defined(AV_WN16) && defined(AV_WB16)
# define AV_WN16(p, v) AV_WB16(p, v)
# endif
# if defined(AV_RN24) && !defined(AV_RB24)
# define AV_RB24(p) AV_RN24(p)
# elif !defined(AV_RN24) && defined(AV_RB24)
# define AV_RN24(p) AV_RB24(p)
# endif
# if defined(AV_WN24) && !defined(AV_WB24)
# define AV_WB24(p, v) AV_WN24(p, v)
# elif !defined(AV_WN24) && defined(AV_WB24)
# define AV_WN24(p, v) AV_WB24(p, v)
# endif
# if defined(AV_RN32) && !defined(AV_RB32)
# define AV_RB32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RB32)
# define AV_RN32(p) AV_RB32(p)
# endif
# if defined(AV_WN32) && !defined(AV_WB32)
# define AV_WB32(p, v) AV_WN32(p, v)
# elif !defined(AV_WN32) && defined(AV_WB32)
# define AV_WN32(p, v) AV_WB32(p, v)
# endif
# if defined(AV_RN64) && !defined(AV_RB64)
# define AV_RB64(p) AV_RN64(p)
# elif !defined(AV_RN64) && defined(AV_RB64)
# define AV_RN64(p) AV_RB64(p)
# endif
# if defined(AV_WN64) && !defined(AV_WB64)
# define AV_WB64(p, v) AV_WN64(p, v)
# elif !defined(AV_WN64) && defined(AV_WB64)
# define AV_WN64(p, v) AV_WB64(p, v)
# endif
#else /* AV_HAVE_BIGENDIAN */
# if defined(AV_RN16) && !defined(AV_RL16)
# define AV_RL16(p) AV_RN16(p)
# elif !defined(AV_RN16) && defined(AV_RL16)
# define AV_RN16(p) AV_RL16(p)
# endif
# if defined(AV_WN16) && !defined(AV_WL16)
# define AV_WL16(p, v) AV_WN16(p, v)
# elif !defined(AV_WN16) && defined(AV_WL16)
# define AV_WN16(p, v) AV_WL16(p, v)
# endif
# if defined(AV_RN24) && !defined(AV_RL24)
# define AV_RL24(p) AV_RN24(p)
# elif !defined(AV_RN24) && defined(AV_RL24)
# define AV_RN24(p) AV_RL24(p)
# endif
# if defined(AV_WN24) && !defined(AV_WL24)
# define AV_WL24(p, v) AV_WN24(p, v)
# elif !defined(AV_WN24) && defined(AV_WL24)
# define AV_WN24(p, v) AV_WL24(p, v)
# endif
# if defined(AV_RN32) && !defined(AV_RL32)
# define AV_RL32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RL32)
# define AV_RN32(p) AV_RL32(p)
# endif
# if defined(AV_WN32) && !defined(AV_WL32)
# define AV_WL32(p, v) AV_WN32(p, v)
# elif !defined(AV_WN32) && defined(AV_WL32)
# define AV_WN32(p, v) AV_WL32(p, v)
# endif
# if defined(AV_RN64) && !defined(AV_RL64)
# define AV_RL64(p) AV_RN64(p)
# elif !defined(AV_RN64) && defined(AV_RL64)
# define AV_RN64(p) AV_RL64(p)
# endif
# if defined(AV_WN64) && !defined(AV_WL64)
# define AV_WL64(p, v) AV_WN64(p, v)
# elif !defined(AV_WN64) && defined(AV_WL64)
# define AV_WN64(p, v) AV_WL64(p, v)
# endif
#endif /* !AV_HAVE_BIGENDIAN */
/*
* Define AV_[RW]N helper macros to simplify definitions not provided
* by per-arch headers.
*/
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
#elif defined(__DECC)
# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
#elif AV_HAVE_FAST_UNALIGNED
# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
# define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
#else
#ifndef AV_RB16
# define AV_RB16(x) \
((((const uint8_t*)(x))[0] << 8) | \
((const uint8_t*)(x))[1])
#endif
#ifndef AV_WB16
# define AV_WB16(p, d) do { \
((uint8_t*)(p))[1] = (d); \
((uint8_t*)(p))[0] = (d)>>8; \
} while(0)
#endif
#ifndef AV_RL16
# define AV_RL16(x) \
((((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL16
# define AV_WL16(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
} while(0)
#endif
#ifndef AV_RB32
# define AV_RB32(x) \
(((uint32_t)((const uint8_t*)(x))[0] << 24) | \
(((const uint8_t*)(x))[1] << 16) | \
(((const uint8_t*)(x))[2] << 8) | \
((const uint8_t*)(x))[3])
#endif
#ifndef AV_WB32
# define AV_WB32(p, d) do { \
((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>16; \
((uint8_t*)(p))[0] = (d)>>24; \
} while(0)
#endif
#ifndef AV_RL32
# define AV_RL32(x) \
(((uint32_t)((const uint8_t*)(x))[3] << 24) | \
(((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL32
# define AV_WL32(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
((uint8_t*)(p))[3] = (d)>>24; \
} while(0)
#endif
#ifndef AV_RB64
# define AV_RB64(x) \
(((uint64_t)((const uint8_t*)(x))[0] << 56) | \
((uint64_t)((const uint8_t*)(x))[1] << 48) | \
((uint64_t)((const uint8_t*)(x))[2] << 40) | \
((uint64_t)((const uint8_t*)(x))[3] << 32) | \
((uint64_t)((const uint8_t*)(x))[4] << 24) | \
((uint64_t)((const uint8_t*)(x))[5] << 16) | \
((uint64_t)((const uint8_t*)(x))[6] << 8) | \
(uint64_t)((const uint8_t*)(x))[7])
#endif
#ifndef AV_WB64
# define AV_WB64(p, d) do { \
((uint8_t*)(p))[7] = (d); \
((uint8_t*)(p))[6] = (d)>>8; \
((uint8_t*)(p))[5] = (d)>>16; \
((uint8_t*)(p))[4] = (d)>>24; \
((uint8_t*)(p))[3] = (d)>>32; \
((uint8_t*)(p))[2] = (d)>>40; \
((uint8_t*)(p))[1] = (d)>>48; \
((uint8_t*)(p))[0] = (d)>>56; \
} while(0)
#endif
#ifndef AV_RL64
# define AV_RL64(x) \
(((uint64_t)((const uint8_t*)(x))[7] << 56) | \
((uint64_t)((const uint8_t*)(x))[6] << 48) | \
((uint64_t)((const uint8_t*)(x))[5] << 40) | \
((uint64_t)((const uint8_t*)(x))[4] << 32) | \
((uint64_t)((const uint8_t*)(x))[3] << 24) | \
((uint64_t)((const uint8_t*)(x))[2] << 16) | \
((uint64_t)((const uint8_t*)(x))[1] << 8) | \
(uint64_t)((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL64
# define AV_WL64(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
((uint8_t*)(p))[3] = (d)>>24; \
((uint8_t*)(p))[4] = (d)>>32; \
((uint8_t*)(p))[5] = (d)>>40; \
((uint8_t*)(p))[6] = (d)>>48; \
((uint8_t*)(p))[7] = (d)>>56; \
} while(0)
#endif
#if AV_HAVE_BIGENDIAN
# define AV_RN(s, p) AV_RB##s(p)
# define AV_WN(s, p, v) AV_WB##s(p, v)
#else
# define AV_RN(s, p) AV_RL##s(p)
# define AV_WN(s, p, v) AV_WL##s(p, v)
#endif
#endif /* HAVE_FAST_UNALIGNED */
#ifndef AV_RN16
# define AV_RN16(p) AV_RN(16, p)
#endif
#ifndef AV_RN32
# define AV_RN32(p) AV_RN(32, p)
#endif
#ifndef AV_RN64
# define AV_RN64(p) AV_RN(64, p)
#endif
#ifndef AV_WN16
# define AV_WN16(p, v) AV_WN(16, p, v)
#endif
#ifndef AV_WN32
# define AV_WN32(p, v) AV_WN(32, p, v)
#endif
#ifndef AV_WN64
# define AV_WN64(p, v) AV_WN(64, p, v)
#endif
#if AV_HAVE_BIGENDIAN
# define AV_RB(s, p) AV_RN##s(p)
# define AV_WB(s, p, v) AV_WN##s(p, v)
# define AV_RL(s, p) av_bswap##s(AV_RN##s(p))
# define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
#else
# define AV_RB(s, p) av_bswap##s(AV_RN##s(p))
# define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
# define AV_RL(s, p) AV_RN##s(p)
# define AV_WL(s, p, v) AV_WN##s(p, v)
#endif
#define AV_RB8(x) (((const uint8_t*)(x))[0])
#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
#define AV_RL8(x) AV_RB8(x)
#define AV_WL8(p, d) AV_WB8(p, d)
#ifndef AV_RB16
# define AV_RB16(p) AV_RB(16, p)
#endif
#ifndef AV_WB16
# define AV_WB16(p, v) AV_WB(16, p, v)
#endif
#ifndef AV_RL16
# define AV_RL16(p) AV_RL(16, p)
#endif
#ifndef AV_WL16
# define AV_WL16(p, v) AV_WL(16, p, v)
#endif
#ifndef AV_RB32
# define AV_RB32(p) AV_RB(32, p)
#endif
#ifndef AV_WB32
# define AV_WB32(p, v) AV_WB(32, p, v)
#endif
#ifndef AV_RL32
# define AV_RL32(p) AV_RL(32, p)
#endif
#ifndef AV_WL32
# define AV_WL32(p, v) AV_WL(32, p, v)
#endif
#ifndef AV_RB64
# define AV_RB64(p) AV_RB(64, p)
#endif
#ifndef AV_WB64
# define AV_WB64(p, v) AV_WB(64, p, v)
#endif
#ifndef AV_RL64
# define AV_RL64(p) AV_RL(64, p)
#endif
#ifndef AV_WL64
# define AV_WL64(p, v) AV_WL(64, p, v)
#endif
#ifndef AV_RB24
# define AV_RB24(x) \
((((const uint8_t*)(x))[0] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[2])
#endif
#ifndef AV_WB24
# define AV_WB24(p, d) do { \
((uint8_t*)(p))[2] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[0] = (d)>>16; \
} while(0)
#endif
#ifndef AV_RL24
# define AV_RL24(x) \
((((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL24
# define AV_WL24(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
} while(0)
#endif
/*
* The AV_[RW]NA macros access naturally aligned data
* in a type-safe way.
*/
#define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s)
#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
#ifndef AV_RN16A
# define AV_RN16A(p) AV_RNA(16, p)
#endif
#ifndef AV_RN32A
# define AV_RN32A(p) AV_RNA(32, p)
#endif
#ifndef AV_RN64A
# define AV_RN64A(p) AV_RNA(64, p)
#endif
#ifndef AV_WN16A
# define AV_WN16A(p, v) AV_WNA(16, p, v)
#endif
#ifndef AV_WN32A
# define AV_WN32A(p, v) AV_WNA(32, p, v)
#endif
#ifndef AV_WN64A
# define AV_WN64A(p, v) AV_WNA(64, p, v)
#endif
/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
* naturally aligned. They may be implemented using MMX,
* so emms_c() must be called before using any float code
* afterwards.
*/
#define AV_COPY(n, d, s) \
(((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
#ifndef AV_COPY16
# define AV_COPY16(d, s) AV_COPY(16, d, s)
#endif
#ifndef AV_COPY32
# define AV_COPY32(d, s) AV_COPY(32, d, s)
#endif
#ifndef AV_COPY64
# define AV_COPY64(d, s) AV_COPY(64, d, s)
#endif
#ifndef AV_COPY128
# define AV_COPY128(d, s) \
do { \
AV_COPY64(d, s); \
AV_COPY64((char*)(d)+8, (char*)(s)+8); \
} while(0)
#endif
#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
#ifndef AV_SWAP64
# define AV_SWAP64(a, b) AV_SWAP(64, a, b)
#endif
#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
#ifndef AV_ZERO16
# define AV_ZERO16(d) AV_ZERO(16, d)
#endif
#ifndef AV_ZERO32
# define AV_ZERO32(d) AV_ZERO(32, d)
#endif
#ifndef AV_ZERO64
# define AV_ZERO64(d) AV_ZERO(64, d)
#endif
#ifndef AV_ZERO128
# define AV_ZERO128(d) \
do { \
AV_ZERO64(d); \
AV_ZERO64((char*)(d)+8); \
} while(0)
#endif
#endif /* AVUTIL_INTREADWRITE_H */
+62
View File
@@ -0,0 +1,62 @@
/*
* Lagged Fibonacci PRNG
* Copyright (c) 2008 Michael Niedermayer
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_LFG_H
#define AVUTIL_LFG_H
typedef struct {
unsigned int state[64];
int index;
} AVLFG;
void av_lfg_init(AVLFG *c, unsigned int seed);
/**
* Get the next random unsigned 32-bit number using an ALFG.
*
* Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case.
*/
static inline unsigned int av_lfg_get(AVLFG *c){
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
return c->state[c->index++ & 63];
}
/**
* Get the next random unsigned 32-bit number using a MLFG.
*
* Please also consider av_lfg_get() above, it is faster.
*/
static inline unsigned int av_mlfg_get(AVLFG *c){
unsigned int a= c->state[(c->index-55) & 63];
unsigned int b= c->state[(c->index-24) & 63];
return c->state[c->index++ & 63] = 2*a*b+a+b;
}
/**
* Get the next two numbers generated by a Box-Muller Gaussian
* generator using the random numbers issued by lfg.
*
* @param out array where the two generated numbers are placed
*/
void av_bmg_get(AVLFG *lfg, double out[2]);
#endif /* AVUTIL_LFG_H */
+49 -5
View File
@@ -25,7 +25,7 @@
#include "avutil.h"
/**
* Describes the class of an AVClass context structure. That is an
* Describe the class of an AVClass context structure. That is an
* arbitrary struct of which the first field is a pointer to an
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
*/
@@ -56,6 +56,27 @@ typedef struct {
*/
int version;
/**
* Offset in the structure where log_level_offset is stored.
* 0 means there is no such variable
*/
int log_level_offset_offset;
/**
* Offset in the structure where a pointer to the parent context for loging is stored.
* for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
* parent context. And a av_log() implementation could then display the parent context
* can be NULL of course
*/
int parent_log_context_offset;
/**
* A function for extended searching, e.g. in possible
* children objects.
*/
const struct AVOption* (*opt_find)(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags);
} AVClass;
/* av_log API */
@@ -95,7 +116,7 @@ typedef struct {
#define AV_LOG_DEBUG 48
/**
* Sends the specified message to the log if the level is less than or equal
* Send the specified message to the log if the level is less than or equal
* to the current av_log_level. By default, all logging messages are sent to
* stderr. This behavior can be altered by setting a different av_vlog callback
* function.
@@ -109,15 +130,38 @@ typedef struct {
* @see av_vlog
*/
#ifdef __GNUC__
void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
#else
void av_log(void*, int level, const char *fmt, ...);
void av_log(void *avcl, int level, const char *fmt, ...);
#endif
void av_vlog(void*, int level, const char *fmt, va_list);
void av_vlog(void *avcl, int level, const char *fmt, va_list);
int av_log_get_level(void);
void av_log_set_level(int);
void av_log_set_callback(void (*)(void*, int, const char*, va_list));
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
const char* av_default_item_name(void* ctx);
/**
* av_dlog macros
* Useful to print debug messages that shouldn't get compiled in normally.
*/
#ifdef DEBUG
# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
#else
# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
#endif
/**
* Skip repeated messages, this requires the user app to use av_log() instead of
* (f)printf as the 2 would otherwise interfere and lead to
* "Last message repeated x times" messages below (f)printf messages with some
* bad luck.
* Also to receive the last, "last repeated" line if any, the user app must
* call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end
*/
#define AV_LOG_SKIP_REPEATED 1
void av_log_set_flags(int arg);
#endif /* AVUTIL_LOG_H */
+2 -2
View File
@@ -22,9 +22,9 @@
#ifndef AVUTIL_LZO_H
#define AVUTIL_LZO_H
#include <msc_stdint.h>
#include <stdint.h>
/** \defgroup errflags Error flags returned by av_lzo1x_decode
/** @name Error flags returned by av_lzo1x_decode
* \{ */
//! end of the input buffer reached before decoding finished
#define AV_LZO_INPUT_DEPLETED 1
+20 -6
View File
@@ -21,7 +21,7 @@
#ifndef AVUTIL_MATHEMATICS_H
#define AVUTIL_MATHEMATICS_H
#include <msc_stdint.h>
#include <stdint.h>
#include <math.h>
#include "attributes.h"
#include "rational.h"
@@ -38,6 +38,9 @@
#ifndef M_LOG2_10
#define M_LOG2_10 3.32192809488736234787 /* log_2 10 */
#endif
#ifndef M_PHI
#define M_PHI 1.61803398874989484820 /* phi / golden ratio */
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
#endif
@@ -63,36 +66,47 @@ enum AVRounding {
};
/**
* Returns the greatest common divisor of a and b.
* Return the greatest common divisor of a and b.
* If both a and b are 0 or either or both are <0 then behavior is
* undefined.
*/
int64_t av_const av_gcd(int64_t a, int64_t b);
/**
* Rescales a 64-bit integer with rounding to nearest.
* Rescale a 64-bit integer with rounding to nearest.
* A simple a*b/c isn't possible as it can overflow.
*/
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
/**
* Rescales a 64-bit integer with specified rounding.
* Rescale a 64-bit integer with specified rounding.
* A simple a*b/c isn't possible as it can overflow.
*/
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
/**
* Rescales a 64-bit integer by 2 rational numbers.
* Rescale a 64-bit integer by 2 rational numbers.
*/
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
/**
* Compares 2 timestamps each in its own timebases.
* Compare 2 timestamps each in its own timebases.
* The result of the function is undefined if one of the timestamps
* is outside the int64_t range when represented in the others timebase.
* @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
*/
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
/**
* Compare 2 integers modulo mod.
* That is we compare integers a and b for which only the least
* significant log2(mod) bits are known.
*
* @param mod must be a power of 2
* @return a negative value if a is smaller than b
* a positive value if a is greater than b
* 0 if a equals b
*/
int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
#endif /* AVUTIL_MATHEMATICS_H */
+1 -1
View File
@@ -21,7 +21,7 @@
#ifndef AVUTIL_MD5_H
#define AVUTIL_MD5_H
#include <msc_stdint.h>
#include <stdint.h>
extern const int av_md5_size;
+25 -15
View File
@@ -27,8 +27,9 @@
#define AVUTIL_MEM_H
#include "attributes.h"
#include "avutil.h"
#if defined(__ICC) || defined(__SUNPRO_C)
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
#elif defined(__TI_COMPILER_VERSION__)
@@ -40,7 +41,7 @@
static const t __attribute__((aligned(n))) v
#elif defined(__GNUC__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t attribute_used __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
@@ -55,26 +56,26 @@
#define av_malloc_attrib
#endif
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
#if AV_GCC_VERSION_AT_LEAST(4,3)
#define av_alloc_size(n) __attribute__((alloc_size(n)))
#else
#define av_alloc_size(n)
#endif
/**
* Allocates a block of size bytes with alignment suitable for all
* Allocate a block of size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU).
* @param size Size in bytes for the memory block to be allocated.
* @return Pointer to the allocated block, NULL if the block cannot
* be allocated.
* @see av_mallocz()
*/
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
/**
* Allocates or reallocates a block of memory.
* If ptr is NULL and size > 0, allocates a new block. If
* size is zero, frees the memory block pointed to by ptr.
* Allocate or reallocate a block of memory.
* If ptr is NULL and size > 0, allocate a new block. If
* size is zero, free the memory block pointed to by ptr.
* @param size Size in bytes for the memory block to be allocated or
* reallocated.
* @param ptr Pointer to a memory block already allocated with
@@ -83,10 +84,10 @@ void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
* cannot be reallocated or the function is used to free the memory block.
* @see av_fast_realloc()
*/
void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
/**
* Frees a memory block which has been allocated with av_malloc(z)() or
* Free a memory block which has been allocated with av_malloc(z)() or
* av_realloc().
* @param ptr Pointer to the memory block which should be freed.
* @note ptr = NULL is explicitly allowed.
@@ -96,17 +97,17 @@ void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
void av_free(void *ptr);
/**
* Allocates a block of size bytes with alignment suitable for all
* Allocate a block of size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU) and
* zeroes all the bytes of the block.
* zero all the bytes of the block.
* @param size Size in bytes for the memory block to be allocated.
* @return Pointer to the allocated block, NULL if it cannot be allocated.
* @see av_malloc()
*/
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
/**
* Duplicates the string s.
* Duplicate the string s.
* @param s string to be duplicated
* @return Pointer to a newly allocated string containing a
* copy of s or NULL if the string cannot be allocated.
@@ -114,7 +115,7 @@ void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
char *av_strdup(const char *s) av_malloc_attrib;
/**
* Frees a memory block which has been allocated with av_malloc(z)() or
* Free a memory block which has been allocated with av_malloc(z)() or
* av_realloc() and set the pointer pointing to it to NULL.
* @param ptr Pointer to the pointer to the memory block which should
* be freed.
@@ -122,4 +123,13 @@ char *av_strdup(const char *s) av_malloc_attrib;
*/
void av_freep(void *ptr);
/**
* Add an element to a dynamic array.
*
* @param tab_ptr Pointer to the array.
* @param nb_ptr Pointer to the number of elements in the array.
* @param elem Element to be added.
*/
void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
#endif /* AVUTIL_MEM_H */
+243
View File
@@ -0,0 +1,243 @@
/*
* AVOptions
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_OPT_H
#define AVUTIL_OPT_H
/**
* @file
* AVOptions
*/
#include "rational.h"
#include "avutil.h"
#include "dict.h"
enum AVOptionType{
FF_OPT_TYPE_FLAGS,
FF_OPT_TYPE_INT,
FF_OPT_TYPE_INT64,
FF_OPT_TYPE_DOUBLE,
FF_OPT_TYPE_FLOAT,
FF_OPT_TYPE_STRING,
FF_OPT_TYPE_RATIONAL,
FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
FF_OPT_TYPE_CONST=128,
};
/**
* AVOption
*/
typedef struct AVOption {
const char *name;
/**
* short English help text
* @todo What about other languages?
*/
const char *help;
/**
* The offset relative to the context structure where the option
* value is stored. It should be 0 for named constants.
*/
int offset;
enum AVOptionType type;
/**
* the default value for scalar options
*/
union {
double dbl;
const char *str;
/* TODO those are unused now */
int64_t i64;
AVRational q;
} default_val;
double min; ///< minimum valid value for the option
double max; ///< maximum valid value for the option
int flags;
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
#define AV_OPT_FLAG_AUDIO_PARAM 8
#define AV_OPT_FLAG_VIDEO_PARAM 16
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
//FIXME think about enc-audio, ... style flags
/**
* The logical unit to which the option belongs. Non-constant
* options and corresponding named constants share the same
* unit. May be NULL.
*/
const char *unit;
} AVOption;
#if FF_API_FIND_OPT
/**
* Look for an option in obj. Look only for the options which
* have the flags set as specified in mask and flags (that is,
* for which it is the case that opt->flags & mask == flags).
*
* @param[in] obj a pointer to a struct whose first element is a
* pointer to an AVClass
* @param[in] name the name of the option to look for
* @param[in] unit the unit of the option to look for, or any if NULL
* @return a pointer to the option found, or NULL if no option
* has been found
*
* @deprecated use av_opt_find.
*/
attribute_deprecated
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
#endif
/**
* Set the field of obj with the given name to value.
*
* @param[in] obj A struct whose first element is a pointer to an
* AVClass.
* @param[in] name the name of the field to set
* @param[in] val The value to set. If the field is not of a string
* type, then the given string is parsed.
* SI postfixes and some named scalars are supported.
* If the field is of a numeric type, it has to be a numeric or named
* scalar. Behavior with more than one scalar and +- infix operators
* is undefined.
* If the field is of a flags type, it has to be a sequence of numeric
* scalars or named flags separated by '+' or '-'. Prefixing a flag
* with '+' causes it to be set without affecting the other flags;
* similarly, '-' unsets a flag.
* @param[out] o_out if non-NULL put here a pointer to the AVOption
* found
* @param alloc when 1 then the old value will be av_freed() and the
* new av_strduped()
* when 0 then no av_free() nor av_strdup() will be used
* @return 0 if the value has been set, or an AVERROR code in case of
* error:
* AVERROR(ENOENT) if no matching option exists
* AVERROR(ERANGE) if the value is out of range
* AVERROR(EINVAL) if the value is not valid
*/
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
const AVOption *av_set_double(void *obj, const char *name, double n);
const AVOption *av_set_q(void *obj, const char *name, AVRational n);
const AVOption *av_set_int(void *obj, const char *name, int64_t n);
double av_get_double(void *obj, const char *name, const AVOption **o_out);
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
const AVOption *av_next_option(void *obj, const AVOption *last);
/**
* Show the obj options.
*
* @param req_flags requested flags for the options to show. Show only the
* options for which it is opt->flags & req_flags.
* @param rej_flags rejected flags for the options to show. Show only the
* options for which it is !(opt->flags & req_flags).
* @param av_log_obj log context to use for showing the options
*/
int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
void av_opt_set_defaults(void *s);
void av_opt_set_defaults2(void *s, int mask, int flags);
/**
* Parse the key/value pairs list in opts. For each key/value pair
* found, stores the value in the field in ctx that is named like the
* key. ctx must be an AVClass context, storing is done using
* AVOptions.
*
* @param opts options string to parse, may be NULL
* @param key_val_sep a 0-terminated list of characters used to
* separate key from value
* @param pairs_sep a 0-terminated list of characters used to separate
* two pairs from each other
* @return the number of successfully set key/value pairs, or a negative
* value corresponding to an AVERROR code in case of error:
* AVERROR(EINVAL) if opts cannot be parsed,
* the error code issued by av_set_string3() if a key/value pair
* cannot be set
*/
int av_set_options_string(void *ctx, const char *opts,
const char *key_val_sep, const char *pairs_sep);
/**
* Free all string and binary options in obj.
*/
void av_opt_free(void *obj);
/**
* Check whether a particular flag is set in a flags field.
*
* @param field_name the name of the flag field option
* @param flag_name the name of the flag to check
* @return non-zero if the flag is set, zero if the flag isn't set,
* isn't of the right type, or the flags field doesn't exist.
*/
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
/*
* Set all the options from a given dictionary on an object.
*
* @param obj a struct whose first element is a pointer to AVClass
* @param options options to process. This dictionary will be freed and replaced
* by a new one containing all options not found in obj.
* Of course this new dictionary needs to be freed by caller
* with av_dict_free().
*
* @return 0 on success, a negative AVERROR if some option was found in obj,
* but could not be set.
*
* @see av_dict_copy()
*/
int av_opt_set_dict(void *obj, struct AVDictionary **options);
#define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the
given object first. */
/**
* Look for an option in an object. Consider only options which
* have all the specified flags set.
*
* @param[in] obj A pointer to a struct whose first element is a
* pointer to an AVClass.
* @param[in] name The name of the option to look for.
* @param[in] unit When searching for named constants, name of the unit
* it belongs to.
* @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
* @param search_flags A combination of AV_OPT_SEARCH_*.
*
* @return A pointer to the option found, or NULL if no option
* was found.
*
* @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable
* directly with av_set_string3(). Use special calls which take an options
* AVDictionary (e.g. avformat_open_input()) to set options found with this
* flag.
*/
const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags);
#endif /* AVUTIL_OPT_H */
+117
View File
@@ -0,0 +1,117 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_PARSEUTILS_H
#define AVUTIL_PARSEUTILS_H
#include "rational.h"
/**
* @file
* misc parsing utilities
*/
/**
* Parse str and put in width_ptr and height_ptr the detected values.
*
* @param[in,out] width_ptr pointer to the variable which will contain the detected
* width value
* @param[in,out] height_ptr pointer to the variable which will contain the detected
* height value
* @param[in] str the string to parse: it has to be a string in the format
* width x height or a valid video size abbreviation.
* @return >= 0 on success, a negative error code otherwise
*/
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
/**
* Parse str and store the detected values in *rate.
*
* @param[in,out] rate pointer to the AVRational which will contain the detected
* frame rate
* @param[in] str the string to parse: it has to be a string in the format
* rate_num / rate_den, a float number or a valid video rate abbreviation
* @return >= 0 on success, a negative error code otherwise
*/
int av_parse_video_rate(AVRational *rate, const char *str);
/**
* Put the RGBA values that correspond to color_string in rgba_color.
*
* @param color_string a string specifying a color. It can be the name of
* a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
* possibly followed by "@" and a string representing the alpha
* component.
* The alpha component may be a string composed by "0x" followed by an
* hexadecimal number or a decimal number between 0.0 and 1.0, which
* represents the opacity value (0x00/0.0 means completely transparent,
* 0xff/1.0 completely opaque).
* If the alpha component is not specified then 0xff is assumed.
* The string "random" will result in a random color.
* @param slen length of the initial part of color_string containing the
* color. It can be set to -1 if color_string is a null terminated string
* containing nothing else than the color.
* @return >= 0 in case of success, a negative value in case of
* failure (for example if color_string cannot be parsed).
*/
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
void *log_ctx);
/**
* Parses timestr and returns in *time a corresponding number of
* microseconds.
*
* @param timeval puts here the number of microseconds corresponding
* to the string in timestr. If the string represents a duration, it
* is the number of microseconds contained in the time interval. If
* the string is a date, is the number of microseconds since 1st of
* January, 1970 up to the time of the parsed date. If timestr cannot
* be successfully parsed, set *time to INT64_MIN.
* @param datestr a string representing a date or a duration.
* - If a date the syntax is:
* @code
* [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
* now
* @endcode
* If the value is "now" it takes the current time.
* Time is local time unless Z is appended, in which case it is
* interpreted as UTC.
* If the year-month-day part is not specified it takes the current
* year-month-day.
* - If a duration the syntax is:
* @code
* [-]HH[:MM[:SS[.m...]]]
* [-]S+[.m...]
* @endcode
* @param duration flag which tells how to interpret timestr, if not
* zero timestr is interpreted as a duration, otherwise as a date
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code otherwise
*/
int av_parse_time(int64_t *timeval, const char *timestr, int duration);
/**
* Attempt to find a specific tag in a URL.
*
* syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
* Return 1 if found.
*/
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
#endif /* AVUTIL_PARSEUTILS_H */
+31 -10
View File
@@ -23,6 +23,7 @@
#define AVUTIL_PIXDESC_H
#include <inttypes.h>
#include "pixfmt.h"
typedef struct AVComponentDescriptor{
uint16_t plane :2; ///< which of the 4 planes contains the component
@@ -93,11 +94,11 @@ typedef struct AVPixFmtDescriptor{
extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
/**
* Reads a line from an image, and writes the values of the
* Read a line from an image, and write the values of the
* pixel format component c to dst.
*
* @param data the array containing the pointers to the planes of the image
* @param linesizes the array containing the linesizes of the image
* @param linesize the array containing the linesizes of the image
* @param desc the pixel format descriptor for the image
* @param x the horizontal coordinate of the first pixel to read
* @param y the vertical coordinate of the first pixel to read
@@ -108,28 +109,28 @@ extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
* component c in data[1] to dst, rather than the palette indexes in
* data[0]. The behavior is undefined if the format is not paletted.
*/
void read_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
/**
* Writes the values from src to the pixel format component c of an
* Write the values from src to the pixel format component c of an
* image line.
*
* @param src array containing the values to write
* @param data the array containing the pointers to the planes of the
* image to write into. It is supposed to be zeroed.
* @param linesizes the array containing the linesizes of the image
* @param linesize the array containing the linesizes of the image
* @param desc the pixel format descriptor for the image
* @param x the horizontal coordinate of the first pixel to write
* @param y the vertical coordinate of the first pixel to write
* @param w the width of the line to write, that is the number of
* values to write to the image line
*/
void write_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
/**
* Returns the pixel format corresponding to name.
* Return the pixel format corresponding to name.
*
* If there is no pixel format with name name, then looks for a
* pixel format with the name corresponding to the native endian
@@ -142,7 +143,27 @@ void write_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
enum PixelFormat av_get_pix_fmt(const char *name);
/**
* Returns the number of bits per pixel used by the pixel format
* Return the short name for a pixel format, NULL in case pix_fmt is
* unknown.
*
* @see av_get_pix_fmt(), av_get_pix_fmt_string()
*/
const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
/**
* Print in buf the string corresponding to the pixel format with
* number pix_fmt, or an header if pix_fmt is negative.
*
* @param buf the buffer where to write the string
* @param buf_size the size of buf
* @param pix_fmt the number of the pixel format to print the
* corresponding info string, or a negative value to print the
* corresponding header.
*/
char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
/**
* Return the number of bits per pixel used by the pixel format
* described by pixdesc.
*
* The returned number of bits refers to the number of bits actually
+32 -7
View File
@@ -71,9 +71,9 @@ enum PixelFormat {
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
PIX_FMT_XVMC_MPEG2_IDCT,
PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@@ -95,7 +95,7 @@ enum PixelFormat {
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG)
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
@@ -128,14 +128,33 @@ enum PixelFormat {
PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately
//is better
PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};
#define PIX_FMT_Y400A PIX_FMT_GRAY8A
#if AV_HAVE_BIGENDIAN
# define PIX_FMT_NE(be, le) PIX_FMT_##be
#else
@@ -152,10 +171,16 @@ enum PixelFormat {
#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
#define PIX_FMT_RGB444 PIX_FMT_NE(RGB444BE, RGB444LE)
#define PIX_FMT_BGR48 PIX_FMT_NE(BGR48BE, BGR48LE)
#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
#define PIX_FMT_YUV420P9 PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
#define PIX_FMT_YUV444P9 PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
#define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
#define PIX_FMT_YUV444P10 PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
+31
View File
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_RANDOM_SEED_H
#define AVUTIL_RANDOM_SEED_H
#include <stdint.h>
/**
* Get a seed to use in conjunction with random functions.
*/
uint32_t av_get_random_seed(void);
#endif /* AVUTIL_RANDOM_SEED_H */
+19 -13
View File
@@ -28,7 +28,8 @@
#ifndef AVUTIL_RATIONAL_H
#define AVUTIL_RATIONAL_H
#include <msc_stdint.h>
#include <stdint.h>
#include <limits.h>
#include "attributes.h"
/**
@@ -40,20 +41,23 @@ typedef struct AVRational{
} AVRational;
/**
* Compares two rationals.
* Compare two rationals.
* @param a first rational
* @param b second rational
* @return 0 if a==b, 1 if a>b and -1 if a<b
* @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
* values is of the form 0/0
*/
static inline int av_cmp_q(AVRational a, AVRational b){
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
if(tmp) return (tmp>>63)|1;
else return 0;
if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
else if(b.den && a.den) return 0;
else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
else return INT_MIN;
}
/**
* Converts rational to double.
* Convert rational to double.
* @param a rational to convert
* @return (double) a
*/
@@ -62,7 +66,7 @@ static inline double av_q2d(AVRational a){
}
/**
* Reduces a fraction.
* Reduce a fraction.
* This is useful for framerate calculations.
* @param dst_num destination numerator
* @param dst_den destination denominator
@@ -74,7 +78,7 @@ static inline double av_q2d(AVRational a){
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
/**
* Multiplies two rationals.
* Multiply two rationals.
* @param b first rational
* @param c second rational
* @return b*c
@@ -82,7 +86,7 @@ int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
AVRational av_mul_q(AVRational b, AVRational c) av_const;
/**
* Divides one rational by another.
* Divide one rational by another.
* @param b first rational
* @param c second rational
* @return b/c
@@ -90,7 +94,7 @@ AVRational av_mul_q(AVRational b, AVRational c) av_const;
AVRational av_div_q(AVRational b, AVRational c) av_const;
/**
* Adds two rationals.
* Add two rationals.
* @param b first rational
* @param c second rational
* @return b+c
@@ -98,7 +102,7 @@ AVRational av_div_q(AVRational b, AVRational c) av_const;
AVRational av_add_q(AVRational b, AVRational c) av_const;
/**
* Subtracts one rational from another.
* Subtract one rational from another.
* @param b first rational
* @param c second rational
* @return b-c
@@ -106,7 +110,9 @@ AVRational av_add_q(AVRational b, AVRational c) av_const;
AVRational av_sub_q(AVRational b, AVRational c) av_const;
/**
* Converts a double precision floating point number to a rational.
* Convert a double precision floating point number to a rational.
* inf is expressed as {1,0} or {-1,0} depending on the sign.
*
* @param d double to convert
* @param max the maximum allowed numerator and denominator
* @return (AVRational) d
@@ -120,7 +126,7 @@ AVRational av_d2q(double d, int max) av_const;
int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
/**
* Finds the nearest value in q_list to q.
* Find the nearest value in q_list to q.
* @param q_list an array of rationals terminated by {0, 0}
* @return the index of the nearest value found in the array
*/
+125
View File
@@ -0,0 +1,125 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_SAMPLEFMT_H
#define AVUTIL_SAMPLEFMT_H
#include "avutil.h"
/**
* all in native-endian format
*/
enum AVSampleFormat {
AV_SAMPLE_FMT_NONE = -1,
AV_SAMPLE_FMT_U8, ///< unsigned 8 bits
AV_SAMPLE_FMT_S16, ///< signed 16 bits
AV_SAMPLE_FMT_S32, ///< signed 32 bits
AV_SAMPLE_FMT_FLT, ///< float
AV_SAMPLE_FMT_DBL, ///< double
AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
};
/**
* Return the name of sample_fmt, or NULL if sample_fmt is not
* recognized.
*/
const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
/**
* Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
* on error.
*/
enum AVSampleFormat av_get_sample_fmt(const char *name);
/**
* Generate a string corresponding to the sample format with
* sample_fmt, or a header if sample_fmt is negative.
*
* @param buf the buffer where to write the string
* @param buf_size the size of buf
* @param sample_fmt the number of the sample format to print the
* corresponding info string, or a negative value to print the
* corresponding header.
* @return the pointer to the filled buffer or NULL if sample_fmt is
* unknown or in case of other errors
*/
char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
#if FF_API_GET_BITS_PER_SAMPLE_FMT
/**
* @deprecated Use av_get_bytes_per_sample() instead.
*/
attribute_deprecated
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
#endif
/**
* Return number of bytes per sample.
*
* @param sample_fmt the sample format
* @return number of bytes per sample or zero if unknown for the given
* sample format
*/
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
/**
* Fill channel data pointers and linesizes for samples with sample
* format sample_fmt.
*
* The pointers array is filled with the pointers to the samples data:
* for planar, set the start point of each plane's data within the buffer,
* for packed, set the start point of the entire buffer only.
*
* The linesize array is filled with the aligned size of each samples
* plane, that is linesize[i] will contain the linesize of the plane i,
* and will be zero for all the unused planes. All linesize values are
* equal.
*
* @param pointers array to be filled with the pointer for each plane, may be NULL
* @param linesizes array to be filled with the linesize, may be NULL
* @param buf the pointer to a buffer containing the samples
* @param nb_samples the number of samples in a single channel
* @param planar 1 if the samples layout is planar, 0 if it is packed
* @param nb_channels the number of channels
* @return the total size of the buffer, a negative
* error code in case of failure
*/
int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
uint8_t *buf, int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int planar, int align);
/**
* Allocate a samples buffer for nb_samples samples, and
* fill pointers and linesizes accordingly.
* The allocated samples buffer has to be freed by using
* av_freep(&pointers[0]).
*
* @param nb_channels number of audio channels
* @param nb_samples number of samples per channel
* @param planar 1 if the samples layout is planar, 0 if packed,
* @param align the value to use for buffer size alignment
* @return the size in bytes required for the samples buffer, a negative
* error code in case of failure
* @see av_samples_fill_arrays()
*/
int av_samples_alloc(uint8_t *pointers[8], int linesizes[8],
int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int planar,
int align);
#endif /* AVCORE_SAMPLEFMT_H */
+56
View File
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_SHA_H
#define AVUTIL_SHA_H
#include <stdint.h>
extern const int av_sha_size;
struct AVSHA;
/**
* Initialize SHA-1 or SHA-2 hashing.
*
* @param context pointer to the function context (of size av_sha_size)
* @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
* @return zero if initialization succeeded, -1 otherwise
*/
int av_sha_init(struct AVSHA* context, int bits);
/**
* Update hash value.
*
* @param context hash function context
* @param data input data to update hash with
* @param len input data length
*/
void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
/**
* Finish hashing and output digest value.
*
* @param context hash function context
* @param digest buffer where output digest value is stored
*/
void av_sha_final(struct AVSHA* context, uint8_t *digest);
#endif /* AVUTIL_SHA_H */
+46 -5
View File
@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBSWSCALE_VERSION_MAJOR 0
#define LIBSWSCALE_VERSION_MINOR 11
#define LIBSWSCALE_VERSION_MAJOR 2
#define LIBSWSCALE_VERSION_MINOR 0
#define LIBSWSCALE_VERSION_MICRO 0
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
@@ -43,6 +43,20 @@
#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
/**
* Those FF_API_* defines are not part of public API.
* They may change, break or disappear at any time.
*/
#ifndef FF_API_SWS_GETCONTEXT
#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#ifndef FF_API_SWS_CPU_CAPS
#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#ifndef FF_API_SWS_FORMAT_NAME
#define FF_API_SWS_FORMAT_NAME (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
/**
* Returns the LIBSWSCALE_VERSION_INT constant.
*/
@@ -87,11 +101,18 @@ const char *swscale_license(void);
#define SWS_ACCURATE_RND 0x40000
#define SWS_BITEXACT 0x80000
#if FF_API_SWS_CPU_CAPS
/**
* CPU caps are autodetected now, those flags
* are only provided for API compatibility.
*/
#define SWS_CPU_CAPS_MMX 0x80000000
#define SWS_CPU_CAPS_MMX2 0x20000000
#define SWS_CPU_CAPS_3DNOW 0x40000000
#define SWS_CPU_CAPS_ALTIVEC 0x10000000
#define SWS_CPU_CAPS_BFIN 0x01000000
#define SWS_CPU_CAPS_SSE2 0x02000000
#endif
#define SWS_MAX_REDUCE_CUTOFF 0.002
@@ -142,12 +163,28 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt);
*/
int sws_isSupportedOutput(enum PixelFormat pix_fmt);
/**
* Allocates an empty SwsContext. This must be filled and passed to
* sws_init_context(). For filling see AVOptions, options.c and
* sws_setColorspaceDetails().
*/
struct SwsContext *sws_alloc_context(void);
/**
* Initializes the swscaler context sws_context.
*
* @return zero or positive value on success, a negative value on
* error
*/
int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
/**
* Frees the swscaler context swsContext.
* If swsContext is NULL, then does nothing.
*/
void sws_freeContext(struct SwsContext *swsContext);
#if FF_API_SWS_GETCONTEXT
/**
* Allocates and returns a SwsContext. You need it to perform
* scaling/conversion operations using sws_scale().
@@ -160,11 +197,15 @@ void sws_freeContext(struct SwsContext *swsContext);
* @param dstFormat the destination image format
* @param flags specify which algorithm and options to use for rescaling
* @return a pointer to an allocated context, or NULL in case of error
* @note this function is to be removed after a saner alternative is
* written
* @deprecated Use sws_getCachedContext() instead.
*/
struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
int dstW, int dstH, enum PixelFormat dstFormat,
int flags, SwsFilter *srcFilter,
SwsFilter *dstFilter, const double *param);
#endif
/**
* Scales the image slice in srcSlice and puts the resulting scaled
@@ -194,6 +235,7 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
*/
int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
#if LIBSWSCALE_VERSION_MAJOR < 1
/**
* @deprecated Use sws_scale() instead.
@@ -205,7 +247,6 @@ int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[],
/**
* @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
* @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
* @return -1 if not supported
*/
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
@@ -312,7 +353,7 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
* @param num_pixels number of pixels to convert
* @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
*/
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
/**
* Converts an 8bit paletted frame into a frame with a color depth of 24 bits.
@@ -324,7 +365,7 @@ void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pi
* @param num_pixels number of pixels to convert
* @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src
*/
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
#endif /* SWSCALE_SWSCALE_H */
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -45,7 +45,7 @@ set_target_properties(${the_target}
PROPERTIES
OUTPUT_NAME "${the_target}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
@@ -54,5 +54,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()
+2 -2
View File
@@ -37,7 +37,7 @@ endif()
set_target_properties(${the_target}
PROPERTIES OUTPUT_NAME "${the_target}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}
)
if(ENABLE_SOLUTION_FOLDERS)
@@ -46,5 +46,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()
+2 -2
View File
@@ -38,7 +38,7 @@ endif()
set_target_properties(${the_target}
PROPERTIES OUTPUT_NAME "${the_target}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
@@ -47,5 +47,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()
+2 -2
View File
@@ -92,7 +92,7 @@ set_target_properties(${the_target}
PROPERTIES
OUTPUT_NAME "${the_target}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib/"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
@@ -101,5 +101,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()
+10 -5
View File
@@ -1,4 +1,4 @@
/* $Id: tif_color.c,v 1.12.2.1 2010-06-08 18:50:41 bfriesen Exp $ */
/* $Id: tif_color.c,v 1.12.2.2 2010-12-14 02:23:09 faxguy Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -183,13 +183,18 @@ void
TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr,
uint32 *r, uint32 *g, uint32 *b)
{
int32 i;
/* XXX: Only 8-bit YCbCr input supported for now */
Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), Cr = CLAMP(Cr, 0, 255);
*r = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr]];
*g = ycbcr->clamptab[ycbcr->Y_tab[Y]
+ (int)((ycbcr->Cb_g_tab[Cb] + ycbcr->Cr_g_tab[Cr]) >> SHIFT)];
*b = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cb_b_tab[Cb]];
i = ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr];
*r = CLAMP(i, 0, 255);
i = ycbcr->Y_tab[Y]
+ (int)((ycbcr->Cb_g_tab[Cb] + ycbcr->Cr_g_tab[Cr]) >> SHIFT);
*g = CLAMP(i, 0, 255);
i = ycbcr->Y_tab[Y] + ycbcr->Cb_b_tab[Cb];
*b = CLAMP(i, 0, 255);
}
/*
+4 -2
View File
@@ -1,4 +1,4 @@
/* $Id: tif_dir.c,v 1.75.2.5 2010-06-09 21:15:27 bfriesen Exp $ */
/* $Id: tif_dir.c,v 1.75.2.6 2010-07-02 09:49:23 dron Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -163,7 +163,9 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
* work in with its normal work.
*/
if (tif->tif_flags & TIFF_SWAB) {
if (td->td_bitspersample == 16)
if (td->td_bitspersample == 8)
tif->tif_postdecode = _TIFFNoPostDecode;
else if (td->td_bitspersample == 16)
tif->tif_postdecode = _TIFFSwab16BitData;
else if (td->td_bitspersample == 24)
tif->tif_postdecode = _TIFFSwab24BitData;
+66 -30
View File
@@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.92.2.9 2010-06-14 00:21:46 fwarmerdam Exp $ */
/* $Id: tif_dirread.c,v 1.92.2.15 2010-12-31 16:12:40 olivier Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -54,7 +54,7 @@ static float TIFFFetchRational(TIFF*, TIFFDirEntry*);
static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*);
static int TIFFFetchPerSampleShorts(TIFF*, TIFFDirEntry*, uint16*);
static int TIFFFetchPerSampleLongs(TIFF*, TIFFDirEntry*, uint32*);
static int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*);
static int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*, double*);
static int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16*);
static int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32**);
static int TIFFFetchRefBlackWhite(TIFF*, TIFFDirEntry*);
@@ -83,6 +83,7 @@ TIFFReadDirectory(TIFF* tif)
const TIFFFieldInfo* fip;
size_t fix;
uint16 dircount;
uint16 previous_tag = 0;
int diroutoforderwarning = 0, compressionknown = 0;
int haveunknowntags = 0;
@@ -105,7 +106,20 @@ TIFFReadDirectory(TIFF* tif)
tif->tif_name, tif->tif_nextdiroff);
return 0;
}
{
TIFFDirEntry* ma;
uint16 mb;
for (ma=dir, mb=0; mb<dircount; ma++, mb++)
{
TIFFDirEntry* na;
uint16 nb;
for (na=ma+1, nb=mb+1; nb<dircount; na++, nb++)
{
if (ma->tdir_tag==na->tdir_tag)
na->tdir_tag=IGNORE;
}
}
}
tif->tif_flags &= ~TIFF_BEENWRITING; /* reset before new dir */
/*
* Setup default value and then make a pass over
@@ -163,23 +177,24 @@ TIFFReadDirectory(TIFF* tif)
if (dp->tdir_tag == IGNORE)
continue;
if (fix >= tif->tif_nfields)
fix = 0;
/*
* Silicon Beach (at least) writes unordered
* directory tags (violating the spec). Handle
* it here, but be obnoxious (maybe they'll fix it?).
*/
if (dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag) {
if (dp->tdir_tag < previous_tag) {
if (!diroutoforderwarning) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: invalid TIFF directory; tags are not sorted in ascending order",
tif->tif_name);
diroutoforderwarning = 1;
}
fix = 0; /* O(n^2) */
}
previous_tag = dp->tdir_tag;
if (fix >= tif->tif_nfields ||
dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag)
fix = 0; /* O(n^2) */
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
@@ -465,11 +480,18 @@ TIFFReadDirectory(TIFF* tif)
}
break;
case TIFFTAG_SMINSAMPLEVALUE:
{
double minv = 0.0, maxv = 0.0;
if (!TIFFFetchPerSampleAnys(tif, dp, &minv, &maxv) ||
!TIFFSetField(tif, dp->tdir_tag, minv))
goto bad;
}
break;
case TIFFTAG_SMAXSAMPLEVALUE:
{
double dv = 0.0;
if (!TIFFFetchPerSampleAnys(tif, dp, &dv) ||
!TIFFSetField(tif, dp->tdir_tag, dv))
double minv = 0.0, maxv = 0.0;
if (!TIFFFetchPerSampleAnys(tif, dp, &minv, &maxv) ||
!TIFFSetField(tif, dp->tdir_tag, maxv))
goto bad;
}
break;
@@ -593,8 +615,7 @@ TIFFReadDirectory(TIFF* tif)
}
if (!TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL))
{
if ((td->td_photometric==PHOTOMETRIC_RGB)
|| (td->td_photometric==PHOTOMETRIC_YCBCR))
if (td->td_photometric==PHOTOMETRIC_RGB)
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
@@ -603,13 +624,22 @@ TIFFReadDirectory(TIFF* tif)
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3))
goto bad;
}
else if ((td->td_photometric==PHOTOMETRIC_MINISWHITE)
|| (td->td_photometric==PHOTOMETRIC_MINISBLACK))
if (td->td_photometric==PHOTOMETRIC_YCBCR)
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
"SamplesPerPixel tag is missing, "
"assuming correct SamplesPerPixel value is 1");
"applying correct SamplesPerPixel value of 3");
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3))
goto bad;
}
else if ((td->td_photometric==PHOTOMETRIC_MINISWHITE)
|| (td->td_photometric==PHOTOMETRIC_MINISBLACK))
{
/*
* SamplesPerPixel tag is missing, but is not required
* by spec. Assume correct SamplesPerPixel value of 1.
*/
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,1))
goto bad;
}
@@ -620,8 +650,14 @@ TIFFReadDirectory(TIFF* tif)
*/
if (td->td_photometric == PHOTOMETRIC_PALETTE &&
!TIFFFieldSet(tif, FIELD_COLORMAP)) {
MissingRequired(tif, "Colormap");
goto bad;
if ( tif->tif_dir.td_bitspersample>=8 && tif->tif_dir.td_samplesperpixel==3)
tif->tif_dir.td_photometric = PHOTOMETRIC_RGB;
else if (tif->tif_dir.td_bitspersample>=8)
tif->tif_dir.td_photometric = PHOTOMETRIC_MINISBLACK;
else {
MissingRequired(tif, "Colormap");
goto bad;
}
}
/*
* OJPEG hack:
@@ -1086,6 +1122,7 @@ CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
"incorrect count for field \"%s\" (%u, expecting %u); tag trimmed",
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
dir->tdir_count, count);
dir->tdir_count = count;
return (1);
}
return (1);
@@ -1413,14 +1450,14 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
case TIFF_BYTE:
case TIFF_SBYTE:
{
uint8 v[4];
uint8 v[4]={0,0,0,0};
return TIFFFetchByteArray(tif, dir, v)
&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
}
case TIFF_SHORT:
case TIFF_SSHORT:
{
uint16 v[2]={0,0};
uint16 v[2]={0,0};
return TIFFFetchShortArray(tif, dir, v)
&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
}
@@ -1822,11 +1859,11 @@ TIFFFetchPerSampleLongs(TIFF* tif, TIFFDirEntry* dir, uint32* pl)
}
/*
* Fetch samples/pixel ANY values for the specified tag and verify that all
* values are the same.
* Fetch samples/pixel ANY values for the specified tag and returns their min
* and max.
*/
static int
TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* minv, double* maxv)
{
uint16 samples = tif->tif_dir.td_samplesperpixel;
int status = 0;
@@ -1844,17 +1881,16 @@ TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
if( samples < check_count )
check_count = samples;
*minv = *maxv = v[0];
for (i = 1; i < check_count; i++)
if (v[i] != v[0]) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Cannot handle different per-sample values for field \"%s\"",
_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
goto bad;
}
*pl = v[0];
{
if (v[i] < *minv)
*minv = v[i];
if (v[i] > *maxv)
*maxv = v[i];
}
status = 1;
}
bad:
if (v && v != buf)
_TIFFfree(v);
}
+36 -14
View File
@@ -1,4 +1,4 @@
/* $Id: tif_dirwrite.c,v 1.37.2.7 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_dirwrite.c,v 1.37.2.9 2011-02-25 15:28:30 dron Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -42,6 +42,7 @@ extern void TIFFCvtNativeToIEEEDouble(TIFF*, uint32, double*);
static int TIFFWriteNormalTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*);
static void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32);
static void TIFFSetupShort(TIFF*, ttag_t, TIFFDirEntry*, uint16);
static int TIFFSetupBytePair(TIFF*, ttag_t, TIFFDirEntry*);
static int TIFFSetupShortPair(TIFF*, ttag_t, TIFFDirEntry*);
static int TIFFWritePerSampleShorts(TIFF*, ttag_t, TIFFDirEntry*);
static int TIFFWritePerSampleAnys(TIFF*, TIFFDataType, ttag_t, TIFFDirEntry*);
@@ -291,12 +292,6 @@ _TIFFWriteDirectory(TIFF* tif, int done)
_TIFFSampleToTagType(tif), fip->field_tag, dir))
goto bad;
break;
case FIELD_PAGENUMBER:
case FIELD_HALFTONEHINTS:
case FIELD_YCBCRSUBSAMPLING:
if (!TIFFSetupShortPair(tif, fip->field_tag, dir))
goto bad;
break;
case FIELD_INKNAMES:
if (!TIFFWriteInkNames(tif, dir))
goto bad;
@@ -336,12 +331,22 @@ _TIFFWriteDirectory(TIFF* tif, int done)
}
break;
default:
/* XXX: Should be fixed and removed. */
if (fip->field_tag == TIFFTAG_DOTRANGE) {
if (!TIFFSetupShortPair(tif, fip->field_tag, dir))
goto bad;
}
else if (!TIFFWriteNormalTag(tif, dir, fip))
/*
* XXX: Should be fixed and removed. See comments
* related to these tags in tif_dir.c.
*/
if (fip->field_tag == TIFFTAG_PAGENUMBER
|| fip->field_tag == TIFFTAG_HALFTONEHINTS
|| fip->field_tag == TIFFTAG_YCBCRSUBSAMPLING
|| fip->field_tag == TIFFTAG_DOTRANGE) {
if (fip->field_type == TIFF_BYTE) {
if (!TIFFSetupBytePair(tif, fip->field_tag, dir))
goto bad;
} else if (fip->field_type == TIFF_SHORT) {
if (!TIFFSetupShortPair(tif, fip->field_tag, dir))
goto bad;
}
} else if (!TIFFWriteNormalTag(tif, dir, fip))
goto bad;
break;
}
@@ -875,6 +880,23 @@ TIFFWritePerSampleAnys(TIFF* tif,
}
#undef NITEMS
/*
* Setup a pair of bytes that are returned by
* value, rather than as a reference to an array.
*/
static int
TIFFSetupBytePair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
{
char v[2];
TIFFGetField(tif, tag, &v[0], &v[1]);
dir->tdir_tag = (uint16) tag;
dir->tdir_type = (uint16) TIFF_BYTE;
dir->tdir_count = 2;
return (TIFFWriteByteArray(tif, dir, v));
}
/*
* Setup a pair of shorts that are returned by
* value, rather than as a reference to an array.
@@ -1019,7 +1041,7 @@ TIFFWriteRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v)
while (fv < 1L<<(31-3) && den < 1L<<(31-3))
fv *= 1<<3, den *= 1L<<3;
}
t[2*i+0] = (uint32) (sign * (fv + 0.5));
t[2*i+0] = (uint32) (sign * (int32)(fv + 0.5));
t[2*i+1] = den;
}
status = TIFFWriteData(tif, dir, (char *)t);
+7 -1
View File
@@ -1,4 +1,4 @@
/* $Id: tif_fax3.h,v 1.5.2.1 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_fax3.h,v 1.5.2.3 2011-03-10 20:22:33 fwarmerdam Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@@ -478,6 +478,12 @@ done1d: \
break; \
case S_VL: \
CHECK_b1; \
if (b1 <= (int) (a0 + TabEnt->Param)) { \
if (b1 < (int) (a0 + TabEnt->Param) || pa != thisrun) { \
unexpected("VL", a0); \
goto eol2d; \
} \
} \
SETVALUE(b1 - a0 - TabEnt->Param); \
b1 -= *--pb; \
break; \
+8 -6
View File
@@ -1,4 +1,4 @@
/* $Id: tif_getimage.c,v 1.63.2.4 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_getimage.c,v 1.63.2.6 2010-07-02 13:38:27 dron Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -1846,6 +1846,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
{
uint32* cp2;
int32 incr = 2*toskew+w;
(void) y;
fromskew = (fromskew / 2) * 6;
cp2 = cp+w+toskew;
@@ -1872,8 +1873,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
cp2 ++ ;
pp += 6;
}
cp += toskew*2+w;
cp2 += toskew*2+w;
cp += incr;
cp2 += incr;
pp += fromskew;
h-=2;
}
@@ -1939,6 +1940,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
DECLAREContigPutFunc(putcontig8bitYCbCr12tile)
{
uint32* cp2;
int32 incr = 2*toskew+w;
(void) y;
fromskew = (fromskew / 2) * 4;
cp2 = cp+w+toskew;
@@ -1953,8 +1955,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr12tile)
cp2 ++;
pp += 4;
} while (--x);
cp += toskew*2+w;
cp2 += toskew*2+w;
cp += incr;
cp2 += incr;
pp += fromskew;
h-=2;
}
@@ -2397,7 +2399,7 @@ PickContigCase(TIFFRGBAImage* img)
}
break;
case PHOTOMETRIC_YCBCR:
if (img->bitspersample == 8)
if ((img->bitspersample==8) && (img->samplesperpixel==3))
{
if (initYCbCrConversion(img)!=0)
{
+22 -9
View File
@@ -1,4 +1,4 @@
/* $Id: tif_jpeg.c,v 1.50.2.9 2010-06-14 02:47:16 fwarmerdam Exp $ */
/* $Id: tif_jpeg.c,v 1.50.2.17 2011-01-04 02:51:17 faxguy Exp $ */
/*
* Copyright (c) 1994-1997 Sam Leffler
@@ -988,8 +988,15 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
tsize_t nrows;
(void) s;
/* data is expected to be read in multiples of a scanline */
if ( (nrows = sp->cinfo.d.image_height) ) {
nrows = cc / sp->bytesperline;
if (cc % sp->bytesperline)
TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read");
if( nrows > (int) sp->cinfo.d.image_height )
nrows = sp->cinfo.d.image_height;
/* data is expected to be read in multiples of a scanline */
if (nrows) {
/* Cb,Cr both have sampling factors 1, so this is correct */
JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width;
int samples_per_clump = sp->samplesperclump;
@@ -1064,7 +1071,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
}
}
else
{ // 12-bit
{ /* 12-bit */
int value_pairs = (sp->cinfo.d.output_width
* sp->cinfo.d.num_components) / 2;
int iPair;
@@ -1087,8 +1094,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
* TODO: resolve this */
buf += sp->bytesperline;
cc -= sp->bytesperline;
nrows -= sp->v_sampling;
} while (nrows > 0);
} while (--nrows > 0);
#ifdef JPEG_LIB_MK1
_TIFFfree(tmpbuf);
@@ -1352,8 +1358,15 @@ JPEGPreEncode(TIFF* tif, tsample_t s)
sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling;
sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling;
} else {
sp->cinfo.c.in_color_space = JCS_UNKNOWN;
if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN))
if ((td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric == PHOTOMETRIC_MINISBLACK) && td->td_samplesperpixel == 1)
sp->cinfo.c.in_color_space = JCS_GRAYSCALE;
else if (td->td_photometric == PHOTOMETRIC_RGB)
sp->cinfo.c.in_color_space = JCS_RGB;
else if (td->td_photometric == PHOTOMETRIC_SEPARATED && td->td_samplesperpixel == 4)
sp->cinfo.c.in_color_space = JCS_CMYK;
else
sp->cinfo.c.in_color_space = JCS_UNKNOWN;
if (!TIFFjpeg_set_colorspace(sp, sp->cinfo.c.in_color_space))
return (0);
/* jpeg_set_colorspace set all sampling factors to 1 */
}
@@ -1523,7 +1536,7 @@ JPEGEncodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s)
sp->scancount = 0;
}
tif->tif_row += sp->v_sampling;
buf += sp->bytesperline;
buf += bytesperclumpline;
nrows -= sp->v_sampling;
}
return (1);
+12 -2
View File
@@ -1,4 +1,4 @@
/* $Id: tif_ojpeg.c,v 1.24.2.6 2010-06-08 23:29:51 bfriesen Exp $ */
/* $Id: tif_ojpeg.c,v 1.24.2.8 2010-12-11 21:25:04 faxguy Exp $ */
/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
specification is now totally obsolete and deprecated for new applications and
@@ -1537,7 +1537,6 @@ OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id)
OJPEGReadSkip(sp,4);
else
{
/* TODO: probably best to also add check on allowed upper bound, especially x, may cause buffer overflow otherwise i think */
/* Y: Number of lines */
if (OJPEGReadWord(sp,&p)==0)
return(0);
@@ -1555,6 +1554,11 @@ OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id)
TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected width");
return(0);
}
if ((uint32)p>sp->strile_width)
{
TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data image width exceeds expected image width");
return(0);
}
sp->sof_x=p;
}
/* Nf: Number of image components in frame */
@@ -1918,8 +1922,14 @@ OJPEGReadBufferFill(OJPEGState* sp)
{
if (sp->in_buffer_file_pos>=sp->file_size)
sp->in_buffer_file_pos=0;
else if (sp->tif->tif_dir.td_stripbytecount==NULL)
sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos;
else
{
if (sp->tif->tif_dir.td_stripbytecount == 0) {
TIFFErrorExt(sp->tif->tif_clientdata,sp->tif->tif_name,"Strip byte counts are missing");
return(0);
}
sp->in_buffer_file_togo=sp->tif->tif_dir.td_stripbytecount[sp->in_buffer_next_strile];
if (sp->in_buffer_file_togo==0)
sp->in_buffer_file_pos=0;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: tif_open.c,v 1.33.2.1 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_open.c,v 1.33.2.2 2010-12-06 16:54:22 faxguy Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -304,7 +304,7 @@ TIFFClientOpen(
/*
* Read in TIFF header.
*/
if (tif->tif_mode & O_TRUNC ||
if ((m & O_TRUNC) ||
!ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {
if (tif->tif_mode == O_RDONLY) {
TIFFErrorExt(tif->tif_clientdata, name,
+1 -7
View File
@@ -1,4 +1,4 @@
/* $Id: tif_print.c,v 1.36.2.4 2010-06-08 18:50:42 bfriesen Exp $ */
/* $Id: tif_print.c,v 1.36.2.5 2010-07-06 14:05:30 dron Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -115,8 +115,6 @@ static int
_TIFFPrettyPrintField(TIFF* tif, FILE* fd, ttag_t tag,
uint32 value_count, void *raw_data)
{
//TIFFDirectory *td = &tif->tif_dir;
switch (tag)
{
case TIFFTAG_INKSET:
@@ -132,10 +130,6 @@ _TIFFPrettyPrintField(TIFF* tif, FILE* fd, ttag_t tag,
break;
}
return 1;
case TIFFTAG_DOTRANGE:
fprintf(fd, " Dot Range: %u-%u\n",
((uint16*)raw_data)[0], ((uint16*)raw_data)[1]);
return 1;
case TIFFTAG_WHITEPOINT:
fprintf(fd, " White Point: %g-%g\n",
((float *)raw_data)[0], ((float *)raw_data)[1]); return 1;
+17 -21
View File
@@ -1,4 +1,4 @@
/* $Id: tif_strip.c,v 1.19.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
/* $Id: tif_strip.c,v 1.19.2.3 2010-12-15 00:50:30 faxguy Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -124,9 +124,9 @@ TIFFVStripSize(TIFF* tif, uint32 nrows)
uint16 ycbcrsubsampling[2];
tsize_t w, scanline, samplingarea;
TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1 );
TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1);
samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1];
if (samplingarea == 0) {
@@ -234,27 +234,23 @@ TIFFScanlineSize(TIFF* tif)
&& !isUpSampled(tif)) {
uint16 ycbcrsubsampling[2];
TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1);
TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1);
if (ycbcrsubsampling[0] == 0) {
if (ycbcrsubsampling[0]*ycbcrsubsampling[1] == 0) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Invalid YCbCr subsampling");
return 0;
}
scanline = TIFFroundup(td->td_imagewidth,
/* number of sample clumps per line */
scanline = TIFFhowmany(td->td_imagewidth,
ycbcrsubsampling[0]);
scanline = TIFFhowmany8(multiply(tif, scanline,
td->td_bitspersample,
"TIFFScanlineSize"));
return ((tsize_t)
summarize(tif, scanline,
multiply(tif, 2,
scanline / ycbcrsubsampling[0],
"TIFFVStripSize"),
"TIFFVStripSize"));
/* number of samples per line */
scanline = multiply(tif, scanline,
ycbcrsubsampling[0]*ycbcrsubsampling[1] + 2,
"TIFFScanlineSize");
} else {
scanline = multiply(tif, td->td_imagewidth,
td->td_samplesperpixel,
@@ -308,9 +304,9 @@ TIFFNewScanlineSize(TIFF* tif)
&& !isUpSampled(tif)) {
uint16 ycbcrsubsampling[2];
TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1);
TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING,
ycbcrsubsampling + 0,
ycbcrsubsampling + 1);
if (ycbcrsubsampling[0]*ycbcrsubsampling[1] == 0) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+31 -7
View File
@@ -1,4 +1,4 @@
/* $Id: tif_thunder.c,v 1.5.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
/* $Id: tif_thunder.c,v 1.5.2.2 2011-03-21 16:01:28 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -25,6 +25,7 @@
*/
#include "tiffiop.h"
#include <assert.h>
#ifdef THUNDER_SUPPORT
/*
* TIFF Library.
@@ -55,12 +56,32 @@
static const int twobitdeltas[4] = { 0, 1, 0, -1 };
static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 };
#define SETPIXEL(op, v) { \
lastpixel = (v) & 0xf; \
if (npixels++ & 1) \
*op++ |= lastpixel; \
else \
#define SETPIXEL(op, v) { \
lastpixel = (v) & 0xf; \
if ( npixels < maxpixels ) \
{ \
if (npixels++ & 1) \
*op++ |= lastpixel; \
else \
op[0] = (tidataval_t) (lastpixel << 4); \
} \
}
static int
ThunderSetupDecode(TIFF* tif)
{
static const char module[] = "ThunderSetupDecode";
if( tif->tif_dir.td_bitspersample != 4 )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Wrong bitspersample value (%d), Thunder decoder only supports 4bits per sample.",
(int) tif->tif_dir.td_bitspersample );
return 0;
}
return (1);
}
static int
@@ -142,7 +163,8 @@ ThunderDecodeRow(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
occ -= tif->tif_scanlinesize;
row += tif->tif_scanlinesize;
}
return (1);
return (1);
}
int
@@ -151,6 +173,7 @@ TIFFInitThunderScan(TIFF* tif, int scheme)
(void) scheme;
tif->tif_decoderow = ThunderDecodeRow;
tif->tif_decodestrip = ThunderDecodeRow;
tif->tif_setupdecode = ThunderSetupDecode;
return (1);
}
#endif /* THUNDER_SUPPORT */
@@ -163,3 +186,4 @@ TIFFInitThunderScan(TIFF* tif, int scheme)
* fill-column: 78
* End:
*/
+5 -2
View File
@@ -1,4 +1,4 @@
/* $Id: tiffiop.h,v 1.51.2.6 2010-06-12 02:55:16 bfriesen Exp $ */
/* $Id: tiffiop.h,v 1.51.2.7 2011-03-21 21:09:19 fwarmerdam Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -59,10 +59,13 @@ extern void *lfind(const void *, const void *, size_t *, size_t,
/*
Libtiff itself does not require a 64-bit type, but bundled TIFF
utilities may use it.
utilities may use it.
*/
#if !defined(__xlC__) && !defined(__xlc__) // Already defined there (#2301)
typedef TIFF_INT64_T int64;
typedef TIFF_UINT64_T uint64;
#endif
#include "tiffio.h"
#include "tif_dir.h"
+2 -2
View File
@@ -1,4 +1,4 @@
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.9.4\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.9.5\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
/*
* This define can be used in code that requires
* compilation-related definitions specific to a
@@ -6,4 +6,4 @@
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
#define TIFFLIB_VERSION 20100615
#define TIFFLIB_VERSION 20110409
+5 -31
View File
@@ -11,7 +11,6 @@ libjpeg 6b (6.2) - The Independent JPEG Group's JPEG software.
HAVE_JPEG preprocessor flag must be set to make highgui use libjpeg.
On UNIX systems configure script takes care of it.
------------------------------------------------------------------------------------
libpng 1.4.3 - Portable Network Graphics library.
Copyright (C) 1998-2010, Glenn Randers-Pehrson.
@@ -20,15 +19,13 @@ libpng 1.4.3 - Portable Network Graphics library.
HAVE_PNG preprocessor flag must be set to make highgui use libpng.
On UNIX systems configure script takes care of it.
------------------------------------------------------------------------------------
libtiff 3.9.4 - Tag Image File Format (TIFF) Software
libtiff 3.9.5 - Tag Image File Format (TIFF) Software
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
See libtiff home page http://www.libtiff.org
for details and links to the source code
HAVE_TIFF preprocessor flag must be set to make highgui use libtiff.
On UNIX systems configure script takes care of it.
@@ -42,9 +39,7 @@ zlib 1.2.5 - General purpose LZ77 compression library
No preprocessor definition is needed to make highgui use this library -
it is included automatically if either libpng or libtiff are used.
------------------------------------------------------------------------------------
jasper-1.900.1 - JasPer is a collection of software
(i.e., a library and application programs) for the coding
and manipulation of images. This software can handle image data in a
@@ -61,9 +56,7 @@ jasper-1.900.1 - JasPer is a collection of software
(lib/libjasper*). To get the latest source code,
please, visit the project homepage:
http://www.ece.uvic.ca/~mdadams/jasper/
------------------------------------------------------------------------------------
openexr-1.4.0 - OpenEXR is a high dynamic-range (HDR) image file format developed
by Industrial Light & Magic for use in computer imaging applications.
@@ -73,34 +66,15 @@ openexr-1.4.0 - OpenEXR is a high dynamic-range (HDR) image file format develope
The project homepage: http://www.openexr.com/
OpenCV on Windows does not include openexr codec by default.
To add it, you will need to recompile highgui with OpenEXR support
using VS.NET2003 or VS.NET2005 (MSVC6 can not compile it):
1) download binaries (e.g. openexr-1.4.0-vs2005.zip)
from the official site.
2) copy
half.lib, iex.lib, ilmimf.lib ilmthread.lib imath.lib to
_graphics/lib
3) copy include/openexr/*.h to _graphics/include/openexr
4) open _make/opencv.sln
5) in highgui/_highgui.h uncomment
#define HAVE_ILMIMF 1
6) build debug/release configurations of highgui.
OpenCV does not include openexr codec.
To add it, you will need install OpenEXR, reconfigure OpenCV
using CMake (make sure OpenEXR library is found) and the rebuild OpenCV.
------------------------------------------------------------------------------------
ffmpeg-0.6.0 - FFmpeg is a complete, cross-platform solution to record,
ffmpeg-0.8.0 - FFmpeg is a complete, cross-platform solution to record,
convert and stream audio and video. It includes libavcodec -
the leading audio/video codec library, and also libavformat, libavutils and
other helper libraries that are used by OpenCV (in highgui module) to
read and write video files.
The project homepage: http://ffmpeg.org/
------------------------------------------------------------------------------------
videoInput-0.1995 - Video capturing library for Windows using DirectShow as backend
Written by Theodore Watson
http://muonics.net/school/spring05/videoInput/
------------------------------------------------------------------------------------
+2 -2
View File
@@ -29,7 +29,7 @@ set_target_properties(${the_target}
PROPERTIES
OUTPUT_NAME "${the_target}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/${OPENCV_LIB_INSTALL_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
@@ -38,5 +38,5 @@ endif()
if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${the_target}
ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main)
ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
endif()
+591 -489
View File
File diff suppressed because it is too large Load Diff
+31 -14
View File
@@ -1,41 +1,53 @@
RELATIVE_PREFIX:=.$(shell echo $(abspath $(LOCAL_PATH))| sed -e "s/\/[^\/]*/\/../g" )
OPENCV_THIS_DIR:=$(RELATIVE_PREFIX)$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
OPENCV_LIBS_DIR:=@CMAKE_LIB_DIRS_CONFIGCMAKE@
OPENCV_BASEDIR:=@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@
# In order to compile your application under cygwin
# you need to define NDK_USE_CYGPATH=1 before calling ndk-build
USER_LOCAL_PATH:=$(LOCAL_PATH)
LOCAL_PATH:=$(subst ?,,$(firstword ?$(subst \, ,$(subst /, ,$(call my-dir)))))
OPENCV_THIS_DIR:=$(patsubst $(LOCAL_PATH)\\%,%,$(patsubst $(LOCAL_PATH)/%,%,$(call my-dir)))
OPENCV_LIBS_DIR:=@CMAKE_LIBS_DIR_CONFIGCMAKE@
OPENCV_BASEDIR:=@CMAKE_BASE_INCLUDE_DIR_CONFIGCMAKE@
OPENCV_LOCAL_C_INCLUDES:=@CMAKE_INCLUDE_DIRS_CONFIGCMAKE@
OPENCV_MODULES := contrib calib3d objdetect features2d imgproc video highgui ml legacy flann core
OPENCV_MODULES := contrib calib3d objdetect features2d video imgproc highgui ml legacy flann core
ifeq (${OPENCV_CAMERA_MODULES},off)
OPENCV_CAMERA_MODULES:=
else
OPENCV_CAMERA_MODULES:=@CMAKE_CAMERA_LIBS_CONFIGCMAKE@
endif
OPENCV_LIB_TYPE:=@OPENCV_LIBTYPE_CONFIGMAKE@
ifeq ($(OPENCV_LIB_TYPE),SHARED)
OPENCV_LIB_SUFFIX:=so
OPENCV_EXTRA_COMPONENTS:=
else
OPENCV_LIB_SUFFIX:=a
OPENCV_MODULES+= androidcamera
OPENCV_EXTRA_COMPONENTS:=@JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ zlib
ifeq (@WITH_ANDROID_CAMERA@,ON)
OPENCV_MODULES+= androidcamera
endif
OPENCV_EXTRA_COMPONENTS:=@JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ @ZLIB_LIBRARY@
endif
OPENCV_CAMERA_MODULES := @CMAKE_CAMERA_LIBS_CONFIGCMAKE@
define add_opencv_module
include $(CLEAR_VARS)
LOCAL_MODULE:=opencv_$1
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libopencv_$1.$(OPENCV_LIB_SUFFIX)
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libs/$(TARGET_ARCH_ABI)/libopencv_$1.$(OPENCV_LIB_SUFFIX)
include $(PREBUILT_@OPENCV_LIBTYPE_CONFIGMAKE@_LIBRARY)
endef
define add_opencv_extra_component
include $(CLEAR_VARS)
LOCAL_MODULE:=$1
LOCAL_SRC_FILES:=$(OPENCV_THIS_DIR)/3rdparty/lib/lib$1.a
LOCAL_SRC_FILES:=$(OPENCV_THIS_DIR)/3rdparty/libs/$(TARGET_ARCH_ABI)/lib$1.a
include $(PREBUILT_STATIC_LIBRARY)
endef
define add_opencv_camera_module
include $(CLEAR_VARS)
LOCAL_MODULE:=$1
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/lib$1.so
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/libs/$(TARGET_ARCH_ABI)/lib$1.so
include $(PREBUILT_SHARED_LIBRARY)
endef
@@ -47,11 +59,16 @@ ifneq ($(OPENCV_BASEDIR),)
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
endif
OPENCV_LOCAL_LIBRARIES += $(foreach mod, $(OPENCV_MODULES), opencv_$(mod))
ifeq ($(OPENCV_LIB_TYPE),STATIC)
OPENCV_LOCAL_LIBRARIES += $(foreach mod, $(OPENCV_MODULES), opencv_$(mod))
endif
OPENCV_LOCAL_LIBRARIES += $(OPENCV_EXTRA_COMPONENTS)
OPENCV_LOCAL_CFLAGS := -fsigned-char -fPIC -DANDROID
OPENCV_LOCAL_CFLAGS := -fPIC -DANDROID -fsigned-char
include $(CLEAR_VARS)
LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
LOCAL_STATIC_LIBRARIES += $(OPENCV_LOCAL_LIBRARIES)
LOCAL_CFLAGS += $(OPENCV_LOCAL_CFLAGS)
LOCAL_PATH:=$(USER_LOCAL_PATH)
+143
View File
@@ -0,0 +1,143 @@
# creates target "${_target}_android_project" for building standard Android project
macro(add_android_project _target _path)
SET (android_dependencies opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core)
if(NOT BUILD_SHARED_LIBS)
LIST(APPEND android_dependencies opencv_androidcamera)
endif()
if (ANDROID AND CAN_BUILD_ANDROID_PROJECTS)
file(GLOB_RECURSE res_files_all RELATIVE "${_path}" "${_path}/res/*")
file(GLOB_RECURSE jni_files_all RELATIVE "${_path}" "${_path}/jni/*.c*" "${_path}/jni/*.h*")
file(GLOB_RECURSE src_files_all RELATIVE "${_path}" "${_path}/src/*.java")
#remove .svn
set(res_files)
foreach(f ${res_files_all})
if(NOT f MATCHES "\\.svn")
list(APPEND res_files "${f}")
endif()
endforeach()
set(jni_files)
foreach(f ${jni_files_all})
if(NOT f MATCHES "\\.svn")
list(APPEND jni_files "${f}")
endif()
endforeach()
set(src_files)
foreach(f ${src_files_all})
if(NOT f MATCHES "\\.svn")
list(APPEND src_files "${f}")
endif()
endforeach()
# get temporary location for the project
file(RELATIVE_PATH build_path "${OpenCV_SOURCE_DIR}" "${_path}")
SET(build_path "${CMAKE_BINARY_DIR}/${build_path}")
# copy project to temporary location
SET(${_target}_project_files)
foreach(f ${res_files} ${src_files} "AndroidManifest.xml")
if(NOT "${build_path}" STREQUAL "${_path}")
#this is not needed in case of in-source build
add_custom_command(
OUTPUT "${build_path}/${f}"
COMMAND ${CMAKE_COMMAND} -E copy "${_path}/${f}" "${build_path}/${f}"
DEPENDS "${_path}/${f}"
COMMENT ""
)
endif()
list(APPEND ${_target}_project_files "${build_path}/${f}")
endforeach()
# process default.properties
file(STRINGS "${_path}/default.properties" default_properties REGEX "^android\\.library\\.reference\\.1=.+$")
if (default_properties)
# has opencv dependency
file(RELATIVE_PATH OPENCV_REFERENCE_PATH "${build_path}" "${CMAKE_BINARY_DIR}")
add_custom_command(
OUTPUT "${build_path}/default.properties"
OUTPUT "${build_path}/build.xml"
OUTPUT "${build_path}/local.properties"
OUTPUT "${build_path}/proguard.cfg"
COMMAND ${CMAKE_COMMAND} -E echo "" > "default.properties"
COMMAND ${ANDROID_EXECUTABLE} update project --name "${_target}" --target "${ANDROID_SDK_TARGET}" --library "${OPENCV_REFERENCE_PATH}" --path .
WORKING_DIRECTORY ${build_path}
DEPENDS ${${_target}_project_files}
DEPENDS "${CMAKE_BINARY_DIR}/default.properties"
DEPENDS "${CMAKE_BINARY_DIR}/AndroidManifest.xml"
COMMENT "Updating android project - ${_target}"
)
else()
# has no opencv dependency
add_custom_command(
OUTPUT "${build_path}/default.properties"
OUTPUT "${build_path}/build.xml"
OUTPUT "${build_path}/local.properties"
OUTPUT "${build_path}/proguard.cfg"
COMMAND ${CMAKE_COMMAND} -E echo "" > "default.properties"
COMMAND ${ANDROID_EXECUTABLE} update project --name "${_target}" --target "${ANDROID_SDK_TARGET}" --path .
WORKING_DIRECTORY ${build_path}
DEPENDS ${${_target}_project_files}
COMMENT "Updating android project - ${_target}"
)
endif()
if("${build_path}" STREQUAL "${_path}")
#in case of in-source build default.properties file is not generated (it is just overwritten :)
SET_SOURCE_FILES_PROPERTIES("${build_path}/default.properties" PROPERTIES GENERATED FALSE)
endif()
list(APPEND ${_target}_project_files "${build_path}/default.properties" "${build_path}/build.xml" "${build_path}/local.properties" "${build_path}/proguard.cfg")
# build native part of android project
if(jni_files)
INCLUDE_DIRECTORIES("${_path}/jni")
FILE(STRINGS "${_path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" )
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
SET(jni_sources)
foreach(src ${jni_files})
list(APPEND jni_sources "${_path}/${src}")
endforeach()
ADD_LIBRARY(${JNI_LIB_NAME} MODULE ${jni_sources})
TARGET_LINK_LIBRARIES(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_dependencies})
set_target_properties(${JNI_LIB_NAME} PROPERTIES
OUTPUT_NAME "${JNI_LIB_NAME}"
LIBRARY_OUTPUT_DIRECTORY "${build_path}/libs/${ARMEABI_NDK_NAME}"
)
ADD_CUSTOM_COMMAND(
TARGET ${JNI_LIB_NAME}
POST_BUILD
COMMAND ${CMAKE_STRIP} "${build_path}/libs/${ARMEABI_NDK_NAME}/*.so"
)
else()
SET(JNI_LIB_NAME)
endif()
add_custom_command(
OUTPUT "${build_path}/bin/${_target}-debug.apk"
OUTPUT "${CMAKE_BINARY_DIR}/bin/${_target}.apk"
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
COMMAND ${CMAKE_COMMAND} -E copy "${build_path}/bin/${_target}-debug.apk" "${CMAKE_BINARY_DIR}/bin/${_target}.apk"
WORKING_DIRECTORY ${build_path}
DEPENDS ${${_target}_project_files}
DEPENDS "${LIBRARY_OUTPUT_PATH}/libopencv_java.so"
COMMENT "Generating bin/${_target}.apk"
)
ADD_CUSTOM_TARGET(${_target}_android_project ALL
DEPENDS "${build_path}/bin/${_target}-debug.apk"
DEPENDS "${CMAKE_BINARY_DIR}/bin/${_target}.apk"
)
add_dependencies(${_target}_android_project opencv_java ${JNI_LIB_NAME})
if("${ARGN}" STREQUAL "INSTALL" AND INSTALL_ANDROID_EXAMPLES)
install(FILES "${CMAKE_BINARY_DIR}/bin/${_target}.apk" DESTINATION "bin" COMPONENT main)
endif()
endif()
endmacro()
+14
View File
@@ -0,0 +1,14 @@
set(OpenCV_VERSION @OPENCV_VERSION@)
set(PACKAGE_VERSION ${OpenCV_VERSION})
set(PACKAGE_VERSION_EXACT False)
set(PACKAGE_VERSION_COMPATIBLE False)
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT True)
set(PACKAGE_VERSION_COMPATIBLE True)
endif()
if(PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION)
set(PACKAGE_VERSION_COMPATIBLE True)
endif()
+89 -63
View File
@@ -15,10 +15,19 @@
# with this path is NOT needed.
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
# - OpenCV_VERSION : The version of this OpenCV build. Example: "1.2.0"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "1"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "2"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "0"
# - OpenCV_VERSION : The version of this OpenCV build. Example: "@OPENCV_VERSION@"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_MINOR@"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "@OPENCV_VERSION_PATCH@"
#
# Advanced variables:
# - OpenCV_SHARED
# - OpenCV_CONFIG_PATH
# - OpenCV_INSTALL_PATH
# - OpenCV_LIB_COMPONENTS
# - OpenCV_EXTRA_COMPONENTS
# - OpenCV_USE_MANGLED_PATHS
# - OpenCV_HAVE_ANDROID_CAMERA
#
# =================================================================================================
@@ -28,9 +37,20 @@
# ======================================================
SET(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC@)
# Some additional settings are required if OpenCV is built as static libs
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
# Enables mangled install paths, that help with side by side installs
set(OpenCV_USE_MANGLED_PATHS @OPENCV_MANGLED_INSTALL_PATHS@)
# Extract the directory where *this* file has been installed (determined at cmake run-time)
# This variable may or may not be used below, depending on the parsing of OpenCVConfig.cmake
get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../.." REALPATH)
# Presence of Android native camera support
set (OpenCV_HAVE_ANDROID_CAMERA @WITH_ANDROID_CAMERA@)
# ======================================================
# Include directories to add to the user project:
@@ -38,7 +58,6 @@ get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH
# Provide the include directories to the caller
SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
# ======================================================
@@ -47,93 +66,100 @@ INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
# Provide the libs directory anyway, it may be needed in some cases.
SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@)
LINK_DIRECTORIES(${OpenCV_LIB_DIR})
# ====================================================================
# Link libraries: e.g. opencv_core220.so, opencv_imgproc220d.lib, etc...
# Link libraries: e.g. libopencv_core.so, opencv_imgproc220d.lib, etc...
# ====================================================================
SET(OpenCV_LIB_COMPONENTS opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core )
#libraries order is very important because linker from Android NDK is one-pass linker
if(NOT ANDROID)
set(OPENCV_LIB_COMPONENTS opencv_core opencv_imgproc opencv_features2d opencv_gpu opencv_calib3d opencv_objdetect opencv_video opencv_highgui opencv_ml opencv_legacy opencv_contrib opencv_flann)
else()
#libraries order is very important because linker from Android NDK is one-pass linker
set(OPENCV_LIB_COMPONENTS opencv_contrib opencv_calib3d opencv_objdetect opencv_features2d opencv_imgproc opencv_video opencv_highgui opencv_ml opencv_legacy opencv_flann opencv_core )
IF (NOT @BUILD_SHARED_LIBS@)
set(OPENCV_LIB_COMPONENTS ${OPENCV_LIB_COMPONENTS} opencv_androidcamera)
ENDIF()
LIST(INSERT OpenCV_LIB_COMPONENTS 0 opencv_gpu)
ELSEIF(NOT OpenCV_SHARED AND OpenCV_HAVE_ANDROID_CAMERA)
LIST(APPEND OpenCV_LIB_COMPONENTS opencv_androidcamera)
endif()
if(OpenCV_USE_MANGLED_PATHS)
#be explicit about the library names.
set(OpenCV_LIB_COMPONENTS_ )
foreach( CVLib ${OpenCV_LIB_COMPONENTS})
list(APPEND OpenCV_LIB_COMPONENTS_ ${OpenCV_LIB_DIR}/lib${CVLib}.so.@OPENCV_VERSION@ )
endforeach()
set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
endif()
SET(OpenCV_LIBS "")
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
# CMake>=2.6 supports the notation "debug XXd optimized XX"
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
# Modern CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} debug ${__CVLIB}@OPENCV_DLLVERSION@@OPENCV_DEBUG_POSTFIX@ optimized ${__CVLIB}@OPENCV_DLLVERSION@)
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
# Old CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}@OPENCV_DLLVERSION@)
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
endforeach(__CVLIB)
if(WIN32)
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
# CMake>=2.6 supports the notation "debug XXd optimized XX"
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
# Modern CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} debug ${__CVLIB}@OPENCV_DLLVERSION@@OPENCV_DEBUG_POSTFIX@ optimized ${__CVLIB}@OPENCV_DLLVERSION@)
else()
# Old CMake:
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB}@OPENCV_DLLVERSION@)
endif()
endforeach()
else()
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
SET(OpenCV_LIBS ${OpenCV_LIBS} ${__CVLIB})
endforeach()
endif()
# ==============================================================
# Extra include directories, needed by OpenCV 2 new structure
# ==============================================================
if(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
SET(BASEDIR @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@)
foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
if(NOT "@CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@" STREQUAL "")
foreach(__CVLIB ${OpenCV_LIB_COMPONENTS})
# We only need the "core",... part here: "opencv_core" -> "core"
STRING(REGEX REPLACE "opencv_(.*)" "\\1" MODNAME ${__CVLIB})
INCLUDE_DIRECTORIES("${BASEDIR}/modules/${MODNAME}/include")
endforeach(__CVLIB)
endif(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
STRING(REGEX REPLACE "opencv_(.*)" "\\1" __MODNAME ${__CVLIB})
INCLUDE_DIRECTORIES("@CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@/modules/${__MODNAME}/include")
endforeach()
endif()
# For OpenCV built as static libs, we need the user to link against
# many more dependencies:
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
IF (NOT OpenCV_SHARED)
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
if(WIN32 AND NOT ANDROID)
LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib)
else()
LINK_DIRECTORIES("${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib")
endif()
LINK_DIRECTORIES(@CMAKE_3RDPARTY_LIB_DIRS_CONFIGCMAKE@)
set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})
set(OpenCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ @ZLIB_LIBRARY@)
set(OPENCV_EXTRA_COMPONENTS @JPEG_LIBRARIES@ @PNG_LIBRARIES@ @TIFF_LIBRARIES@ @JASPER_LIBRARIES@ zlib)
if (CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
foreach(__EXTRA_LIB ${OPENCV_EXTRA_COMPONENTS})
if (WIN32 AND ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.4)
# Modern CMake:
foreach(__EXTRA_LIB ${OpenCV_EXTRA_COMPONENTS})
set(OpenCV_LIBS ${OpenCV_LIBS}
debug ${__EXTRA_LIB}@OPENCV_DEBUG_POSTFIX@
optimized ${__EXTRA_LIB})
endforeach(__EXTRA_LIB)
else(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
set(OpenCV_LIBS ${OpenCV_LIBS} ${OPENCV_EXTRA_COMPONENTS})
endif(CMAKE_MAJOR_VERSION GREATER 2 OR CMAKE_MINOR_VERSION GREATER 4)
endforeach()
else()
# Old CMake:
set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_EXTRA_COMPONENTS})
endif()
if (APPLE)
set(OpenCV_LIBS ${OpenCV_LIBS} "-lbz2" "-framework Cocoa" "-framework QuartzCore" "-framework QTKit")
endif()
ENDIF()
# ======================================================
# Android camera helper macro
# ======================================================
IF (ANDROID)
IF (OpenCV_HAVE_ANDROID_CAMERA)
macro( COPY_NATIVE_CAMERA_LIBS target )
IF( ARMEABI_V7A)
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_location "${target_location}" PATH)
file(GLOB camera_wrappers "${OpenCV_LIB_DIR}/libnative_camera_r*.so")
foreach(wrapper ${camera_wrappers})
ADD_CUSTOM_COMMAND(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
)
endforeach()
ENDIF( ARMEABI_V7A )
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_location "${target_location}" PATH)
file(GLOB camera_wrappers "${OpenCV_LIB_DIR}/libnative_camera_r*.so")
foreach(wrapper ${camera_wrappers})
ADD_CUSTOM_COMMAND(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
)
endforeach()
endmacro()
ENDIF(ANDROID)
ENDIF()
# ======================================================
# Version variables:
+11 -3
View File
@@ -43,6 +43,14 @@ set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
set(IPP_X64 0)
if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(IPP_X64 1)
endif()
if (CMAKE_CL_64)
set(IPP_X64 1)
endif()
# ------------------------------------------------------------------------
# This function detect IPP version by analyzing ippversion.h file
# Note, ippversion.h file was inroduced since IPP 5.3
@@ -96,7 +104,7 @@ function(set_ipp_old_libraries)
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
if (IPP_X64)
set(IPP_ARCH "em64t")
endif()
@@ -167,7 +175,7 @@ function(set_ipp_variables _LATEST_VERSION)
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
if (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/../em64t)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
@@ -188,7 +196,7 @@ function(set_ipp_variables _LATEST_VERSION)
# set INCLUDE and LIB folders
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
if (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
+9 -9
View File
@@ -47,55 +47,55 @@ IF (WIN32)
ENDIF (WIN32)
FIND_PROGRAM(LATEX_COMPILER
FIND_HOST_PROGRAM(LATEX_COMPILER
NAMES latex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
FIND_PROGRAM(PDFLATEX_COMPILER
FIND_HOST_PROGRAM(PDFLATEX_COMPILER
NAMES pdflatex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
FIND_PROGRAM(BIBTEX_COMPILER
FIND_HOST_PROGRAM(BIBTEX_COMPILER
NAMES bibtex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
FIND_PROGRAM(MAKEINDEX_COMPILER
FIND_HOST_PROGRAM(MAKEINDEX_COMPILER
NAMES makeindex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
FIND_PROGRAM(DVIPS_CONVERTER
FIND_HOST_PROGRAM(DVIPS_CONVERTER
NAMES dvips
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
FIND_PROGRAM(DVIPDF_CONVERTER
FIND_HOST_PROGRAM(DVIPDF_CONVERTER
NAMES dvipdfm dvipdft dvipdf
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
)
IF (WIN32)
FIND_PROGRAM(PS2PDF_CONVERTER
FIND_HOST_PROGRAM(PS2PDF_CONVERTER
NAMES ps2pdf14.bat
PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
)
ELSE (WIN32)
FIND_PROGRAM(PS2PDF_CONVERTER
FIND_HOST_PROGRAM(PS2PDF_CONVERTER
NAMES ps2pdf14 ps2pdf
PATHS /usr/bin /usr/texbin
)
ENDIF (WIN32)
FIND_PROGRAM(LATEX2HTML_CONVERTER
FIND_HOST_PROGRAM(LATEX2HTML_CONVERTER
NAMES latex2html
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin /usr/texbin
+22 -46
View File
@@ -2,81 +2,57 @@
# OPENNI_LIBRARY and OPENNI_INCLUDES to link OpenCV modules with OpenNI
# HAVE_OPENNI for conditional compilation OpenCV with/without OpenNI
set(OPENNI_LIB_DESCR "Path to the directory of OpenNI libraries" CACHE INTERNAL "Description" )
set(OPENNI_INCLUDE_DESCR "Path to the directory of OpenNI includes" CACHE INTERNAL "Description" )
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DESCR "Path to the directory of PrimeSensor Module binaries" CACHE INTERNAL "Description" )
if(NOT "${OPENNI_LIB_DIR}" STREQUAL "${OPENNI_LIB_DIR_INTERNAL}")
unset(OPENNI_LIBRARY CACHE)
endif()
if(NOT "${OPENNI_INCLUDE_DIR}" STREQUAL "${OPENNI_INCLUDE_DIR_INTERNAL}")
unset(OPENNI_INCLUDES CACHE)
endif()
if(NOT "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" STREQUAL "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}")
unset(OPENNI_PRIME_SENSOR_MODULE CACHE)
endif()
if(NOT OPENNI_LIB_DIR OR OPENNI_LIB_DIR STREQUAL "")
if(WIN32)
set(OPENNI_LIB_DIR "c:/Program Files/OpenNI/Lib" CACHE PATH ${OPENNI_LIB_DESCR})
elseif(UNIX OR APPLE)
set(OPENNI_LIB_DIR "/usr/lib" CACHE PATH ${OPENNI_LIB_DESCR})
endif()
endif()
if(NOT OPENNI_INCLUDE_DIR OR OPENNI_INCLUDE_DIR STREQUAL "")
if(WIN32)
set(OPENNI_INCLUDE_DIR "c:/Program Files/OpenNI/Include" CACHE PATH ${OPENNI_INCLUDE_DESCR})
elseif(UNIX OR APPLE)
set(OPENNI_INCLUDE_DIR "/usr/include/ni" CACHE PATH ${OPENNI_INCLUDE_DESCR})
endif()
endif()
if(NOT OPENNI_PRIME_SENSOR_MODULE_BIN_DIR OR OPENNI_PRIME_SENSOR_MODULE_BIN_DIR STREQUAL "")
if(WIN32)
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "c:/Program Files/Prime Sense/Sensor/Bin" CACHE PATH ${OPENNI_PRIME_SENSOR_MODULE_BIN_DESCR})
elseif(UNIX OR APPLE)
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "/usr/lib" CACHE PATH ${OPENNI_PRIME_SENSOR_MODULE_BIN_DESCR})
endif()
unset(OPENNI_LIB_DIR CACHE)
endif()
find_library(OPENNI_LIBRARY "OpenNI" PATHS ${OPENNI_LIB_DIR} DOC "OpenNI library" NO_DEFAULT_PATH)
find_path(OPENNI_INCLUDES "XnCppWrapper.h" PATHS ${OPENNI_INCLUDE_DIR} DOC "OpenNI c++ interface header" NO_DEFAULT_PATH)
if(NOT "${OPENNI_INCLUDE_DIR}" STREQUAL "${OPENNI_INCLUDE_DIR_INTERNAL}")
unset(OPENNI_INCLUDES CACHE)
unset(OPENNI_INCLUDE_DIR CACHE)
endif()
if(NOT "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" STREQUAL "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR_INTERNAL}")
unset(OPENNI_PRIME_SENSOR_MODULE CACHE)
unset(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR CACHE)
endif()
find_file(OPENNI_INCLUDES "XnCppWrapper.h" PATHS $ENV{OPEN_NI_INCLUDE} "/usr/include/ni" "/usr/include/openni" "c:/Program Files/OpenNI/Include" DOC "OpenNI c++ interface header")
find_library(OPENNI_LIBRARY "OpenNI" PATHS $ENV{OPEN_NI_LIB} "/usr/lib" "c:/Program Files/OpenNI/Lib" DOC "OpenNI library")
if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
set(HAVE_OPENNI TRUE)
# the check: are PrimeSensor Modules for OpenNI installed?
# the check: are PrimeSensor Modules for OpenNI installed
if(WIN32)
find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore.dll" PATHS ${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR} DOC "Core library of PrimeSensor Modules for OpenNI" NO_DEFAULT_PATH)
find_file(OPENNI_PRIME_SENSOR_MODULE "XnCore.dll" PATHS "c:/Program Files/Prime Sense/Sensor/Bin" DOC "Core library of PrimeSensor Modules for OpenNI")
elseif(UNIX OR APPLE)
find_library(OPENNI_PRIME_SENSOR_MODULE "XnCore" PATHS ${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR} DOC "Core library of PrimeSensor Modules for OpenNI" NO_DEFAULT_PATH)
find_library(OPENNI_PRIME_SENSOR_MODULE "XnCore" PATHS "/usr/lib" DOC "Core library of PrimeSensor Modules for OpenNI")
endif()
if(OPENNI_PRIME_SENSOR_MODULE)
set(HAVE_OPENNI_PRIME_SENSOR_MODULE TRUE)
endif()
endif()
endif() #if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
get_filename_component(OPENNI_LIB_DIR "${OPENNI_LIBRARY}" PATH CACHE)
get_filename_component(OPENNI_INCLUDE_DIR ${OPENNI_INCLUDES} PATH CACHE)
get_filename_component(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE}" PATH CACHE)
if(OPENNI_LIBRARY)
set(OPENNI_LIB_DIR_INTERNAL "${OPENNI_LIB_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_LIB_DIR was set successfully." FORCE)
else()
set(OPENNI_LIB_DIR "${OPENNI_LIB_DIR}-NOTFOUND or does not have OpenNI libraries" CACHE PATH ${OPENNI_LIB_DESCR} FORCE)
message( WARNING, " OpenNI library directory (set by OPENNI_LIB_DIR variable) is not found or does not have OpenNI libraries." )
endif()
if(OPENNI_INCLUDES)
set(OPENNI_INCLUDE_DIR_INTERNAL "${OPENNI_INCLUDE_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_INCLUDE_DIR was set successfully." FORCE)
else()
set(OPENNI_INCLUDE_DIR "${OPENNI_INCLUDE_DIR}-NOTFOUND or does not have OpenNI includes" CACHE PATH ${OPENNI_INCLUDE_DESCR} FORCE)
message( WARNING, " OpenNI include directory (set by OPENNI_INCLUDE_DIR variable) is not found or does not have OpenNI includes." )
message( WARNING, " OpenNI include directory (set by OPENNI_INCLUDE_DIR variable) is not found or does not have OpenNI include files." )
endif()
if(OPENNI_PRIME_SENSOR_MODULE)
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR_INTERNAL "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_PRIME_SENSOR_MODULE_BIN_DIR was set successfully." FORCE)
else()
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}-NOTFOUND or does not have PrimeSensor Module binaries" CACHE PATH ${OPENNI_PRIME_SENSOR_MODULE_BIN_DESCR} FORCE)
message( WARNING, " PrimeSensor Module binaries directory (set by OPENNI_PRIME_SENSOR_MODULE_BIN_DIR variable) is not found or does not have PrimeSensor Module binaries." )
endif()
+35
View File
@@ -0,0 +1,35 @@
# - Find XIMEA
# This module finds if XIMEA Software package is installed
# and determines where the binaries and header files are.
# This code sets the following variables:
#
# XIMEA_FOUND - True if XIMEA API found
# XIMEA_PATH: - Path to the XIMEA API folder
# XIMEA_LIBRARY_DIRS - XIMEA libraries folder
#
# Created: 5 Aug 2011 by Marian Zajko (marian.zajko@ximea.com)
#
set(XIMEA_FOUND)
set(XIMEA_PATH)
set(XIMEA_LIBRARY_DIR)
# Try to find the XIMEA API path in registry.
GET_FILENAME_COMPONENT(XIMEA_PATH "[HKEY_CURRENT_USER\\Software\\XIMEA\\CamSupport\\API;Path]" ABSOLUTE)
if(XIMEA_PATH)
set(XIMEA_FOUND 1)
# set LIB folders
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}\\x86")
else()
set(XIMEA_FOUND 0)
endif()
mark_as_advanced(FORCE XIMEA_FOUND)
mark_as_advanced(FORCE XIMEA_PATH)
mark_as_advanced(FORCE XIMEA_LIBRARY_DIR)
+36 -39
View File
@@ -1,3 +1,24 @@
#opencv precompiled headers macro (can add pch to modules and tests)
#this macro must be called after any "add_definitions" commands, otherwise precompiled headers will not work
macro(add_opencv_precompiled_headers the_target)
if("${the_target}" MATCHES "opencv_test_.*")
SET(pch_name "test/test_precomp")
else()
SET(pch_name "src/precomp")
endif()
set(pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${pch_name}.hpp")
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
if(CMAKE_GENERATOR MATCHES Visual)
set(${the_target}_pch "${CMAKE_CURRENT_SOURCE_DIR}/${pch_name}.cpp")
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_GENERATOR MATCHES Xcode)
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_GENERATOR MATCHES Makefiles)
add_precompiled_header(${the_target} ${pch_header})
endif()
endif()
endmacro()
# this is template for a OpenCV module
macro(define_opencv_module name)
@@ -8,20 +29,19 @@ macro(define_opencv_module name)
"${CMAKE_CURRENT_BINARY_DIR}")
foreach(d ${ARGN})
if(${d} MATCHES "opencv_")
if(${d} MATCHES "opencv_lapack")
else()
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
include_directories("${d_dir}/include")
endif()
if(d MATCHES "opencv_")
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
include_directories("${d_dir}/include")
endif()
endforeach()
file(GLOB lib_srcs "src/*.cpp")
file(GLOB lib_int_hdrs "src/*.h*")
if(COMMAND get_module_external_sources)
get_module_external_sources(${name})
endif()
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
file(GLOB lib_hdrs "include/opencv2/${name}/*.h*")
@@ -66,17 +86,7 @@ macro(define_opencv_module name)
INSTALL_NAME_DIR lib
)
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")
set(${the_target}_pch "src/precomp.cpp")
endif()
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
add_precompiled_header(${the_target} ${pch_header})
endif()
endif()
add_opencv_precompiled_headers(${the_target})
# Add the required libraries for linking:
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
@@ -97,11 +107,11 @@ macro(define_opencv_module name)
install(TARGETS ${the_target}
RUNTIME DESTINATION bin COMPONENT main
LIBRARY DESTINATION lib COMPONENT main
ARCHIVE DESTINATION lib COMPONENT main)
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
install(FILES ${lib_hdrs}
DESTINATION include/opencv2/${name}
DESTINATION ${OPENCV_INCLUDE_PREFIX}/opencv2/${name}
COMPONENT main)
if(BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test)
@@ -111,12 +121,9 @@ macro(define_opencv_module name)
set(test_deps opencv_${name} ${ARGN} opencv_ts opencv_highgui ${EXTRA_${the_target}_DEPS})
foreach(d ${test_deps})
if(${d} MATCHES "opencv_")
if(${d} MATCHES "opencv_lapack")
else()
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
include_directories("${d_dir}/include")
endif()
if(d MATCHES "opencv_")
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
include_directories("${d_dir}/include")
endif()
endforeach()
@@ -130,24 +137,14 @@ macro(define_opencv_module name)
add_executable(${the_target} ${test_srcs} ${test_hdrs})
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/test/test_precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
if(${CMAKE_GENERATOR} MATCHES "Visual*")
set(${the_target}_pch "test/test_precomp.cpp")
endif()
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_GENERATOR} MATCHES ".*Makefiles")
add_precompiled_header(${the_target} ${pch_header})
endif()
endif()
add_opencv_precompiled_headers(${the_target})
# Additional target properties
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}"
)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "tests")
endif()
@@ -165,5 +162,5 @@ macro(define_opencv_module name)
# install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
#endif()
endif()
endmacro()
+199 -205
View File
@@ -15,234 +15,234 @@
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
#MESSAGE("GCC Version: ${gcc_compiler_version}")
IF(gcc_compiler_version MATCHES "4\\.[0,2-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF()
SET(_PCH_include_prefix "-I")
SET(_PCH_include_prefix "-I")
ELSEIF(WIN32)
SET(PCHSupport_FOUND TRUE) # for experimental msvc support
SET(_PCH_include_prefix "/I")
ELSE()
IF(WIN32)
SET(PCHSupport_FOUND TRUE) # for experimental msvc support
SET(_PCH_include_prefix "/I")
ELSE()
SET(PCHSupport_FOUND FALSE)
ENDIF()
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(PCHSupport_FOUND FALSE)
ENDIF()
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(${_out_compile_flags} ${${_flags_var_name}} )
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(${_out_compile_flags} ${${_flags_var_name}} )
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCXX)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
LIST(APPEND ${_out_compile_flags} "-fPIC")
ENDIF()
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)
LIST(APPEND ${_out_compile_flags} "${${_out_compile_flags}} -fPIC")
ELSE()
## TODO ... ? or does it work out of the box
ENDIF()
ELSE()
## TODO ... ? or does it work out of the box
ENDIF()
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}${item}")
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${OpenCV_SOURCE_DIR} DEFINITIONS)
#MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
LIST(APPEND ${_out_compile_flags} ${_directory_flags})
LIST(APPEND ${_out_compile_flags} ${_global_definitions})
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS})
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${OpenCV_SOURCE_DIR} DEFINITIONS)
#MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
LIST(APPEND ${_out_compile_flags} ${_directory_flags})
LIST(APPEND ${_out_compile_flags} ${_global_definitions})
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS} )
SEPARATE_ARGUMENTS(${_out_compile_flags})
SEPARATE_ARGUMENTS(${_out_compile_flags})
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp)
SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx)
FILE(WRITE ${${_dephelp}}
"#include \"${_include_file}\"
int testfunction()
{
return 0;
}
"
)
SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx)
IF(CMAKE_HOST_WIN32)
ADD_CUSTOM_COMMAND(
OUTPUT "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "#include \\\"${_include_file}\\\"" > "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction()" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo " return 0;" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "}" >> "${${_dephelp}}"
DEPENDS "${_include_file}"
)
else()
ADD_CUSTOM_COMMAND(
OUTPUT "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${_include_file}\\\"" > "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction\\(\\)" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo " \\return 0\\;" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "}" >> "${${_dephelp}}"
DEPENDS "${_include_file}"
)
endif()
ENDMACRO(_PCH_WRITE_PCHDEP_CXX )
MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output)
FILE(TO_NATIVE_PATH ${_input} _native_input)
FILE(TO_NATIVE_PATH ${_output} _native_output)
FILE(TO_NATIVE_PATH ${_input} _native_input)
FILE(TO_NATIVE_PATH ${_output} _native_output)
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
SET(${out_command}
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
)
ELSE(CMAKE_CXX_COMPILER_ARG1)
SET(${out_command}
${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
)
ENDIF(CMAKE_CXX_COMPILER_ARG1)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
SET(${out_command}
${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
)
ELSE(CMAKE_CXX_COMPILER_ARG1)
SET(${out_command}
${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
)
ENDIF(CMAKE_CXX_COMPILER_ARG1)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
SET(_dummy_str "#include <${_input}>")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str})
SET(_dummy_str "#include <${_input}>")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str})
SET(${out_command}
${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp
)
#/out:${_output}
SET(${out_command}
${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp
)
#/out:${_output}
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDMACRO(_PCH_GET_COMPILE_COMMAND )
MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn )
FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path)
FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path)
IF(CMAKE_COMPILER_IS_GNUCXX)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
# if you want warnings for invalid header files (which is very inconvenient
# if you have different versions of the headers for different build types
# you may set _pch_dowarn
IF (_dowarn)
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} -Winvalid-pch " )
ELSE (_dowarn)
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} " )
ENDIF (_dowarn)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCXX)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
# if you want warnings for invalid header files (which is very inconvenient
# if you have different versions of the headers for different build types
# you may set _pch_dowarn
IF (_dowarn)
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" -Winvalid-pch " )
ELSE (_dowarn)
SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include \"${CMAKE_CURRENT_BINARY_DIR}/${_header_name}\" " )
ENDIF (_dowarn)
set(${_cflags} "/Fp${_native_pch_path} /Yu${_header_name}" )
ELSE(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
set(${_cflags} "/Fp${_native_pch_path} /Yu${_header_name}" )
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDMACRO(_PCH_GET_TARGET_COMPILE_FLAGS )
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
GET_FILENAME_COMPONENT(_name ${_input} NAME)
GET_FILENAME_COMPONENT(_path ${_input} PATH)
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.gch")
GET_FILENAME_COMPONENT(_name ${_input} NAME)
GET_FILENAME_COMPONENT(_path ${_input} PATH)
SET(${_output} "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.gch")
ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input)
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
GET_FILENAME_COMPONENT(_name ${_input} NAME)
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
GET_FILENAME_COMPONENT(_name ${_input} NAME)
IF( "${ARGN}" STREQUAL "0")
SET(_dowarn 0)
ELSE( "${ARGN}" STREQUAL "0")
SET(_dowarn 1)
ENDIF("${ARGN}" STREQUAL "0")
IF(ARGN STREQUAL "0")
SET(_dowarn 0)
ELSE()
SET(_dowarn 1)
ENDIF()
_PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn})
#MESSAGE("Add flags ${_target_cflags} to ${_targetName} " )
SET_TARGET_PROPERTIES(${_targetName}
PROPERTIES
COMPILE_FLAGS ${_target_cflags}
)
_PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn})
# MESSAGE("Add flags ${_target_cflags} to ${_targetName} " )
SET_TARGET_PROPERTIES(${_targetName}
PROPERTIES
COMPILE_FLAGS ${_target_cflags}
)
ADD_CUSTOM_TARGET(pch_Generate_${_targetName}
DEPENDS ${_pch_output_to_use}
)
ADD_CUSTOM_TARGET(pch_Generate_${_targetName}
DEPENDS ${_pch_output_to_use}
)
ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} )
ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} )
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET)
MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
SET(_PCH_current_target ${_targetName})
SET(_PCH_current_target ${_targetName})
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF(NOT CMAKE_BUILD_TYPE)
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF()
IF( "${ARGN}" STREQUAL "0")
SET(_dowarn 0)
ELSE( "${ARGN}" STREQUAL "0")
SET(_dowarn 1)
ENDIF("${ARGN}" STREQUAL "0")
IF(ARGN STREQUAL "0")
SET(_dowarn 0)
ELSE()
SET(_dowarn 1)
ENDIF()
GET_FILENAME_COMPONENT(_name ${_input} NAME)
GET_FILENAME_COMPONENT(_path ${_input} PATH)
GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output)
GET_FILENAME_COMPONENT(_name ${_input} NAME)
GET_FILENAME_COMPONENT(_path ${_input} PATH)
GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output)
_PCH_WRITE_PCHDEP_CXX(${_targetName} "${_input}" _pch_dephelp_cxx)
GET_FILENAME_COMPONENT(_outdir ${_output} PATH )
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
_PCH_WRITE_PCHDEP_CXX(${_targetName} ${_input} _pch_dephelp_cxx)
IF(${_targetType} STREQUAL SHARED_LIBRARY)
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx} )
ELSE(${_targetType} STREQUAL SHARED_LIBRARY)
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx})
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY)
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC "${_pch_dephelp_cxx}" "${_input}" )
set_target_properties(${_targetName}_pch_dephelp PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
)
set_target_properties(${_targetName}_pch_dephelp PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}"
)
_PCH_GET_COMPILE_FLAGS(_compile_FLAGS)
FILE(MAKE_DIRECTORY ${_outdir})
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
ADD_CUSTOM_COMMAND(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
COMMAND ${CMAKE_COMMAND} -E copy "${_input}" "${CMAKE_CURRENT_BINARY_DIR}/${_name}" # ensure same directory! Required by gcc
DEPENDS "${_input}"
)
#message("_command ${_input} ${_output}")
_PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} )
_PCH_GET_COMPILE_FLAGS(_compile_FLAGS)
GET_FILENAME_COMPONENT(_outdir ${_output} PATH)
ADD_CUSTOM_COMMAND(
OUTPUT "${_output}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${_outdir}"
COMMAND ${_command}
DEPENDS "${_input}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
DEPENDS ${_targetName}_pch_dephelp
)
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${_name} PROPERTIES GENERATED 1)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}
COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} # ensure same directory! Required by gcc
DEPENDS ${_input}
)
#message("_command ${_input} ${_output}")
_PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} )
#message(${_input} )
#message("_output ${_output}")
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${_command}
DEPENDS ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_targetName}_pch_dephelp
)
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn})
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn})
ENDMACRO(ADD_PRECOMPILED_HEADER)
@@ -253,72 +253,66 @@ ENDMACRO(ADD_PRECOMPILED_HEADER)
MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input)
if(CMAKE_GENERATOR MATCHES Visual*)
if(CMAKE_GENERATOR MATCHES "^Visual.*$")
SET(_dummy_str "#include \"${_input}\"\n"
"// This is required to suppress LNK4221. Very annoying.\n"
"void *g_${_targetName}Dummy = 0\;\n")
SET(_dummy_str "#include \"${_input}\"\n"
"// This is required to suppress LNK4221. Very annoying.\n"
"void *g_${_targetName}Dummy = 0\;\n")
# Use of cxx extension for generated files (as Qt does)
SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx)
if(EXISTS ${${_targetName}_pch})
# Check if contents is the same, if not rewrite
# todo
else(EXISTS ${${_targetName}_pch})
FILE(WRITE ${${_targetName}_pch} ${_dummy_str})
endif(EXISTS ${${_targetName}_pch})
endif(CMAKE_GENERATOR MATCHES Visual*)
# Use of cxx extension for generated files (as Qt does)
SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx)
if(EXISTS ${${_targetName}_pch})
# Check if contents is the same, if not rewrite
# todo
else()
FILE(WRITE ${${_targetName}_pch} ${_dummy_str})
endif()
endif()
ENDMACRO(GET_NATIVE_PRECOMPILED_HEADER)
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input)
IF( "${ARGN}" STREQUAL "0")
SET(_dowarn 0)
ELSE( "${ARGN}" STREQUAL "0")
SET(_dowarn 1)
ENDIF("${ARGN}" STREQUAL "0")
IF(ARGN STREQUAL "0")
SET(_dowarn 0)
ELSE()
SET(_dowarn 1)
ENDIF()
if(CMAKE_GENERATOR MATCHES Visual*)
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
if(CMAKE_GENERATOR MATCHES "^Visual.*$")
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
if (${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
endif(${oldProps} MATCHES NOTFOUND)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
if (oldProps MATCHES NOTFOUND)
SET(oldProps "")
endif()
SET(newProperties "${oldProps} /Yu\"${_input}\" /FI\"${_input}\"")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
SET(newProperties "${oldProps} /Yu\"${_input}\" /FI\"${_input}\"")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${${_targetName}_pch} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}\"")
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${${_targetName}_pch} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}\"")
else(CMAKE_GENERATOR MATCHES Visual*)
elseif (CMAKE_GENERATOR MATCHES Xcode)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
if (CMAKE_GENERATOR MATCHES Xcode)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
if (${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
endif(${oldProps} MATCHES NOTFOUND)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE)
else()
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
#Fallback to the "old" precompiled suppport
#ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn})
else (CMAKE_GENERATOR MATCHES Xcode)
#Fallback to the "old" precompiled suppport
#ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn})
endif(CMAKE_GENERATOR MATCHES Xcode)
endif(CMAKE_GENERATOR MATCHES Visual*)
endif()
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)

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