⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 h263dec.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
📖 第 1 页 / 共 2 页
字号:
        h263_Add8x8HP_16s8u(pRef, stepRef, coeffMB, pCur, stepCur, mv, rc); \    } else { \        h263_Copy8x8HP_8u(pRef, stepRef, pCur, stepCur, mv, rc); \    } \}#define h263_MC(pat, pRef, stepRef, pCur, stepCur, coeffMB) \{ \  if (pat) { \    ippiAdd8x8HP_16s8u_C1RS(coeffMB, 16, pRef, stepRef, pCur, stepCur, 0, 0); \  } else { \    ippiCopy8x8_8u_C1R(pRef, stepRef, pCur, stepCur); \  } \}#define h263_AddResidual(pat, pc, stepc, coeffMB) \{ \    if (pat) { \        h263_Add8x8_16s8u(pc, coeffMB, stepc); \    } \}#define h263_DecodeMCBlockInter(pInfo, quant, pat, pRef, pCur, step, coeffMB, mv, rounding) \{ \  if (pat) { \    int lnz; \    int modQ = pInfo->VideoSequence.VideoPicture.oppmodes.modQuant; \    if (!pInfo->VideoSequence.VideoPicture.oppmodes.altInterVLC) { \      if (ippiReconstructCoeffsInter_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB, &lnz, quant, modQ) != ippStsNoErr) { \        h263_Error("Error when decoding coefficients of Inter block"); \        return H263_STATUS_ERROR; \      } \    } else { \      if (ippiDecodeCoeffsInter_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB+64, &lnz, modQ, IPPVC_SCAN_NONE) != ippStsNoErr) { \        if (ippiDecodeCoeffsIntra_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB+64, &lnz, 1, modQ, IPPVC_SCAN_NONE) != ippStsNoErr) { \          h263_Error("Error when decoding coefficients of a block in advanced INTER VLC mode"); \          return H263_STATUS_ERROR; \        } \      } \      ippiQuantInvInter_H263_16s_C1I(coeffMB+64, lnz, quant, modQ); \      ippiScanInv_16s_C1(coeffMB+64, coeffMB, lnz, IPPVC_SCAN_ZIGZAG); \    } \    if (lnz != 0) { \      if ((lnz <= 4) && (coeffMB[16] == 0)) \        ippiDCT8x8Inv_2x2_16s_C1I(coeffMB); \      else if ((lnz <= 13) && (coeffMB[32] == 0)) \        ippiDCT8x8Inv_4x4_16s_C1I(coeffMB); \      else \        ippiDCT8x8Inv_16s_C1I(coeffMB); \    } else { \      h263_Set64_16s((Ipp16s)((coeffMB[0] + 4) >> 3), coeffMB); \    } \    h263_Add8x8HP_16s8u(pRef, step, coeffMB, pCur, step, mv, rounding); \    h263_StatisticInc_(&pInfo->VideoSequence.Statistic.nB_INTER_C); \  } else { \    h263_Copy8x8HP_8u(pRef, step, pCur, step, mv, rounding); \    h263_StatisticInc_(&pInfo->VideoSequence.Statistic.nB_INTER_NC); \  } \}#define h263_DecodeMCBlockInter_B(pInfo, quant, pat, pRef, stepR, pB, stepB, coeffMB) \{ \  if (pat) { \    int lnz; \    int modQ = pInfo->VideoSequence.VideoPicture.oppmodes.modQuant; \    if (!pInfo->VideoSequence.VideoPicture.oppmodes.altInterVLC) { \      if (ippiReconstructCoeffsInter_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB, &lnz, quant, modQ) != ippStsNoErr) { \        h263_Error("Error when decoding coefficients of Inter block"); \        return H263_STATUS_ERROR; \      } \    } else { \      if (ippiDecodeCoeffsInter_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB+64, &lnz, modQ, IPPVC_SCAN_NONE) != ippStsNoErr) { \        if (ippiDecodeCoeffsIntra_H263_1u16s(&pInfo->bufptr, &pInfo->bitoff, coeffMB+64, &lnz, 1, modQ, IPPVC_SCAN_NONE) != ippStsNoErr) { \          h263_Error("Error when decoding coefficients of a block in advanced INTER VLC mode"); \          return H263_STATUS_ERROR; \        } \      } \      ippiQuantInvInter_H263_16s_C1I(coeffMB+64, lnz, quant, modQ); \      ippiScanInv_16s_C1(coeffMB+64, coeffMB, lnz, IPPVC_SCAN_ZIGZAG); \    } \    if (lnz != 0) { \      if ((lnz <= 4) && (coeffMB[16] == 0)) \        ippiDCT8x8Inv_2x2_16s_C1I(coeffMB); \      else if ((lnz <= 13) && (coeffMB[32] == 0)) \        ippiDCT8x8Inv_4x4_16s_C1I(coeffMB); \      else \        ippiDCT8x8Inv_16s_C1I(coeffMB); \    } else { \      h263_Set64_16s((Ipp16s)((coeffMB[0] + 4) >> 3), coeffMB); \    } \    ippiAdd8x8HP_16s8u_C1RS(coeffMB, 16, pRef, stepR, pB, stepB, 0, 0); \    h263_StatisticInc_(&pInfo->VideoSequence.Statistic.nB_INTER_C); \  } else { \    ippiCopy8x8_8u_C1R(pRef, stepR, pB, stepB); \    h263_StatisticInc_(&pInfo->VideoSequence.Statistic.nB_INTER_NC); \  } \}/*//  decode cbpy for Intra MB*/__INLINE h263_Status h263_DecodeCBPY_I(h263_Info* pInfo, int *yPattern){  Ipp32u      code;  code = h263_ShowBits9(pInfo, 6);  *yPattern = h263_cbpy[code].code;  if (h263_cbpy[code].len == 255) {    h263_Error("Error when decoding cbpy of I-Frame macroblock");    return H263_STATUS_ERROR;  } else {    h263_FlushBits(pInfo, h263_cbpy[code].len);    return H263_STATUS_OK;  }}/*//  decode cbpy for Inter-Frame MB*/__INLINE h263_Status h263_DecodeCBPY_P(h263_Info* pInfo, int *yPattern, int mbType){  Ipp32u code;  code = h263_ShowBits9(pInfo, 6);  if (mbType < IPPVC_MBTYPE_INTRA || mbType == IPPVC_MBTYPE_INTER4V_Q)    *yPattern = 15 - h263_cbpy[code].code;  else    *yPattern = h263_cbpy[code].code;  if (h263_cbpy[code].len == 255) {    h263_Error("Error when decoding cbpy of P-Frame macroblock");    return H263_STATUS_ERROR;  } else {    h263_FlushBits(pInfo, h263_cbpy[code].len);    return H263_STATUS_OK;  }}/*//  decode cbpy for B-Frame MB*/__INLINE h263_Status h263_DecodeCBPY_B(h263_Info* pInfo, int *yPattern, int mbType){  Ipp32u code;  code = h263_ShowBits9(pInfo, 6);  if (mbType == IPPVC_MBTYPE_INTRA || mbType == IPPVC_MBTYPE_INTRA_Q)    *yPattern = h263_cbpy[code].code;  else    *yPattern = 15 - h263_cbpy[code].code;  if (h263_cbpy[code].len == 255) {    h263_Error("Error when decoding cbpy of B-Frame macroblock");    return H263_STATUS_ERROR;  } else {    h263_FlushBits(pInfo, h263_cbpy[code].len);    return H263_STATUS_OK;  }}#define h263_Decode_CBPC_B(pInfo, cbpc) \{ \  Ipp32u code; \  h263_VLC1 vlc; \  code = h263_ShowBits9(pInfo, 3); \  vlc = h263_Bmb_cbpc[code]; \  cbpc = vlc.code; \  h263_FlushBits(pInfo, vlc.len); \}#define h263_AdvI_PredMode(pInfo, predMode) { \  if (h263_GetBit(pInfo)) { \    if (h263_GetBit(pInfo)) \      predMode = IPPVC_SCAN_VERTICAL; \    else \      predMode = IPPVC_SCAN_HORIZONTAL; \  } else \    predMode = IPPVC_SCAN_ZIGZAG; \}#define H263_MB_INTERNAL_HOR_DEBLOCKING_LUM(pYc, stepYc, quant) \{ \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pYc + 8*stepYc, stepYc, quant); \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pYc + 8 + 8*stepYc, stepYc, quant); \}#define H263_MB_INTERNAL_VER_DEBLOCKING_LUM(pYc, stepYc, quant) \{ \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pYc + 8, stepYc, quant); \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pYc + 8 + 8*stepYc, stepYc, quant); \}#define H263_MB_HOR_DEBLOCKING(pYc, stepYc, pCbc, stepCbc, pCrc, stepCrc, quant, quant_c) \{ \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pYc, stepYc, quant); \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pYc + 8, stepYc, quant); \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pCbc, stepCbc, quant_c); \  ippiFilterDeblocking8x8HorEdge_H263_8u_C1IR(pCrc, stepCrc, quant_c); \}#define H263_MB_VER_DEBLOCKING(pYc, stepYc, pCbc, stepCbc, pCrc, stepCrc, quant, quant_c) \{ \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pYc, stepYc, quant); \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pYc + 8*stepYc, stepYc, quant); \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pCbc, stepCbc, quant_c); \  ippiFilterDeblocking8x8VerEdge_H263_8u_C1IR(pCrc, stepCrc, quant_c); \}extern void h263_DecodeMODB_iPB(h263_Info* pInfo, int *bmb_type, int *cbpb, int *mvdb);extern h263_Status h263_PredictDecodeMV(h263_Info *pInfo, h263_MacroBlock *MBcurr, int frGOB, int y, int x, int adv);extern h263_Status h263_DecodeMVD(h263_Info *pInfo, int *mvdx,  int *mvdy, int fcode);extern h263_Status h263_DecodeMV(h263_Info *pInfo, IppMotionVector *mv, int leftlim, int rightlim);extern h263_Status h263_DecodeMVD_umvplus(h263_Info *pInfo, int *mvdx, int *mvdy);extern h263_Status h263_DecodeMacroBlockIntra(h263_Info *pInfo, int pat, int quant, int quant_c, Ipp8u *pR[], int stepR[]);extern h263_Status h263_DecodeMacroBlockIntra_AdvI(h263_Info *pInfo, int x, int pat, int quant, int quant_c, int scan, Ipp8u *pR[], int stepR[]);extern h263_Status h263_DecodeMacroBlockInter(h263_Info *pInfo, Ipp16s *coeffMB, int quant, int quant_c, int pat);extern h263_Status h263_BidirPredMacroblock(Ipp8u *pYr, int stepYr, Ipp8u *pCbr, Ipp8u* pCrr, int stepCbr,                                            Ipp8u *pYc, int stepYc, Ipp8u *pCbc, Ipp8u* pCrc, int stepCbc,                                            Ipp8u *predMB, IppMotionVector *mvForw, IppMotionVector *mvFCbCr,                                            IppMotionVector *mvBack,  IppMotionVector *mvBCbCr, int fourMVmode);extern h263_Status h263_DecodeVideoPicture(h263_Info* pInfo);extern h263_Status h263_DecodeMCBPC_P(h263_Info* pInfo, int *mbType, int *mbPattern, int stat);extern h263_Status h263_PredictDecode4MV(h263_Info *pInfo, h263_MacroBlock *MBcurr, int frGOB, int y, int x);extern void h263_OBMC(h263_Info *pInfo, h263_MacroBlock *pMBinfo, IppMotionVector *mvCur, int colNum, int rowNum, IppiRect limitRectL, Ipp8u *pYc, int stepYc, Ipp8u *pYr, int stepYr, int cbpy, Ipp16s *coeffMB);extern h263_Status h263_DecodeFrame_I(h263_Info* pInfo);extern h263_Status h263_DecodeFrame_P(h263_Info* pInfo, h263_Frame* refFrame);extern h263_Status h263_DecodeFrame_B(h263_Info* pInfo, h263_EnhancedLayer *Layer, h263_Frame* refFrame);extern h263_Status h263_DecodeFrame_EI(h263_Info* pInfo, h263_EnhancedLayer *Layer);extern h263_Status h263_DecodeFrame_EP(h263_Info* pInfo, h263_EnhancedLayer *Layer, h263_Frame* refFrame);extern int h263_UpdateQuant_Mod(h263_Info *pInfo);extern void h263_DeblockingFilter_P(h263_Info *pInfo, h263_Frame *frame);extern void h263_DeblockingFilter_I(h263_Info *pInfo, h263_Frame *frame);extern h263_Status h263_DecodeMBTYPE_B(h263_Info* pInfo, int *mbType, int *cbp, int *dquant);extern h263_Status h263_DecodeMCBPC_EI(h263_Info* pInfo, int *mbType, int *mbPattern);extern h263_Status h263_DecodeMBTYPE_EP(h263_Info* pInfo, int *mbType, int *cbp, int *dquant);#ifdef _OMP_KARABAS#define H263_NUM_THREADS 2extern h263_Status h263_DecodeFrame_P_MT(h263_Info* pInfo, h263_Frame *refFrame);extern h263_Status h263_DecodeFrame_I_MT(h263_Info* pInfo);extern h263_Status h263_DecodeDequantMacroBlockIntra(h263_Info *pInfo, int x, int pat, int quant, int quant_c,                                                     int scan, Ipp16s *coeffMB, Ipp8u lastNZ[]);extern h263_Status h263_DecodeDequantMacroBlockInter(h263_Info *pInfo, int pat, int quant, int quant_c,                                                     Ipp16s *coeffMB, Ipp8u lastNZ[]);extern void h263_DCT_MacroBlockInter(Ipp16s *coeffMB, Ipp8u lastNZ[], int pat);extern void h263_DeblockingFilterHor_P_MT(h263_Info *pInfo, int curRow);extern void h263_DeblockingFilterVer_P_MT(h263_Info *pInfo, int curRow);extern void h263_DeblockingFilterHor_I_MT(h263_Info *pInfo, int curRow);extern void h263_DeblockingFilterVer_I_MT(h263_Info *pInfo, int curRow);#endif#ifdef __cplusplus}#endif#endif  /* _H263DEC_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -