diff options
author | DeeJayLSP <djlsplays@gmail.com> | 2022-09-27 21:18:11 -0300 |
---|---|---|
committer | DeeJayLSP <djlsplays@gmail.com> | 2022-10-18 21:15:13 -0300 |
commit | b87584a070c5bb6ca1c51f756ec6db5ab4729349 (patch) | |
tree | dd3c528a2ee92d9bc2b406dfa7559e5fd6ed2123 /thirdparty/libtheora/bitpack.h | |
parent | 92bcd3c01d5188480793c03b2b50e97363ceb624 (diff) |
Update libtheora to GIT (2020.10)
Diffstat (limited to 'thirdparty/libtheora/bitpack.h')
-rw-r--r-- | thirdparty/libtheora/bitpack.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/thirdparty/libtheora/bitpack.h b/thirdparty/libtheora/bitpack.h index a020a292f5..237b584055 100644 --- a/thirdparty/libtheora/bitpack.h +++ b/thirdparty/libtheora/bitpack.h @@ -16,15 +16,32 @@ ********************************************************************/ #if !defined(_bitpack_H) # define _bitpack_H (1) +# include <stddef.h> # include <limits.h> +# include "internal.h" -typedef unsigned long oc_pb_window; +typedef size_t oc_pb_window; typedef struct oc_pack_buf oc_pack_buf; +/*Custom bitpacker implementations.*/ +# if defined(OC_ARM_ASM) +# include "arm/armbits.h" +# endif + +# if !defined(oc_pack_read) +# define oc_pack_read oc_pack_read_c +# endif +# if !defined(oc_pack_read1) +# define oc_pack_read1 oc_pack_read1_c +# endif +# if !defined(oc_huff_token_decode) +# define oc_huff_token_decode oc_huff_token_decode_c +# endif + # define OC_PB_WINDOW_SIZE ((int)sizeof(oc_pb_window)*CHAR_BIT) /*This is meant to be a large, positive constant that can still be efficiently loaded as an immediate (on platforms like ARM, for example). @@ -34,9 +51,9 @@ typedef struct oc_pack_buf oc_pack_buf; struct oc_pack_buf{ - oc_pb_window window; - const unsigned char *ptr; const unsigned char *stop; + const unsigned char *ptr; + oc_pb_window window; int bits; int eof; }; @@ -45,8 +62,8 @@ void oc_pack_readinit(oc_pack_buf *_b,unsigned char *_buf,long _bytes); int oc_pack_look1(oc_pack_buf *_b); void oc_pack_adv1(oc_pack_buf *_b); /*Here we assume 0<=_bits&&_bits<=32.*/ -long oc_pack_read(oc_pack_buf *_b,int _bits); -int oc_pack_read1(oc_pack_buf *_b); +long oc_pack_read_c(oc_pack_buf *_b,int _bits); +int oc_pack_read1_c(oc_pack_buf *_b); /* returns -1 for read beyond EOF, or the number of whole bytes available */ long oc_pack_bytes_left(oc_pack_buf *_b); |