From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 14E594CA0E for <ffmpegdev@gitmailbox.com>; Fri, 11 Apr 2025 07:59:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB79168C109; Fri, 11 Apr 2025 10:58:52 +0300 (EEST) Received: from out162-62-57-64.mail.qq.com (out162-62-57-64.mail.qq.com [162.62.57.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 96CA768C109 for <ffmpeg-devel@ffmpeg.org>; Fri, 11 Apr 2025 10:58:50 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1744358323; bh=nHALpW70fIY10PHBoCyXLWDUgynRnmoiW56fyhemT9Y=; h=From:To:Cc:Subject:Date; b=dBtHD51++Kh6DmELrWnDhainfNwZecptFrkHs2Ix3Et73gAuEk/YnfUbyT6GRtqW/ gRf1M6w7VLwUIg9ZPt8yo0FNbYogdjDZIgupVgeZw4P1Bm7wGkRmyAC22V8x695tMP /kR/1XHQoP79IHTLUzr619JXBOlEkg9pKm0YiLsA= Received: from localhost.localdomain ([119.147.10.242]) by newxmesmtplogicsvrszb20-0.qq.com (NewEsmtp) with SMTP id EAA006A6; Fri, 11 Apr 2025 15:58:42 +0800 X-QQ-mid: xmsmtpt1744358322tzrfdj5ae Message-ID: <tencent_EEEA0039686E7EE6ADDE38F9C2E1B774690A@qq.com> X-QQ-XMAILINFO: M+LbSN6IdDJLvqJsBeXcRz7/nXYlSFSe+qAe96Rwf21dH2s7bcNnxyRuumBfKz IsdOlWmaz7gk5cqKTADLXh3gcnCvZx4456rdnIpiLheZ2QmX7/+0uVAglvHXFtNwth/H94lEjmWV C48bxYDNIPwuv9zpMqg8MGsvVGXC/N9RdieyH/UC7L1KqQ2+c6ss92uq0aON1y3r0ChIWV0tz/PS PghMlPXOo0ye8CDKt6uyoSTin43xqzEr9jUSscjXQLMbpo7uSUojnmSGcSMraTUBA4tPumVYdcpr VU+688unnpv9fQrwwN4hTSYfWuPXA0/3SYHX47bY0z3rhrgiaUiodOrxWs2VH4Z5Oo5hh02eNIRA PpC2nMpTRdc69U/01vyv0O8sfAvPyoM9A5oG+Ez8kiCiYBlWHPFY8SkDpedpcjZg4XtMPxisF5P1 o0d34S7hacO9glic5gq1RTQmW4zsJN69hFR10ukRVmjVuH2dVjFIt56I5j7XpliWMH4lsgFLiG7I XVLQDtaytj9bpMnDIHRrVr/TXmOkV261ZtRNIAPDpvzenVyLejQM3GU//JlyhSq5VS78s+mruTHS ST4X5vjjVnjwvrz3eQDklh7tMFbt88k+7XdwkhHDpNAhISPcJIjMBJpYDTR35JPNs4191KuloCWz xLKsQ+cQX4jdJ8XX7q84mLLPKXRNYd6wQ7m/ES+Z84ZRPk40twd3kIwm6OkMNqnUgXdXxTqrDTXr 2zNfY+jzzSsNa0/Yf1OKiSl6L8Gr2p6IW5RwqSJ/EcbU0YI/wd/Cci+Orkx7rM8+ytvw9LU+qRBG cZPskbG+KUza/eNTRk6JniLrVUewrSe1ZKKDq62X6cHLEfjt5BPg219uL/gXSGhlXcf+6G0PMcC6 bdqzNpgZGhrCkv0P1v3gq7Qfvfxb1YSo5NxyaZa3ihqAakUCUq0GN9UxHDEZMPeUaF0NXbJJG7oE zrH2axwvfPOxfTWYTF8JM/27xs/YKSAnYHsMMOK2WuKf3GpgNMWE1WSkTV5FW7NBaz2uwo1XEDOK fWCQih2R0DMQx/i2Qv X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Apr 2025 15:58:41 +0800 X-OQ-MSGID: <20250411075841.56828-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/22] avcodec/ac3enc: Remove use of av_uninit X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Zhao Zhili <zhilizhao@tencent.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/tencent_EEEA0039686E7EE6ADDE38F9C2E1B774690A@qq.com/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> From: Zhao Zhili <zhilizhao@tencent.com> --- libavcodec/ac3enc.c | 5 +++-- libavcodec/ac3enc_template.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 3649289865..17d45097ac 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1692,7 +1692,7 @@ static void ac3_output_frame_header(AC3EncodeContext *s, PutBitContext *pb) */ static void output_audio_block(AC3EncodeContext *s, PutBitContext *pb, int blk) { - int ch, i, baie, bnd, got_cpl, av_uninit(ch0); + int ch, i, baie, bnd, got_cpl; AC3Block *block = &s->blocks[blk]; /* block switching */ @@ -1852,6 +1852,7 @@ static void output_audio_block(AC3EncodeContext *s, PutBitContext *pb, int blk) /* mantissas */ got_cpl = !block->cpl_in_use; for (ch = 1; ch <= s->channels; ch++) { + int ch0 = 0; int b, q; if (!got_cpl && ch > 1 && block->channel_in_cpl[ch-1]) { @@ -2341,7 +2342,7 @@ static av_cold int validate_options(AC3EncodeContext *s) */ static av_cold void set_bandwidth(AC3EncodeContext *s) { - int blk, ch, av_uninit(cpl_start); + int blk, ch, cpl_start = 0; if (s->cutoff) { /* calculate bandwidth based on user-specified cutoff frequency */ diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index 049666fdca..84887c8079 100644 --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@ -93,7 +93,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) #else int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords; #endif - int av_uninit(blk), ch, bnd, i, j; + int ch, bnd, i, j; CoefSumType energy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][16] = {{{0}}}; int cpl_start, num_cpl_coefs; @@ -109,7 +109,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) cpl_start = FFMIN(256, cpl_start + num_cpl_coefs) - num_cpl_coefs; /* calculate coupling channel from fbw channels */ - for (blk = 0; blk < s->num_blocks; blk++) { + for (int blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; CoefType *cpl_coef = &block->mdct_coef[CPL_CH][cpl_start]; if (!block->cpl_in_use) @@ -134,7 +134,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) while (i < s->cpl_end_freq) { int band_size = s->cpl_band_sizes[bnd]; for (ch = CPL_CH; ch <= s->fbw_channels; ch++) { - for (blk = 0; blk < s->num_blocks; blk++) { + for (int blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; if (!block->cpl_in_use || (ch > CPL_CH && !block->channel_in_cpl[ch])) continue; @@ -149,7 +149,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) } /* calculate coupling coordinates for all blocks for all channels */ - for (blk = 0; blk < s->num_blocks; blk++) { + for (int blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; if (!block->cpl_in_use) continue; @@ -164,7 +164,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) } /* determine which blocks to send new coupling coordinates for */ - for (blk = 0; blk < s->num_blocks; blk++) { + for (int blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; AC3Block *block0 = blk ? &s->blocks[blk-1] : NULL; @@ -205,9 +205,9 @@ static void apply_channel_coupling(AC3EncodeContext *s) /* calculate final coupling coordinates, taking into account reusing of coordinates in successive blocks */ for (bnd = 0; bnd < s->num_cpl_bands; bnd++) { - blk = 0; + int blk = 0; while (blk < s->num_blocks) { - int av_uninit(blk1); + int blk1 = 0; AC3Block *block = &s->blocks[blk]; if (!block->cpl_in_use) { @@ -236,7 +236,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) } /* calculate exponents/mantissas for coupling coordinates */ - for (blk = 0; blk < s->num_blocks; blk++) { + for (int blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; if (!block->cpl_in_use) continue; -- 2.46.0 _______________________________________________ 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".