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.

124 lines
4.1KB

  1. /*
  2. Copyright (C) 2001-2002 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
  30. #define CHROM_DERING (DERING<<4) // 64
  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
  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 TEMP_NOISE_FILTER 0x100000
  48. #define FORCE_QUANT 0x200000
  49. #define GET_PP_QUALITY_MAX 6
  50. //must be defined if stride%8 != 0
  51. //#define PP_FUNNY_STRIDE
  52. //#define TIMING
  53. //#define MORE_TIMING
  54. //use if u want a faster postprocessing code
  55. //cant differentiate between chroma & luma filters (both on or both off)
  56. //obviosly the -pp option at the commandline has no effect except turning the here selected
  57. //filters on
  58. //#define COMPILE_TIME_MODE 0x77
  59. #define QP_STORE_T int
  60. struct PPMode{
  61. int lumMode; //acivates filters for luminance
  62. int chromMode; //acivates filters for chrominance
  63. int oldMode; // will be passed to odivx
  64. int error; // non zero on error
  65. int minAllowedY; // for brigtness correction
  66. int maxAllowedY; // for brihtness correction
  67. int maxTmpNoise[3]; // for Temporal Noise Reducing filter (Maximal sum of abs differences)
  68. int maxDcDiff; // max abs diff between pixels to be considered flat
  69. int forcedQuant; // quantizer if FORCE_QUANT is used
  70. };
  71. struct PPFilter{
  72. char *shortName;
  73. char *longName;
  74. int chromDefault; // is chrominance filtering on by default if this filter is manually activated
  75. int minLumQuality; // minimum quality to turn luminance filtering on
  76. int minChromQuality; // minimum quality to turn chrominance filtering on
  77. int mask; // Bitmask to turn this filter on
  78. };
  79. /* Obsolete, dont use it, use postprocess2() instead */
  80. void postprocess(unsigned char * src[], int src_stride,
  81. unsigned char * dst[], int dst_stride,
  82. int horizontal_size, int vertical_size,
  83. QP_STORE_T *QP_store, int QP_stride, int mode);
  84. void postprocess2(unsigned char * src[], int src_stride,
  85. unsigned char * dst[], int dst_stride,
  86. int horizontal_size, int vertical_size,
  87. QP_STORE_T *QP_store, int QP_stride, struct PPMode *mode);
  88. /* Obsolete, dont use it, use getPpModeByNameAndQuality() instead */
  89. int getPpModeForQuality(int quality);
  90. // name is the stuff after "-pp" on the command line
  91. struct PPMode getPPModeByNameAndQuality(char *name, int quality);
  92. int readPPOpt(void *conf, char *arg);
  93. #endif