Skip to content

Commit

Permalink
Rename greedyhdeint MANGLE macro to avoid conflict with libavutil's M…
Browse files Browse the repository at this point in the history
…ANGLE macro.
  • Loading branch information
daniel-kristjansson committed Dec 20, 2012
1 parent a4b7d60 commit 84de78c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
32 changes: 16 additions & 16 deletions mythtv/filters/greedyhdeint/greedyh.asm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void FUNCT_NAME(uint8_t *output, int outstride,
"movq (%%"XAX", %%"XCX"), %%mm3\n\t" // L3, next odd row
"movq %%mm1, %%mm6\n\t" // L1 - get simple single pixel interp
// pavgb mm6, mm3 // use macro below
V_PAVGB ("%%mm6", "%%mm3", "%%mm4", MANGLE(ShiftMask))
V_PAVGB ("%%mm6", "%%mm3", "%%mm4", GREEDYH_MANGLE(ShiftMask))

// DJR - Diagonal Jaggie Reduction
// In the event that we are going to use an average (Bob) pixel we do not want a jagged
Expand All @@ -175,22 +175,22 @@ static void FUNCT_NAME(uint8_t *output, int outstride,

"movq (%%"XBX"), %%mm5\n\t" // next horiz qword from L1
// pavgb mm5, qword ptr[ebx+ecx] // next horiz qword from L3, use macro below
V_PAVGB ("%%mm5", "(%%"XBX",%%"XCX")", "%%mm7", MANGLE(ShiftMask))
V_PAVGB ("%%mm5", "(%%"XBX",%%"XCX")", "%%mm7", GREEDYH_MANGLE(ShiftMask))
"psllq $48, %%mm5\n\t" // left just 1 pixel
"movq %%mm6, %%mm7\n\t" // another copy of simple bob pixel
"psrlq $16, %%mm7\n\t" // right just 3 pixels
"por %%mm7, %%mm5\n\t" // combine
// pavgb mm4, mm5 // avg of forward and prev by 1 pixel, use macro
V_PAVGB ("%%mm4", "%%mm5", "%%mm5", MANGLE(ShiftMask)) // mm5 gets modified if MMX
V_PAVGB ("%%mm4", "%%mm5", "%%mm5", GREEDYH_MANGLE(ShiftMask)) // mm5 gets modified if MMX
// pavgb mm6, mm4 // avg of center and surround interp vals, use macro
V_PAVGB ("%%mm6", "%%mm4", "%%mm7", MANGLE(ShiftMask))
V_PAVGB ("%%mm6", "%%mm4", "%%mm7", GREEDYH_MANGLE(ShiftMask))

// Don't do any more averaging than needed for mmx. It hurts performance and causes rounding errors.
#ifndef IS_MMX
// pavgb mm4, mm6 // 1/4 center, 3/4 adjacent
V_PAVGB ("%%mm4", "%%mm6", "%%mm7", MANGLE(ShiftMask))
V_PAVGB ("%%mm4", "%%mm6", "%%mm7", GREEDYH_MANGLE(ShiftMask))
// pavgb mm6, mm4 // 3/8 center, 5/8 adjacent
V_PAVGB ("%%mm6", "%%mm4", "%%mm7", MANGLE(ShiftMask))
V_PAVGB ("%%mm6", "%%mm4", "%%mm7", GREEDYH_MANGLE(ShiftMask))
#endif

// get abs value of possible L2 comb
Expand Down Expand Up @@ -243,34 +243,34 @@ static void FUNCT_NAME(uint8_t *output, int outstride,
// pminub mm5, mm3 // now = Min(L1,L3), use macro
V_PMINUB ("%%mm5", "%%mm3", "%%mm7")
// allow the value to be above the high or below the low by amt of MaxComb
"psubusb "MANGLE(MaxComb)", %%mm5\n\t" // lower min by diff
"paddusb "MANGLE(MaxComb)", %%mm2\n\t" // increase max by diff
"psubusb "GREEDYH_MANGLE(MaxComb)", %%mm5\n\t" // lower min by diff
"paddusb "GREEDYH_MANGLE(MaxComb)", %%mm2\n\t" // increase max by diff
// pmaxub mm4, mm5 // now = Max(best,Min(L1,L3) use macro
V_PMAXUB ("%%mm4", "%%mm5")
// pminub mm4, mm2 // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped
V_PMINUB ("%%mm4", "%%mm2", "%%mm7")

// Blend weave pixel with bob pixel, depending on motion val in mm0
"psubusb "MANGLE(MotionThreshold)", %%mm0\n\t"// test Threshold, clear chroma change >>>??
"pmullw "MANGLE(MotionSense)", %%mm0\n\t" // mul by user factor, keep low 16 bits
"movq "MANGLE(QW256)", %%mm7\n\t"
"psubusb "GREEDYH_MANGLE(MotionThreshold)", %%mm0\n\t"// test Threshold, clear chroma change >>>??
"pmullw "GREEDYH_MANGLE(MotionSense)", %%mm0\n\t" // mul by user factor, keep low 16 bits
"movq "GREEDYH_MANGLE(QW256)", %%mm7\n\t"
#ifdef IS_SSE
"pminsw %%mm7, %%mm0\n\t" // max = 256
#else
"paddusw "MANGLE(QW256B)", %%mm0\n\t" // add, may sat at fff..
"psubusw "MANGLE(QW256B)", %%mm0\n\t" // now = Min(L1,256)
"paddusw "GREEDYH_MANGLE(QW256B)", %%mm0\n\t" // add, may sat at fff..
"psubusw "GREEDYH_MANGLE(QW256B)", %%mm0\n\t" // now = Min(L1,256)
#endif
"psubusw %%mm0, %%mm7\n\t" // so the 2 sum to 256, weighted avg
"movq %%mm4, %%mm2\n\t" // save weave chroma info before trashing
"pand "MANGLE(YMask)", %%mm4\n\t" // keep only luma from calc'd value
"pand "GREEDYH_MANGLE(YMask)", %%mm4\n\t" // keep only luma from calc'd value
"pmullw %%mm7, %%mm4\n\t" // use more weave for less motion
"pand "MANGLE(YMask)", %%mm6\n\t" // keep only luma from calc'd value
"pand "GREEDYH_MANGLE(YMask)", %%mm6\n\t" // keep only luma from calc'd value
"pmullw %%mm0, %%mm6\n\t" // use more bob for large motion
"paddusw %%mm6, %%mm4\n\t" // combine
"psrlw $8, %%mm4\n\t" // div by 256 to get weighted avg

// chroma comes from weave pixel
"pand "MANGLE(UVMask)", %%mm2\n\t" // keep chroma
"pand "GREEDYH_MANGLE(UVMask)", %%mm2\n\t" // keep chroma
"por %%mm4, %%mm2\n\t" // and combine

V_MOVNTQ ("(%%"XDI")", "%%mm2") // move in our clipped best, use macro
Expand Down
14 changes: 7 additions & 7 deletions mythtv/filters/greedyhdeint/mangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
* File licensed under the GPL, see http://www.fsf.org/ for more info.
*/

#ifndef __MANGLE_H
#define __MANGLE_H
#ifndef __GREEDYH_MANGLE_H
#define __GREEDYH_MANGLE_H

/* Feel free to add more to the list, eg. a.out IMO */
/* Use rip-relative addressing if compiling PIC code on x86-64. */
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
CONFIG_DARWIN || (defined(__OpenBSD__) && !defined(__ELF__))
#if ARCH_X86_64 && defined(PIC)
#define MANGLE(a) "_" #a"(%%rip)"
#define GREEDYH_MANGLE(a) "_" #a"(%%rip)"
#else
#define MANGLE(a) "_" #a
#define GREEDYH_MANGLE(a) "_" #a
#endif
#else
#if ARCH_X86_64 && defined(PIC)
#define MANGLE(a) #a"(%%rip)"
#define GREEDYH_MANGLE(a) #a"(%%rip)"
#else
#define MANGLE(a) #a
#define GREEDYH_MANGLE(a) #a
#endif
#endif

#endif /* !__MANGLE_H */
#endif /* !__GREEDYH_MANGLE_H */

0 comments on commit 84de78c

Please sign in to comment.