| 101 | |
| 102 | |
| 103 | static int alloc_table(VLC *vlc, int size, int use_static) |
| 104 | { |
| 105 | int index; |
| 106 | index = vlc->table_size; |
| 107 | vlc->table_size += size; |
| 108 | if (vlc->table_size > vlc->table_allocated) { |
| 109 | if(use_static) |
| 110 | abort(); //cant do anything, init_vlc() is used with too little memory |
| 111 | vlc->table_allocated += (1 << vlc->bits); |
| 112 | vlc->table = av_realloc(vlc->table, |
| 113 | sizeof(VLC_TYPE) * 2 * vlc->table_allocated); |
| 114 | if (!vlc->table) |
| 115 | return -1; |
| 116 | } |
| 117 | return index; |
| 118 | } |
| 119 | |
| 120 | static av_always_inline uint32_t bitswap_32(uint32_t x) { |
| 121 | return av_reverse[x&0xFF]<<24 |
no test coverage detected