[bTSstream-devel] [Git][videolan/bitstream][master] mpga: add mpga_sync_compare_formats_free

Christophe Massiot gitlab at videolan.org
Wed Sep 12 16:17:47 CEST 2018


Christophe Massiot pushed to branch master at VideoLAN / bitstream


Commits:
6a24dfe2 by Christophe Massiot at 2018-09-12T14:17:08Z
mpga: add mpga_sync_compare_formats_free

- - - - -


1 changed file:

- mpeg/mpga.h


Changes:

=====================================
mpeg/mpga.h
=====================================
@@ -228,6 +228,23 @@ static inline bool mpga_sync_compare_formats(const uint8_t *p_mpga1, const uint8
     return i_mode1 == i_mode2;
 }
 
+/* same but without comparing bitrate (free bitrate) */
+static inline bool mpga_sync_compare_formats_free(const uint8_t *p_mpga1, const uint8_t *p_mpga2)
+{
+    if (!(p_mpga1[0] == p_mpga2[0] &&
+          (p_mpga1[1] & 0xfe) == (p_mpga2[1] & 0xfe) &&
+          (p_mpga1[2] & 0xc) == (p_mpga2[2] & 0xc)))
+        return false;
+
+    /* consider stereo and joint stereo the same - because encoders can
+     * switch on the fly */
+    uint8_t i_mode1 = mpga_get_mode(p_mpga1);
+    uint8_t i_mode2 = mpga_get_mode(p_mpga2);
+    if (i_mode1 == MPGA_MODE_JOINT) i_mode1 = MPGA_MODE_STEREO;
+    if (i_mode2 == MPGA_MODE_JOINT) i_mode2 = MPGA_MODE_STEREO;
+    return i_mode1 == i_mode2;
+}
+
 #ifdef __cplusplus
 }
 #endif



View it on GitLab: https://code.videolan.org/videolan/bitstream/commit/6a24dfe25ba7145ade30d5c529a9bfaad7d22201

-- 
View it on GitLab: https://code.videolan.org/videolan/bitstream/commit/6a24dfe25ba7145ade30d5c529a9bfaad7d22201
You're receiving this email because of your account on code.videolan.org.


More information about the biTStream-devel mailing list