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.

91 lines
2.8KB

  1. /* values for the flags, the stuff on the command line is different */
  2. #define SWS_FAST_BILINEAR 1
  3. #define SWS_BILINEAR 2
  4. #define SWS_BICUBIC 4
  5. #define SWS_X 8
  6. #define SWS_FULL_UV_IPOL 0x100
  7. #define SWS_PRINT_INFO 0x1000
  8. #define SWS_MAX_SIZE 2000
  9. /* this struct should be aligned on at least 32-byte boundary */
  10. typedef struct{
  11. int srcW, srcH, dstW, dstH;
  12. int chrDstW, chrDstH;
  13. int lumXInc, chrXInc;
  14. int lumYInc, chrYInc;
  15. int dstFormat, srcFormat;
  16. int16_t __attribute__((aligned(8))) *lumPixBuf[SWS_MAX_SIZE];
  17. int16_t __attribute__((aligned(8))) *chrPixBuf[SWS_MAX_SIZE];
  18. int16_t __attribute__((aligned(8))) hLumFilter[SWS_MAX_SIZE*5];
  19. int16_t __attribute__((aligned(8))) hLumFilterPos[SWS_MAX_SIZE];
  20. int16_t __attribute__((aligned(8))) hChrFilter[SWS_MAX_SIZE*5];
  21. int16_t __attribute__((aligned(8))) hChrFilterPos[SWS_MAX_SIZE];
  22. int16_t __attribute__((aligned(8))) vLumFilter[SWS_MAX_SIZE*5];
  23. int16_t __attribute__((aligned(8))) vLumFilterPos[SWS_MAX_SIZE];
  24. int16_t __attribute__((aligned(8))) vChrFilter[SWS_MAX_SIZE*5];
  25. int16_t __attribute__((aligned(8))) vChrFilterPos[SWS_MAX_SIZE];
  26. // Contain simply the values from v(Lum|Chr)Filter just nicely packed for mmx
  27. int16_t __attribute__((aligned(8))) lumMmxFilter[SWS_MAX_SIZE*20];
  28. int16_t __attribute__((aligned(8))) chrMmxFilter[SWS_MAX_SIZE*20];
  29. int hLumFilterSize;
  30. int hChrFilterSize;
  31. int vLumFilterSize;
  32. int vChrFilterSize;
  33. int vLumBufSize;
  34. int vChrBufSize;
  35. uint8_t __attribute__((aligned(32))) funnyYCode[10000];
  36. uint8_t __attribute__((aligned(32))) funnyUVCode[10000];
  37. int canMMX2BeUsed;
  38. int lastInLumBuf;
  39. int lastInChrBuf;
  40. int lumBufIndex;
  41. int chrBufIndex;
  42. int dstY;
  43. int flags;
  44. } SwsContext;
  45. //FIXME check init (where 0)
  46. typedef struct {
  47. double *lumH;
  48. double *lumV;
  49. double *chrH;
  50. double *chrV;
  51. int length;
  52. } SwsFilter;
  53. // *** bilinear scaling and yuv->rgb & yuv->yuv conversion of yv12 slices:
  54. // *** Note: it's called multiple times while decoding a frame, first time y==0
  55. // dstbpp == 12 -> yv12 output
  56. // will use sws_flags
  57. void SwScale_YV12slice(unsigned char* src[],int srcStride[], int srcSliceY,
  58. int srcSliceH, uint8_t* dst[], int dstStride, int dstbpp,
  59. int srcW, int srcH, int dstW, int dstH);
  60. // Obsolete, will be removed soon
  61. void SwScale_Init();
  62. void freeSwsContext(SwsContext swsContext);
  63. SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
  64. SwsFilter *srcFilter, SwsFilter *dstFilter);
  65. extern void (*swScale)(SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
  66. int srcSliceH, uint8_t* dst[], int dstStride[]);
  67. double *getGaussian(double variance, double quality);
  68. void normalize(double *coeff, int length, double height);
  69. double *conv(double *a, int aLength, double *b, int bLength);