From c003d455518e5bad93b607b22763c299987664b5 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 2 Jan 2004 20:47:03 +0000 Subject: my small contribution to the cygwin port ;-) CVS patchset: 5975 CVS date: 2004/01/02 20:47:03 --- .../deinterlace/plugins/greedy2frame_template.c | 49 +++++++++++++--------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/post/deinterlace/plugins/greedy2frame_template.c b/src/post/deinterlace/plugins/greedy2frame_template.c index 999571e23..41be3dc49 100644 --- a/src/post/deinterlace/plugins/greedy2frame_template.c +++ b/src/post/deinterlace/plugins/greedy2frame_template.c @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// $Id: greedy2frame_template.c,v 1.1 2003/06/22 17:30:03 miguelfreitas Exp $ +// $Id: greedy2frame_template.c,v 1.2 2004/01/02 20:47:03 miguelfreitas Exp $ ///////////////////////////////////////////////////////////////////////////// // Copyright (c) 2000 John Adcock, Tom Barry, Steve Grimm All rights reserved. // port copyright (c) 2003 Miguel Freitas @@ -19,8 +19,11 @@ // CVS Log // // $Log: greedy2frame_template.c,v $ -// Revision 1.1 2003/06/22 17:30:03 miguelfreitas -// use our own port of greedy2frame (tvtime port is currently broken) +// Revision 1.2 2004/01/02 20:47:03 miguelfreitas +// my small contribution to the cygwin port ;-) +// +// Revision 1.1 2003/06/22 17:30:03 miguelfreitas +// use our own port of greedy2frame (tvtime port is currently broken) // // Revision 1.8 2001/11/23 17:18:54 adcockj // Fixed silly and/or confusion @@ -61,13 +64,21 @@ #if !defined(MASKS_DEFINED) #define MASKS_DEFINED - static const int64_t YMask = 0x00ff00ff00ff00ff; - static const int64_t Mask = 0x7f7f7f7f7f7f7f7f; - static const int64_t DwordOne = 0x0000000100000001; - static const int64_t DwordTwo = 0x0000000200000002; + static const int64_t YMask = 0x00ff00ff00ff00ffll; + static const int64_t Mask = 0x7f7f7f7f7f7f7f7fll; + static const int64_t DwordOne = 0x0000000100000001ll; + static const int64_t DwordTwo = 0x0000000200000002ll; static int64_t qwGreedyTwoFrameThreshold; #endif +#if !defined(MANGLE) + #if defined(__CYGWIN__) + #define MANGLE(a) "_" #a + #else + #define MANGLE(a) #a + #endif +#endif + #if defined(IS_SSE) static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride, deinterlace_frame_data_t *data, @@ -140,7 +151,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, // See above for a description of the algorithm. ".align 8 \n\t" - "movq Mask, %%mm6 \n\t" + "movq "MANGLE(Mask)", %%mm6 \n\t" "movq %0, %%mm1 \n\t" // T1 "movq %1, %%mm0 \n\t" // M1 @@ -204,10 +215,10 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, #endif // if |M1-M0| > Threshold we want dword worth of twos - "pcmpgtb qwGreedyTwoFrameThreshold, %%mm4 \n\t" - "pand Mask, %%mm4 \n\t" // get rid of any sign bit - "pcmpgtd DwordOne, %%mm4 \n\t" // do we want to bob - "pandn DwordTwo, %%mm4 \n\t" + "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm4 \n\t" + "pand "MANGLE(Mask)", %%mm4 \n\t" // get rid of any sign bit + "pcmpgtd "MANGLE(DwordOne)", %%mm4 \n\t" // do we want to bob + "pandn "MANGLE(DwordTwo)", %%mm4 \n\t" "movq %1, %%mm2 \n\t" // mm2 = T0 @@ -220,11 +231,11 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, "pand %%mm6, %%mm5 \n\t" // if |T1-T0| > Threshold we want dword worth of ones - "pcmpgtb qwGreedyTwoFrameThreshold, %%mm5 \n\t" + "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm5 \n\t" "pand %%mm6, %%mm5 \n\t" // get rid of any sign bit - "pcmpgtd DwordOne, %%mm5 \n\t" - "pandn DwordOne, %%mm5 \n\t" + "pcmpgtd "MANGLE(DwordOne)", %%mm5 \n\t" + "pandn "MANGLE(DwordOne)", %%mm5 \n\t" "paddd %%mm5, %%mm4 \n\t" "movq %2, %%mm2 \n\t" // B0 @@ -238,13 +249,13 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, "pand %%mm6, %%mm5 \n\t" // if |B1-B0| > Threshold we want dword worth of ones - "pcmpgtb qwGreedyTwoFrameThreshold, %%mm5 \n\t" + "pcmpgtb "MANGLE(qwGreedyTwoFrameThreshold)", %%mm5 \n\t" "pand %%mm6, %%mm5 \n\t" // get rid of any sign bit - "pcmpgtd DwordOne, %%mm5 \n\t" - "pandn DwordOne, %%mm5 \n\t" + "pcmpgtd "MANGLE(DwordOne)", %%mm5 \n\t" + "pandn "MANGLE(DwordOne)", %%mm5 \n\t" "paddd %%mm5, %%mm4 \n\t" - "pcmpgtd DwordTwo, %%mm4 \n\t" + "pcmpgtd "MANGLE(DwordTwo)", %%mm4 \n\t" // debugging feature // output the value of mm4 at this point which is pink where we will weave -- cgit v1.2.3