Changeset 6c44dd6c in ffmpeg


Ignore:
Timestamp:
Feb 14, 2015, 9:32:23 PM (10 years ago)
Author:
Michael Niedermayer <michaelni@gmx.at>
Branches:
master
Children:
d2223ec2
Parents:
877c038a (diff), 8a213179 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Michael Niedermayer <michaelni@gmx.at> (02/14/15 21:31:53)
git-committer:
Michael Niedermayer <michaelni@gmx.at> (02/14/15 21:32:23)
Message:

Merge commit '8a213179aff0174d81b3e889134a3b4f7d21f5c3'

Merged-by: Michael Niedermayer <michaelni@gmx.at>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libavcodec/dcadec.c

    r877c038a r6c44dd6c  
    5252#   include "arm/dca.h"
    5353#endif
    54 
    55 //#define TRACE
    5654
    5755enum DCAMode {
     
    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}
     
    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;
     
    840774            s->lfe_data[j] *= lfe_scale;
    841775    }
    842 
    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
    908776
    909777    return 0;
     
    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;
     
    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)))
     
    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;
     
    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)))
Note: See TracChangeset for help on using the changeset viewer.