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 6678E4237D for ; Fri, 17 Dec 2021 20:08:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DCEC68AEE9; Fri, 17 Dec 2021 22:08:50 +0200 (EET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2046868AE6B for ; Fri, 17 Dec 2021 22:08:44 +0200 (EET) Received: by mail-wr1-f48.google.com with SMTP id a9so6100833wrr.8 for ; Fri, 17 Dec 2021 12:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1Wo4gzxNlYX9R3FsOUv2LJnMq2sb9ELqE5TI+TsVZD4=; b=SZeEj+gbBuUD5SpK74nH+Ap9LK17geLHgP6S00cKNb6HxfKO4YkA0/ARMKifHdg1E0 0ED/I664xDLWAB3feQhT1OqhyAtsd4SGW+VmNsWrZh8XVaKXmyhg1esEhUPLF60NS1D0 SrzPJffk+dr+CG3IJg5HOajxtK4dr6y6ChR3ZyUyHqoZzUPzHW7DvDqPBPrG/pY8OqCX c7jVNNP5YXCTozVcwtJnEsUh1RVFXd5IkOfAZPZk7WQLzTU4nP9D64cPD2EzKntcMA9E XVZUlaLQNIUnThtoEHEmbm/Y0C7SqiphPc5cIXXUnR46bQD2BXoFSVyM5OO3qJchrlyw SmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1Wo4gzxNlYX9R3FsOUv2LJnMq2sb9ELqE5TI+TsVZD4=; b=qqvCFyOm9IqRCsRc0kToueNPuPeSsrsSElNVg2NQoO7P9JxE5gGkEQTC07hJnVrVNr VDzL04kWlj+rFHsMN2MmWjaSHjdLMfY7z0OkdA/irKNyUlLzRn/Dwynv4dUApcFOhpNc B+GQobjcY/BjtP7a6oTaRNhAGAN/6+t5kp1uEGj852Dk+kf24T3+dmtSDhkqqUXbVdPX hWHVufvLznysoVQVLpr17YQ6MLd8epX5rX951CoaDG6+NN2wzxZmievE+FsASSmfn5RE dqt0gmozsruvB3K/CHU43UPYrl7+9G7CvQ+iieRlpjX+yvc9YbZOCDR/cJb79gT8zXvF mJ+A== X-Gm-Message-State: AOAM5325Pf/e6WpevcXjvIoQewf3BU5XnsEi2wpnfB+K+EGcNPB2Dcmv 5cuekANN/f7OdW9lPtCa79aEw7Nlfk1WhBm2iY7dLHKpNQxQSw== X-Google-Smtp-Source: ABdhPJw5nEqdT4EIQNlN2LtfuOb9cGMjiFL3O0boSwl5DxxNijpMXDA82/UNtw+1SZQ+SoTNg0bzXB548IBoQ7Tv7RY= X-Received: by 2002:adf:f741:: with SMTP id z1mr2548017wrp.54.1639771723261; Fri, 17 Dec 2021 12:08:43 -0800 (PST) MIME-Version: 1.0 References: <20211216194321.18669-1-mvanb1@gmail.com> <20211217114330.GI2829255@pb2> In-Reply-To: <20211217114330.GI2829255@pb2> From: Martijn van Beurden Date: Fri, 17 Dec 2021 21:08:30 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] Add 32 bit-per-sample capability to FLAC encoder 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 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: Op vr 17 dec. 2021 om 12:43 schreef Michael Niedermayer : > > + sub->coefs[i] = sub->coefs[i]*0.98; > ^^^^ > This is ugly, the amount of actual overflow should be known at this point > so no arbitrary downscale should be needed here Many thanks for the suggestion, I didn't think of using a more intelligent approach. I'll work something out. > > + if (!ff_flacdsp_lpc_encode_c_32_overflow_detect(res, smp, n, sub->order, > > + sub->coefs, sub->shift)) { > > + sub->type = sub->type_code = FLAC_SUBFRAME_VERBATIM; > > + memcpy(res, smp, n * sizeof(int32_t)); > > + return subframe_count_exact(s, sub, 0); > > How often does this occur ? Depends on the content. On low dynamic range, distorted, overdriven sounds like certain kinds of metal, this happens on about half of the subframes. On most popular music, up to about 5%. On classical music never. For the intended use (archiving of tape recordings with ample headroom) probably never as well. A more intelligent approach as suggested could bring these numbers down. _______________________________________________ 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".