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
964 ff_aac_encode_main_pred,964 ff_aac_encode_main_pred,
965 ff_aac_adjust_common_prediction,965 ff_aac_adjust_common_prediction,
966 ff_aac_apply_main_pred,966 ff_aac_apply_main_pred,
967 ff_aac_update_main_pred,
968 set_special_band_scalefactors,967 set_special_band_scalefactors,
969 search_for_pns,968 search_for_pns,
970 ff_aac_search_for_tns,969 ff_aac_search_for_tns,
@@ -980,7 +979,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
980 ff_aac_encode_main_pred,979 ff_aac_encode_main_pred,
981 ff_aac_adjust_common_prediction,980 ff_aac_adjust_common_prediction,
982 ff_aac_apply_main_pred,981 ff_aac_apply_main_pred,
983 ff_aac_update_main_pred,
984 set_special_band_scalefactors,982 set_special_band_scalefactors,
985 search_for_pns,983 search_for_pns,
986 ff_aac_search_for_tns,984 ff_aac_search_for_tns,
@@ -996,7 +994,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
996 ff_aac_encode_main_pred,994 ff_aac_encode_main_pred,
997 ff_aac_adjust_common_prediction,995 ff_aac_adjust_common_prediction,
998 ff_aac_apply_main_pred,996 ff_aac_apply_main_pred,
999 ff_aac_update_main_pred,
1000 set_special_band_scalefactors,997 set_special_band_scalefactors,
1001 search_for_pns,998 search_for_pns,
1002 ff_aac_search_for_tns,999 ff_aac_search_for_tns,
@@ -1012,7 +1009,6 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { · 9 unmodified lines
1012 ff_aac_encode_main_pred,1009 ff_aac_encode_main_pred,
1013 ff_aac_adjust_common_prediction,1010 ff_aac_adjust_common_prediction,
1014 ff_aac_apply_main_pred,1011 ff_aac_apply_main_pred,
1015 ff_aac_update_main_pred,
1016 set_special_band_scalefactors,1012 set_special_band_scalefactors,
1017 search_for_pns,1013 search_for_pns,
1018 ff_aac_search_for_tns,1014 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