]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ac3enc.c
Rename rotate_buffer() to copy_and_dup() and doxy it
[ffmpeg] / libavcodec / ac3enc.c
index af70c12ed87ea0eaaf08ab3a3a511bba48700038..b4410b3cd1f22705a4e1b8e223ba9c4c0801bfd8 100644 (file)
@@ -25,9 +25,9 @@
  */
 //#define DEBUG
 //#define DEBUG_BITALLOC
+#include "libavutil/crc.h"
 #include "avcodec.h"
 #include "bitstream.h"
-#include "crc.h"
 #include "ac3.h"
 
 typedef struct AC3EncodeContext {
@@ -90,7 +90,7 @@ typedef struct IComplex {
 
 static void fft_init(int ln)
 {
-    int i, j, m, n;
+    int i, n;
     float alpha;
 
     n = 1 << ln;
@@ -463,7 +463,8 @@ static int bit_alloc(AC3EncodeContext *s,
         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]);
         }
@@ -608,7 +609,7 @@ static int compute_bit_allocation(AC3EncodeContext *s,
     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;
@@ -676,7 +677,7 @@ static int AC3_encode_init(AVCodecContext *avctx)
     } else {
         /* use default bandwidth setting */
         /* XXX: should compute the bandwidth according to the frame
-           size, so that we avoid anoying high freq artefacts */
+           size, so that we avoid annoying high frequency artifacts */
         bw_code = 50;
     }
     for(ch=0;ch<s->nb_channels;ch++) {
@@ -1255,7 +1256,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
     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;
@@ -1363,4 +1364,5 @@ AVCodec ac3_encoder = {
     AC3_encode_frame,
     AC3_encode_close,
     NULL,
+    .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
 };