*/
//#define DEBUG
//#define DEBUG_BITALLOC
+#include "libavutil/crc.h"
#include "avcodec.h"
#include "bitstream.h"
-#include "crc.h"
#include "ac3.h"
typedef struct AC3EncodeContext {
for(ch=0;ch<s->nb_all_channels;ch++) {
ff_ac3_bit_alloc_calc_bap(mask[i][ch], psd[i][ch], 0,
s->nb_coefs[ch], snr_offset,
- s->bit_alloc.floor, bap[i][ch]);
+ s->bit_alloc.floor, ff_ac3_bap_tab,
+ bap[i][ch]);
frame_bits += compute_mantissa_size(s, bap[i][ch],
s->nb_coefs[ch]);
}
return 0;
}
-static int AC3_encode_init(AVCodecContext *avctx)
+static av_cold int AC3_encode_init(AVCodecContext *avctx)
{
int freq = avctx->sample_rate;
int bitrate = avctx->bit_rate;
return output_frame_end(s);
}
-static int AC3_encode_close(AVCodecContext *avctx)
+static av_cold int AC3_encode_close(AVCodecContext *avctx)
{
av_freep(&avctx->coded_frame);
return 0;
AC3_encode_frame,
AC3_encode_close,
NULL,
+ .long_name = "ATSC A/52 / AC-3",
};