vorbisenc.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: vorbis encode-engine setup
  13. last mod: $Id: vorbisenc.h,v 1.2 2008-04-10 22:54:16 adrian_henke Exp $
  14. ********************************************************************/
  15. #ifndef _OV_ENC_H_
  16. #define _OV_ENC_H_
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif /* __cplusplus */
  21. #include "codec.h"
  22. extern int vorbis_encode_init(vorbis_info *vi,
  23. long channels,
  24. long rate,
  25. long max_bitrate,
  26. long nominal_bitrate,
  27. long min_bitrate);
  28. extern int vorbis_encode_setup_managed(vorbis_info *vi,
  29. long channels,
  30. long rate,
  31. long max_bitrate,
  32. long nominal_bitrate,
  33. long min_bitrate);
  34. extern int vorbis_encode_setup_vbr(vorbis_info *vi,
  35. long channels,
  36. long rate,
  37. float quality /* quality level from 0. (lo) to 1. (hi) */
  38. );
  39. extern int vorbis_encode_init_vbr(vorbis_info *vi,
  40. long channels,
  41. long rate,
  42. float base_quality /* quality level from 0. (lo) to 1. (hi) */
  43. );
  44. extern int vorbis_encode_setup_init(vorbis_info *vi);
  45. extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
  46. /* deprecated rate management supported only for compatability */
  47. #define OV_ECTL_RATEMANAGE_GET 0x10
  48. #define OV_ECTL_RATEMANAGE_SET 0x11
  49. #define OV_ECTL_RATEMANAGE_AVG 0x12
  50. #define OV_ECTL_RATEMANAGE_HARD 0x13
  51. struct ovectl_ratemanage_arg {
  52. int management_active;
  53. long bitrate_hard_min;
  54. long bitrate_hard_max;
  55. double bitrate_hard_window;
  56. long bitrate_av_lo;
  57. long bitrate_av_hi;
  58. double bitrate_av_window;
  59. double bitrate_av_window_center;
  60. };
  61. /* new rate setup */
  62. #define OV_ECTL_RATEMANAGE2_GET 0x14
  63. #define OV_ECTL_RATEMANAGE2_SET 0x15
  64. struct ovectl_ratemanage2_arg {
  65. int management_active;
  66. long bitrate_limit_min_kbps;
  67. long bitrate_limit_max_kbps;
  68. long bitrate_limit_reservoir_bits;
  69. double bitrate_limit_reservoir_bias;
  70. long bitrate_average_kbps;
  71. double bitrate_average_damping;
  72. };
  73. #define OV_ECTL_LOWPASS_GET 0x20
  74. #define OV_ECTL_LOWPASS_SET 0x21
  75. #define OV_ECTL_IBLOCK_GET 0x30
  76. #define OV_ECTL_IBLOCK_SET 0x31
  77. #ifdef __cplusplus
  78. }
  79. #endif /* __cplusplus */
  80. #endif