summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-06-26 21:16:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-06-29 16:44:40 +0200
commit7c10b87b5744179f16411f5981e96738021ec7ca (patch)
tree3c2dde11cc45c0fe3ce67124084064e14bd4021d /libavcodec/aacenc.c
parentda8b228977406b1be95d7881e38651f4e61d1fc6 (diff)
aacenc: add support for coding of intensity stereo scalefactor indices
This commit adds support for the coding of intensity stereo scalefactor indices. It does not do any marking of such bands and as such does no functional changes to the encoder. It removes any old twoloop specific code for PNS and moves it into a seperate function which handles setting of scalefactor indices for PNS and IS bands. Reviewed-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 897c3a10df..3a512ffeee 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -389,7 +389,7 @@ static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce)
{
int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0] - NOISE_OFFSET;
- int noise_flag = 1;
+ int off_is = 0, noise_flag = 1;
int i, w;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
@@ -402,6 +402,10 @@ static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
put_bits(&s->pb, NOISE_PRE_BITS, diff + NOISE_PRE);
continue;
}
+ } else if (sce->band_type[w*16 + i] == INTENSITY_BT ||
+ sce->band_type[w*16 + i] == INTENSITY_BT2) {
+ diff = sce->sf_idx[w*16 + i] - off_is;
+ off_is = sce->sf_idx[w*16 + i];
} else {
diff = sce->sf_idx[w*16 + i] - off_sf;
off_sf = sce->sf_idx[w*16 + i];