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

Function decodeGainControl

libavcodec/atrac3.c:428–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426 */
427
428static int decodeGainControl (GetBitContext *gb, gain_block *pGb, int numBands)
429{
430 int i, cf, numData;
431 int *pLevel, *pLoc;
432
433 gain_info *pGain = pGb->gBlock;
434
435 for (i=0 ; i<=numBands; i++)
436 {
437 numData = get_bits(gb,3);
438 pGain[i].num_gain_data = numData;
439 pLevel = pGain[i].levcode;
440 pLoc = pGain[i].loccode;
441
442 for (cf = 0; cf < numData; cf++){
443 pLevel[cf]= get_bits(gb,4);
444 pLoc [cf]= get_bits(gb,5);
445 if(cf && pLoc[cf] <= pLoc[cf-1])
446 return -1;
447 }
448 }
449
450 /* Clear the unused blocks. */
451 for (; i<4 ; i++)
452 pGain[i].num_gain_data = 0;
453
454 return 0;
455}
456
457/**
458 * Apply gain parameters and perform the MDCT overlapping part

Callers 1

decodeChannelSoundUnitFunction · 0.85

Calls 1

get_bitsFunction · 0.85

Tested by

no test coverage detected