X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdca.h;h=a1ac76310571559800faf56fca6549465392b1f6;hb=bf29794022db597f526a8575648244a7c6ee15ed;hp=ccb02af91c083dfb3ee6f92e81d5c3319f455a8b;hpb=463de5625bcba2abb53ee8194ecb8bf45b83f315;p=ffmpeg diff --git a/libavcodec/dca.h b/libavcodec/dca.h index ccb02af91c0..a1ac7631057 100644 --- a/libavcodec/dca.h +++ b/libavcodec/dca.h @@ -28,6 +28,7 @@ #include +#include "libavutil/common.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" @@ -90,6 +91,33 @@ enum DCASpeakerMask { #define DCA_HAS_STEREO(mask) \ ((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO) +enum DCASpeakerPair { + DCA_SPEAKER_PAIR_C = 0x0001, + DCA_SPEAKER_PAIR_LR = 0x0002, + DCA_SPEAKER_PAIR_LsRs = 0x0004, + DCA_SPEAKER_PAIR_LFE1 = 0x0008, + DCA_SPEAKER_PAIR_Cs = 0x0010, + DCA_SPEAKER_PAIR_LhRh = 0x0020, + DCA_SPEAKER_PAIR_LsrRsr = 0x0040, + DCA_SPEAKER_PAIR_Ch = 0x0080, + DCA_SPEAKER_PAIR_Oh = 0x0100, + DCA_SPEAKER_PAIR_LcRc = 0x0200, + DCA_SPEAKER_PAIR_LwRw = 0x0400, + DCA_SPEAKER_PAIR_LssRss = 0x0800, + DCA_SPEAKER_PAIR_LFE2 = 0x1000, + DCA_SPEAKER_PAIR_LhsRhs = 0x2000, + DCA_SPEAKER_PAIR_Chr = 0x4000, + DCA_SPEAKER_PAIR_LhrRhr = 0x8000 +}; + +/** + * Return number of individual channels in DCASpeakerPair mask + */ +static inline int ff_dca_count_chs_for_mask(unsigned int mask) +{ + return av_popcount((mask & 0xffff) | ((mask & 0xae66) << 16)); +} + enum DCARepresentationType { DCA_REPR_TYPE_LtRt = 2, DCA_REPR_TYPE_LhRh = 3