[vlc-commits] packetizer: startcode_helper: revector sse2 helper entry
Francois Cartegnie
git at videolan.org
Thu Apr 12 10:46:00 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 12 07:37:13 2018 +0200| [b8259472e3e7db7b6b875f5f0c2ae5730a867476] | committer: Francois Cartegnie
packetizer: startcode_helper: revector sse2 helper entry
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b8259472e3e7db7b6b875f5f0c2ae5730a867476
---
modules/packetizer/startcode_helper.h | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/modules/packetizer/startcode_helper.h b/modules/packetizer/startcode_helper.h
index ea70ec5b28..2b61e5cf98 100644
--- a/modules/packetizer/startcode_helper.h
+++ b/modules/packetizer/startcode_helper.h
@@ -113,12 +113,8 @@ static inline const uint8_t * startcode_FindAnnexB_SSE2( const uint8_t *p, const
* and i believe the trick originated from
* https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
*/
-static inline const uint8_t * startcode_FindAnnexB( const uint8_t *p, const uint8_t *end )
+static inline const uint8_t * startcode_FindAnnexB_Bits( const uint8_t *p, const uint8_t *end )
{
-#if defined(CAN_COMPILE_SSE2) || defined(HAVE_SSE2_INTRINSICS)
- if (vlc_CPU_SSE2())
- return startcode_FindAnnexB_SSE2(p, end);
-#endif
const uint8_t *a = p + 4 - ((intptr_t)p & 3);
for (end -= 3; p < a && p <= end; p++) {
@@ -142,7 +138,18 @@ static inline const uint8_t * startcode_FindAnnexB( const uint8_t *p, const uint
return NULL;
}
-
#undef TRY_MATCH
+#if defined(CAN_COMPILE_SSE2) || defined(HAVE_SSE2_INTRINSICS)
+static inline const uint8_t * startcode_FindAnnexB( const uint8_t *p, const uint8_t *end )
+{
+ if (vlc_CPU_SSE2())
+ return startcode_FindAnnexB_SSE2(p, end);
+ else
+ return startcode_FindAnnexB_Bits(p, end);
+}
+#else
+ #define startcode_FindAnnexB startcode_FindAnnexB_Bits
+#endif
+
#endif
More information about the vlc-commits
mailing list