Mercurial > libavcodec.hg
comparison ac3enc.c @ 1602:fdb8244da1e5 libavcodec
av_log patch(2 of ?) by (Michel Bardiaux <mbardiaux at peaktime dot be>)
author | michael |
---|---|
date | Mon, 03 Nov 2003 18:06:54 +0000 |
parents | 932d306bf1dc |
children | 34cdcb221665 |
comparison
equal
deleted
inserted
replaced
1601:a70c07e13e8e | 1602:fdb8244da1e5 |
---|---|
462 reused in the next frame */ | 462 reused in the next frame */ |
463 exp_strategy[0][ch] = EXP_NEW; | 463 exp_strategy[0][ch] = EXP_NEW; |
464 for(i=1;i<NB_BLOCKS;i++) { | 464 for(i=1;i<NB_BLOCKS;i++) { |
465 exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2); | 465 exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2); |
466 #ifdef DEBUG | 466 #ifdef DEBUG |
467 av_log(AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff); | 467 av_log(NULL, AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff); |
468 #endif | 468 #endif |
469 if (exp_diff > EXP_DIFF_THRESHOLD) | 469 if (exp_diff > EXP_DIFF_THRESHOLD) |
470 exp_strategy[i][ch] = EXP_NEW; | 470 exp_strategy[i][ch] = EXP_NEW; |
471 else | 471 else |
472 exp_strategy[i][ch] = EXP_REUSE; | 472 exp_strategy[i][ch] = EXP_REUSE; |
578 } | 578 } |
579 k += group_size; | 579 k += group_size; |
580 } | 580 } |
581 | 581 |
582 #if defined(DEBUG) | 582 #if defined(DEBUG) |
583 av_log(AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy); | 583 av_log(NULL, AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy); |
584 for(i=0;i<=nb_groups * group_size;i++) { | 584 for(i=0;i<=nb_groups * group_size;i++) { |
585 av_log(AV_LOG_DEBUG, "%d ", encoded_exp[i]); | 585 av_log(NULL, AV_LOG_DEBUG, "%d ", encoded_exp[i]); |
586 } | 586 } |
587 av_log(AV_LOG_DEBUG, "\n"); | 587 av_log(NULL, AV_LOG_DEBUG, "\n"); |
588 #endif | 588 #endif |
589 | 589 |
590 return 4 + (nb_groups / 3) * 7; | 590 return 4 + (nb_groups / 3) * 7; |
591 } | 591 } |
592 | 592 |
1019 } | 1019 } |
1020 | 1020 |
1021 #if defined(DEBUG) | 1021 #if defined(DEBUG) |
1022 { | 1022 { |
1023 static int count = 0; | 1023 static int count = 0; |
1024 av_log(AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++); | 1024 av_log(NULL, AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++); |
1025 } | 1025 } |
1026 #endif | 1026 #endif |
1027 /* exponent strategy */ | 1027 /* exponent strategy */ |
1028 for(ch=0;ch<s->nb_channels;ch++) { | 1028 for(ch=0;ch<s->nb_channels;ch++) { |
1029 put_bits(&s->pb, 2, exp_strategy[ch]); | 1029 put_bits(&s->pb, 2, exp_strategy[ch]); |