front-end/build/ffmpeg/libavcodec/dcadec.c
/* parse initial header for XXCH and dump details */
parse initial header for XXCH and dump details
parse initial header for XXCH and dump details
static int dca_xxch_decode_frame(DCAContext *s)
{
    int hdr_size, spkmsk_bits, num_chsets, core_spk, hdr_pos;
    int i, chset, base_channel, chstart, fsize[8];
    hdr_pos     = get_bits_count(&s->gb) - 32;
    hdr_size    = get_bits(&s->gb, 6) + 1;
   skip_bits1(&s->gb);
    spkmsk_bits = get_bits(&s->gb, 5) + 1;
    num_chsets  = get_bits(&s->gb, 2) + 1;
    for (i = 0; i < num_chsets; i++)
        fsize[i] = get_bits(&s->gb, 14) + 1;
    core_spk               = get_bits(&s->gb, spkmsk_bits);
    s->xxch_core_spkmask   = core_spk;
    s->xxch_nbits_spk_mask = spkmsk_bits;
    s->xxch_dmix_embedded  = 0;
    i = get_bits_count(&s->gb);
    if (hdr_pos + hdr_size * 8 > i)
        skip_bits_long(&s->gb, hdr_pos + hdr_size * 8 - i);
    for (chset = 0; chset < num_chsets; chset++) {
        chstart       = get_bits_count(&s->gb);
        base_channel  = s->prim_channels;
        s->xxch_chset = chset;
        dca_parse_audio_coding_header(s, base_channel, 1);
        for (i = 0; i < (s->sample_blocks / 8); i++) {
            if (dca_decode_block(s, base_channel, i)) {
                av_log(s->avctx, AV_LOG_ERROR,
                       "Error decoding DTS-XXCH extension\n");
                continue;
            }
        }
        i = get_bits_count(&s->gb);
        if (chstart + fsize[chset] * 8 > i)
            skip_bits_long(&s->gb, chstart + fsize[chset] * 8 - i);
    }
    s->xxch_chset = num_chsets;
    return 0;
}
static int dca_xxch_decode_frame ( DCAContext * s ) { int hdr_size , spkmsk_bits , num_chsets , core_spk , hdr_pos ; int i , chset , base_channel , chstart , fsize [ 8 ] ; hdr_pos = get_bits_count ( & s -> gb ) - 32 ; hdr_size = get_bits ( & s -> gb , 6 ) + 1 ; skip_bits1 ( & s -> gb ) ; spkmsk_bits = get_bits ( & s -> gb , 5 ) + 1 ; num_chsets = get_bits ( & s -> gb , 2 ) + 1 ; for ( i = 0 ; i < num_chsets ; i ++ ) fsize [ i ] = get_bits ( & s -> gb , 14 ) + 1 ; core_spk = get_bits ( & s -> gb , spkmsk_bits ) ; s -> xxch_core_spkmask = core_spk ; s -> xxch_nbits_spk_mask = spkmsk_bits ; s -> xxch_dmix_embedded = 0 ; i = get_bits_count ( & s -> gb ) ; if ( hdr_pos + hdr_size * 8 > i ) skip_bits_long ( & s -> gb , hdr_pos + hdr_size * 8 - i ) ; for ( chset = 0 ; chset < num_chsets ; chset ++ ) { chstart = get_bits_count ( & s -> gb ) ; base_channel = s -> prim_channels ; s -> xxch_chset = chset ; dca_parse_audio_coding_header ( s , base_channel , 1 ) ; for ( i = 0 ; i < ( s -> sample_blocks / 8 ) ; i ++ ) { if ( dca_decode_block ( s , base_channel , i ) ) { av_log ( s -> avctx , AV_LOG_ERROR , " \n " ) ; continue ; } } i = get_bits_count ( & s -> gb ) ; if ( chstart + fsize [ chset ] * 8 > i ) skip_bits_long ( & s -> gb , chstart + fsize [ chset ] * 8 - i ) ; } s -> xxch_chset = num_chsets ; return 0 ; }
parse initial header for XXCH and dump details
parse initial header for XXCH and dump details
/* assume header word has already been parsed */ /*chhdr_crc   =*/ /* skip to the end of the header */ /* XXCH and Core headers differ, see 6.4.2 "XXCH Channel Set Header" vs.
           5.3.2 "Primary Audio Coding Header", DTS Spec 1.3.1 */ /* decode channel data */ /* skip to end of this section */