]> git.sesse.net Git - ffmpeg/commitdiff
aacenc: reorder resetting of cpe->common_window
authorRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 1 Sep 2015 06:00:10 +0000 (07:00 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 1 Sep 2015 06:00:10 +0000 (07:00 +0100)
Purely a cosmetic change, most of the zeroing of encoder resources
should happen at the top of the main loop.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/aacenc.c

index 1a845be407446be284b49c8ae43359ecb8748274..2f9b5e5706ea38cf876bf5a48244f39c7ff3d731 100644 (file)
@@ -571,6 +571,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
             tag      = s->chan_map[i+1];
             chans    = tag == TYPE_CPE ? 2 : 1;
             cpe      = &s->cpe[i];
+            cpe->common_window = 0;
             memset(cpe->is_mask, 0, sizeof(cpe->is_mask));
             memset(cpe->ms_mask, 0, sizeof(cpe->ms_mask));
             put_bits(&s->pb, 3, tag);
@@ -590,7 +591,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
                 s->cur_channel = start_ch + ch;
                 s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
             }
-            cpe->common_window = 0;
             if (chans > 1
                 && wi[0].window_type[0] == wi[1].window_type[0]
                 && wi[0].window_shape   == wi[1].window_shape) {