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

Function read_map

libavcodec/dstdec.c:109–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static int read_map(GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels)
110{
111 int ch;
112 t->elements = 1;
113 map[0] = 0;
114 if (!get_bits1(gb)) {
115 for (ch = 1; ch < channels; ch++) {
116 int bits = av_log2(t->elements) + 1;
117 map[ch] = get_bits(gb, bits);
118 if (map[ch] == t->elements) {
119 t->elements++;
120 if (t->elements >= DST_MAX_ELEMENTS)
121 return AVERROR_INVALIDDATA;
122 } else if (map[ch] > t->elements) {
123 return AVERROR_INVALIDDATA;
124 }
125 }
126 } else {
127 memset(map, 0, sizeof(*map) * DST_MAX_CHANNELS);
128 }
129 return 0;
130}
131
132static av_always_inline int get_sr_golomb_dst(GetBitContext *gb, unsigned int k)
133{

Callers 1

decode_frameFunction · 0.85

Calls 3

get_bits1Function · 0.85
av_log2Function · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected