Lines Matching refs:sbrEnvData
132 HANDLE_SBR_ENV_DATA sbrEnvData, HANDLE_FDK_BITSTREAM hBitStream,
140 static INT encodeSbrGrid(HANDLE_SBR_ENV_DATA sbrEnvData,
143 static int encodeLowDelaySbrGrid(HANDLE_SBR_ENV_DATA sbrEnvData,
148 static INT encodeSbrDtdf(HANDLE_SBR_ENV_DATA sbrEnvData,
151 static INT writeNoiseLevelData(HANDLE_SBR_ENV_DATA sbrEnvData,
154 static INT writeEnvelopeData(HANDLE_SBR_ENV_DATA sbrEnvData,
157 static INT writeSyntheticCodingData(HANDLE_SBR_ENV_DATA sbrEnvData,
177 HANDLE_SBR_BITSTREAM_DATA sbrBitstreamData, HANDLE_SBR_ENV_DATA sbrEnvData, in FDKsbrEnc_WriteEnvSingleChannelElement() argument
187 if (sbrEnvData != NULL) { in FDKsbrEnc_WriteEnvSingleChannelElement()
192 payloadBits += encodeSbrData(sbrEnvData, NULL, hParametricStereo, cmonData, in FDKsbrEnc_WriteEnvSingleChannelElement()
402 HANDLE_SBR_ENV_DATA sbrEnvData, HANDLE_FDK_BITSTREAM hBitStream, in encodeSbrSingleChannelElement() argument
409 if (sbrEnvData->ldGrid) { in encodeSbrSingleChannelElement()
410 if (sbrEnvData->hSbrBSGrid->frameClass != FIXFIXonly) { in encodeSbrSingleChannelElement()
412 payloadBits += encodeSbrGrid(sbrEnvData, hBitStream); in encodeSbrSingleChannelElement()
416 sbrEnvData, hBitStream, encodeFreqs(LD_TRANSMISSION), sbrSyntaxFlags); in encodeSbrSingleChannelElement()
422 payloadBits += encodeSbrGrid(sbrEnvData, hBitStream); in encodeSbrSingleChannelElement()
425 payloadBits += encodeSbrDtdf(sbrEnvData, hBitStream); in encodeSbrSingleChannelElement()
427 for (i = 0; i < sbrEnvData->noOfnoisebands; i++) { in encodeSbrSingleChannelElement()
428 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->sbr_invf_mode_vec[i], in encodeSbrSingleChannelElement()
432 payloadBits += writeEnvelopeData(sbrEnvData, hBitStream, 0); in encodeSbrSingleChannelElement()
433 payloadBits += writeNoiseLevelData(sbrEnvData, hBitStream, 0); in encodeSbrSingleChannelElement()
435 payloadBits += writeSyntheticCodingData(sbrEnvData, hBitStream); in encodeSbrSingleChannelElement()
574 static INT encodeSbrGrid(HANDLE_SBR_ENV_DATA sbrEnvData, in encodeSbrGrid() argument
578 INT bufferFrameStart = sbrEnvData->hSbrBSGrid->bufferFrameStart; in encodeSbrGrid()
579 INT numberTimeSlots = sbrEnvData->hSbrBSGrid->numberTimeSlots; in encodeSbrGrid()
581 if (sbrEnvData->ldGrid) in encodeSbrGrid()
582 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->frameClass, in encodeSbrGrid()
585 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->frameClass, in encodeSbrGrid()
588 switch (sbrEnvData->hSbrBSGrid->frameClass) { in encodeSbrGrid()
593 temp = ceil_ln2(sbrEnvData->hSbrBSGrid->bs_num_env); in encodeSbrGrid()
595 if ((sbrEnvData->ldGrid) && (sbrEnvData->hSbrBSGrid->bs_num_env == 1)) in encodeSbrGrid()
596 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->currentAmpResFF, in encodeSbrGrid()
598 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->v_f[0], in encodeSbrGrid()
605 if (sbrEnvData->hSbrBSGrid->frameClass == FIXVAR) in encodeSbrGrid()
606 temp = sbrEnvData->hSbrBSGrid->bs_abs_bord - in encodeSbrGrid()
609 temp = sbrEnvData->hSbrBSGrid->bs_abs_bord - bufferFrameStart; in encodeSbrGrid()
613 FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->n, SBR_NUM_BITS); in encodeSbrGrid()
615 for (i = 0; i < sbrEnvData->hSbrBSGrid->n; i++) { in encodeSbrGrid()
616 temp = (sbrEnvData->hSbrBSGrid->bs_rel_bord[i] - 2) >> 1; in encodeSbrGrid()
620 temp = ceil_ln2(sbrEnvData->hSbrBSGrid->n + 2); in encodeSbrGrid()
621 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->p, temp); in encodeSbrGrid()
623 for (i = 0; i < sbrEnvData->hSbrBSGrid->n + 1; i++) { in encodeSbrGrid()
624 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->v_f[i], in encodeSbrGrid()
630 temp = sbrEnvData->hSbrBSGrid->bs_abs_bord_0 - bufferFrameStart; in encodeSbrGrid()
632 temp = sbrEnvData->hSbrBSGrid->bs_abs_bord_1 - in encodeSbrGrid()
637 hBitStream, sbrEnvData->hSbrBSGrid->bs_num_rel_0, SBR_NUM_BITS); in encodeSbrGrid()
639 hBitStream, sbrEnvData->hSbrBSGrid->bs_num_rel_1, SBR_NUM_BITS); in encodeSbrGrid()
641 for (i = 0; i < sbrEnvData->hSbrBSGrid->bs_num_rel_0; i++) { in encodeSbrGrid()
642 temp = (sbrEnvData->hSbrBSGrid->bs_rel_bord_0[i] - 2) >> 1; in encodeSbrGrid()
646 for (i = 0; i < sbrEnvData->hSbrBSGrid->bs_num_rel_1; i++) { in encodeSbrGrid()
647 temp = (sbrEnvData->hSbrBSGrid->bs_rel_bord_1[i] - 2) >> 1; in encodeSbrGrid()
651 temp = ceil_ln2(sbrEnvData->hSbrBSGrid->bs_num_rel_0 + in encodeSbrGrid()
652 sbrEnvData->hSbrBSGrid->bs_num_rel_1 + 2); in encodeSbrGrid()
653 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->p, temp); in encodeSbrGrid()
655 temp = sbrEnvData->hSbrBSGrid->bs_num_rel_0 + in encodeSbrGrid()
656 sbrEnvData->hSbrBSGrid->bs_num_rel_1 + 1; in encodeSbrGrid()
660 hBitStream, sbrEnvData->hSbrBSGrid->v_fLR[i], SBR_RES_BITS); in encodeSbrGrid()
681 static int encodeLowDelaySbrGrid(HANDLE_SBR_ENV_DATA sbrEnvData, in encodeLowDelaySbrGrid() argument
699 if (sbrEnvData->hSbrBSGrid->numberTimeSlots == 8) in encodeLowDelaySbrGrid()
701 FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->bs_abs_bord, 3); in encodeLowDelaySbrGrid()
704 FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->bs_abs_bord, 4); in encodeLowDelaySbrGrid()
708 for (i = 0; i < sbrEnvData->hSbrBSGrid->bs_num_env; i++) { in encodeLowDelaySbrGrid()
709 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->hSbrBSGrid->v_f[i], in encodeLowDelaySbrGrid()
724 static INT encodeSbrDtdf(HANDLE_SBR_ENV_DATA sbrEnvData, in encodeSbrDtdf() argument
728 noOfNoiseEnvelopes = sbrEnvData->noOfEnvelopes > 1 ? 2 : 1; in encodeSbrDtdf()
730 for (i = 0; i < sbrEnvData->noOfEnvelopes; ++i) { in encodeSbrDtdf()
732 FDKwriteBits(hBitStream, sbrEnvData->domain_vec[i], SBR_DIR_BITS); in encodeSbrDtdf()
736 FDKwriteBits(hBitStream, sbrEnvData->domain_vec_noise[i], SBR_DIR_BITS); in encodeSbrDtdf()
751 static INT writeNoiseLevelData(HANDLE_SBR_ENV_DATA sbrEnvData, in writeNoiseLevelData() argument
754 INT nNoiseEnvelopes = sbrEnvData->noOfEnvelopes > 1 ? 2 : 1; in writeNoiseLevelData()
757 switch (sbrEnvData->domain_vec_noise[i]) { in writeNoiseLevelData()
759 if (coupling && sbrEnvData->balance) { in writeNoiseLevelData()
762 sbrEnvData->sbr_noise_levels[i * sbrEnvData->noOfnoisebands], in writeNoiseLevelData()
763 sbrEnvData->si_sbr_start_noise_bits_balance); in writeNoiseLevelData()
767 sbrEnvData->sbr_noise_levels[i * sbrEnvData->noOfnoisebands], in writeNoiseLevelData()
768 sbrEnvData->si_sbr_start_noise_bits); in writeNoiseLevelData()
771 for (j = 1 + i * sbrEnvData->noOfnoisebands; in writeNoiseLevelData()
772 j < (sbrEnvData->noOfnoisebands * (1 + i)); j++) { in writeNoiseLevelData()
774 if (sbrEnvData->balance) { in writeNoiseLevelData()
777 sbrEnvData->hufftableNoiseBalanceFreqC in writeNoiseLevelData()
778 [sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
780 sbrEnvData->hufftableNoiseBalanceFreqL in writeNoiseLevelData()
781 [sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
787 sbrEnvData->hufftableNoiseLevelFreqC in writeNoiseLevelData()
788 [sbrEnvData->sbr_noise_levels[j] + CODE_BOOK_SCF_LAV11], in writeNoiseLevelData()
789 sbrEnvData->hufftableNoiseLevelFreqL in writeNoiseLevelData()
790 [sbrEnvData->sbr_noise_levels[j] + CODE_BOOK_SCF_LAV11]); in writeNoiseLevelData()
796 sbrEnvData in writeNoiseLevelData()
797 ->hufftableNoiseFreqC[sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
799 sbrEnvData in writeNoiseLevelData()
800 ->hufftableNoiseFreqL[sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
807 for (j = i * sbrEnvData->noOfnoisebands; in writeNoiseLevelData()
808 j < (sbrEnvData->noOfnoisebands * (1 + i)); j++) { in writeNoiseLevelData()
810 if (sbrEnvData->balance) { in writeNoiseLevelData()
813 sbrEnvData->hufftableNoiseBalanceTimeC in writeNoiseLevelData()
814 [sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
816 sbrEnvData->hufftableNoiseBalanceTimeL in writeNoiseLevelData()
817 [sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
823 sbrEnvData->hufftableNoiseLevelTimeC in writeNoiseLevelData()
824 [sbrEnvData->sbr_noise_levels[j] + CODE_BOOK_SCF_LAV11], in writeNoiseLevelData()
825 sbrEnvData->hufftableNoiseLevelTimeL in writeNoiseLevelData()
826 [sbrEnvData->sbr_noise_levels[j] + CODE_BOOK_SCF_LAV11]); in writeNoiseLevelData()
832 sbrEnvData in writeNoiseLevelData()
833 ->hufftableNoiseLevelTimeC[sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
835 sbrEnvData in writeNoiseLevelData()
836 ->hufftableNoiseLevelTimeL[sbrEnvData->sbr_noise_levels[j] + in writeNoiseLevelData()
855 static INT writeEnvelopeData(HANDLE_SBR_ENV_DATA sbrEnvData, in writeEnvelopeData() argument
859 for (j = 0; j < sbrEnvData->noOfEnvelopes; in writeEnvelopeData()
861 if (sbrEnvData->domain_vec[j] == FREQ) { in writeEnvelopeData()
862 if (coupling && sbrEnvData->balance) { in writeEnvelopeData()
863 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->ienvelope[j][0], in writeEnvelopeData()
864 sbrEnvData->si_sbr_start_env_bits_balance); in writeEnvelopeData()
866 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->ienvelope[j][0], in writeEnvelopeData()
867 sbrEnvData->si_sbr_start_env_bits); in writeEnvelopeData()
871 for (i = 1 - sbrEnvData->domain_vec[j]; i < sbrEnvData->noScfBands[j]; in writeEnvelopeData()
873 delta = sbrEnvData->ienvelope[j][i]; in writeEnvelopeData()
874 if (coupling && sbrEnvData->balance) { in writeEnvelopeData()
875 FDK_ASSERT(fixp_abs(delta) <= sbrEnvData->codeBookScfLavBalance); in writeEnvelopeData()
877 FDK_ASSERT(fixp_abs(delta) <= sbrEnvData->codeBookScfLav); in writeEnvelopeData()
880 if (sbrEnvData->balance) { in writeEnvelopeData()
881 if (sbrEnvData->domain_vec[j]) { in writeEnvelopeData()
885 sbrEnvData in writeEnvelopeData()
887 sbrEnvData->codeBookScfLavBalance], in writeEnvelopeData()
888 sbrEnvData in writeEnvelopeData()
890 sbrEnvData->codeBookScfLavBalance]); in writeEnvelopeData()
895 sbrEnvData in writeEnvelopeData()
897 sbrEnvData->codeBookScfLavBalance], in writeEnvelopeData()
898 sbrEnvData in writeEnvelopeData()
900 sbrEnvData->codeBookScfLavBalance]); in writeEnvelopeData()
903 if (sbrEnvData->domain_vec[j]) { in writeEnvelopeData()
907 sbrEnvData in writeEnvelopeData()
908 ->hufftableLevelTimeC[delta + sbrEnvData->codeBookScfLav], in writeEnvelopeData()
909 sbrEnvData in writeEnvelopeData()
910 ->hufftableLevelTimeL[delta + sbrEnvData->codeBookScfLav]); in writeEnvelopeData()
915 sbrEnvData in writeEnvelopeData()
916 ->hufftableLevelFreqC[delta + sbrEnvData->codeBookScfLav], in writeEnvelopeData()
917 sbrEnvData in writeEnvelopeData()
918 ->hufftableLevelFreqL[delta + sbrEnvData->codeBookScfLav]); in writeEnvelopeData()
922 if (sbrEnvData->domain_vec[j]) { in writeEnvelopeData()
926 sbrEnvData->hufftableTimeC[delta + sbrEnvData->codeBookScfLav], in writeEnvelopeData()
927 sbrEnvData->hufftableTimeL[delta + sbrEnvData->codeBookScfLav]); in writeEnvelopeData()
932 sbrEnvData->hufftableFreqC[delta + sbrEnvData->codeBookScfLav], in writeEnvelopeData()
933 sbrEnvData->hufftableFreqL[delta + sbrEnvData->codeBookScfLav]); in writeEnvelopeData()
1004 static INT writeSyntheticCodingData(HANDLE_SBR_ENV_DATA sbrEnvData, in writeSyntheticCodingData() argument
1011 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->addHarmonicFlag, 1); in writeSyntheticCodingData()
1013 if (sbrEnvData->addHarmonicFlag) { in writeSyntheticCodingData()
1014 for (i = 0; i < sbrEnvData->noHarmonics; i++) { in writeSyntheticCodingData()
1015 payloadBits += FDKwriteBits(hBitStream, sbrEnvData->addHarmonic[i], 1); in writeSyntheticCodingData()