]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ilbcdec.c
avcodec/ljpegenc: Allow full range yuv420p, yuv422p, yuv444p by default
[ffmpeg] / libavcodec / ilbcdec.c
index 643547f4ab96984482db2fd517030386f946f1cc..33f4e2c1eb119488605289091c74d72d677e093c 100644 (file)
@@ -408,11 +408,11 @@ static void lsf2poly(int16_t *a, int16_t *lsf)
 
     a[0] = 4096;
     for (i = 5; i > 0; i--) {
-        tmp = f[0][6 - i] + (unsigned)f[1][6 - i];
-        a[6 - i] = (tmp + 4096) >> 13;
+        tmp = f[0][6 - i] + (unsigned)f[1][6 - i] + 4096;
+        a[6 - i] = tmp >> 13;
 
-        tmp = f[0][6 - i] - (unsigned)f[1][6 - i];
-        a[5 + i] = (tmp + 4096) >> 13;
+        tmp = f[0][6 - i] - (unsigned)f[1][6 - i] + 4096;
+        a[5 + i] = tmp >> 13;
     }
 }
 
@@ -724,7 +724,7 @@ static void construct_vector (
     int16_t cbvec0[SUBL];
     int16_t cbvec1[SUBL];
     int16_t cbvec2[SUBL];
-    int32_t a32;
+    unsigned a32;
     int16_t *gainPtr;
     int j;
 
@@ -745,9 +745,9 @@ static void construct_vector (
     for (j = 0; j < veclen; j++) {
         a32 = SPL_MUL_16_16(*gainPtr++, cbvec0[j]);
         a32 += SPL_MUL_16_16(*gainPtr++, cbvec1[j]);
-        a32 += (unsigned)SPL_MUL_16_16(*gainPtr, cbvec2[j]);
+        a32 += SPL_MUL_16_16(*gainPtr, cbvec2[j]);
         gainPtr -= 2;
-        decvector[j] = (a32 + 8192) >> 14;
+        decvector[j] = (int)(a32 + 8192) >> 14;
     }
 }
 
@@ -1484,6 +1484,6 @@ AVCodec ff_ilbc_decoder = {
     .id             = AV_CODEC_ID_ILBC,
     .init           = ilbc_decode_init,
     .decode         = ilbc_decode_frame,
-    .capabilities   = AV_CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
     .priv_data_size = sizeof(ILBCContext),
 };