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

Function ff_dca_core_dequantize

libavcodec/dca_core.h:226–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static inline void ff_dca_core_dequantize(int32_t *output, const int32_t *input,
227 int32_t step_size, int32_t scale, int residual, int len)
228{
229 // Account for quantizer step size
230 int64_t step_scale = (int64_t)step_size * scale;
231 int n, shift = 0;
232
233 // Limit scale factor resolution to 22 bits
234 if (step_scale > (1 << 23)) {
235 shift = av_log2(step_scale >> 23) + 1;
236 step_scale >>= shift;
237 }
238
239 // Scale the samples
240 if (residual) {
241 for (n = 0; n < len; n++)
242 output[n] += clip23(norm__(input[n] * step_scale, 22 - shift));
243 } else {
244 for (n = 0; n < len; n++)
245 output[n] = clip23(norm__(input[n] * step_scale, 22 - shift));
246 }
247}
248
249int ff_dca_core_parse(DCACoreDecoder *s, const uint8_t *data, int size);
250int ff_dca_core_parse_exss(DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset);

Callers 5

ff_dcaadpcm_do_realFunction · 0.85
fill_in_adpcm_buferFunction · 0.85
parse_subframe_audioFunction · 0.85
parse_xbr_subframeFunction · 0.85
parse_x96_subframe_audioFunction · 0.85

Calls 3

av_log2Function · 0.85
clip23Function · 0.85
norm__Function · 0.85

Tested by

no test coverage detected