Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
6.1 KiB

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /* nabtsdsp.c */
  5. Double dmin (Double x, Double y);
  6. Double dmin3 (Double x, Double y, Double z);
  7. int imin (int x, int y);
  8. int imin3 (int x, int y, int z);
  9. Double dmax (Double x, Double y);
  10. Double dmax3 (Double x, Double y, Double z);
  11. int imax (int x, int y);
  12. int imax3 (int x, int y, int z);
  13. int iabs (int x);
  14. int idivceil (int a, int b);
  15. int idivfloor (int a, int b);
  16. void NDSPInitGlobals (void);
  17. NDSPState *NDSPStateNew (void *memory);
  18. int NDSPStateSetSampleRate(NDSPState* pState, unsigned long samp_rate);
  19. int NDSPStateDestroy (NDSPState *pState);
  20. int NDSPStateConnectToFEC (NDSPState *pDSPState, NFECState *pFECState);
  21. int NDSPStartRetrain (NDSPState *pState);
  22. int NDSPResetFilter (NDSPState *pState);
  23. void Copy_d_8 (Double *pfOutput, unsigned char *pbInput, int nLen);
  24. void Convolve_d_d_filt_var (NDSPState *pState, Double *dest, int dest_begin, int dest_end, Double *a, int a_begin, int a_end, FIRFilter *pFilt, BOOL bSubtractMean);
  25. void Convolve_d_d_filt (Double *dest, int dest_begin, int dest_end, Double *a, int a_begin, int a_end, FIRFilter *pFilt, BOOL bSubtractMean);
  26. void Convolve_d_d_d (Double *dest, int dest_begin, int dest_end, Double *a, Double a_begin, Double a_end, Double a_step, Double *b, Double b_begin, Double b_end, Double b_step, BOOL bSubtractMean);
  27. void RecalcVariableFIRFilterBounds (FIRFilter *pFilter);
  28. void AddToVariableFIRFilter (FIRFilter *pFilter, int nCenterPos, int nLeftTaps, int nRightTaps, int nTapSpacing);
  29. void ClearVariableFIRFilter (FIRFilter *pFilter);
  30. void CopyFIRFilter (FIRFilter *pfilterDest, FIRFilter *pfilterSrc);
  31. int DoEqualizeFromGCRs (NDSPState *pState);
  32. int DoEqualizeFromNabsync (NDSPState *pState);
  33. int DoGCREqualFromSignal (NDSPState *pState, NDSPSigMatch *sigmatch, EqualizeMatch *eqm, FIRFilter *pfilterTemplate, int nAddTaps);
  34. int DoEqualize (NDSPState *pState);
  35. int ComputeOffsets (KS_VBIINFOHEADER *pVBIINFO, int *pnOffsetData, int *pnOffsetSamples);
  36. int NDSPProcessGCRLine (NDSPGCRStats *pLineStats, unsigned char *pbSamples, NDSPState *pState, int nFieldNumber, int nLineNumber, KS_VBIINFOHEADER *pVBIINFO);
  37. void NDSPResetGCRAcquisition (NDSPState *pState);
  38. void NDSPResetNabsyncAcquisition (NDSPState *pState);
  39. int NDSPAvgSigs (NDSPState *pState, Double *pdDest, NDSPSigMatch *psm, Double *dConvRet);
  40. void NDSPTryToInsertSig(NDSPState *pState, NDSPSigMatch *psm, Double dMaxval,
  41. unsigned char *pbSamples, int nOffset);
  42. void NDSPAcquireNabsync (NDSPState *pState, unsigned char *pbSamples);
  43. void NDSPAcquireGCR (NDSPState *pState, unsigned char *pbSamples);
  44. int NDSPSyncBytesToConfidence (unsigned char *pbSyncBytes);
  45. int NDSPDetectGCRConfidence (unsigned char *pbSamples);
  46. int NDSPPartialDecodeLine (unsigned char *pbDest, NDSPLineStats *pLineStats, unsigned char *pbSamples, NDSPState *pState, int nFECType, int nFieldNumber, int nLineNumber, int nStart, int nEnd, KS_VBIINFOHEADER *pVBIINFO);
  47. int NDSPDecodeLine (unsigned char *pbDest, NDSPLineStats *pLineStats, unsigned char *pbSamples, NDSPState *pState, int nFECType, int nFieldNumber, int nLineNumber, KS_VBIINFOHEADER *pVBIINFO);
  48. int NDSPStateSetFilter (NDSPState *pState, FIRFilter *filter, int nFilterSize);
  49. void NormalizeFilter (FIRFilter *pFilter);
  50. void NDSPDecodeFindSync (unsigned char *pbSamples, Double *pdSyncConfidence, Double *pdSyncStart, Double *pdDC, Double *pdAC, NDSPState *pState, KS_VBIINFOHEADER *pVBIINFO);
  51. int NDSPGetBits (unsigned char *pbDest, unsigned char *pbSamples, Double dSyncStart, double dDC, NDSPState *pState, int nFECType);
  52. int NDSPGetBits_5_5 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  53. int NDSPGetBits_5_4 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  54. int NDSPGetBits_5_47 (unsigned char *pbDest, unsigned char *pbSamples, Double dSyncStart, double dDC, NDSPState *pState, int nFECType);
  55. int NDSPGetBits_no_filter (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  56. Double Sum_d (Double *a, int a_size);
  57. int NDSPGetBits_21_2 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  58. int NDSPGetBits_var (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  59. BOOL FilterIsVar (FIRFilter *pFilter, int nSpacing, int nLeft, int nRight, int nExtra);
  60. int NDSPGetBits_var_5_2_2_0 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  61. int NDSPGetBits_var_3_11_9_0 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  62. int NDSPGetBits_var_3_11_9_2 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  63. int NDSPGetBits_var_2_11_9_2 (unsigned char *pbDest, unsigned char *pbSamples, int nSyncStart, double dDC, NDSPState *pState, int nFECType);
  64. void print_filter (FIRFilter *pFilt);
  65. void printarray_d1 (Double *arr, int n);
  66. void printarray_ed1 (Double *arr, int n);
  67. void printarray_d2 (Double *arr, int a_size, int b_size);
  68. void printarray_ed2 (Double *arr, int a_size, int b_size);
  69. void SubtractMean_d (Double *pfOutput, Double *pfInput, int nLen);
  70. void FillGCRSignals (void);
  71. void NormalizeSyncSignal (void);
  72. Double Mean_d (Double *a, int a_size);
  73. Double Mean_8 (unsigned char *a, int a_size);
  74. void Mult_d (Double *dest, Double *src, int size, Double factor);
  75. int Sum_16 (short *a, int a_size);
  76. int MatchWithEqualizeSignal (NDSPState *pState, unsigned char *pbSamples, EqualizeMatch *eqm, int *pnOffset, Double *pdMaxval, BOOL bNegativeOK);
  77. BOOL EqualizeVar (NDSPState *pState, Double *pfInput, int nMinInputIndex, int nMaxInputIndex, Double *pfDesiredOutput, int nDesiredOutputLength, int nOutputSpacing, FIRFilter *pFilter);
  78. int get_sync_samples(unsigned long newHZ);
  79. int get_gcr_samples(unsigned long newHZ);
  80. void onResample (double sample_rate, int syncLen, int gcrLen);
  81. void NDSPComputeNewSampleRate(unsigned long new_rate, unsigned long old_rate);
  82. void NDSPReset (void);
  83. #ifdef __cplusplus
  84. }
  85. #endif