Unverified Commit cb576f29 authored by Wolle's avatar Wolle Committed by GitHub

force end of packet

parent b520259d
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* adapted for the ESP32 by schreibfaul1 * adapted for the ESP32 by schreibfaul1
* *
* Created on: 13.02.2023 * Created on: 13.02.2023
* Updated on: 07.04.2023 * Updated on: 19.04.2023
*/ */
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// O G G I M P L. // O G G I M P L.
...@@ -923,17 +923,21 @@ int32_t bitReader_look(uint16_t nBits){ ...@@ -923,17 +923,21 @@ int32_t bitReader_look(uint16_t nBits){
/* bits <= 32 */ /* bits <= 32 */
int32_t bitReader(uint16_t nBits) { int32_t bitReader(uint16_t nBits) {
int32_t ret = bitReader_look(nBits); int32_t ret = bitReader_look(nBits);
bitReader_adv(nBits); if(bitReader_adv(nBits) < 0) return -1;
return (ret); return (ret);
} }
/* limited to 32 at a time */ /* limited to 32 at a time */
void bitReader_adv(uint16_t nBits) { int8_t bitReader_adv(uint16_t nBits) {
nBits += s_bitReader.headbit; nBits += s_bitReader.headbit;
s_bitReader.headbit = nBits & 7; s_bitReader.headbit = nBits & 7;
s_bitReader.headend -= (nBits >> 3); s_bitReader.headend -= (nBits >> 3);
s_bitReader.headptr += (nBits >> 3); s_bitReader.headptr += (nBits >> 3);
if(s_bitReader.headend < 1){log_e("error in bitreader");} if(s_bitReader.headend < 1){
return -1;
log_e("error in bitreader");
}
return 0;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int ilog(uint32_t v) { int ilog(uint32_t v) {
...@@ -1866,6 +1870,10 @@ int32_t *floor1_inverse1(vorbis_info_floor_t *in, int32_t *fit_value) { ...@@ -1866,6 +1870,10 @@ int32_t *floor1_inverse1(vorbis_info_floor_t *in, int32_t *fit_value) {
return (fit_value); return (fit_value);
} }
else{
// log_i("err in br");
;
}
eop: eop:
return (NULL); return (NULL);
} }
...@@ -1876,7 +1884,7 @@ int32_t vorbis_book_decode(codebook_t* book) { ...@@ -1876,7 +1884,7 @@ int32_t vorbis_book_decode(codebook_t* book) {
return decode_packed_entry_number(book); return decode_packed_entry_number(book);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
uint32_t decode_packed_entry_number(codebook_t *book) { int32_t decode_packed_entry_number(codebook_t *book) {
uint32_t chase = 0; uint32_t chase = 0;
int read = book->dec_maxlength; int read = book->dec_maxlength;
int32_t lok = bitReader_look(read), i; int32_t lok = bitReader_look(read), i;
......
...@@ -231,7 +231,7 @@ int floor1_memosize(vorbis_info_floor_t *i); ...@@ -231,7 +231,7 @@ int floor1_memosize(vorbis_info_floor_t *i);
int32_t *floor0_inverse1(vorbis_info_floor_t *i, int32_t *lsp); int32_t *floor0_inverse1(vorbis_info_floor_t *i, int32_t *lsp);
int32_t *floor1_inverse1(vorbis_info_floor_t *in, int32_t *fit_value); int32_t *floor1_inverse1(vorbis_info_floor_t *in, int32_t *fit_value);
int32_t vorbis_book_decode(codebook_t* book); int32_t vorbis_book_decode(codebook_t* book);
uint32_t decode_packed_entry_number(codebook_t *book); int32_t decode_packed_entry_number(codebook_t *book);
int render_point(int x0, int x1, int y0, int y1, int x); int render_point(int x0, int x1, int y0, int y1, int x);
int32_t vorbis_book_decodev_set(codebook_t *book, int32_t *a, int n, int point); int32_t vorbis_book_decodev_set(codebook_t *book, int32_t *a, int n, int point);
int decode_map(codebook_t *s, int32_t *v, int point); int decode_map(codebook_t *s, int32_t *v, int point);
...@@ -270,7 +270,7 @@ void bitReader_clear(); ...@@ -270,7 +270,7 @@ void bitReader_clear();
void bitReader_setData(uint8_t *buff, uint16_t buffSize); void bitReader_setData(uint8_t *buff, uint16_t buffSize);
int32_t bitReader(uint16_t bits); int32_t bitReader(uint16_t bits);
int32_t bitReader_look(uint16_t nBits); int32_t bitReader_look(uint16_t nBits);
void bitReader_adv(uint16_t bits); int8_t bitReader_adv(uint16_t bits);
uint8_t _ilog(uint32_t v); uint8_t _ilog(uint32_t v);
int ilog(uint32_t v); int ilog(uint32_t v);
int32_t _float32_unpack(int32_t val, int *point); int32_t _float32_unpack(int32_t val, int *point);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment