|
|
@ -86,6 +86,11 @@ typedef struct { |
|
|
|
int * residue; |
|
|
|
int * residue; |
|
|
|
} mapping_t; |
|
|
|
} mapping_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
|
|
|
int blockflag; |
|
|
|
|
|
|
|
int mapping; |
|
|
|
|
|
|
|
} vorbis_mode_t; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
typedef struct { |
|
|
|
int channels; |
|
|
|
int channels; |
|
|
|
int sample_rate; |
|
|
|
int sample_rate; |
|
|
@ -102,6 +107,9 @@ typedef struct { |
|
|
|
|
|
|
|
|
|
|
|
int nmappings; |
|
|
|
int nmappings; |
|
|
|
mapping_t * mappings; |
|
|
|
mapping_t * mappings; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nmodes; |
|
|
|
|
|
|
|
vorbis_mode_t * modes; |
|
|
|
} venc_context_t; |
|
|
|
} venc_context_t; |
|
|
|
|
|
|
|
|
|
|
|
static inline int ilog(unsigned int a) { |
|
|
|
static inline int ilog(unsigned int a) { |
|
|
@ -320,6 +328,15 @@ static int put_main_header(venc_context_t * venc, uint8_t ** out) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// modes
|
|
|
|
|
|
|
|
put_bits(&pb, 6, venc->nmodes - 1); |
|
|
|
|
|
|
|
for (i = 0; i < venc->nmodes; i++) { |
|
|
|
|
|
|
|
put_bits(&pb, 1, venc->modes[i].blockflag); |
|
|
|
|
|
|
|
put_bits(&pb, 16, 0); // reserved window type
|
|
|
|
|
|
|
|
put_bits(&pb, 16, 0); // reserved transform type
|
|
|
|
|
|
|
|
put_bits(&pb, 8, venc->modes[i].mapping); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flush_put_bits(&pb); |
|
|
|
flush_put_bits(&pb); |
|
|
|
hlens[2] = (put_bits_count(&pb) + 7) / 8; |
|
|
|
hlens[2] = (put_bits_count(&pb) + 7) / 8; |
|
|
|
|
|
|
|
|
|
|
|