]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dirac_vlc.c
avfilter/formats: Remove avfilter_make_format64_list()
[ffmpeg] / libavcodec / dirac_vlc.c
index fbe28017bcd9f66ef178b64d07b2cbbdbdff57df..c5a0371dae4a172dd649975515f136022e3547df 100644 (file)
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/mem_internal.h"
+
 #include "dirac_vlc.h"
 
 enum {
@@ -43,7 +45,7 @@ typedef struct LUTState {
     uint16_t  state;     /* Expected state for the next byte */
 } LUTState;
 
-const DECLARE_ALIGNED(32, LUTState, ff_dirac_golomb_lut)[1024] = {
+static const DECLARE_ALIGNED(32, LUTState, dirac_golomb_lut)[1024] = {
     { +16,  0,  0,  0,  0, 5, +1, 0,  0, STATE_FOLLOW },
     { +17,  0,  0,  0,  0, 5, +1, 0,  0, STATE_FOLLOW },
     {  +8,  0,  0,  0,  0, 4, +1, 1,  0,  STATE_START },
@@ -1087,15 +1089,15 @@ const DECLARE_ALIGNED(32, LUTState, ff_dirac_golomb_lut)[1024] = {
         dst += lut.num;                                \
         if (dst >= last)                               \
             return coeffs;                             \
-        lut = ff_dirac_golomb_lut[lut.state + *buf++]; \
+        lut = dirac_golomb_lut[lut.state + *buf++];    \
     } while (0)
 
 int ff_dirac_golomb_read_16bit(const uint8_t *buf, int bytes,
                                uint8_t *_dst, int coeffs)
 {
-    LUTState lut = ff_dirac_golomb_lut[*buf++];
+    LUTState lut = dirac_golomb_lut[*buf++];
     int16_t *dst = (int16_t *)_dst, *last = dst + coeffs;
-    int16_t val = 0;
+    uint16_t val = 0;
 
     for (int i = 1; i < bytes; i++)
         PROCESS_VALS;
@@ -1113,9 +1115,9 @@ int ff_dirac_golomb_read_16bit(const uint8_t *buf, int bytes,
 int ff_dirac_golomb_read_32bit(const uint8_t *buf, int bytes,
                                uint8_t *_dst, int coeffs)
 {
-    LUTState lut = ff_dirac_golomb_lut[*buf++];
+    LUTState lut = dirac_golomb_lut[*buf++];
     int32_t *dst = (int32_t *)_dst, *last = dst + coeffs;
-    int32_t val = 0;
+    uint32_t val = 0;
 
     for (int i = 1; i < bytes; i++)
         PROCESS_VALS;