comparison dca.c @ 11909:3bfcb8fd3dc9 libavcodec

Support DTS-ES extension (XCh) in dca: move original code around to allow reused by DTS-ES code Patch by Nick Brereton, nick at nbrereton dot net
author mstorsjo
date Tue, 22 Jun 2010 08:33:00 +0000
parents 9b1095b2616a
children 284f85e281fc
comparison
equal deleted inserted replaced
11908:9b1095b2616a 11909:3bfcb8fd3dc9
221 int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]; ///< stereo downmix coefficients 221 int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]; ///< stereo downmix coefficients
222 int dynrange_coef; ///< dynamic range coefficient 222 int dynrange_coef; ///< dynamic range coefficient
223 223
224 int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded high frequency subbands 224 int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< VQ encoded high frequency subbands
225 225
226 float lfe_data[2 * DCA_SUBSUBFRAMES_MAX * DCA_LFE_MAX * 226 float lfe_data[2 * DCA_LFE_MAX * (DCA_BLOCKS_MAX + 4)]; ///< Low frequency effect data
227 2 /*history */ ]; ///< Low frequency effect data
228 int lfe_scale_factor; 227 int lfe_scale_factor;
229 228
230 /* Subband samples history (for ADPCM) */ 229 /* Subband samples history (for ADPCM) */
231 float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4]; 230 float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
232 DECLARE_ALIGNED(16, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512]; 231 DECLARE_ALIGNED(16, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512];
324 { 323 {
325 while(len--) 324 while(len--)
326 *dst++ = get_bits(gb, bits); 325 *dst++ = get_bits(gb, bits);
327 } 326 }
328 327
329 static int dca_parse_frame_header(DCAContext * s) 328 static int dca_parse_audio_coding_header(DCAContext * s)
330 { 329 {
331 int i, j; 330 int i, j;
332 static const float adj_table[4] = { 1.0, 1.1250, 1.2500, 1.4375 }; 331 static const float adj_table[4] = { 1.0, 1.1250, 1.2500, 1.4375 };
333 static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 }; 332 static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };
334 static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 }; 333 static const int thr[11] = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };
335 334
335 s->total_channels = get_bits(&s->gb, 3) + 1;
336 s->prim_channels = s->total_channels;
337 if (s->prim_channels > DCA_PRIM_CHANNELS_MAX)
338 s->prim_channels = DCA_PRIM_CHANNELS_MAX; /* We only support DTS core */
339
340
341 for (i = 0; i < s->prim_channels; i++) {
342 s->subband_activity[i] = get_bits(&s->gb, 5) + 2;
343 if (s->subband_activity[i] > DCA_SUBBANDS)
344 s->subband_activity[i] = DCA_SUBBANDS;
345 }
346 for (i = 0; i < s->prim_channels; i++) {
347 s->vq_start_subband[i] = get_bits(&s->gb, 5) + 1;
348 if (s->vq_start_subband[i] > DCA_SUBBANDS)
349 s->vq_start_subband[i] = DCA_SUBBANDS;
350 }
351 get_array(&s->gb, s->joint_intensity, s->prim_channels, 3);
352 get_array(&s->gb, s->transient_huffman, s->prim_channels, 2);
353 get_array(&s->gb, s->scalefactor_huffman, s->prim_channels, 3);
354 get_array(&s->gb, s->bitalloc_huffman, s->prim_channels, 3);
355
356 /* Get codebooks quantization indexes */
357 memset(s->quant_index_huffman, 0, sizeof(s->quant_index_huffman));
358 for (j = 1; j < 11; j++)
359 for (i = 0; i < s->prim_channels; i++)
360 s->quant_index_huffman[i][j] = get_bits(&s->gb, bitlen[j]);
361
362 /* Get scale factor adjustment */
363 for (j = 0; j < 11; j++)
364 for (i = 0; i < s->prim_channels; i++)
365 s->scalefactor_adj[i][j] = 1;
366
367 for (j = 1; j < 11; j++)
368 for (i = 0; i < s->prim_channels; i++)
369 if (s->quant_index_huffman[i][j] < thr[j])
370 s->scalefactor_adj[i][j] = adj_table[get_bits(&s->gb, 2)];
371
372 if (s->crc_present) {
373 /* Audio header CRC check */
374 get_bits(&s->gb, 16);
375 }
376
377 s->current_subframe = 0;
378 s->current_subsubframe = 0;
379
380 #ifdef TRACE
381 av_log(s->avctx, AV_LOG_DEBUG, "subframes: %i\n", s->subframes);
382 av_log(s->avctx, AV_LOG_DEBUG, "prim channels: %i\n", s->prim_channels);
383 for (i = 0; i < s->prim_channels; i++){
384 av_log(s->avctx, AV_LOG_DEBUG, "subband activity: %i\n", s->subband_activity[i]);
385 av_log(s->avctx, AV_LOG_DEBUG, "vq start subband: %i\n", s->vq_start_subband[i]);
386 av_log(s->avctx, AV_LOG_DEBUG, "joint intensity: %i\n", s->joint_intensity[i]);
387 av_log(s->avctx, AV_LOG_DEBUG, "transient mode codebook: %i\n", s->transient_huffman[i]);
388 av_log(s->avctx, AV_LOG_DEBUG, "scale factor codebook: %i\n", s->scalefactor_huffman[i]);
389 av_log(s->avctx, AV_LOG_DEBUG, "bit allocation quantizer: %i\n", s->bitalloc_huffman[i]);
390 av_log(s->avctx, AV_LOG_DEBUG, "quant index huff:");
391 for (j = 0; j < 11; j++)
392 av_log(s->avctx, AV_LOG_DEBUG, " %i",
393 s->quant_index_huffman[i][j]);
394 av_log(s->avctx, AV_LOG_DEBUG, "\n");
395 av_log(s->avctx, AV_LOG_DEBUG, "scalefac adj:");
396 for (j = 0; j < 11; j++)
397 av_log(s->avctx, AV_LOG_DEBUG, " %1.3f", s->scalefactor_adj[i][j]);
398 av_log(s->avctx, AV_LOG_DEBUG, "\n");
399 }
400 #endif
401
402 return 0;
403 }
404
405 static int dca_parse_frame_header(DCAContext * s)
406 {
336 init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8); 407 init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
337 408
338 /* Sync code */ 409 /* Sync code */
339 get_bits(&s->gb, 32); 410 get_bits(&s->gb, 32);
340 411
420 av_log(s->avctx, AV_LOG_DEBUG, "\n"); 491 av_log(s->avctx, AV_LOG_DEBUG, "\n");
421 #endif 492 #endif
422 493
423 /* Primary audio coding header */ 494 /* Primary audio coding header */
424 s->subframes = get_bits(&s->gb, 4) + 1; 495 s->subframes = get_bits(&s->gb, 4) + 1;
425 s->total_channels = get_bits(&s->gb, 3) + 1; 496
426 s->prim_channels = s->total_channels; 497 return dca_parse_audio_coding_header(s);
427 if (s->prim_channels > DCA_PRIM_CHANNELS_MAX)
428 s->prim_channels = DCA_PRIM_CHANNELS_MAX; /* We only support DTS core */
429
430
431 for (i = 0; i < s->prim_channels; i++) {
432 s->subband_activity[i] = get_bits(&s->gb, 5) + 2;
433 if (s->subband_activity[i] > DCA_SUBBANDS)
434 s->subband_activity[i] = DCA_SUBBANDS;
435 }
436 for (i = 0; i < s->prim_channels; i++) {
437 s->vq_start_subband[i] = get_bits(&s->gb, 5) + 1;
438 if (s->vq_start_subband[i] > DCA_SUBBANDS)
439 s->vq_start_subband[i] = DCA_SUBBANDS;
440 }
441 get_array(&s->gb, s->joint_intensity, s->prim_channels, 3);
442 get_array(&s->gb, s->transient_huffman, s->prim_channels, 2);
443 get_array(&s->gb, s->scalefactor_huffman, s->prim_channels, 3);
444 get_array(&s->gb, s->bitalloc_huffman, s->prim_channels, 3);
445
446 /* Get codebooks quantization indexes */
447 memset(s->quant_index_huffman, 0, sizeof(s->quant_index_huffman));
448 for (j = 1; j < 11; j++)
449 for (i = 0; i < s->prim_channels; i++)
450 s->quant_index_huffman[i][j] = get_bits(&s->gb, bitlen[j]);
451
452 /* Get scale factor adjustment */
453 for (j = 0; j < 11; j++)
454 for (i = 0; i < s->prim_channels; i++)
455 s->scalefactor_adj[i][j] = 1;
456
457 for (j = 1; j < 11; j++)
458 for (i = 0; i < s->prim_channels; i++)
459 if (s->quant_index_huffman[i][j] < thr[j])
460 s->scalefactor_adj[i][j] = adj_table[get_bits(&s->gb, 2)];
461
462 if (s->crc_present) {
463 /* Audio header CRC check */
464 get_bits(&s->gb, 16);
465 }
466
467 s->current_subframe = 0;
468 s->current_subsubframe = 0;
469
470 #ifdef TRACE
471 av_log(s->avctx, AV_LOG_DEBUG, "subframes: %i\n", s->subframes);
472 av_log(s->avctx, AV_LOG_DEBUG, "prim channels: %i\n", s->prim_channels);
473 for(i = 0; i < s->prim_channels; i++){
474 av_log(s->avctx, AV_LOG_DEBUG, "subband activity: %i\n", s->subband_activity[i]);
475 av_log(s->avctx, AV_LOG_DEBUG, "vq start subband: %i\n", s->vq_start_subband[i]);
476 av_log(s->avctx, AV_LOG_DEBUG, "joint intensity: %i\n", s->joint_intensity[i]);
477 av_log(s->avctx, AV_LOG_DEBUG, "transient mode codebook: %i\n", s->transient_huffman[i]);
478 av_log(s->avctx, AV_LOG_DEBUG, "scale factor codebook: %i\n", s->scalefactor_huffman[i]);
479 av_log(s->avctx, AV_LOG_DEBUG, "bit allocation quantizer: %i\n", s->bitalloc_huffman[i]);
480 av_log(s->avctx, AV_LOG_DEBUG, "quant index huff:");
481 for (j = 0; j < 11; j++)
482 av_log(s->avctx, AV_LOG_DEBUG, " %i",
483 s->quant_index_huffman[i][j]);
484 av_log(s->avctx, AV_LOG_DEBUG, "\n");
485 av_log(s->avctx, AV_LOG_DEBUG, "scalefac adj:");
486 for (j = 0; j < 11; j++)
487 av_log(s->avctx, AV_LOG_DEBUG, " %1.3f", s->scalefactor_adj[i][j]);
488 av_log(s->avctx, AV_LOG_DEBUG, "\n");
489 }
490 #endif
491
492 return 0;
493 } 498 }
494 499
495 500
496 static inline int get_scale(GetBitContext *gb, int level, int value) 501 static inline int get_scale(GetBitContext *gb, int level, int value)
497 { 502 {
501 } else if(level < 8) 506 } else if(level < 8)
502 value = get_bits(gb, level + 1); 507 value = get_bits(gb, level + 1);
503 return value; 508 return value;
504 } 509 }
505 510
506 static int dca_subframe_header(DCAContext * s) 511 static int dca_subframe_header(DCAContext * s, int block_index)
507 { 512 {
508 /* Primary audio coding side information */ 513 /* Primary audio coding side information */
509 int j, k; 514 int j, k;
510 515
511 s->subsubframes = get_bits(&s->gb, 2) + 1; 516 s->subsubframes = get_bits(&s->gb, 2) + 1;
658 s->high_freq_vq[j][k] = get_bits(&s->gb, 10); 663 s->high_freq_vq[j][k] = get_bits(&s->gb, 10);
659 664
660 /* Low frequency effect data */ 665 /* Low frequency effect data */
661 if (s->lfe) { 666 if (s->lfe) {
662 /* LFE samples */ 667 /* LFE samples */
663 int lfe_samples = 2 * s->lfe * s->subsubframes; 668 int lfe_samples = 2 * s->lfe * (4 + block_index);
669 int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes);
664 float lfe_scale; 670 float lfe_scale;
665 671
666 for (j = lfe_samples; j < lfe_samples * 2; j++) { 672 for (j = lfe_samples; j < lfe_end_sample; j++) {
667 /* Signed 8 bits int */ 673 /* Signed 8 bits int */
668 s->lfe_data[j] = get_sbits(&s->gb, 8); 674 s->lfe_data[j] = get_sbits(&s->gb, 8);
669 } 675 }
670 676
671 /* Scale factor index */ 677 /* Scale factor index */
672 s->lfe_scale_factor = scale_factor_quant7[get_bits(&s->gb, 8)]; 678 s->lfe_scale_factor = scale_factor_quant7[get_bits(&s->gb, 8)];
673 679
674 /* Quantization step size * scale factor */ 680 /* Quantization step size * scale factor */
675 lfe_scale = 0.035 * s->lfe_scale_factor; 681 lfe_scale = 0.035 * s->lfe_scale_factor;
676 682
677 for (j = lfe_samples; j < lfe_samples * 2; j++) 683 for (j = lfe_samples; j < lfe_end_sample; j++)
678 s->lfe_data[j] *= lfe_scale; 684 s->lfe_data[j] *= lfe_scale;
679 } 685 }
680 686
681 #ifdef TRACE 687 #ifdef TRACE
682 av_log(s->avctx, AV_LOG_DEBUG, "subsubframes: %i\n", s->subsubframes); 688 av_log(s->avctx, AV_LOG_DEBUG, "subsubframes: %i\n", s->subsubframes);
738 } 744 }
739 for (j = 0; j < s->prim_channels; j++) 745 for (j = 0; j < s->prim_channels; j++)
740 for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++) 746 for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
741 av_log(s->avctx, AV_LOG_DEBUG, "VQ index: %i\n", s->high_freq_vq[j][k]); 747 av_log(s->avctx, AV_LOG_DEBUG, "VQ index: %i\n", s->high_freq_vq[j][k]);
742 if(s->lfe){ 748 if(s->lfe){
743 int lfe_samples = 2 * s->lfe * s->subsubframes; 749 int lfe_samples = 2 * s->lfe * (4 + block_index);
750 int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
751
744 av_log(s->avctx, AV_LOG_DEBUG, "LFE samples:\n"); 752 av_log(s->avctx, AV_LOG_DEBUG, "LFE samples:\n");
745 for (j = lfe_samples; j < lfe_samples * 2; j++) 753 for (j = lfe_samples; j < lfe_end_sample; j++)
746 av_log(s->avctx, AV_LOG_DEBUG, " %f", s->lfe_data[j]); 754 av_log(s->avctx, AV_LOG_DEBUG, " %f", s->lfe_data[j]);
747 av_log(s->avctx, AV_LOG_DEBUG, "\n"); 755 av_log(s->avctx, AV_LOG_DEBUG, "\n");
748 } 756 }
749 #endif 757 #endif
750 758
1041 for (k = 0; k < s->prim_channels; k++) 1049 for (k = 0; k < s->prim_channels; k++)
1042 for (l = 0; l < s->vq_start_subband[k]; l++) 1050 for (l = 0; l < s->vq_start_subband[k]; l++)
1043 memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4], 1051 memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4],
1044 4 * sizeof(subband_samples[0][0][0])); 1052 4 * sizeof(subband_samples[0][0][0]));
1045 1053
1054 return 0;
1055 }
1056
1057 static int dca_filter_channels(DCAContext * s, int block_index)
1058 {
1059 float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
1060 int k;
1061
1046 /* 32 subbands QMF */ 1062 /* 32 subbands QMF */
1047 for (k = 0; k < s->prim_channels; k++) { 1063 for (k = 0; k < s->prim_channels; k++) {
1048 /* static float pcm_to_double[8] = 1064 /* static float pcm_to_double[8] =
1049 {32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/ 1065 {32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/
1050 qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * s->channel_order_tab[k]], 1066 qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * s->channel_order_tab[k]],
1051 M_SQRT1_2*s->scale_bias /*pcm_to_double[s->source_pcm_res] */ , 1067 M_SQRT1_2*s->scale_bias /*pcm_to_double[s->source_pcm_res] */ ,
1052 s->add_bias ); 1068 s->add_bias );
1053 } 1069 }
1054 1070
1055 /* Down mixing */ 1071 /* Down mixing */
1056 1072 if (s->avctx->request_channels == 2 && s->prim_channels > 2) {
1057 if (s->prim_channels > dca_channels[s->output & DCA_CHANNEL_MASK]) {
1058 dca_downmix(s->samples, s->amode, s->downmix_coef); 1073 dca_downmix(s->samples, s->amode, s->downmix_coef);
1059 } 1074 }
1060 1075
1061 /* Generate LFE samples for this subsubframe FIXME!!! */ 1076 /* Generate LFE samples for this subsubframe FIXME!!! */
1062 if (s->output & DCA_LFE) { 1077 if (s->output & DCA_LFE) {
1063 int lfe_samples = 2 * s->lfe * s->subsubframes;
1064
1065 lfe_interpolation_fir(s, s->lfe, 2 * s->lfe, 1078 lfe_interpolation_fir(s, s->lfe, 2 * s->lfe,
1066 s->lfe_data + lfe_samples + 1079 s->lfe_data + 2 * s->lfe * (block_index + 4),
1067 2 * s->lfe * subsubframe,
1068 &s->samples[256 * dca_lfe_index[s->amode]], 1080 &s->samples[256 * dca_lfe_index[s->amode]],
1069 (1.0/256.0)*s->scale_bias, s->add_bias); 1081 (1.0/256.0)*s->scale_bias, s->add_bias);
1070 /* Outputs 20bits pcm samples */ 1082 /* Outputs 20bits pcm samples */
1071 } 1083 }
1072 1084
1075 1087
1076 1088
1077 static int dca_subframe_footer(DCAContext * s) 1089 static int dca_subframe_footer(DCAContext * s)
1078 { 1090 {
1079 int aux_data_count = 0, i; 1091 int aux_data_count = 0, i;
1080 int lfe_samples;
1081 1092
1082 /* 1093 /*
1083 * Unpack optional information 1094 * Unpack optional information
1084 */ 1095 */
1085 1096
1092 for (i = 0; i < aux_data_count; i++) 1103 for (i = 0; i < aux_data_count; i++)
1093 get_bits(&s->gb, 8); 1104 get_bits(&s->gb, 8);
1094 1105
1095 if (s->crc_present && (s->downmix || s->dynrange)) 1106 if (s->crc_present && (s->downmix || s->dynrange))
1096 get_bits(&s->gb, 16); 1107 get_bits(&s->gb, 16);
1097
1098 lfe_samples = 2 * s->lfe * s->subsubframes;
1099 for (i = 0; i < lfe_samples; i++) {
1100 s->lfe_data[i] = s->lfe_data[i + lfe_samples];
1101 }
1102 1108
1103 return 0; 1109 return 0;
1104 } 1110 }
1105 1111
1106 /** 1112 /**
1122 if (!s->current_subsubframe) { 1128 if (!s->current_subsubframe) {
1123 #ifdef TRACE 1129 #ifdef TRACE
1124 av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n"); 1130 av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n");
1125 #endif 1131 #endif
1126 /* Read subframe header */ 1132 /* Read subframe header */
1127 if (dca_subframe_header(s)) 1133 if (dca_subframe_header(s, block_index))
1128 return -1; 1134 return -1;
1129 } 1135 }
1130 1136
1131 /* Read subsubframe */ 1137 /* Read subsubframe */
1132 #ifdef TRACE 1138 #ifdef TRACE
1203 AVPacket *avpkt) 1209 AVPacket *avpkt)
1204 { 1210 {
1205 const uint8_t *buf = avpkt->data; 1211 const uint8_t *buf = avpkt->data;
1206 int buf_size = avpkt->size; 1212 int buf_size = avpkt->size;
1207 1213
1214 int lfe_samples;
1208 int i; 1215 int i;
1209 int16_t *samples = data; 1216 int16_t *samples = data;
1210 DCAContext *s = avctx->priv_data; 1217 DCAContext *s = avctx->priv_data;
1211 int channels; 1218 int channels;
1212 1219
1224 return buf_size; 1231 return buf_size;
1225 } 1232 }
1226 //set AVCodec values with parsed data 1233 //set AVCodec values with parsed data
1227 avctx->sample_rate = s->sample_rate; 1234 avctx->sample_rate = s->sample_rate;
1228 avctx->bit_rate = s->bit_rate; 1235 avctx->bit_rate = s->bit_rate;
1236
1237 for (i = 0; i < (s->sample_blocks / 8); i++) {
1238 dca_decode_block(s, i);
1239 }
1229 1240
1230 channels = s->prim_channels + !!s->lfe; 1241 channels = s->prim_channels + !!s->lfe;
1231 1242
1232 if (s->amode<16) { 1243 if (s->amode<16) {
1233 avctx->channel_layout = dca_core_channel_layout[s->amode]; 1244 avctx->channel_layout = dca_core_channel_layout[s->amode];
1262 avctx->channels = channels; 1273 avctx->channels = channels;
1263 1274
1264 if(*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels) 1275 if(*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)
1265 return -1; 1276 return -1;
1266 *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels; 1277 *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels;
1278
1279 /* filter to get final output */
1267 for (i = 0; i < (s->sample_blocks / 8); i++) { 1280 for (i = 0; i < (s->sample_blocks / 8); i++) {
1268 dca_decode_block(s, i); 1281 dca_filter_channels(s, i);
1269 s->dsp.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels); 1282 s->dsp.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels);
1270 samples += 256 * channels; 1283 samples += 256 * channels;
1284 }
1285
1286 /* update lfe history */
1287 lfe_samples = 2 * s->lfe * (s->sample_blocks / 8);
1288 for (i = 0; i < 2 * s->lfe * 4; i++) {
1289 s->lfe_data[i] = s->lfe_data[i + lfe_samples];
1271 } 1290 }
1272 1291
1273 return buf_size; 1292 return buf_size;
1274 } 1293 }
1275 1294
1292 dsputil_init(&s->dsp, avctx); 1311 dsputil_init(&s->dsp, avctx);
1293 ff_mdct_init(&s->imdct, 6, 1, 1.0); 1312 ff_mdct_init(&s->imdct, 6, 1, 1.0);
1294 ff_synth_filter_init(&s->synth); 1313 ff_synth_filter_init(&s->synth);
1295 ff_dcadsp_init(&s->dcadsp); 1314 ff_dcadsp_init(&s->dcadsp);
1296 1315
1297 for(i = 0; i < 6; i++) 1316 for (i = 0; i < DCA_PRIM_CHANNELS_MAX+1; i++)
1298 s->samples_chanptr[i] = s->samples + i * 256; 1317 s->samples_chanptr[i] = s->samples + i * 256;
1299 avctx->sample_fmt = SAMPLE_FMT_S16; 1318 avctx->sample_fmt = SAMPLE_FMT_S16;
1300 1319
1301 if(s->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) { 1320 if(s->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) {
1302 s->add_bias = 385.0f; 1321 s->add_bias = 385.0f;