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.

123 lines
3.1KB

  1. /*
  2. * Float MPEG Audio decoder
  3. * Copyright (c) 2010 Michael Niedermayer
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #define CONFIG_FLOAT 1
  22. #include "mpegaudiodec.c"
  23. void ff_mpa_synth_filter_float(MPADecodeContext *s, float *synth_buf_ptr,
  24. int *synth_buf_offset,
  25. float *window, int *dither_state,
  26. float *samples, int incr,
  27. float sb_samples[SBLIMIT])
  28. {
  29. float *synth_buf;
  30. int offset;
  31. offset = *synth_buf_offset;
  32. synth_buf = synth_buf_ptr + offset;
  33. dct32(synth_buf, sb_samples);
  34. s->apply_window_mp3(synth_buf, window, dither_state, samples, incr);
  35. offset = (offset - 32) & 511;
  36. *synth_buf_offset = offset;
  37. }
  38. #if CONFIG_MP1FLOAT_DECODER
  39. AVCodec mp1float_decoder =
  40. {
  41. "mp1float",
  42. AVMEDIA_TYPE_AUDIO,
  43. CODEC_ID_MP1,
  44. sizeof(MPADecodeContext),
  45. decode_init,
  46. NULL,
  47. NULL,
  48. decode_frame,
  49. CODEC_CAP_PARSE_ONLY,
  50. .flush= flush,
  51. .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
  52. };
  53. #endif
  54. #if CONFIG_MP2FLOAT_DECODER
  55. AVCodec mp2float_decoder =
  56. {
  57. "mp2float",
  58. AVMEDIA_TYPE_AUDIO,
  59. CODEC_ID_MP2,
  60. sizeof(MPADecodeContext),
  61. decode_init,
  62. NULL,
  63. NULL,
  64. decode_frame,
  65. CODEC_CAP_PARSE_ONLY,
  66. .flush= flush,
  67. .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
  68. };
  69. #endif
  70. #if CONFIG_MP3FLOAT_DECODER
  71. AVCodec mp3float_decoder =
  72. {
  73. "mp3float",
  74. AVMEDIA_TYPE_AUDIO,
  75. CODEC_ID_MP3,
  76. sizeof(MPADecodeContext),
  77. decode_init,
  78. NULL,
  79. NULL,
  80. decode_frame,
  81. CODEC_CAP_PARSE_ONLY,
  82. .flush= flush,
  83. .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
  84. };
  85. #endif
  86. #if CONFIG_MP3ADUFLOAT_DECODER
  87. AVCodec mp3adufloat_decoder =
  88. {
  89. "mp3adufloat",
  90. AVMEDIA_TYPE_AUDIO,
  91. CODEC_ID_MP3ADU,
  92. sizeof(MPADecodeContext),
  93. decode_init,
  94. NULL,
  95. NULL,
  96. decode_frame_adu,
  97. CODEC_CAP_PARSE_ONLY,
  98. .flush= flush,
  99. .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
  100. };
  101. #endif
  102. #if CONFIG_MP3ON4FLOAT_DECODER
  103. AVCodec mp3on4float_decoder =
  104. {
  105. "mp3on4float",
  106. AVMEDIA_TYPE_AUDIO,
  107. CODEC_ID_MP3ON4,
  108. sizeof(MP3On4DecodeContext),
  109. decode_init_mp3on4,
  110. NULL,
  111. decode_close_mp3on4,
  112. decode_frame_mp3on4,
  113. .flush= flush,
  114. .long_name= NULL_IF_CONFIG_SMALL("MP3onMP4"),
  115. };
  116. #endif