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 1DD8C4101E for ; Tue, 11 Oct 2022 17:25:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9991368BCAC; Tue, 11 Oct 2022 20:25:02 +0300 (EEST) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7E5A68B9C6 for ; Tue, 11 Oct 2022 20:24:56 +0300 (EEST) Received: by mail-ed1-f41.google.com with SMTP id e18so21136698edj.3 for ; Tue, 11 Oct 2022 10:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JA1RsQ8ytvto56E0G0ZOKNfFbGLVJtOpyDgNy6wcz+k=; b=YM3bLeqBZfR9OuJ22z69/VU5HSdfS2D/JwxsjJJvnX1IbkF85vS0LwUrLP9z80aoUS NDosMhLQiGy1/LweEhMZDGO6sx3iSDiXPSL6lwRidHbwmpv+W2V4wXIf2MlVd31oT9uo GkkpfObRMV+6aPKnFxl9GZGbKvNE6ejhrnjdkrVup6ttU5q9DzaCmGBSzixJvzqXIwDC 6j1uPGC86gozT15gIvKkH0owln0HlsvHGIyCGXfyscIcZP21KRTTjJTIiezkbvjFpQPB 49QHgyfqQwyuqjN65a2tfGAeTeIl1xpY4OTCzAuI6AsRLbc1TUyEWjazvj7UeCcgrSGv G/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JA1RsQ8ytvto56E0G0ZOKNfFbGLVJtOpyDgNy6wcz+k=; b=wIkU3ezidsk2BBP0mftFkBqJq7tdCKKdWCA556fD2tf6VsRCRQxnS1Aw0mKVGaIdA4 pPvQyFxGqVoVGOmUNFPiGNOYiLmo3jtFrVM9mSuBgC9mqxDQ8X6HuQMmFbF7OcEz69jm yiaOsQi8oZ21uQez1YF1yUMH8JwyjXuZ6AFMP+LYLQY2TRmtL137aX5wMC6jlk0OTnk8 gQR9JwyJsje+skLD8M483avykpI1Bn/rVSZYEakVkteWaAdrVCi+NEzNwIRtnuYtR+a0 OWXWsFQD3DX04fJMWJsnralfa+O8FlpcIWwdJOWx4FvXaVYObbTsOJNAcrf0gKeTDV2q 3cYw== X-Gm-Message-State: ACrzQf2qcMvwmBYavosLFNAXakZcU2JXNaIcuYOEv5J9wAUIoSHCcfqE IACyZ9eUqxQyo2cohPdFVrt9wIvzcVQ= X-Google-Smtp-Source: AMsMyM6O/oDhhvZo3dxak4IvIsaq82SkfrqffvyzvfCvilLONSV2IqB6+c04os8EHLxJkIJUkwy5TQ== X-Received: by 2002:a05:6402:4505:b0:451:1551:7b14 with SMTP id ez5-20020a056402450500b0045115517b14mr24248813edb.300.1665509095703; Tue, 11 Oct 2022 10:24:55 -0700 (PDT) Received: from localhost.localdomain (92-64-99-37.biz.kpn.net. [92.64.99.37]) by smtp.googlemail.com with ESMTPSA id jt11-20020a170906ca0b00b0078de26f66b9sm8532ejb.114.2022.10.11.10.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 10:24:54 -0700 (PDT) From: Martijn van Beurden To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Oct 2022 19:24:34 +0200 Message-Id: <20221011172437.36211-1-mvanb1@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 0/3] 32bps FLAC patches 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: , Reply-To: FFmpeg development discussions and patches Cc: Martijn van Beurden 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: Recently libFLAC gained the ability (first released in FLAC 1.4.0) to create FLAC files containing 32-bit int PCM samples. To keep complexity reasonable, the choice was made to limit residuals to 32-bit integers, which the encoder must make sure of. In case the encoder cannot find any predictor of which the residuals fit this limit, it must default to using a verbatim subframe. Tests have shown that this does not happen often (<0.1% of subframes on a music corpus of various styles). See also discussion here: https://github.com/ietf-wg-cellar/flac-specification/pull/148 These two patches implement decoding and encoding following this format. Changes since v1: fix copy-paste error in encoder, several invocations of lpc_encode_choose_datapath used wrong parameters, making FATE fail as compression was less than it should be Changes since v2: Rebased decoder part as it didn't apply anymore Changes since v3: Moved put_golomb part to flacenc.c (as it is now quite specific to FLAC) and renamed put_sbits64 to put_sbits63 (and changed assert accordingly) Changes since v4: Fix check of decoded_buffer_33bps malloc. Fix reading of wasted bits for 33bps subframe. Add fate test Changes since v5: Slimmed down 32 bps fate flac test from 2 to 1 input file. Replaced -strict -2 with -strict experimental in fate and encoder warning. Changes since v6: Deduplicated function bodies with preprocessor macros in both encoder and decoder, declared variables in loop body where possible and changed ff_ctz to ff_ctzll where necessary Martijn van Beurden (3): libavcodec/flacdec: Implement decoding of 32 bit-per-sample PCM libavcodec/flacenc: Implement encoding of 32 bit-per-sample PCM fate/flac: Add test of 32 bps encoding/decoding libavcodec/flac.c | 4 +- libavcodec/flacdec.c | 218 ++++++++++++++++-- libavcodec/flacenc.c | 480 +++++++++++++++++++++++++++++++--------- libavcodec/get_bits.h | 12 + libavcodec/mathops.h | 9 + libavcodec/put_bits.h | 7 + libavcodec/put_golomb.h | 14 -- tests/fate/flac.mak | 4 + 8 files changed, 602 insertions(+), 146 deletions(-) -- 2.30.2 _______________________________________________ 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".