History

aacenc_pred: rework the way prediction is done

This commit completely alters the algorithm of prediction. The original commit which introduced prediction was completely incorrect to even remotely care about what the actual coefficients contain or whether any options were enabled. Not my actual fault. This commit treats prediction the way the decoder does and expects to do: like lossy encryption. Everything related to prediction now happens at the very end but just before quantization and encoding of coefficients. On the decoder side, prediction happens before anything has had a chance to even access the coefficients. Also the original implementation had problems because it actually touched the band_type of special bands which already had their scalefactor indices marked and it's a wonder the asserion wasn't triggered when transmitting those. Overall, this now drastically increases audio quality and you should think about enabling it if you don't plan on playing anything encoded on really old low power ultra-embedded devices since they might not support decoding of prediction or AAC-Main. Though the specifications were written ages ago and as times change so do the FLOPS.

Rostislav Pehlivanov committed 11 years ago

Commit 44ddee91 parent 949a4896 files · +190 −225Browse files

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

Unified · Split

libavcodec/aaccoder.c+0−4
@@ -964,7 +964,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 963 unmodified lines
964964 ff_aac_encode_main_pred,
965965 ff_aac_adjust_common_prediction,
966966 ff_aac_apply_main_pred,
967− ff_aac_update_main_pred,
968967 set_special_band_scalefactors,
969968 search_for_pns,
970969 ff_aac_search_for_tns,
@@ -980,7 +979,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
980979 ff_aac_encode_main_pred,
981980 ff_aac_adjust_common_prediction,
982981 ff_aac_apply_main_pred,
983− ff_aac_update_main_pred,
984982 set_special_band_scalefactors,
985983 search_for_pns,
986984 ff_aac_search_for_tns,
@@ -996,7 +994,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
996994 ff_aac_encode_main_pred,
997995 ff_aac_adjust_common_prediction,
998996 ff_aac_apply_main_pred,
999− ff_aac_update_main_pred,
1000997 set_special_band_scalefactors,
1001998 search_for_pns,
1002999 ff_aac_search_for_tns,
@@ -1012,7 +1009,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
10121009 ff_aac_encode_main_pred,
10131010 ff_aac_adjust_common_prediction,
10141011 ff_aac_apply_main_pred,
1015− ff_aac_update_main_pred,
10161012 set_special_band_scalefactors,
10171013 search_for_pns,
10181014 ff_aac_search_for_tns,

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