📄 softidct.h
字号:
#endif
#if defined(FREESCALE_MX1)
void MX1PopNone(softidct* p);
void MX1Intra8x8(softidct* p,idct_block_t* Data,int Length,int ScanType);
void MX1Inter8x8Back(softidct* p,idct_block_t* Block,int Length);
void MX1Inter8x8BackFwd(softidct* p,idct_block_t* Block,int Length);
void MX1Inter8x8QPEL(softidct* p,idct_block_t* Block,int Length);
void MX1Inter8x8GMC(softidct* p,idct_block_t* Block,int Length);
void MX1Intra8x8Swap(softidct* p,idct_block_t* Data,int Length,int ScanType);
void MX1Inter8x8BackSwap(softidct* p,idct_block_t* Block,int Length);
void MX1Inter8x8BackFwdSwap(softidct* p,idct_block_t* Block,int Length);
#endif
#if defined(ARM)
void WMMXIntra8x8(softidct* p,idct_block_t* Data,int Length,int ScanType);
void WMMXInter8x8Back(softidct* p,idct_block_t* Block,int Length);
void WMMXInter8x8BackFwd(softidct* p,idct_block_t* Block,int Length);
void WMMXIntra8x8Swap(softidct* p,idct_block_t* Data,int Length,int ScanType);
void WMMXInter8x8QPEL(softidct* p,idct_block_t* Block,int Length);
void WMMXInter8x8GMC(softidct* p,idct_block_t* Block,int Length);
void WMMXInter8x8BackSwap(softidct* p,idct_block_t* Block,int Length);
void WMMXInter8x8BackFwdSwap(softidct* p,idct_block_t* Block,int Length);
void STDCALL WMMXIDCT_Block8x4(idct_block_t *Block, uint8_t *Dest, int DestStride, const uint8_t *Src);
void STDCALL WMMXIDCT_Block8x8(idct_block_t *Block, uint8_t *Dest, int DestStride, const uint8_t *Src);
void STDCALL WMMXIDCT_Const8x8(int v,uint8_t * Dst,int DstStride,uint8_t * Src);
void STDCALL WMMXIDCT_Const4x4(int v,uint8_t * Dst,int DstStride,uint8_t * Src);
void STDCALL WMMXCopyBlockM(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockHorRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXCopyBlockHorVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL WMMXAddBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL WMMXAddBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL WMMXAddBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL WMMXAddBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL FastCopyBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockHorRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastCopyBlockHorVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL FastAddBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL FastAddBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL FastAddBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL FastAddBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL PreLoadCopyBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockHorRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadCopyBlockHorVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
void STDCALL PreLoadAddBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL PreLoadAddBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL PreLoadAddBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
void STDCALL PreLoadAddBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
#endif
#if defined(MIPS64)
#define CopyBlock8x8 CopyBlock
#define CopyBlock16x16 CopyMBlock
extern void STDCALL CopyMBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockHorRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void STDCALL CopyMBlockHorVerRound(uint8_t * Src, uint8_t * Dst, int SrcPitch, int DstPitch);
extern void Inter8x8Add(softidct* p,idct_block_t *Block,int Length);
// Src must be aligned
extern void AddBlock8x8(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void AddBlock16x16(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
#if defined(TARGET_WINCE) || defined(TARGET_WIN32)
#define MIPS64_WIN32
#endif
#ifdef MIPS64_WIN32
static INLINE void DisableInterrupts() {
__asm( ".set noreorder;"
"mfc0 $4,$12;"
"li $5,-1;"
"sll $5,$5,1;"
"and $4,$4,$5;"
"mtc0 $4,$12;"
"nop;"
".set reorder;"
);
}
static INLINE void EnableInterrupts() {
__asm( ".set noreorder;"
"mfc0 $4,$12;"
"nop;"
"nop;"
"ori $4,$4,0x001;"
"mtc0 $4,$12;"
"nop;"
".set reorder;"
);
}
#endif
#elif defined(MIPS32)
// Src must be aligned
extern void STDCALL AddBlock4x4(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL AddBlock8x8(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL CopyBlock4x4(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL CopyBlock16x16(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL CopyBlock8x8(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
#else
// AddBlock DstPitch=8
extern void STDCALL AddBlock(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlockHor(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlockVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlockHorVer(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_00(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_01(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_02(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_03(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_10(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_11(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_12(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_13(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_20(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_21(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_22(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_23(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_30(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_31(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_32(uint8_t * Src, uint8_t * Dst, int SrcPitch);
extern void STDCALL AddBlock4x4_33(uint8_t * Src, uint8_t * Dst, int SrcPitch);
// Src must be aligned
extern void STDCALL CopyBlock4x4(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL CopyBlock8x8(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
extern void STDCALL CopyBlock16x16(uint8_t * Src, uint8_t * Dst, int SrcPitch,int DstPitch);
#endif
#ifdef MMX
#ifdef _MSC_VER
#if defined(TARGET_WINCE) || defined(_M_AMD64)
extern void STDCALL EMMS();
#else
static INLINE void EMMS() { __asm { emms } }
#endif
#else
#define EMMS() __asm__ __volatile__ ("emms")
#endif
#else
static INLINE void EMMS() {}
#endif
#ifdef ARM
#define SAT(Value) Value = Value < 0 ? 0: (Value > 255 ? 255: Value);
#else
// upper bits are trashed! use only lower 8 bits afterward
#define SAT(Value) Value <<= Value >> 16; Value |= (Value << 23) >> 31;
#endif
static INLINE void ProcessHead(softidct* p,int x,int y)
{
#ifdef MIPS64_WIN32
if (y != p->NextIRQ)
EnableInterrupts();
#endif
}
static INLINE void ProcessTail(softidct* p,int x,int y)
{
#ifdef MIPS64_WIN32
if (y != p->NextIRQ)
{
p->NextIRQ = y;
DisableInterrupts();
}
#endif
}
static INLINE void SetPtr420(softidct* p,int x,int y,int shift)
{
x <<= 4-shift;
y <<= 4-shift;
x += EDGE;
y += EDGE;
y *= p->BufWidth;
p->CurrPitch = p->BufWidth;
p->DstPtr = p->Dst+x+y;
p->RefPtr[0] = p->Ref[0]+x+y;
p->RefPtr[1] = p->Ref[1]+x+y;
p->Ptr = p->Tab;
p->Tab[3] = 1 | 2*(-y-x-(8>>shift)*p->BufWidth-(8>>shift) +
p->YToU + (x>>1) + (y>>2)); //Y[1;1] -> U
}
static INLINE void SetPtr422(softidct* p,int x,int y,int shift)
{
x <<= 4-shift;
y <<= 3-shift;
x += EDGE;
y += EDGE;
y *= p->BufWidth;
p->CurrPitch = p->BufWidth;
p->DstPtr = p->Dst+x+y;
p->RefPtr[0] = p->Ref[0]+x+y;
p->RefPtr[1] = p->Ref[1]+x+y;
p->Ptr = p->Tab;
p->Tab[1] = 1 | 2*(-y-x-(8>>shift) +
p->YToU + (x>>1) + (y>>1)); //Y[0;1] -> U
}
static INLINE void SetPtr444(softidct* p,int x,int y,int shift)
{
x <<= 3-shift;
y <<= 3-shift;
x += EDGE;
y += EDGE;
y *= p->BufWidth;
p->CurrPitch = p->BufWidth;
p->DstPtr = p->Dst+x+y;
p->RefPtr[0] = p->Ref[0]+x+y;
p->RefPtr[1] = p->Ref[1]+x+y;
p->Ptr = p->Tab;
}
static INLINE void IncPtr(softidct* p,bool_t Ref0,bool_t Ref1)
{
uint8_t* DstPtr = p->DstPtr;
int v = *(p->Ptr++);
if (v & 1) p->CurrPitch >>= 1;
v >>= 1;
p->DstPtr = DstPtr + v;
if (Ref0) p->RefPtr[0] += v;
if (Ref1) p->RefPtr[1] += v;
}
static INLINE void IncPtrLum(softidct* p)
{
int v = (p->Tab[0]+p->Tab[1]+p->Tab[2]+p->Tab[3]) >> 1;
p->CurrPitch >>= 1;
p->DstPtr += v;
p->RefPtr[0] += v;
p->RefPtr[1] += v;
p->Ptr = &p->Tab[4];
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -