Skip to content

Commit

Permalink
Drops enums, and reserve the slots for demixed labels.
Browse files Browse the repository at this point in the history
  - 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
  • Loading branch information
jwcullen authored and felicialim committed Oct 16, 2024
1 parent e7f3656 commit 43f179a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 62 deletions.
30 changes: 0 additions & 30 deletions iamf/cli/channel_label.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ absl::StatusOr<ChannelLabel::Label> 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:
Expand All @@ -296,10 +294,6 @@ absl::StatusOr<ChannelLabel::Label> 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:
Expand All @@ -312,22 +306,10 @@ absl::StatusOr<ChannelLabel::Label> 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:
Expand All @@ -336,10 +318,6 @@ absl::StatusOr<ChannelLabel::Label> 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:
Expand All @@ -352,14 +330,6 @@ absl::StatusOr<ChannelLabel::Label> 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:
Expand Down
17 changes: 2 additions & 15 deletions iamf/cli/proto/audio_frame.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -30,40 +29,26 @@ 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;
CHANNEL_LABEL_LSS_7 = 34;
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;
Expand All @@ -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;

Expand Down
17 changes: 0 additions & 17 deletions iamf/cli/tests/channel_label_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,6 @@ TEST(ConvertAndFillLabels, ValidWith9_1_6ProtoLabels) {
kTpBL, kTpBR}));
}

TEST(ConvertAndFillLabels, ValidWithDemixedLabels) {
ExpectConvertAndFillLabelsHasExpectedOutput(
std::vector<iamf_tools_cli_proto::ChannelLabel>(
{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<ChannelLabel::Label>(
{kDemixedR2, kDemixedL3, kDemixedR3, kDemixedL5, kDemixedR5,
kDemixedLs5, kDemixedRs5, kDemixedLtf2, kDemixedRtf2, kDemixedLtb4,
kDemixedRtb4, kDemixedL7, kDemixedR7, kDemixedLrs7, kDemixedRrs7}));
}

TEST(ConvertAndFillLabels, ValidWithZerothOrderAmbisonicsProtoLabels) {
ExpectConvertAndFillLabelsHasExpectedOutput(
std::vector<iamf_tools_cli_proto::ChannelLabel>({CHANNEL_LABEL_A_0}),
Expand Down

0 comments on commit 43f179a

Please sign in to comment.