Skip to content

Commit 8dff7ad

Browse files
authored
Merge pull request #129 from thinrope/master
Obliterating most any reference to ORC
2 parents c8caf90 + 05d2903 commit 8dff7ad

23 files changed

+8
-1620
lines changed

CMakeLists.txt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ if(APPLE AND NOT CMAKE_OSX_ARCHITECTURES AND NOT SSE2_FOUND)
3636
add_definitions(-march=armv8-a+fp+simd+crypto+crc)
3737
endif()
3838

39-
### ORC is not used in any active code at the moment ###
40-
# I tried it with 0.4.14
41-
# 0.4.10 did not work (not all opcode implemented)
42-
# find_package(Orc)
43-
if(ORC_FOUND)
44-
add_definitions( -DUSE_ORC ${ORC_DEFINITIONS} )
45-
include_directories( ${ORC_INCLUDE_DIRS} )
46-
else()
47-
add_definitions( -DDISABLE_ORC )
48-
endif()
49-
5039
# here we should check for SSE2
5140
# our -DUSE_SSE2_ASM code does not work with fpic
5241
if(SSE2_FOUND)
@@ -60,7 +49,7 @@ endif()
6049
set(SOURCES src/frameinfo.c src/transformtype.c src/libvidstab.c
6150
src/transform.c src/transformfixedpoint.c src/motiondetect.c
6251
src/motiondetect_opt.c src/serialize.c src/localmotion2transform.c
63-
src/boxblur.c src/vsvector.c src/orc/motiondetectorc.c)
52+
src/boxblur.c src/vsvector.c)
6453

