#define VALUE_NOT_FOUND 0xFFFFFFF

static const int64_t AV_CH_LAYOUT_T_TAB[][2] = {
  {(-1386054801), AV_CH_LAYOUT_NATIVE},
  {(1718882439), AV_CH_LAYOUT_MONO},
  {(2053588657), AV_CH_LAYOUT_STEREO},
  {(-1607517655), AV_CH_LAYOUT_2POINT1},
  {(2112033099), AV_CH_LAYOUT_2_1},
  {(494846397), AV_CH_LAYOUT_SURROUND},
  {(-212195413), AV_CH_LAYOUT_3POINT1},
  {(1183126827), AV_CH_LAYOUT_4POINT0},
  {(1183126829), AV_CH_LAYOUT_4POINT1},
  {(2112033101), AV_CH_LAYOUT_2_2},
  {(1808189903), AV_CH_LAYOUT_QUAD},
  {(-1716518227), AV_CH_LAYOUT_5POINT0},
  {(-1716518225), AV_CH_LAYOUT_5POINT1},
  {(-1397835295), AV_CH_LAYOUT_5POINT0_BACK},
  {(2036691615), AV_CH_LAYOUT_5POINT1_BACK},
  {(-321195985), AV_CH_LAYOUT_6POINT0},
  {(-1451948413), AV_CH_LAYOUT_6POINT0_FRONT},
  {(-2031818409), AV_CH_LAYOUT_HEXAGONAL},
  {(-321195983), AV_CH_LAYOUT_6POINT1},
  {(-52146723), AV_CH_LAYOUT_6POINT1_BACK},
  {(-56626171), AV_CH_LAYOUT_6POINT1_FRONT},
  {(1074126257), AV_CH_LAYOUT_7POINT0},
  {(888537477), AV_CH_LAYOUT_7POINT0_FRONT},
  {(1074126259), AV_CH_LAYOUT_7POINT1},
  {(-1674427149), AV_CH_LAYOUT_7POINT1_WIDE},
  {(-575112741), AV_CH_LAYOUT_7POINT1_WIDE_BACK},
  {(-559732511), AV_CH_LAYOUT_OCTAGONAL},
  {(2138366425), AV_CH_LAYOUT_HEXADECAGONAL},
  {(284438183), AV_CH_LAYOUT_STEREO_DOWNMIX},
};

#define AV_CH_LAYOUT_T_TAB_LEN 29
uint64_t ChannelLayout_val(value v){
int i;
for(i=0;i<AV_CH_LAYOUT_T_TAB_LEN;i++){
if(v==AV_CH_LAYOUT_T_TAB[i][0])return AV_CH_LAYOUT_T_TAB[i][1];
}
return VALUE_NOT_FOUND;
}
value Val_ChannelLayout(uint64_t t){
int i;
for(i=0;i<AV_CH_LAYOUT_T_TAB_LEN; i++){
if(t==AV_CH_LAYOUT_T_TAB[i][1])return AV_CH_LAYOUT_T_TAB[i][0];
}
return VALUE_NOT_FOUND;
}
