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

Function dca_subsubframe

libavcodec/dca.c:910–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 };
909
910static int dca_subsubframe(DCAContext * s)
911{
912 int k, l;
913 int subsubframe = s->current_subsubframe;
914
915 const float *quant_step_table;
916
917 /* FIXME */
918 LOCAL_ALIGNED_16(float, subband_samples, [DCA_PRIM_CHANNELS_MAX], [DCA_SUBBANDS][8]);
919 LOCAL_ALIGNED_16(int, block, [8]);
920
921 /*
922 * Audio data
923 */
924
925 /* Select quantization step size table */
926 if (s->bit_rate_index == 0x1f)
927 quant_step_table = lossless_quant_d;
928 else
929 quant_step_table = lossy_quant_d;
930
931 for (k = 0; k < s->prim_channels; k++) {
932 for (l = 0; l < s->vq_start_subband[k]; l++) {
933 int m;
934
935 /* Select the mid-tread linear quantizer */
936 int abits = s->bitalloc[k][l];
937
938 float quant_step_size = quant_step_table[abits];
939
940 /*
941 * Determine quantization index code book and its type
942 */
943
944 /* Select quantization index code book */
945 int sel = s->quant_index_huffman[k][abits];
946
947 /*
948 * Extract bits from the bit stream
949 */
950 if(!abits){
951 memset(subband_samples[k][l], 0, 8 * sizeof(subband_samples[0][0][0]));
952 } else {
953 /* Deal with transients */
954 int sfi = s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l];
955 float rscale = quant_step_size * s->scale_factor[k][l][sfi] * s->scalefactor_adj[k][sel];
956
957 if(abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){
958 if(abits <= 7){
959 /* Block code */
960 int block_code1, block_code2, size, levels;
961
962 size = abits_sizes[abits-1];
963 levels = abits_levels[abits-1];
964
965 block_code1 = get_bits(&s->gb, size);
966 /* FIXME Should test return value */
967 decode_blockcode(block_code1, levels, block);

Callers 1

dca_decode_blockFunction · 0.85

Calls 8

get_bitsFunction · 0.85
decode_blockcodeFunction · 0.85
get_sbitsFunction · 0.85
get_bitallocFunction · 0.85
av_logFunction · 0.85
qmf_32_subbandsFunction · 0.85
dca_downmixFunction · 0.85
lfe_interpolation_firFunction · 0.85

Tested by

no test coverage detected