patch-libavcodec_aacenctab_h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. $OpenBSD: patch-libavcodec_aacenctab_h,v 1.4 2015/10/17 06:49:22 ajacoutot Exp $
  2. AAC encoder: simplify and speed up find_min_book
  3. avcodec/aacenctab: Make aac_maxval_cb const
  4. aacenc: add support for encoding 7.1 channel audio
  5. aacenc: add support for changing options based on a profile
  6. aacenc: partially revert previous commits to set options via a profile
  7. --- libavcodec/aacenctab.h.orig Mon Sep 7 21:58:01 2015
  8. +++ libavcodec/aacenctab.h Fri Oct 16 23:46:59 2015
  9. @@ -36,7 +36,7 @@
  10. /** Total number of codebooks, including special ones **/
  11. #define CB_TOT_ALL 15
  12. -#define AAC_MAX_CHANNELS 6
  13. +#define AAC_MAX_CHANNELS 8
  14. extern const uint8_t *ff_aac_swb_size_1024[];
  15. extern const int ff_aac_swb_size_1024_len;
  16. @@ -44,13 +44,15 @@ extern const uint8_t *ff_aac_swb_size_128[];
  17. extern const int ff_aac_swb_size_128_len;
  18. /** default channel configurations */
  19. -static const uint8_t aac_chan_configs[6][5] = {
  20. - {1, TYPE_SCE}, // 1 channel - single channel element
  21. - {1, TYPE_CPE}, // 2 channels - channel pair
  22. - {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
  23. - {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
  24. - {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
  25. - {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
  26. +static const uint8_t aac_chan_configs[AAC_MAX_CHANNELS][6] = {
  27. + {1, TYPE_SCE}, // 1 channel - single channel element
  28. + {1, TYPE_CPE}, // 2 channels - channel pair
  29. + {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
  30. + {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
  31. + {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
  32. + {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
  33. + {0}, // 7 channels - invalid without PCE
  34. + {5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 8 channels - front center + front stereo + side stereo + back stereo + LFE
  35. };
  36. /**
  37. @@ -63,6 +65,8 @@ static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][A
  38. { 2, 0, 1, 3 },
  39. { 2, 0, 1, 3, 4 },
  40. { 2, 0, 1, 4, 5, 3 },
  41. + { 0 },
  42. + { 2, 0, 1, 6, 7, 4, 5, 3 },
  43. };
  44. /* duplicated from avpriv_mpeg4audio_sample_rates to avoid shared build
  45. @@ -109,5 +113,16 @@ static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,
  46. static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
  47. static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
  48. +
  49. +static const unsigned char aac_maxval_cb[] = {
  50. + 0, 1, 3, 5, 5, 7, 7, 7, 9, 9, 9, 9, 9, 11
  51. +};
  52. +
  53. +static const int aacenc_profiles[] = {
  54. + FF_PROFILE_AAC_MAIN,
  55. + FF_PROFILE_AAC_LOW,
  56. + FF_PROFILE_AAC_LTP,
  57. + FF_PROFILE_MPEG2_AAC_LOW,
  58. +};
  59. #endif /* AVCODEC_AACENCTAB_H */