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.

105 lines
3.2KB

  1. /*
  2. Copyright (C) 2001 Michael Niedermayer (michaelni@gmx.at)
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  14. */
  15. // POSTPROCESS_H is defined by opendivx's postprocess.h
  16. #ifndef NEWPOSTPROCESS_H
  17. #define NEWPOSTPROCESS_H
  18. #define BLOCK_SIZE 8
  19. #define TEMP_STRIDE 8
  20. //#define NUM_BLOCKS_AT_ONCE 16 //not used yet
  21. #define V_DEBLOCK 0x01
  22. #define H_DEBLOCK 0x02
  23. #define DERING 0x04
  24. #define LEVEL_FIX 0x08 /* Brightness & Contrast */
  25. #define LUM_V_DEBLOCK V_DEBLOCK // 1
  26. #define LUM_H_DEBLOCK H_DEBLOCK // 2
  27. #define CHROM_V_DEBLOCK (V_DEBLOCK<<4) // 16
  28. #define CHROM_H_DEBLOCK (H_DEBLOCK<<4) // 32
  29. #define LUM_DERING DERING // 4 (not implemented yet)
  30. #define CHROM_DERING (DERING<<4) // 64 (not implemented yet)
  31. #define LUM_LEVEL_FIX LEVEL_FIX // 8
  32. #define CHROM_LEVEL_FIX (LEVEL_FIX<<4) // 128 (not implemented yet)
  33. // Experimental vertical filters
  34. #define V_RK1_FILTER 0x0100 // 256
  35. #define V_X1_FILTER 0x0200 // 512
  36. // Experimental horizontal filters
  37. #define H_RK1_FILTER 0x1000 // 4096 (not implemented yet)
  38. #define H_X1_FILTER 0x2000 // 8192
  39. // select between full y range (255-0) or standart one (234-16)
  40. #define FULL_Y_RANGE 0x8000 // 32768
  41. //Deinterlacing Filters
  42. #define LINEAR_IPOL_DEINT_FILTER 0x10000 // 65536
  43. #define LINEAR_BLEND_DEINT_FILTER 0x20000 // 131072
  44. #define CUBIC_BLEND_DEINT_FILTER 0x8000 // (not implemented yet)
  45. #define CUBIC_IPOL_DEINT_FILTER 0x40000 // 262144
  46. #define MEDIAN_DEINT_FILTER 0x80000 // 524288
  47. #define GET_PP_QUALITY_MAX 6
  48. //must be defined if stride%8 != 0
  49. //#define PP_FUNNY_STRIDE
  50. //#define TIMING
  51. //#define MORE_TIMING
  52. #define QP_STORE_T int
  53. struct PPMode{
  54. int lumMode; //acivates filters for luminance
  55. int chromMode; //acivates filters for chrominance
  56. int oldMode; // will be passed to odivx
  57. int error; // non zero on error
  58. int minAllowedY;
  59. int maxAllowedY;
  60. };
  61. struct PPFilter{
  62. char *shortName;
  63. char *longName;
  64. int chromDefault;
  65. int minLumQuality;
  66. int minChromQuality;
  67. int mask;
  68. };
  69. void postprocess(unsigned char * src[], int src_stride,
  70. unsigned char * dst[], int dst_stride,
  71. int horizontal_size, int vertical_size,
  72. QP_STORE_T *QP_store, int QP_stride, int mode);
  73. void postprocess2(unsigned char * src[], int src_stride,
  74. unsigned char * dst[], int dst_stride,
  75. int horizontal_size, int vertical_size,
  76. QP_STORE_T *QP_store, int QP_stride, struct PPMode *mode);
  77. int getPpModeForQuality(int quality);
  78. struct PPMode getPpModeByNameAndQuality(char *name, int quality);
  79. #endif