Borrar filtros
Borrar filtros

Less then 8 bit data ?

2 visualizaciones (últimos 30 días)
Adel Hafri
Adel Hafri el 11 de Mzo. de 2022
Comentada: Adel Hafri el 12 de Mzo. de 2022
Hello, im coding Shanoon fanoo algorith rn which compressed images by changing the code of most occuring bits to smaller codes, but the problem is matlab always makes them int8, while i need to make them smaller then that, what's a workaround ?

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Mzo. de 2022
The newest "bit-sliced" computer that I can find (one able to index down to single bits) was 1981. I seem to have a memory of one designed in roughly 1984-ish, but it would be a fair strain to remember any details.
Basically, what you are asking to do has not been supported on computers in decades.
What people do instead is one of:
  • use byte arrays for all working calculations, and pack the bits into bytes when it comes time to write to file; Or
  • pack multiple bits into a single byte (or word or long word) by keeping track of the relative position and using arithmetic operations. In MATLAB, you can use bitset() and bitget()
  1 comentario
Adel Hafri
Adel Hafri el 12 de Mzo. de 2022
Man, i dont know how i didnt think come i didnt think of storing the bits into a single byte, but it totally works, thank you so much!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by