]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ac3enc.c
Bump version and update APIchanges after r25210.
[ffmpeg] / libavcodec / ac3enc.c
index 9b3e00e6e428098cf46eb2ec6ae7f27e935dd9d3..ea8ba8b496a378a768607a0b41c60f25456a737c 100644 (file)
  */
 
 /**
- * @file libavcodec/ac3enc.c
+ * @file
  * The simplest AC-3 encoder.
  */
 //#define DEBUG
 //#define DEBUG_BITALLOC
 #include "libavutil/crc.h"
 #include "avcodec.h"
-#include "get_bits.h" // for ff_reverse
+#include "libavutil/common.h" /* for av_reverse */
 #include "put_bits.h"
 #include "ac3.h"
 #include "audioconvert.h"
@@ -138,7 +138,7 @@ static void fft(IComplex *z, int ln)
 
     /* reverse */
     for(j=0;j<np;j++) {
-        int k = ff_reverse[j] >> (8 - ln);
+        int k = av_reverse[j] >> (8 - ln);
         if (k < j)
             FFSWAP(IComplex, z[k], z[j]);
     }
@@ -1161,14 +1161,14 @@ static int output_frame_end(AC3EncodeContext *s)
     /* Now we must compute both crcs : this is not so easy for crc1
        because it is at the beginning of the data... */
     frame_size_58 = (frame_size >> 1) + (frame_size >> 3);
-    crc1 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
+    crc1 = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
                            frame + 4, 2 * frame_size_58 - 4));
     /* XXX: could precompute crc_inv */
     crc_inv = pow_poly((CRC16_POLY >> 1), (16 * frame_size_58) - 16, CRC16_POLY);
     crc1 = mul_poly(crc_inv, crc1, CRC16_POLY);
     AV_WB16(frame+2,crc1);
 
-    crc2 = bswap_16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
+    crc2 = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0,
                            frame + 2 * frame_size_58,
                            (frame_size - frame_size_58) * 2 - 2));
     AV_WB16(frame+2*frame_size-2,crc2);
@@ -1181,7 +1181,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
                             unsigned char *frame, int buf_size, void *data)
 {
     AC3EncodeContext *s = avctx->priv_data;
-    int16_t *samples = data;
+    const int16_t *samples = data;
     int i, j, k, v, ch;
     int16_t input_samples[N];
     int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
@@ -1197,7 +1197,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
         int ich = s->channel_map[ch];
         /* fixed mdct to the six sub blocks & exponent computation */
         for(i=0;i<NB_BLOCKS;i++) {
-            int16_t *sptr;
+            const int16_t *sptr;
             int sinc;
 
             /* compute input samples */
@@ -1393,7 +1393,7 @@ void test_ac3(void)
 
 AVCodec ac3_encoder = {
     "ac3",
-    CODEC_TYPE_AUDIO,
+    AVMEDIA_TYPE_AUDIO,
     CODEC_ID_AC3,
     sizeof(AC3EncodeContext),
     AC3_encode_init,