]> git.sesse.net Git - vlc/blobdiff - src/spu_decoder/spu_decoder.h
* Additional optimizations to the subtitle decoder
[vlc] / src / spu_decoder / spu_decoder.h
index 47ce700a27b7d356814eebdb022e662a6dbb8f2a..966f09754f01ea46a2a2be7eac92111709a3d241 100644 (file)
@@ -65,17 +65,18 @@ typedef struct spudec_thread_s
 #define SPU_CMD_END                 0xff
 
 /*****************************************************************************
- * GetNibble: read a nibble from a source packet.
+ * AddNibble: read a nibble from a source packet and add it to our integer.
  *****************************************************************************/
-static __inline__ u8 GetNibble( u8 *p_source, int *pi_index )
+static __inline__ unsigned int AddNibble( unsigned int i_code,
+                                          u8 *p_src, int *pi_index )
 {
     if( *pi_index & 0x1 )
     {
-        return( p_source[(*pi_index)++ >> 1] & 0xf );
+        return( i_code << 4 | ( p_src[(*pi_index)++ >> 1] & 0xf ) );
     }
     else
     {
-        return( p_source[(*pi_index)++ >> 1] >> 4 );
+        return( i_code << 4 | p_src[(*pi_index)++ >> 1] >> 4 );
     }
 }