MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / alloc_table

Function alloc_table

libavcodec/bitstream.c:103–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102
103static 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
120static av_always_inline uint32_t bitswap_32(uint32_t x) {
121 return av_reverse[x&0xFF]<<24

Callers 1

build_tableFunction · 0.85

Calls 1

av_reallocFunction · 0.85

Tested by

no test coverage detected