]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ac3dec_fixed.c
avformat/dump: Remove remnants of codec timebase
[ffmpeg] / libavcodec / ac3dec_fixed.c
index bd66175d50f93a1893cf60309f5e0b64e1a766d1..f6c2810ce552a955bc1f589c8e359c3f7b167a8f 100644 (file)
@@ -107,30 +107,17 @@ static void scale_coefs (
       }
     } else {
       shift = -shift;
+      mul <<= shift;
       for (i=0; i<len; i+=8) {
 
-          temp = src[i] * mul;
-          temp1 = src[i+1] * mul;
-          temp2 = src[i+2] * mul;
-
-          dst[i] = temp << shift;
-          temp3 = src[i+3] * mul;
-
-          dst[i+1] = temp1 << shift;
-          temp4 = src[i + 4] * mul;
-          dst[i+2] = temp2 << shift;
-
-          temp5 = src[i+5] * mul;
-          dst[i+3] = temp3 << shift;
-          temp6 = src[i+6] * mul;
-
-          dst[i+4] = temp4 << shift;
-          temp7 = src[i+7] * mul;
-
-          dst[i+5] = temp5 << shift;
-          dst[i+6] = temp6 << shift;
-          dst[i+7] = temp7 << shift;
-
+          dst[i]   = src[i  ] * mul;
+          dst[i+1] = src[i+1] * mul;
+          dst[i+2] = src[i+2] * mul;
+          dst[i+3] = src[i+3] * mul;
+          dst[i+4] = src[i+4] * mul;
+          dst[i+5] = src[i+5] * mul;
+          dst[i+6] = src[i+6] * mul;
+          dst[i+7] = src[i+7] * mul;
       }
     }
 }
@@ -181,7 +168,7 @@ static const AVClass ac3_decoder_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-AVCodec ff_ac3_fixed_decoder = {
+const AVCodec ff_ac3_fixed_decoder = {
     .name           = "ac3_fixed",
     .type           = AVMEDIA_TYPE_AUDIO,
     .id             = AV_CODEC_ID_AC3,
@@ -189,9 +176,11 @@ AVCodec ff_ac3_fixed_decoder = {
     .init           = ac3_decode_init,
     .close          = ac3_decode_end,
     .decode         = ac3_decode_frame,
-    .capabilities   = AV_CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_CHANNEL_CONF |
+                      AV_CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
                                                       AV_SAMPLE_FMT_NONE },
     .priv_class     = &ac3_decoder_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };