Browse Source

new functions to detect sync header changes

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

+ 9
- 0
mpeg/aac.h View File

@ -188,6 +188,15 @@ static inline bool adts_sync_compare(const uint8_t *p_adts1, const uint8_t *p_ad
(p_adts1[3] & 0xfc) == (p_adts2[3] & 0xfc);
}
/* same but only takes into account meaningful fields */
static inline bool adts_sync_compare_formats(const uint8_t *p_adts1, const uint8_t *p_adts2)
{
return p_adts1[0] == p_adts2[0] &&
(p_adts1[1] & 0xfe) == (p_adts2[1] & 0xfe) &&
p_adts1[2] == p_adts2[2] &&
(p_adts1[3] & 0xc0) == (p_adts2[3] & 0xc0);
}
#ifdef __cplusplus
}
#endif

+ 9
- 0
mpeg/mpga.h View File

@ -211,6 +211,15 @@ static inline bool mpga_sync_compare(const uint8_t *p_mpga1, const uint8_t *p_mp
p_mpga1[3] == p_mpga2[3];
}
/* same but only takes into account meaningful fields */
static inline bool mpga_sync_compare_formats(const uint8_t *p_mpga1, const uint8_t *p_mpga2)
{
return p_mpga1[0] == p_mpga2[0] &&
(p_mpga1[1] & 0xfe) == (p_mpga2[1] & 0xfe) &&
(p_mpga1[2] & 0xfc) == (p_mpga2[2] & 0xfc) &&
(p_mpga1[3] & 0xf0) == (p_mpga2[3] & 0xf0);
}
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save