Skip to content

Commit 6f9c879

Browse files
committed
Check the rule of ambisonics channels
1 parent 067a207 commit 6f9c879

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

code/src/iamf_dec/IAMF_decoder.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static int32_t iamf_stream_scale_decoder_demix(IAMF_StreamDecoder *decoder,
600600
uint32_t frame_size);
601601
static int iamf_stream_ambisonics_decoder_decode(IAMF_StreamDecoder *decoder,
602602
float *pcm);
603+
static uint32_t iamf_stream_ambisionisc_order(int channels);
603604

604605
/* >>>>>>>>>>>>>>>>>> DATABASE >>>>>>>>>>>>>>>>>> */
605606

@@ -698,14 +699,13 @@ static int iamf_element_is_valid(IAMF_Element *e) {
698699
} else if (e->element_type == AUDIO_ELEMENT_TYPE_SCENE_BASED) {
699700
int channels = e->ambisonics_conf->substream_count +
700701
e->ambisonics_conf->coupled_substream_count;
701-
if ((e->ambisonics_conf->output_channel_count >
702-
IAMF_AMBISONICS_MAX_CHANNELS) ||
703-
(channels > IAMF_AMBISONICS_MAX_CHANNELS)) {
702+
if ((iamf_stream_ambisionisc_order(
703+
e->ambisonics_conf->output_channel_count) == UINT32_MAX) ||
704+
(channels > e->ambisonics_conf->output_channel_count)) {
704705
ia_logw(
705-
"Invalid output channel count %d or invalid channels %d in "
706-
"ambisonics mode, it is more than %d",
707-
e->ambisonics_conf->output_channel_count, channels,
708-
IAMF_AMBISONICS_MAX_CHANNELS);
706+
"Invalid output channel count %d or input channel count %d more than "
707+
"output in ambisonics mode",
708+
e->ambisonics_conf->output_channel_count, channels);
709709
ret = IAMF_ERR_UNIMPLEMENTED;
710710
}
711711
} else

code/src/iamf_dec/IAMF_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ typedef enum {
117117
#define IA_CH_CATE_WEIGHT 0X200
118118
#define IA_CH_CATE_TOP 0X400
119119

120-
#define IAMF_AMBISONICS_MAX_CHANNELS 16
121120
#define IAMF_MIX_PRESENTATION_MAX_SUBS 1
122121
/// @brief should be able to reconstruct one Audio Element. in simple profile.
123122
#define IAMF_SIMPLE_PROFILE_MIX_PRESENTATION_MAX_ELEMENTS 1

0 commit comments

Comments
 (0)