From 310edf444908b09ea6d00c03baceb7925f3bb7a2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 21 Mar 2024 18:19:04 +0100 Subject: Merging upstream version 1.45.0. Signed-off-by: Daniel Baumann --- ml/dlib/dlib/bit_stream/bit_stream_multi_1.h | 103 --------------------------- 1 file changed, 103 deletions(-) delete mode 100644 ml/dlib/dlib/bit_stream/bit_stream_multi_1.h (limited to 'ml/dlib/dlib/bit_stream/bit_stream_multi_1.h') diff --git a/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h b/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h deleted file mode 100644 index bf1cc0357..000000000 --- a/ml/dlib/dlib/bit_stream/bit_stream_multi_1.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (C) 2003 Davis E. King (davis@dlib.net) -// License: Boost Software License See LICENSE.txt for the full license. -#ifndef DLIB_BIT_STREAM_MULTi_1_ -#define DLIB_BIT_STREAM_MULTi_1_ - -#include "bit_stream_multi_abstract.h" - -namespace dlib -{ - template < - typename bit_stream_base - > - class bit_stream_multi_1 : public bit_stream_base - { - - public: - - void multi_write ( - unsigned long data, - int num_to_write - ); - - int multi_read ( - unsigned long& data, - int num_to_read - ); - - }; - - template < - typename bit_stream_base - > - inline void swap ( - bit_stream_multi_1& a, - bit_stream_multi_1& b - ) { a.swap(b); } - -// ---------------------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- - // member function definitions -// ---------------------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- - - template < - typename bit_stream_base - > - void bit_stream_multi_1:: - multi_write ( - unsigned long data, - int num_to_write - ) - { - // move the first bit into the most significant position - data <<= 32 - num_to_write; - - for (int i = 0; i < num_to_write; ++i) - { - // write the first bit from data - this->write(static_cast(data >> 31)); - - // shift the next bit into position - data <<= 1; - - } - } - -// ---------------------------------------------------------------------------------------- - - template < - typename bit_stream_base - > - int bit_stream_multi_1:: - multi_read ( - unsigned long& data, - int num_to_read - ) - { - int bit, i; - data = 0; - for (i = 0; i < num_to_read; ++i) - { - - // get a bit - if (this->read(bit) == false) - break; - - // shift data to make room for this new bit - data <<= 1; - - // put bit into the least significant position in data - data += static_cast(bit); - - } - - return i; - } - -// ---------------------------------------------------------------------------------------- - -} - -#endif // DLIB_BIT_STREAM_MULTi_1_ - -- cgit v1.2.3