History

AAC encoder: Fix application of M/S with PNS

When both M/S coding and PNS are enabled, scalefactors and coding books would be mistakenly clobbered when setting the M/S flag on PNS'd bands. The flag needs to be set to signal the generation of correlated noise, but the scalefactors, coefficients and the coding books need to be kept intact.

Claudio Freire committed 10 years ago

Commit fc36d851 parent 04deaef2 files · +9 −3Browse files

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

Unified · Split

libavcodec/aaccoder.c+2−2
@@ -887,8 +887,8 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe) · 886 unmodified lines
887887 }
888888 cpe->ms_mask[w*16+g] = dist2 <= dist1 && B1 < B0;
889889 if (cpe->ms_mask[w*16+g]) {
890− /* Setting the M/S mask is useful with I/S, but only the flag */
891− if (!cpe->is_mask[w*16+g]) {
890+ /* Setting the M/S mask is useful with I/S or PNS, but only the flag */
891+ if (!cpe->is_mask[w*16+g] && sce0->band_type[w*16+g] != NOISE_BT && sce1->band_type[w*16+g] != NOISE_BT) {
892892 sce0->sf_idx[w*16+g] = mididx;
893893 sce1->sf_idx[w*16+g] = sididx;
894894 sce0->band_type[w*16+g] = midcb;

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