From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9244E4B83D for ; Sun, 16 Jun 2024 08:55:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78B8D68D699; Sun, 16 Jun 2024 11:55:05 +0300 (EEST) Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9F3D68D1BB for ; Sun, 16 Jun 2024 11:54:58 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 16 Jun 2024 10:54:43 +0200 Message-ID: <20240616085454.2560973-1-dev@lynne.ee> X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] aacdec_usac: apply specification fix M55715 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lynne via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Lynne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavcodec/aac/aacdec_usac.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 98e8c1c0bc..065bc869d9 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -835,6 +835,11 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, tns_active = get_bits1(gb); us->common_window = get_bits1(gb); + if (!us->common_window || indep_flag) { + memset(us->prev_alpha_q_re, 0, sizeof(us->prev_alpha_q_re)); + memset(us->prev_alpha_q_im, 0, sizeof(us->prev_alpha_q_im)); + } + if (us->common_window) { /* ics_info() */ ics1->window_sequence[1] = ics1->window_sequence[0]; @@ -845,6 +850,20 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, ics2->use_kb_window[1] = ics2->use_kb_window[0]; ics1->use_kb_window[0] = ics2->use_kb_window[0] = get_bits1(gb); + /* If there's a change in the transform sequence, zero out last frame's + * stereo prediction coefficients */ + if ((ics1->window_sequence[0] == EIGHT_SHORT_SEQUENCE && + ics1->window_sequence[1] != EIGHT_SHORT_SEQUENCE) || + (ics1->window_sequence[1] == EIGHT_SHORT_SEQUENCE && + ics1->window_sequence[0] != EIGHT_SHORT_SEQUENCE) || + (ics2->window_sequence[0] == EIGHT_SHORT_SEQUENCE && + ics2->window_sequence[1] != EIGHT_SHORT_SEQUENCE) || + (ics2->window_sequence[1] == EIGHT_SHORT_SEQUENCE && + ics2->window_sequence[0] != EIGHT_SHORT_SEQUENCE)) { + memset(us->prev_alpha_q_re, 0, sizeof(us->prev_alpha_q_re)); + memset(us->prev_alpha_q_im, 0, sizeof(us->prev_alpha_q_im)); + } + if (ics1->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { ics1->max_sfb = ics2->max_sfb = get_bits(gb, 4); ue1->scale_factor_grouping = ue2->scale_factor_grouping = get_bits(gb, 7); -- 2.45.1.288.g0e0cd299f1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".