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.

100 lines
3.2KB

  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 V_DEBLOCK 0x01
  19. #define H_DEBLOCK 0x02
  20. #define DERING 0x04
  21. #define LEVEL_FIX 0x08 /* Brightness & Contrast */
  22. #define LUM_V_DEBLOCK V_DEBLOCK // 1
  23. #define LUM_H_DEBLOCK H_DEBLOCK // 2
  24. #define CHROM_V_DEBLOCK (V_DEBLOCK<<4) // 16
  25. #define CHROM_H_DEBLOCK (H_DEBLOCK<<4) // 32
  26. #define LUM_DERING DERING // 4
  27. #define CHROM_DERING (DERING<<4) // 64
  28. #define LUM_LEVEL_FIX LEVEL_FIX // 8
  29. #define CHROM_LEVEL_FIX (LEVEL_FIX<<4) // 128 (not implemented yet)
  30. // Experimental vertical filters
  31. #define V_X1_FILTER 0x0200 // 512
  32. // Experimental horizontal filters
  33. #define H_X1_FILTER 0x2000 // 8192
  34. // select between full y range (255-0) or standart one (234-16)
  35. #define FULL_Y_RANGE 0x8000 // 32768
  36. //Deinterlacing Filters
  37. #define LINEAR_IPOL_DEINT_FILTER 0x10000 // 65536
  38. #define LINEAR_BLEND_DEINT_FILTER 0x20000 // 131072
  39. #define CUBIC_BLEND_DEINT_FILTER 0x8000 // (not implemented yet)
  40. #define CUBIC_IPOL_DEINT_FILTER 0x40000 // 262144
  41. #define MEDIAN_DEINT_FILTER 0x80000 // 524288
  42. #define FFMPEG_DEINT_FILTER 0x400000
  43. #define TEMP_NOISE_FILTER 0x100000
  44. #define FORCE_QUANT 0x200000
  45. #define GET_PP_QUALITY_MAX 6
  46. //use if u want a faster postprocessing code
  47. //cant differentiate between chroma & luma filters (both on or both off)
  48. //obviosly the -pp option at the commandline has no effect except turning the here selected
  49. //filters on
  50. //#define COMPILE_TIME_MODE 0x77
  51. #define QP_STORE_T int
  52. char *postproc_help;
  53. typedef struct PPMode{
  54. int lumMode; //acivates filters for luminance
  55. int chromMode; //acivates filters for chrominance
  56. int error; // non zero on error
  57. int minAllowedY; // for brigtness correction
  58. int maxAllowedY; // for brihtness correction
  59. int maxTmpNoise[3]; // for Temporal Noise Reducing filter (Maximal sum of abs differences)
  60. int baseDcDiff;
  61. int flatnessThreshold;
  62. int forcedQuant; // quantizer if FORCE_QUANT is used
  63. } PPMode;
  64. void postprocess(uint8_t * src[3], int srcStride[3],
  65. uint8_t * dst[3], int dstStride[3],
  66. int horizontalSize, int verticalSize,
  67. QP_STORE_T *QP_store, int QP_stride,
  68. PPMode *mode, void *ppContext, int pict_type);
  69. // name is the stuff after "-pp" on the command line
  70. PPMode getPPModeByNameAndQuality(char *name, int quality);
  71. void *getPPContext(int width, int height);
  72. void freePPContext(void *ppContext);
  73. int readPPOpt(void *conf, char *arg);
  74. #endif