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

Function ff_tak_decode_frame_header

libavcodec/tak.c:147–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb,
148 TAKStreamInfo *ti, int log_level_offset)
149{
150 if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) {
151 av_log(logctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n");
152 return AVERROR_INVALIDDATA;
153 }
154
155 ti->flags = get_bits(gb, TAK_FRAME_HEADER_FLAGS_BITS);
156 ti->frame_num = get_bits(gb, TAK_FRAME_HEADER_NO_BITS);
157
158 if (ti->flags & TAK_FRAME_FLAG_IS_LAST) {
159 ti->last_frame_samples = get_bits(gb, TAK_FRAME_HEADER_SAMPLE_COUNT_BITS) + 1;
160 skip_bits(gb, 2);
161 } else {
162 ti->last_frame_samples = 0;
163 }
164
165 if (ti->flags & TAK_FRAME_FLAG_HAS_INFO) {
166 int ret = tak_parse_streaminfo(ti, gb);
167 if (ret < 0)
168 return ret;
169
170 if (get_bits(gb, 6))
171 skip_bits(gb, 25);
172 align_get_bits(gb);
173 }
174
175 if (ti->flags & TAK_FRAME_FLAG_HAS_METADATA)
176 return AVERROR_INVALIDDATA;
177
178 if (get_bits_left(gb) < 24)
179 return AVERROR_INVALIDDATA;
180
181 skip_bits(gb, 24);
182
183 return 0;
184}

Callers 2

tak_decode_frameFunction · 0.85
tak_parseFunction · 0.85

Calls 6

av_logFunction · 0.85
skip_bitsFunction · 0.85
tak_parse_streaminfoFunction · 0.85
align_get_bitsFunction · 0.85
get_bits_leftFunction · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected