dca_exss.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (C) 2016 foo86
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_DCA_EXSS_H
  21. #define AVCODEC_DCA_EXSS_H
  22. #include "libavutil/common.h"
  23. #include "avcodec.h"
  24. #include "get_bits.h"
  25. typedef struct DCAExssAsset {
  26. int asset_offset; ///< Offset to asset data from start of substream
  27. int asset_size; ///< Size of encoded asset data
  28. int asset_index; ///< Audio asset identifier
  29. int pcm_bit_res; ///< PCM bit resolution
  30. int max_sample_rate; ///< Maximum sample rate
  31. int nchannels_total; ///< Total number of channels
  32. int one_to_one_map_ch_to_spkr; ///< One to one channel to speaker mapping flag
  33. int embedded_stereo; ///< Embedded stereo flag
  34. int embedded_6ch; ///< Embedded 6 channels flag
  35. int spkr_mask_enabled; ///< Speaker mask enabled flag
  36. int spkr_mask; ///< Loudspeaker activity mask
  37. int representation_type; ///< Representation type
  38. int coding_mode; ///< Coding mode for the asset
  39. int extension_mask; ///< Coding components used in asset
  40. int core_offset; ///< Offset to core component from start of substream
  41. int core_size; ///< Size of core component in extension substream
  42. int xbr_offset; ///< Offset to XBR extension from start of substream
  43. int xbr_size; ///< Size of XBR extension in extension substream
  44. int xxch_offset; ///< Offset to XXCH extension from start of substream
  45. int xxch_size; ///< Size of XXCH extension in extension substream
  46. int x96_offset; ///< Offset to X96 extension from start of substream
  47. int x96_size; ///< Size of X96 extension in extension substream
  48. int lbr_offset; ///< Offset to LBR component from start of substream
  49. int lbr_size; ///< Size of LBR component in extension substream
  50. int xll_offset; ///< Offset to XLL data from start of substream
  51. int xll_size; ///< Size of XLL data in extension substream
  52. int xll_sync_present; ///< XLL sync word present flag
  53. int xll_delay_nframes; ///< Initial XLL decoding delay in frames
  54. int xll_sync_offset; ///< Number of bytes offset to XLL sync
  55. int hd_stream_id; ///< DTS-HD stream ID
  56. } DCAExssAsset;
  57. typedef struct DCAExssParser {
  58. AVCodecContext *avctx;
  59. GetBitContext gb;
  60. int exss_index; ///< Extension substream index
  61. int exss_size_nbits; ///< Number of bits for extension substream size
  62. int exss_size; ///< Number of bytes of extension substream
  63. int static_fields_present; ///< Per stream static fields presence flag
  64. int npresents; ///< Number of defined audio presentations
  65. int nassets; ///< Number of audio assets in extension substream
  66. int mix_metadata_enabled; ///< Mixing metadata enable flag
  67. int nmixoutconfigs; ///< Number of mixing configurations
  68. int nmixoutchs[4]; ///< Speaker layout mask for mixer output channels
  69. DCAExssAsset assets[1]; ///< Audio asset descriptors
  70. } DCAExssParser;
  71. int ff_dca_exss_parse(DCAExssParser *s, const uint8_t *data, int size);
  72. #endif