Revision 3abe5fbd libavcodec/ac3enc.c

View differences:

libavcodec/ac3enc.c
1141 1141
    /* Now we must compute both crcs : this is not so easy for crc1
1142 1142
       because it is at the beginning of the data... */
1143 1143
    frame_size_58 = (frame_size >> 1) + (frame_size >> 3);
1144
    crc1 = bswap_16(av_crc(av_crc8005, 0, frame + 4, 2 * frame_size_58 - 4));
1144
    crc1 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
1145
                           frame + 4, 2 * frame_size_58 - 4));
1145 1146
    /* XXX: could precompute crc_inv */
1146 1147
    crc_inv = pow_poly((CRC16_POLY >> 1), (16 * frame_size_58) - 16, CRC16_POLY);
1147 1148
    crc1 = mul_poly(crc_inv, crc1, CRC16_POLY);
1148 1149
    AV_WB16(frame+2,crc1);
1149 1150

  
1150
    crc2 = bswap_16(av_crc(av_crc8005, 0, frame + 2 * frame_size_58, (frame_size - frame_size_58) * 2 - 2));
1151
    crc2 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
1152
                           frame + 2 * frame_size_58,
1153
                           (frame_size - frame_size_58) * 2 - 2));
1151 1154
    AV_WB16(frame+2*frame_size-2,crc2);
1152 1155

  
1153 1156
    //    printf("n=%d frame_size=%d\n", n, frame_size);

Also available in: Unified diff