History

Merge commit '8a213179aff0174d81b3e889134a3b4f7d21f5c3'

* commit '8a213179aff0174d81b3e889134a3b4f7d21f5c3': dca: Remove trace debugging code

Michael Niedermayer committed 11 years ago

Commit 6c44dd62 parents 877c038 8a213171 file · +1 −146Browse files

Unified · Split

libavcodec/dcadec.c+1−146
@@ -52,8 +52,6 @@ · 51 unmodified lines
5252 # include "arm/dca.h"
5353 #endif
5454
55−//#define TRACE
56−
5755 enum DCAMode {
5856 DCA_MONO = 0,
5957 DCA_CHANNEL,
@@ -511,33 +509,6 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel, · 451 unmodified lines
511509 s->current_subframe = 0;
512510 s->current_subsubframe = 0;
513511
514−#ifdef TRACE
515− av_log(s->avctx, AV_LOG_DEBUG, "subframes: %i\n", s->subframes);
516− av_log(s->avctx, AV_LOG_DEBUG, "prim channels: %i\n", s->prim_channels);
517− for (i = base_channel; i < s->prim_channels; i++) {
518− av_log(s->avctx, AV_LOG_DEBUG, "subband activity: %i\n",
519− s->subband_activity[i]);
520− av_log(s->avctx, AV_LOG_DEBUG, "vq start subband: %i\n",
521− s->vq_start_subband[i]);
522− av_log(s->avctx, AV_LOG_DEBUG, "joint intensity: %i\n",
523− s->joint_intensity[i]);
524− av_log(s->avctx, AV_LOG_DEBUG, "transient mode codebook: %i\n",
525− s->transient_huffman[i]);
526− av_log(s->avctx, AV_LOG_DEBUG, "scale factor codebook: %i\n",
527− s->scalefactor_huffman[i]);
528− av_log(s->avctx, AV_LOG_DEBUG, "bit allocation quantizer: %i\n",
529− s->bitalloc_huffman[i]);
530− av_log(s->avctx, AV_LOG_DEBUG, "quant index huff:");
531− for (j = 0; j < 11; j++)
532− av_log(s->avctx, AV_LOG_DEBUG, " %i", s->quant_index_huffman[i][j]);
533− av_log(s->avctx, AV_LOG_DEBUG, "\n");
534− av_log(s->avctx, AV_LOG_DEBUG, "scalefac adj:");
535− for (j = 0; j < 11; j++)
536− av_log(s->avctx, AV_LOG_DEBUG, " %1.3f", s->scalefactor_adj[i][j]);
537− av_log(s->avctx, AV_LOG_DEBUG, "\n");
538− }
539−#endif
540−
541512 return 0;
542513 }
543514
@@ -599,43 +570,6 @@ static int dca_parse_frame_header(DCAContext *s) · 55 unmodified lines
599570 if (s->lfe)
600571 s->output |= DCA_LFE;
601572
602−#ifdef TRACE
603− av_log(s->avctx, AV_LOG_DEBUG, "frame type: %i\n", s->frame_type);
604− av_log(s->avctx, AV_LOG_DEBUG, "samples deficit: %i\n", s->samples_deficit);
605− av_log(s->avctx, AV_LOG_DEBUG, "crc present: %i\n", s->crc_present);
606− av_log(s->avctx, AV_LOG_DEBUG, "sample blocks: %i (%i samples)\n",
607− s->sample_blocks, s->sample_blocks * 32);
608− av_log(s->avctx, AV_LOG_DEBUG, "frame size: %i bytes\n", s->frame_size);
609− av_log(s->avctx, AV_LOG_DEBUG, "amode: %i (%i channels)\n",
610− s->amode, dca_channels[s->amode]);
611− av_log(s->avctx, AV_LOG_DEBUG, "sample rate: %i Hz\n",
612− s->sample_rate);
613− av_log(s->avctx, AV_LOG_DEBUG, "bit rate: %i bits/s\n",
614− s->bit_rate);
615− av_log(s->avctx, AV_LOG_DEBUG, "dynrange: %i\n", s->dynrange);
616− av_log(s->avctx, AV_LOG_DEBUG, "timestamp: %i\n", s->timestamp);
617− av_log(s->avctx, AV_LOG_DEBUG, "aux_data: %i\n", s->aux_data);
618− av_log(s->avctx, AV_LOG_DEBUG, "hdcd: %i\n", s->hdcd);
619− av_log(s->avctx, AV_LOG_DEBUG, "ext descr: %i\n", s->ext_descr);
620− av_log(s->avctx, AV_LOG_DEBUG, "ext coding: %i\n", s->ext_coding);
621− av_log(s->avctx, AV_LOG_DEBUG, "aspf: %i\n", s->aspf);
622− av_log(s->avctx, AV_LOG_DEBUG, "lfe: %i\n", s->lfe);
623− av_log(s->avctx, AV_LOG_DEBUG, "predictor history: %i\n",
624− s->predictor_history);
625− av_log(s->avctx, AV_LOG_DEBUG, "header crc: %i\n", s->header_crc);
626− av_log(s->avctx, AV_LOG_DEBUG, "multirate inter: %i\n",
627− s->multirate_inter);
628− av_log(s->avctx, AV_LOG_DEBUG, "version number: %i\n", s->version);
629− av_log(s->avctx, AV_LOG_DEBUG, "copy history: %i\n", s->copy_history);
630− av_log(s->avctx, AV_LOG_DEBUG,
631− "source pcm resolution: %i (%i bits/sample)\n",
632− s->source_pcm_res, dca_bits_per_sample[s->source_pcm_res]);
633− av_log(s->avctx, AV_LOG_DEBUG, "front sum: %i\n", s->front_sum);
634− av_log(s->avctx, AV_LOG_DEBUG, "surround sum: %i\n", s->surround_sum);
635− av_log(s->avctx, AV_LOG_DEBUG, "dialog norm: %i\n", s->dialog_norm);
636− av_log(s->avctx, AV_LOG_DEBUG, "\n");
637−#endif
638−
639573 /* Primary audio coding header */
640574 s->subframes = get_bits(&s->gb, 4) + 1;
641575
@@ -840,72 +774,6 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) · 198 unmodified lines
840774 s->lfe_data[j] *= lfe_scale;
841775 }
842776
843−#ifdef TRACE
844− av_log(s->avctx, AV_LOG_DEBUG, "subsubframes: %i\n",
845− s->subsubframes[s->current_subframe]);
846− av_log(s->avctx, AV_LOG_DEBUG, "partial samples: %i\n",
847− s->partial_samples[s->current_subframe]);
848−
849− for (j = base_channel; j < s->prim_channels; j++) {
850− av_log(s->avctx, AV_LOG_DEBUG, "prediction mode:");
851− for (k = 0; k < s->subband_activity[j]; k++)
852− av_log(s->avctx, AV_LOG_DEBUG, " %i", s->prediction_mode[j][k]);
853− av_log(s->avctx, AV_LOG_DEBUG, "\n");
854− }
855− for (j = base_channel; j < s->prim_channels; j++) {
856− for (k = 0; k < s->subband_activity[j]; k++)
857− av_log(s->avctx, AV_LOG_DEBUG,
858− "prediction coefs: %f, %f, %f, %f\n",
859− (float) adpcm_vb[s->prediction_vq[j][k]][0] / 8192,
860− (float) adpcm_vb[s->prediction_vq[j][k]][1] / 8192,
861− (float) adpcm_vb[s->prediction_vq[j][k]][2] / 8192,
862− (float) adpcm_vb[s->prediction_vq[j][k]][3] / 8192);
863− }
864− for (j = base_channel; j < s->prim_channels; j++) {
865− av_log(s->avctx, AV_LOG_DEBUG, "bitalloc index: ");
866− for (k = 0; k < s->vq_start_subband[j]; k++)
867− av_log(s->avctx, AV_LOG_DEBUG, "%2.2i ", s->bitalloc[j][k]);
868− av_log(s->avctx, AV_LOG_DEBUG, "\n");
869− }
870− for (j = base_channel; j < s->prim_channels; j++) {
871− av_log(s->avctx, AV_LOG_DEBUG, "Transition mode:");
872− for (k = 0; k < s->subband_activity[j]; k++)
873− av_log(s->avctx, AV_LOG_DEBUG, " %i", s->transition_mode[j][k]);
874− av_log(s->avctx, AV_LOG_DEBUG, "\n");
875− }
876− for (j = base_channel; j < s->prim_channels; j++) {
877− av_log(s->avctx, AV_LOG_DEBUG, "Scale factor:");
878− for (k = 0; k < s->subband_activity[j]; k++) {
879− if (k >= s->vq_start_subband[j] || s->bitalloc[j][k] > 0)
880− av_log(s->avctx, AV_LOG_DEBUG, " %i", s->scale_factor[j][k][0]);
881− if (k < s->vq_start_subband[j] && s->transition_mode[j][k])
882− av_log(s->avctx, AV_LOG_DEBUG, " %i(t)", s->scale_factor[j][k][1]);
883− }
884− av_log(s->avctx, AV_LOG_DEBUG, "\n");
885− }
886− for (j = base_channel; j < s->prim_channels; j++) {
887− if (s->joint_intensity[j] > 0) {
888− int source_channel = s->joint_intensity[j] - 1;
889− av_log(s->avctx, AV_LOG_DEBUG, "Joint scale factor index:\n");
890− for (k = s->subband_activity[j]; k < s->subband_activity[source_channel]; k++)
891− av_log(s->avctx, AV_LOG_DEBUG, " %i", s->joint_scale_factor[j][k]);
892− av_log(s->avctx, AV_LOG_DEBUG, "\n");
893− }
894− }
895− for (j = base_channel; j < s->prim_channels; j++)
896− for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
897− av_log(s->avctx, AV_LOG_DEBUG, "VQ index: %i\n", s->high_freq_vq[j][k]);
898− if (!base_channel && s->lfe) {
899− int lfe_samples = 2 * s->lfe * (4 + block_index);
900− int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
901−
902− av_log(s->avctx, AV_LOG_DEBUG, "LFE samples:\n");
903− for (j = lfe_samples; j < lfe_end_sample; j++)
904− av_log(s->avctx, AV_LOG_DEBUG, " %f", s->lfe_data[j]);
905− av_log(s->avctx, AV_LOG_DEBUG, "\n");
906− }
907−#endif
908−
909777 return 0;
910778 }
911779
@@ -1212,11 +1080,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index) · 300 unmodified lines
12121080
12131081 /* Check for DSYNC after subsubframe */
12141082 if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {
1215− if (0xFFFF == get_bits(&s->gb, 16)) { /* 0xFFFF */
1216−#ifdef TRACE
1217− av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\n");
1218−#endif
1219− } else {
1083+ if (get_bits(&s->gb, 16) != 0xFFFF) {
12201084 av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
12211085 return AVERROR_INVALIDDATA;
12221086 }
@@ -1382,18 +1246,12 @@ static int dca_decode_block(DCAContext *s, int base_channel, int block_index) · 159 unmodified lines
13821246 }
13831247
13841248 if (!s->current_subsubframe) {
1385−#ifdef TRACE
1386− av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n");
1387−#endif
13881249 /* Read subframe header */
13891250 if ((ret = dca_subframe_header(s, base_channel, block_index)))
13901251 return ret;
13911252 }
13921253
13931254 /* Read subsubframe */
1394−#ifdef TRACE
1395− av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subsubframe\n");
1396−#endif
13971255 if ((ret = dca_subsubframe(s, base_channel, block_index)))
13981256 return ret;
13991257
@@ -1404,9 +1262,6 @@ static int dca_decode_block(DCAContext *s, int base_channel, int block_index) · 4 unmodified lines
14041262 s->current_subframe++;
14051263 }
14061264 if (s->current_subframe >= s->subframes) {
1407−#ifdef TRACE
1408− av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_footer\n");
1409−#endif
14101265 /* Read subframe footer */
14111266 if ((ret = dca_subframe_footer(s, base_channel)))
14121267 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t