1
0

VP6VFWState.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //------------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1999-2003 On2 Technologies Inc. All Rights Reserved.
  4. //
  5. //------------------------------------------------------------------------------
  6. //
  7. // $Workfile: VP6VFWState.hpp$
  8. // $Date: 2010/07/23 19:10:48 $
  9. // $Revision: 1.1 $
  10. //
  11. //------------------------------------------------------------------------------
  12. #if !defined(VP6VFWSTATE_HPP)
  13. #define VP6VFWSTATE_HPP
  14. #include "FourCC.hpp"
  15. #include <iosfwd>
  16. namespace on2vp
  17. {
  18. //--------------------------------------
  19. class VP6VFWState
  20. {
  21. friend std::ostream& operator<<(std::ostream& os, const VP6VFWState& vfws);
  22. public:
  23. enum Mode
  24. {
  25. M_Setting,
  26. M_Config
  27. };
  28. enum
  29. {
  30. HeaderSize = 8
  31. };
  32. enum
  33. {
  34. ConfigUsed = 1724
  35. };
  36. struct VPConfig
  37. {
  38. unsigned int Used;
  39. int Width;
  40. int Height;
  41. int TargetBitRate;
  42. int Quality;
  43. int RateNum;
  44. int RateDenom;
  45. int KeyFrameFrequency;
  46. int KeyFrameDataTarget;
  47. int AutoKeyFrameEnabled;
  48. int AutoKeyFrameThreshold;
  49. int MinimumDistanceToKeyFrame;
  50. int ForceKeyFrameEvery;
  51. int NoiseSensitivity;
  52. int AllowDF;
  53. int AllowSpatialResampling;
  54. int HScale;
  55. int HRatio;
  56. int VScale;
  57. int VRatio;
  58. int ScalingMode;
  59. int QuickCompress;
  60. int Speed;
  61. int Interlaced;
  62. int FixedQ;
  63. int StartingBufferLevel;
  64. int OptimalBufferLevel;
  65. int DropFramesWaterMark;
  66. int ResampleDownWaterMark;
  67. int ResampleUpWaterMark;
  68. int OutputFrameRate;
  69. int ErrorResilientMode;
  70. int Profile;
  71. int DisableGolden;
  72. int VBMode;
  73. int BestAllowedQ;
  74. int UnderShootPct;
  75. int MaxAllowedDatarate;
  76. int MaximumBufferSize;
  77. int TwoPassVBREnabled;
  78. int TwoPassVBRBias;
  79. int TwoPassVBRMaxSection;
  80. int TwoPassVBRMinSection;
  81. int Pass;
  82. int Mode;
  83. int EndUsage;
  84. int Sharpness;
  85. char FirstPassFile[512];
  86. char SettingsFile[512];
  87. char RootDirectory[512];
  88. char Reserved[2048 - ConfigUsed];
  89. VPConfig() :
  90. Used(ConfigUsed)
  91. {
  92. }
  93. };
  94. VP6VFWState(FourCC fcc);
  95. ~VP6VFWState();
  96. FourCC fcc() const;
  97. Mode mode() const;
  98. static size_t nominalSize();
  99. VPConfig& vpConfig();
  100. size_t vpStateSize() const;
  101. const void* vpState() const;
  102. void vpState(const void* pVPState, size_t sizeVPState);
  103. size_t size() const;
  104. const void* data() const;
  105. int data(const void* pData, size_t sizeData);
  106. private:
  107. VP6VFWState(const VP6VFWState& vfws); // Not implemented
  108. VP6VFWState& operator=(const VP6VFWState& vfws); // Not implemented
  109. int extract_(const void* pData, size_t sizeData);
  110. void update_(const void* pVPState, size_t sizeVPState) const;
  111. FourCC m_fcc;
  112. Mode m_mode;
  113. VPConfig m_vpConfig;
  114. mutable void* m_pData;
  115. mutable size_t m_sizeData;
  116. };
  117. } // namespace on2vp
  118. #endif // VP6VFWSTATE_HPP