From patchwork Thu Nov 5 13:48:22 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: 23400 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 4D5E0448C17 for ; Thu, 5 Nov 2020 15:48:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 22C1E68B7C7; Thu, 5 Nov 2020 15:48:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A80568B205 for ; Thu, 5 Nov 2020 15:48:40 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1604584119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HphoP7exJN75HI+8uwWtvQxP583sbi+5crhRMa1KVPE=; b=PR5D7zdX/wSxpbzsDxkWyIMJ0vlaxFDc8fozXKNN96jycnyllGqTv6y9z9uS06WWqko29X 4qQ7OhUPaeFnRSedv0af2WRKCaVrg2tWCK09sqKK8Tgke0AqdyPmdjkONPeGFT+RZ7i0ef jOiz4WoL/vt+sPBSSipLBdIjh+IbF6AqsTC3IwNEzH+/nJG0O7TuroQtJwkjHJJMp97JHc T8r3NmQUdq2x7DC2m023IPajerd/PZLLCM8D5AQ+p0YHoP5UTrDxEDPBwzAd7qqObBQEuT /9XwpgvzV+6vah+GNNQwWvIITBWXi420mvjwGJ7X7mOvn1P+HoFFDtHwVRTTkw== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Nov 2020 23:48:22 +1000 Message-Id: <20201105134827.25564-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Authenticated-User: git-morningstar@zanevaniperen.com X-Spam-Score: 0.00 Subject: [FFmpeg-devel] [PATCH v4 0/5] AMV muxing and adpcm_ima_amv encoding support 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" Adds support for encoding to adpcm_ima_amv and muxing to AMV. Things to note: - AMV is a hard-coded (and broken) subset of AVI. It's not worth sullying the existing AVI muxer with its filth. - The muxer is extremely pedantic about its streams, this is to not break certain software players. - The sizes of certain tags are deliberately set to 0 as some players break when they're set correctly. Ditto with some header fields. - Players can be **very** sensitive to the frame order and sizes. - Frames must be strictly interleaved as V-A, any V-V or A-A will cause crashes. - Variable audio frame sizes cause crashes. - If audio is shorter than video, it's padded with silence. - If video is shorter than audio, the most recent frame is repeated. v4: - Always use the coded sample count if its a sensible value - Fix decoder odd sample check v3: [2] - Use ffio_fill() v2: [1] - Unref allocated audio frame - Check return value of av_packet_ref() - Remove unnecessary initialisations - Add deinit() function [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-November/271837.html [2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-November/271882.html Zane van Iperen (5): avcodec/adpcm_ima_amv: restrict to 1 channel avcodec/adpcm_ima_amv: use coded sample count avcodec/adpcm_ima_amv: document header format avcodec: add adpcm_ima_amv encoder avformat: add amv muxer MAINTAINERS | 1 + doc/general_contents.texi | 2 +- libavcodec/adpcm.c | 34 ++- libavcodec/adpcmenc.c | 58 ++++- libavcodec/allcodecs.c | 1 + libavcodec/utils.c | 3 +- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/amvenc.c | 413 +++++++++++++++++++++++++++++++++++ tests/ref/fate/adpcm-ima-amv | 312 +++++++++++++------------- 10 files changed, 665 insertions(+), 161 deletions(-) create mode 100644 libavformat/amvenc.c