FastLED 3.9.15
Loading...
Searching...
No Matches

◆ plm_buffer_read()

int fl::third_party::plm_buffer_read ( plm_buffer_t * self,
int count )

Definition at line 1017 of file pl_mpeg.hpp.

1017 {
1018 if (!plm_buffer_has(self, count)) {
1019 return 0;
1020 }
1021
1022 int value = 0;
1023 while (count) {
1024 int current_byte = self->bytes[self->bit_index >> 3];
1025
1026 int remaining = 8 - (self->bit_index & 7); // Remaining bits in byte
1027 int read = remaining < count ? remaining : count; // Bits in self run
1028 int shift = remaining - read;
1029 int mask = (0xff >> (8 - read));
1030
1031 value = (value << read) | ((current_byte & (mask << shift)) >> shift);
1032
1033 self->bit_index += read;
1034 count -= read;
1035 }
1036
1037 return value;
1038}
int plm_buffer_has(plm_buffer_t *self, size_t count) FL_NOEXCEPT
Definition pl_mpeg.hpp:998
constexpr int type_rank< T >::value
int read()

References FL_NOEXCEPT, plm_buffer_has(), fl::read(), and fl::type_rank< T >::value.

Referenced by plm_audio_decode_frame(), plm_audio_decode_header(), plm_audio_read_allocation(), plm_audio_read_samples(), plm_buffer_peek_non_zero(), plm_buffer_read_vlc(), plm_demux_decode_packet(), plm_demux_decode_time(), plm_demux_has_headers(), plm_video_decode_block(), plm_video_decode_macroblock(), plm_video_decode_motion_vector(), plm_video_decode_picture(), plm_video_decode_sequence_header(), and plm_video_decode_slice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: