/**************************************************************************** * * Module Title : DeInterlaceWmt.c * * Description : DeInterlace Routines * ***************************************************************************/ /**************************************************************************** * Header Files ****************************************************************************/ #include "postp.h" /**************************************************************************** * Module constants. ****************************************************************************/ #if defined(_WIN32_WCE) #pragma pack(16) short four2s[] = { 2, 2, 2, 2 }; #pragma pack() #else __declspec(align(16)) short four2s[] = { 2, 2, 2, 2 }; #endif /**************************************************************************** * * ROUTINE : WmtFastDeInterlace * * INPUTS : UINT8 *SrcPtr : Pointer to input frame. * UINT8 *DstPtr : Pointer to output frame. * INT32 Width : Width of frame in pixels. * INT32 Height : Height of frame in pixels. * INT32 Stride : Stride of images. * * OUTPUTS : None. * * RETURNS : void * * FUNCTION : Applies a 3 tap filter vertically to remove interlacing * artifacts. * * SPECIAL NOTES : This function use a three tap filter [1, 2, 1] to blur * veritically in an interlaced frame. This function assumes: * 1) Buffers SrcPtr and DstPtr point to have the same geometery, * 2) SrcPtr and DstPtr can _not_ be same. * ****************************************************************************/ void MmxFastDeInterlace ( UINT8 *SrcPtr, UINT8 *DstPtr, INT32 Width, INT32 Height, INT32 Stride ) { INT32 i; UINT8 *CurrentSrcPtr = SrcPtr; UINT8 *CurrentDstPtr = DstPtr; // Always copy the first line memcpy ( CurrentDstPtr, CurrentSrcPtr, Width ); for ( i=1; i> 2 psraw mm3, 2 // >> 2 packuswb mm0, mm3 movq QWORD ptr [edi+ecx], mm0 add ecx, 8 cmp ecx, ebx jl MmxDeInterlaceLoop } CurrentSrcPtr += Stride; /* for(j=0;j>2 ); } */ } // copy the last line CurrentSrcPtr += Stride; CurrentDstPtr += Stride; memcpy ( CurrentDstPtr, CurrentSrcPtr, Width ); }