aboutsummaryrefslogtreecommitdiffstats
path: root/libtoolame-dab/toolame.c
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-17 20:29:43 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-17 20:29:43 +0100
commitfcae305acbd8b20550699d6c9774e366dba0b4f1 (patch)
tree006aad1a040d93c2af71d2e9a9d20077efe5f3da /libtoolame-dab/toolame.c
parentce5773ca73462a9319c16d0afc692eb38e35af8d (diff)
downloadfdk-aac-dabplus-fcae305acbd8b20550699d6c9774e366dba0b4f1.tar.gz
fdk-aac-dabplus-fcae305acbd8b20550699d6c9774e366dba0b4f1.tar.bz2
fdk-aac-dabplus-fcae305acbd8b20550699d6c9774e366dba0b4f1.zip
Remove unused code, cosmetics
Diffstat (limited to 'libtoolame-dab/toolame.c')
-rw-r--r--libtoolame-dab/toolame.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/libtoolame-dab/toolame.c b/libtoolame-dab/toolame.c
index bea186c..9eed2f6 100644
--- a/libtoolame-dab/toolame.c
+++ b/libtoolame-dab/toolame.c
@@ -351,7 +351,8 @@ int toolame_encode_frame(
for (int sb = 0; sb < SBLIMIT; sb++)
smr[ch][sb] = smrdef[ch][sb];
}
- } else {
+ }
+ else {
/* calculate the psymodel */
switch (model) {
case -1:
@@ -446,19 +447,17 @@ int toolame_encode_frame(
exit (0);
}
- if (glopts.quickmode == TRUE)
+ if (glopts.quickmode == TRUE) {
/* copy the smr values and reuse them later */
for (int ch = 0; ch < nch; ch++) {
for (int sb = 0; sb < SBLIMIT; sb++)
smrdef[ch][sb] = smr[ch][sb];
}
+ }
- if (glopts.verbosity > 4)
+ if (glopts.verbosity > 4) {
smr_dump(smr, nch);
-
-
-
-
+ }
}
#ifdef NEWENCODE
@@ -466,13 +465,15 @@ int toolame_encode_frame(
main_bit_allocation_new (smr, scfsi, bit_alloc, &adb, &frame, &glopts);
//main_bit_allocation (smr, scfsi, bit_alloc, &adb, &frame, &glopts);
- if (error_protection)
+ if (error_protection) {
CRC_calc (&frame, bit_alloc, scfsi, &crc);
+ }
write_header (&frame, &bs);
//encode_info (&frame, &bs);
- if (error_protection)
+ if (error_protection) {
putbits (&bs, crc, 16);
+ }
write_bit_alloc (bit_alloc, &frame, &bs);
//encode_bit_alloc (bit_alloc, &frame, &bs);
write_scalefactors(bit_alloc, scfsi, scalar, &frame, &bs);
@@ -486,11 +487,13 @@ int toolame_encode_frame(
#else
transmission_pattern (scalar, scfsi, &frame);
main_bit_allocation (smr, scfsi, bit_alloc, &adb, &frame, &glopts);
- if (error_protection)
+ if (error_protection) {
CRC_calc (&frame, bit_alloc, scfsi, &crc);
+ }
encode_info (&frame, &bs);
- if (error_protection)
+ if (error_protection) {
encode_CRC (crc, &bs);
+ }
encode_bit_alloc (bit_alloc, &frame, &bs);
encode_scale (bit_alloc, scfsi, scalar, &frame, &bs);
subband_quantization (scalar, *sb_sample, j_scale, *j_sample, bit_alloc,
@@ -538,16 +541,19 @@ int toolame_encode_frame(
return bs.output_buffer_written;
}
-void smr_dump(double smr[2][SBLIMIT], int nch) {
- int ch, sb;
+// Dump function for psy model comparison
+void smr_dump(double smr[2][SBLIMIT], int nch)
+{
+ fprintf(stdout, "SMR:");
- fprintf(stdout,"SMR:");
- for (ch = 0;ch<nch; ch++) {
- if (ch==1)
- fprintf(stdout," ");
- for (sb=0;sb<SBLIMIT;sb++)
- fprintf(stdout,"%3.0f ",smr[ch][sb]);
- fprintf(stdout,"\n");
+ for (int ch = 0; ch < nch; ch++) {
+ if (ch==1) {
+ fprintf(stdout, " ");
+ }
+ for (int sb = 0; sb < SBLIMIT; sb++) {
+ fprintf(stdout, "%3.0f ", smr[ch][sb]);
+ }
+ fprintf(stdout, "\n");
}
}