Add files.h and optimisation of QAM

This commit is contained in:
2025-09-30 09:32:08 +02:00
parent 68ab97e222
commit ae3da7c9f0
7 changed files with 46548 additions and 1173 deletions

21
files/files.h Normal file
View File

@ -0,0 +1,21 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>
// Conteneur de bits (0/1 stockés dans uint8_t)
typedef struct {
uint8_t *bits; // tableau de 0/1
size_t nb_bits; // nombre total de bits
} bit_array;
// Lire un fichier binaire et le transformer en tableau de bits (0/1)
bit_array file_to_bits(const char *filename);
// Transformer un tableau de bits (0/1) en fichier binaire
int bits_to_file(const char *filename, const bit_array *arr);
// Génère un nom du type "output.<ext>" où <ext> est l'extension du fichier d'entrée
char* make_output_filename(const char *input_filename);
// Libérer la mémoire du bit_array
void free_bit_array(bit_array *arr);