6554
set(HEADERS src/frameinfo.h src/transformtype.h src/libvidstab.h
6655
src/transform.h src/motiondetect.h src/serialize.h
@@ -76,10 +65,6 @@ set_target_properties(vidstab PROPERTIES SOVERSION ${MAJOR_VERSION}.${MINOR_VERS
7665

7766
target_link_libraries(vidstab m)
7867
set(PKG_EXTRA_LIBS -lm)
79-
if(ORC_FOUND)
80-
target_link_libraries(vidstab ${ORC_LIBRARIES})
81-
set(PKG_EXTRA_LIBS "${PKG_EXTRA_LIBS} ${ORC_LIBRARIES}")
82-
endif()
8368
if(USE_OMP AND OPENMP_FOUND)
8469
if(TARGET OpenMP::OpenMP_C)
8570
target_link_libraries(vidstab OpenMP::OpenMP_C)

CMakeModules/FindOrc.cmake

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/motiondetect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,7 @@ void drawLine(unsigned char* I, int width, int height, int bytesPerPixel,
878878
// }
879879

880880

881-
//#ifdef TESTING
882-
/// plain C implementation of compareSubImg (without ORC)
881+
/// plain C implementation of compareSubImg
883882
unsigned int compareSubImg_thr(unsigned char* const I1, unsigned char* const I2,
884883
const Field* field, int width1, int width2, int height,
885884
int bytesPerPixel, int d_x, int d_y,

src/motiondetect_opt.c

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
*/
2727
#include "motiondetect_opt.h"
2828

29-
#ifdef USE_ORC
30-
#include "orc/motiondetectorc.h"
31-
#endif
32-
3329
#ifdef USE_SSE2
3430
#include <emmintrin.h>
3531

@@ -100,35 +96,7 @@ double contrastSubImg1_SSE(unsigned char* const I, const Field* field,
10096
}
10197
#endif
10298

103-
#ifdef USE_ORC
104-
/**
105-
calculates the contrast in the given small part of the given image
106-
using the absolute difference from mean luminance (like Root-Mean-Square,
107-
but with abs() (Manhattan-Norm))
108-
For multichannel images use contrastSubImg_Michelson()
109-
110-
\param I pointer to framebuffer
111-
\param field Field specifies position(center) and size of subimage
112-
\param width width of frame
113-
\param height height of frame
114-
*/
115-
double contrastSubImg_variance_orc(unsigned char* const I, const Field* field,
116-
int width, int height) {
117-
unsigned char* p = NULL;
118-
int s2 = field->size / 2;
119-
int numpixel = field->size*field->size;
120-
121-
p = I + ((field->x - s2) + (field->y - s2) * width);
122-
123-
unsigned int sum=0;
124-
image_sum_optimized((signed int*)&sum, p, width, field->size, field->size);
125-
unsigned char mean = sum / numpixel;
126-
int var=0;
127-
image_variance_optimized(&var, p, width, mean, field->size, field->size);
128-
return (double)var/numpixel/255.0;
129-
}
130-
131-
/// plain C implementation of variance based contrastSubImg (without ORC)
99+
/// plain C implementation of variance based contrastSubImg
132100
double contrastSubImg_variance_C(unsigned char* const I,
133101
const Field* field, int width, int height) {
134102
int k, j;
@@ -158,69 +126,6 @@ double contrastSubImg_variance_C(unsigned char* const I,
158126
}
159127
return (double)var/numpixel/255.0;
160128
}
161-
#endif
162-
163-
164-
165-
166-
167-
168-
#ifdef USE_ORC
169-
/**
170-
compares a small part of two given images
171-
and returns the average absolute difference.
172-
Field center, size and shift have to be choosen,
173-
so that no clipping is required.
174-
Uses optimized inner loops by ORC.
175-
176-
\param field Field specifies position(center) and size of subimage
177-
\param d_x shift in x direction
178-
\param d_y shift in y direction
179-
*/
180-
unsigned int compareSubImg_thr_orc(unsigned char* const I1, unsigned char* const I2,
181-
const Field* field, int width1, int width2, int height,
182-
int bytesPerPixel, int d_x, int d_y,
183-
unsigned int threshold) {
184-
unsigned char* p1 = NULL;
185-
unsigned char* p2 = NULL;
186-
int s2 = field->size / 2;
187-
int j;
188-
unsigned int sum = 0;
189-
p1 = I1 + ((field->x - s2) + (field->y - s2) * width1) * bytesPerPixel;
190-
p2 = I2 + ((field->x - s2 + d_x) + (field->y - s2 + d_y) * width2) * bytesPerPixel;
191-
192-
for (j = 0; j < field->size; j++) {
193-
unsigned int s = 0;
194-
image_line_difference_optimized(&s, p1, p2, field->size* bytesPerPixel);
195-
sum += s;
196-
if( sum > threshold) // no need to calculate any longer: worse than the best match
197-
break;
198-
p1 += width1 * bytesPerPixel;
199-
p2 += width2 * bytesPerPixel;
200-
}
201-
202-
203-
return sum;
204-
}
205-
206-
// implementation with 1 orc function, but no threshold
207-
unsigned int compareSubImg_orc(unsigned char* const I1, unsigned char* const I2,
208-
const Field* field, int width1, int width2, int height,
209-
int bytesPerPixel, int d_x, int d_y,
210-
unsigned int threshold) {
211-
unsigned char* p1 = NULL;
212-
unsigned char* p2 = NULL;
213-
int s2 = field->size / 2;
214-
unsigned int sum=0;
215-
p1 = I1 + ((field->x - s2) + (field->y - s2) * width1) * bytesPerPixel;
216-
p2 = I2 + ((field->x - s2 + d_x) + (field->y - s2 + d_y) * width2)
217-
* bytesPerPixel;
218-
219-
image_difference_optimized(&sum, p1, width1 * bytesPerPixel, p2, width2 * bytesPerPixel,
220-
field->size* bytesPerPixel , field->size);
221-
return sum;
222-
}
223-
#endif
224129

225130
#ifdef USE_SSE2
226131
unsigned int compareSubImg_thr_sse2(unsigned char* const I1, unsigned char* const I2,

src/motiondetect_opt.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#define compareSubImg compareSubImg_thr_sse2_asm
3535
#elif defined(USE_SSE2) //enable SSE2 code
3636
#define compareSubImg compareSubImg_thr_sse2
37-
#elif defined(USE_ORC)
38-
#define compareSubImg compareSubImg_thr_orc
3937
#else
4038
#define compareSubImg compareSubImg_thr
4139
#endif
@@ -45,27 +43,9 @@ double contrastSubImg1_SSE(unsigned char* const I, const Field* field,
4543
int width, int height);
4644
#endif
4745

48-
#ifdef USE_ORC
49-
double contrastSubImg_variance_orc(unsigned char* const I, const Field* field,
50-
int width, int height);
5146
double contrastSubImg_variance_C(unsigned char* const I, const Field* field,
5247
int width, int height);
5348

54-
#endif
55-
56-
#ifdef USE_ORC
57-
unsigned int compareSubImg_orc(unsigned char* const I1, unsigned char* const I2,
58-
const Field* field, int width1, int width2, int height,
59-
int bytesPerPixel, int d_x, int d_y,
60-
unsigned int threshold);
61-
62-
63-
unsigned int compareSubImg_thr_orc(unsigned char* const I1, unsigned char* const I2,
64-
const Field* field, int width1, int width2, int height,
65-
int bytesPerPixel, int d_x, int d_y,
66-
unsigned int threshold);
67-
#endif
68-
6949
#ifdef USE_SSE2
7050
unsigned int compareSubImg_thr_sse2(unsigned char* const I1, unsigned char* const I2,
7151
const Field* field, int width1, int width2, int height,

src/orc/Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)