Browse Source

enhance mpga and adts support

master
Christophe Massiot 11 years ago
parent
commit
d726e6cd65
2 changed files with 16 additions and 0 deletions
  1. +8
    -0
      mpeg/aac.h
  2. +8
    -0
      mpeg/mpga.h

+ 8
- 0
mpeg/aac.h View File

@ -180,6 +180,14 @@ static inline void adts_set_num_blocks(uint8_t *p_adts, uint8_t i_blocks_min1)
p_adts[6] |= i_blocks_min1 & 0x03;
}
static inline bool adts_sync_compare(const uint8_t *p_adts1, const uint8_t *p_adts2)
{
return p_adts1[0] == p_adts2[0] &&
p_adts1[1] == p_adts2[1] &&
p_adts1[2] == p_adts2[2] &&
(p_adts1[3] & 0xfc) == (p_adts2[3] & 0xfc);
}
#ifdef __cplusplus
}
#endif

+ 8
- 0
mpeg/mpga.h View File

@ -203,6 +203,14 @@ static inline void mpga_set_emphasis(uint8_t *p_mpga, uint8_t i_emphasis)
p_mpga[3] |= i_emphasis & 0x03;
}
static inline bool mpga_sync_compare(const uint8_t *p_mpga1, const uint8_t *p_mpga2)
{
return p_mpga1[0] == p_mpga2[0] &&
p_mpga1[1] == p_mpga2[1] &&
(p_mpga1[2] & 0xfc) == (p_mpga2[2] & 0xfc) &&
p_mpga1[3] == p_mpga2[3];
}
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save