]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/bitstream.c
Add a Makefile variable for the old scaler that gets enabled when the new
[ffmpeg] / libavcodec / bitstream.c
index 6323167838b31823d4563a7303a8dabcddc12865..57f139138eb4c3ffdbdeafd288de9b562d522c5e 100644 (file)
 #include "avcodec.h"
 #include "bitstream.h"
 
+const uint8_t ff_log2_run[32]={
+ 0, 0, 0, 0, 1, 1, 1, 1,
+ 2, 2, 2, 2, 3, 3, 3, 3,
+ 4, 4, 5, 5, 6, 6, 7, 7,
+ 8, 9,10,11,12,13,14,15
+};
+
 /**
  * Same as av_mallocz_static(), but does a realloc.
  *
 attribute_deprecated av_alloc_size(2)
 static void *ff_realloc_static(void *ptr, unsigned int size);
 
-static unsigned int last_static = 0;
-static unsigned int allocated_static = 0;
-static void** array_static = NULL;
-
-static void *av_mallocz_static(unsigned int size)
-{
-    void *ptr = av_mallocz(size);
-
-    if(ptr){
-        array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));
-        if(!array_static)
-            return NULL;
-        array_static[last_static++] = ptr;
-    }
-
-    return ptr;
-}
-
 static void *ff_realloc_static(void *ptr, unsigned int size)
 {
-    int i;
-    if(!ptr)
-      return av_mallocz_static(size);
-    /* Look for the old ptr */
-    for(i = 0; i < last_static; i++) {
-        if(array_static[i] == ptr) {
-            array_static[i] = av_realloc(array_static[i], size);
-            return array_static[i];
-        }
-    }
-    return NULL;
-
-}
-
-static void av_free_static(void)
-{
-    while(last_static){
-        av_freep(&array_static[--last_static]);
-    }
-    av_freep(&array_static);
+    return av_realloc(ptr, size);
 }
 
-
 void align_put_bits(PutBitContext *s)
 {
 #ifdef ALT_BITSTREAM_WRITER