History

Turn on AAC rate control.

Originally committed as revision 19379 to svn://svn.ffmpeg.org/ffmpeg/trunk

Alex Converse committed 17 years ago

Commit 7a4eebc1 parent c8f47d82 files · +6 −14Browse files

Showing the changes to libavcodec/aaccoder.c (1 of 2 files). Show all

Unified · Split

libavcodec/aaccoder.c+5−14
@@ -457,15 +457,6 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce · 456 unmodified lines
457 }457 }
458}458}
459 459
460static void encode_window_bands_info_fixed(AACEncContext *s,
461 SingleChannelElement *sce,
462 int win, int group_len,
463 const float lambda)
464{
465 encode_window_bands_info(s, sce, win, group_len, 1.0f);
466}
467
468
469typedef struct TrellisPath {460typedef struct TrellisPath {
470 float cost;461 float cost;
471 int prev;462 int prev;
@@ -700,7 +691,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 228 unmodified lines
700 sce->ics.swb_sizes[g],691 sce->ics.swb_sizes[g],
701 sce->sf_idx[w*16+g],692 sce->sf_idx[w*16+g],
702 ESC_BT,693 ESC_BT,
703 1.0,694 lambda,
704 INFINITY,695 INFINITY,
705 &b);696 &b);
706 bb += b;697 bb += b;
@@ -710,7 +701,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 3 unmodified lines
710 minbits = bb;701 minbits = bb;
711 }702 }
712 }703 }
713 dists[w*16+g] = mindist - minbits;704 dists[w*16+g] = (mindist - minbits) / lambda;
714 bits = minbits;705 bits = minbits;
715 if (prev != -1) {706 if (prev != -1) {
716 bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];707 bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];
@@ -870,12 +861,12 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s, · 153 unmodified lines
870 sce->ics.swb_sizes[g],861 sce->ics.swb_sizes[g],
871 scf,862 scf,
872 ESC_BT,863 ESC_BT,
873 1.0,864 lambda,
874 INFINITY,865 INFINITY,
875 &b);866 &b);
876 dist -= b;867 dist -= b;
877 }868 }
878 dist *= 1.0f/512.0f;869 dist *= 1.0f / 512.0f / lambda;
879 quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]);870 quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]);
880 if (quant_max >= 8191) { // too much, return to the previous quantizer871 if (quant_max >= 8191) { // too much, return to the previous quantizer
881 sce->sf_idx[w*16+g] = prev_scf;872 sce->sf_idx[w*16+g] = prev_scf;
@@ -1019,7 +1010,7 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe, · 137 unmodified lines
1019AACCoefficientsEncoder ff_aac_coders[] = {1010AACCoefficientsEncoder ff_aac_coders[] = {
1020 {1011 {
1021 search_for_quantizers_faac,1012 search_for_quantizers_faac,
1022 encode_window_bands_info_fixed,1013 encode_window_bands_info,
1023 quantize_and_encode_band,1014 quantize_and_encode_band,
1024// search_for_ms,1015// search_for_ms,
1025 },1016 },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t