From patchwork Wed Oct 14 13:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 22940 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id C34AA44ADAD for ; Wed, 14 Oct 2020 16:10:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB3F168BAA3; Wed, 14 Oct 2020 16:10:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5BEE468B964 for ; Wed, 14 Oct 2020 16:09:54 +0300 (EEST) Date: Wed, 14 Oct 2020 13:09:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=protonmail2; t=1602680993; bh=3h9VA0XTPpu+BE729uYHZpCwS7bFTiuJsDOeHpQM4Bo=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=yhE985w0Z03/3ieOJJrPI82lZziWDg93RRc9Sk9ueW5AgcMACIUDEkNr3CCopGXyX AP5XM5PbuURnIYw6zYgCKSbtJepL2kvqflEPK2+S3fLYrxkmPcC12qj8A9/spEn8/a wLKV98qZZ0hV/2NCDUruv52kHmvZht0MGqwEvd9t0JoYt3dvoWD7iIB1ekJjYrYRqb 7BxtAGwW42tRAJWYH+PdFI+xd1lU8GLwvIx/Dzj/7WtoIVOM82pk57o7k2D/fIUfr/ UW/Avo0ctP0udz40poSw+Imach3FHU3UZOYQRQFS2EDKRGwchkNgLJ6iMT3lBTp9Ik IuTaUI9JTwQLw== To: ffmpeg-devel@ffmpeg.org From: Zane van Iperen Message-ID: <20201014130915.25948-2-zane@zanevaniperen.com> In-Reply-To: <20201014130915.25948-1-zane@zanevaniperen.com> References: <20201014130915.25948-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Subject: [FFmpeg-devel] [PATCH 2/7] avcodec/adpcm_ms: support variable block size for encoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zane van Iperen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes tickets #6585 and #7109 Signed-off-by: Zane van Iperen --- libavcodec/adpcmenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 0038a10830..fc29bf8571 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -127,9 +127,9 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_ADPCM_MS: /* each 16 bits sample gives one nibble and we have 7 bytes per channel overhead */ - avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; + avctx->frame_size = (s->block_size - 7 * avctx->channels) * 2 / avctx->channels + 2; avctx->bits_per_coded_sample = 4; - avctx->block_align = BLKSIZE; + avctx->block_align = s->block_size; if (!(avctx->extradata = av_malloc(32 + AV_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); avctx->extradata_size = 32;