channel_map.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * Copyright(c) 2019 Intel Corporation
  7. */
  8. #ifndef __IPC_CHANNEL_MAP_H__
  9. #define __IPC_CHANNEL_MAP_H__
  10. #include <uapi/sound/sof/header.h>
  11. #include <sound/sof/header.h>
  12. /**
  13. * \brief Channel map, specifies transformation of one-to-many or many-to-one.
  14. *
  15. * In case of one-to-many specifies how the output channels are computed out of
  16. * a single source channel,
  17. * in case of many-to-one specifies how a single target channel is computed
  18. * from a multichannel input stream.
  19. *
  20. * Channel index specifies position of the channel in the stream on the 'one'
  21. * side.
  22. *
  23. * Ext ID is the identifier of external part of the transformation. Depending
  24. * on the context, it may be pipeline ID, dai ID, ...
  25. *
  26. * Channel mask describes which channels are taken into account on the "many"
  27. * side. Bit[i] set to 1 means that i-th channel is used for computation
  28. * (either as source or as a target).
  29. *
  30. * Channel mask is followed by array of coefficients in Q2.30 format,
  31. * one per each channel set in the mask (left to right, LS bit set in the
  32. * mask corresponds to ch_coeffs[0]).
  33. */
  34. struct sof_ipc_channel_map {
  35. uint32_t ch_index;
  36. uint32_t ext_id;
  37. uint32_t ch_mask;
  38. uint32_t reserved;
  39. int32_t ch_coeffs[];
  40. } __packed;
  41. /**
  42. * \brief Complete map for each channel of a multichannel stream.
  43. *
  44. * num_ch_map Specifies number of items in the ch_map.
  45. * More than one transformation per a single channel is allowed (in case
  46. * multiple external entities are transformed).
  47. * A channel may be skipped in the transformation list, then it is filled
  48. * with 0's by the transformation function.
  49. */
  50. struct sof_ipc_stream_map {
  51. struct sof_ipc_cmd_hdr hdr;
  52. uint32_t num_ch_map;
  53. uint32_t reserved[3];
  54. struct sof_ipc_channel_map ch_map[];
  55. } __packed;
  56. #endif /* __IPC_CHANNEL_MAP_H__ */