From 43f179a320de8522eed900c227f07e1ff0417da8 Mon Sep 17 00:00:00 2001 From: jwcullen Date: Mon, 14 Oct 2024 06:21:01 -0700 Subject: [PATCH] Drops enums, and reserve the slots for demixed labels. - Demixed labels are probably not useful at the front-end. - But reserve the slots that align with internal enums in case we change our mind. PiperOrigin-RevId: 685684477 --- iamf/cli/channel_label.cc | 30 ---------------------------- iamf/cli/proto/audio_frame.proto | 17 ++-------------- iamf/cli/tests/channel_label_test.cc | 17 ---------------- 3 files changed, 2 insertions(+), 62 deletions(-) diff --git a/iamf/cli/channel_label.cc b/iamf/cli/channel_label.cc index 710149c..4223147 100644 --- a/iamf/cli/channel_label.cc +++ b/iamf/cli/channel_label.cc @@ -284,8 +284,6 @@ absl::StatusOr ChannelLabel::ProtoToLabel( return kMono; case CHANNEL_LABEL_L_2: return kL2; - case CHANNEL_LABEL_DEMIXED_R_2: - return kDemixedR2; case CHANNEL_LABEL_R_2: return kR2; case CHANNEL_LABEL_CENTRE: @@ -296,10 +294,6 @@ absl::StatusOr ChannelLabel::ProtoToLabel( return kL3; case CHANNEL_LABEL_R_3: return kR3; - case CHANNEL_LABEL_DEMIXED_L_3: - return kDemixedL3; - case CHANNEL_LABEL_DEMIXED_R_3: - return kDemixedR3; case CHANNEL_LABEL_LTF_3: return kLtf3; case CHANNEL_LABEL_RTF_3: @@ -312,22 +306,10 @@ absl::StatusOr ChannelLabel::ProtoToLabel( return kLs5; case CHANNEL_LABEL_RS_5: return kRs5; - case CHANNEL_LABEL_DEMIXED_L_5: - return kDemixedL5; - case CHANNEL_LABEL_DEMIXED_R_5: - return kDemixedR5; - case CHANNEL_LABEL_DEMIXED_LS_5: - return kDemixedLs5; - case CHANNEL_LABEL_DEMIXED_RS_5: - return kDemixedRs5; case CHANNEL_LABEL_LTF_2: return kLtf2; case CHANNEL_LABEL_RTF_2: return kRtf2; - case CHANNEL_LABEL_DEMIXED_LTF_2: - return kDemixedLtf2; - case CHANNEL_LABEL_DEMIXED_RTF_2: - return kDemixedRtf2; case CHANNEL_LABEL_LTF_4: return kLtf4; case CHANNEL_LABEL_RTF_4: @@ -336,10 +318,6 @@ absl::StatusOr ChannelLabel::ProtoToLabel( return kLtb4; case CHANNEL_LABEL_RTB_4: return kRtb4; - case CHANNEL_LABEL_DEMIXED_LTB_4: - return kDemixedLtb4; - case CHANNEL_LABEL_DEMIXED_RTB_4: - return kDemixedRtb4; case CHANNEL_LABEL_L_7: return kL7; case CHANNEL_LABEL_R_7: @@ -352,14 +330,6 @@ absl::StatusOr ChannelLabel::ProtoToLabel( return kLrs7; case CHANNEL_LABEL_RRS_7: return kRrs7; - case CHANNEL_LABEL_DEMIXED_L_7: - return kDemixedL7; - case CHANNEL_LABEL_DEMIXED_R_7: - return kDemixedR7; - case CHANNEL_LABEL_DEMIXED_LRS_7: - return kDemixedLrs7; - case CHANNEL_LABEL_DEMIXED_RRS_7: - return kDemixedRrs7; case CHANNEL_LABEL_FLC: return kFLc; case CHANNEL_LABEL_FC: diff --git a/iamf/cli/proto/audio_frame.proto b/iamf/cli/proto/audio_frame.proto index 3815eb8..04a8815 100644 --- a/iamf/cli/proto/audio_frame.proto +++ b/iamf/cli/proto/audio_frame.proto @@ -20,7 +20,6 @@ enum ChannelLabel { // Stereo or binaural channels. CHANNEL_LABEL_L_2 = 3; CHANNEL_LABEL_R_2 = 4; - CHANNEL_LABEL_DEMIXED_R_2 = 5; // Centre channel common to several layouts (e.g. 3.1.2, 5.x.y, 7.x.y). CHANNEL_LABEL_CENTRE = 6; // LFE channel common to several layouts (e.g. 3.1.2, 5.1.y, 7.1.y, 9.1.6). @@ -30,29 +29,19 @@ enum ChannelLabel { CHANNEL_LABEL_R_3 = 9; CHANNEL_LABEL_LTF_3 = 10; CHANNEL_LABEL_RTF_3 = 11; - CHANNEL_LABEL_DEMIXED_L_3 = 12; - CHANNEL_LABEL_DEMIXED_R_3 = 13; // 5.x.y surround channels. CHANNEL_LABEL_L_5 = 14; CHANNEL_LABEL_R_5 = 15; CHANNEL_LABEL_LS_5 = 16; CHANNEL_LABEL_RS_5 = 17; - CHANNEL_LABEL_DEMIXED_L_5 = 18; - CHANNEL_LABEL_DEMIXED_R_5 = 19; - CHANNEL_LABEL_DEMIXED_LS_5 = 20; - CHANNEL_LABEL_DEMIXED_RS_5 = 21; // Common channels between 5.1.2 and 7.1.2. CHANNEL_LABEL_LTF_2 = 22; CHANNEL_LABEL_RTF_2 = 23; - CHANNEL_LABEL_DEMIXED_LTF_2 = 24; - CHANNEL_LABEL_DEMIXED_RTF_2 = 25; // Common channels between 5.1.4 and 7.1.4. CHANNEL_LABEL_LTF_4 = 26; CHANNEL_LABEL_RTF_4 = 27; CHANNEL_LABEL_LTB_4 = 28; CHANNEL_LABEL_RTB_4 = 29; - CHANNEL_LABEL_DEMIXED_LTB_4 = 30; - CHANNEL_LABEL_DEMIXED_RTB_4 = 31; // 7.x.y surround channels. CHANNEL_LABEL_L_7 = 32; CHANNEL_LABEL_R_7 = 33; @@ -60,10 +49,6 @@ enum ChannelLabel { CHANNEL_LABEL_RSS_7 = 35; CHANNEL_LABEL_LRS_7 = 36; CHANNEL_LABEL_RRS_7 = 37; - CHANNEL_LABEL_DEMIXED_L_7 = 38; - CHANNEL_LABEL_DEMIXED_R_7 = 39; - CHANNEL_LABEL_DEMIXED_LRS_7 = 40; - CHANNEL_LABEL_DEMIXED_RRS_7 = 41; // 9.1.6 surround channels. CHANNEL_LABEL_FLC = 42; CHANNEL_LABEL_FC = 43; @@ -80,6 +65,8 @@ enum ChannelLabel { CHANNEL_LABEL_TP_SI_R = 54; CHANNEL_LABEL_TP_BL = 55; CHANNEL_LABEL_TP_BR = 56; + // Reserved for possible use of demixed labels. + reserved 5, 12, 13, 18 to 21, 24, 25, 30, 31, 38 to 41; // Reserved for channel-based labels. reserved 57 to 999; diff --git a/iamf/cli/tests/channel_label_test.cc b/iamf/cli/tests/channel_label_test.cc index 2b5259c..35bc588 100644 --- a/iamf/cli/tests/channel_label_test.cc +++ b/iamf/cli/tests/channel_label_test.cc @@ -251,23 +251,6 @@ TEST(ConvertAndFillLabels, ValidWith9_1_6ProtoLabels) { kTpBL, kTpBR})); } -TEST(ConvertAndFillLabels, ValidWithDemixedLabels) { - ExpectConvertAndFillLabelsHasExpectedOutput( - std::vector( - {CHANNEL_LABEL_DEMIXED_R_2, CHANNEL_LABEL_DEMIXED_L_3, - CHANNEL_LABEL_DEMIXED_R_3, CHANNEL_LABEL_DEMIXED_L_5, - CHANNEL_LABEL_DEMIXED_R_5, CHANNEL_LABEL_DEMIXED_LS_5, - CHANNEL_LABEL_DEMIXED_RS_5, CHANNEL_LABEL_DEMIXED_LTF_2, - CHANNEL_LABEL_DEMIXED_RTF_2, CHANNEL_LABEL_DEMIXED_LTB_4, - CHANNEL_LABEL_DEMIXED_RTB_4, CHANNEL_LABEL_DEMIXED_L_7, - CHANNEL_LABEL_DEMIXED_R_7, CHANNEL_LABEL_DEMIXED_LRS_7, - CHANNEL_LABEL_DEMIXED_RRS_7}), - std::vector( - {kDemixedR2, kDemixedL3, kDemixedR3, kDemixedL5, kDemixedR5, - kDemixedLs5, kDemixedRs5, kDemixedLtf2, kDemixedRtf2, kDemixedLtb4, - kDemixedRtb4, kDemixedL7, kDemixedR7, kDemixedLrs7, kDemixedRrs7})); -} - TEST(ConvertAndFillLabels, ValidWithZerothOrderAmbisonicsProtoLabels) { ExpectConvertAndFillLabelsHasExpectedOutput( std::vector({CHANNEL_LABEL_A_0}),