ReactOS  0.4.14-dev-114-gc8cbd56
getbits.h File Reference
#include "mpg123lib_intern.h"
Include dependency graph for getbits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define backbits(fr, nob)
 
#define getbitoffset(fr)   ((-fr->bitindex)&0x7)
 
#define getbyte(fr)   (*fr->wordpointer++)
 
#define macro_getbits(fr, nob)
 
#define skipbits(fr, nob)
 
#define getbits_fast(fr, nob)
 
#define get1bit(fr)
 

Functions

static unsigned int getbits (mpg123_handle *fr, int number_of_bits)
 

Macro Definition Documentation

◆ backbits

#define backbits (   fr,
  nob 
)
Value:
((void)( \
fr->bitindex -= nob, \
fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 0x7 ))
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49

Definition at line 17 of file getbits.h.

◆ get1bit

#define get1bit (   fr)
Value:
( \
fr->uctmp = *fr->wordpointer << fr->bitindex, fr->bitindex++, \
fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 )

Definition at line 99 of file getbits.h.

◆ getbitoffset

#define getbitoffset (   fr)    ((-fr->bitindex)&0x7)

Definition at line 22 of file getbits.h.

◆ getbits_fast

#define getbits_fast (   fr,
  nob 
)
Value:
( \
fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \
fr->ultmp |= ((unsigned long) fr->wordpointer[1]<<fr->bitindex)>>8, \
fr->ultmp <<= nob, fr->ultmp >>= 8, \
fr->bitindex += nob, fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7, fr->ultmp )
unsigned char
Definition: typeof.h:29
#define long
Definition: qsort.c:33

Definition at line 92 of file getbits.h.

◆ getbyte

#define getbyte (   fr)    (*fr->wordpointer++)

Definition at line 23 of file getbits.h.

◆ macro_getbits

#define macro_getbits (   fr,
  nob 
)
Value:
( \
fr->ultmp = fr->wordpointer[0],\
fr->ultmp <<= 8, \
fr->ultmp |= fr->wordpointer[1], \
fr->ultmp <<= 8, \
fr->ultmp |= fr->wordpointer[2], \
fr->ultmp <<= fr->bitindex, \
fr->ultmp &= 0xffffff, \
fr->bitindex += nob, \
fr->ultmp >>= (24-nob), \
fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7, \
fr->ultmp)

Definition at line 26 of file getbits.h.

◆ skipbits

#define skipbits (   fr,
  nob 
)
Value:
fr->ultmp = ( \
fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \
fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \
fr->ultmp &= 0xffffff, fr->bitindex += nob, \
fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \
fr->bitindex &= 7 )

Definition at line 85 of file getbits.h.

Function Documentation

◆ getbits()

static unsigned int getbits ( mpg123_handle fr,
int  number_of_bits 
)
static

Definition at line 40 of file getbits.h.

41 {
42  unsigned long rval;
43 
44 #ifdef DEBUG_GETBITS
45 fprintf(stderr,"g%d",number_of_bits);
46 #endif
47  /* Safety catch until we got the nasty code fully figured out. */
48  /* No, that catch stays here, even if we think we got it figured out! */
49  if( (long)(fr->wordpointer-fr->bsbuf)*8
50  + fr->bitindex+number_of_bits > (long)fr->framesize*8 )
51  return 0;
52 /* This is actually slow: if(!number_of_bits)
53  return 0; */
54 
55 #if 0
56  check_buffer_range(number_of_bits+fr->bitindex);
57 #endif
58 
59  {
60  rval = fr->wordpointer[0];
61  rval <<= 8;
62  rval |= fr->wordpointer[1];
63  rval <<= 8;
64  rval |= fr->wordpointer[2];
65 
66  rval <<= fr->bitindex;
67  rval &= 0xffffff;
68 
69  fr->bitindex += number_of_bits;
70 
71  rval >>= (24-number_of_bits);
72 
73  fr->wordpointer += (fr->bitindex>>3);
74  fr->bitindex &= 7;
75  }
76 
77 #ifdef DEBUG_GETBITS
78 fprintf(stderr,":%lx\n",rval);
79 #endif
80 
81  return rval;
82 }
unsigned char * wordpointer
Definition: frame.h:227
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
float rval
Definition: cylfrac.c:48
FILE * stderr
unsigned char * bsbuf
Definition: frame.h:252