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 2B02144317 for ; Sat, 8 Oct 2022 03:26:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0457F68BC12; Sat, 8 Oct 2022 06:25:58 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D364068B9F1 for ; Sat, 8 Oct 2022 06:25:51 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id E5B001060158 for ; Sat, 8 Oct 2022 03:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1665199550; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=5qwZYhnKxDt29LD//xvx7T9IRKV78ATCQ+JG5Bht/Sc=; b=wLJlq4GKSKRs7YlYO3M83Ds5Eokx5tniUb34UXbe+25WpGUsrCEQvWj0zt34mvAy ZnaB9xmtJZHAKS86pTtwwtBh+A9SUynHPS+adxcrG4/I+/Bkhq3Am4JSUcHxKklEp80 koy/1yr3ZQLoa6HIU8SyYZAoBbZSwD393/NeH7d/nXAGVYotMljkQeKfBopKDFhUwoa /J2//45Ia9OhErkRvZi/Cto4MiKmv20mamQ9JfD7K0lE8T/f2YwTWga3L6CUPBXgRb/ qfhp3DOD0gJNbw0VeAn7v5HjGrdVoyVOfR03dB92V13SKHA7ZJ4dy6PU4Jxw2oBKv4l xCn4B8zgow== Date: Sat, 8 Oct 2022 05:25:50 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/9] avcodec/opus_rc: Remove write-only waste from OpusRangeCoder 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: Oct 7, 2022, 22:20 by andreas.rheinhardt@outlook.com: > Write-only since e7d977b446194649aa30f2aacc6c17bce7aeb90b > (and local to ff_opus_rc_enc_end() before that). > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/opus_rc.c | 2 -- > libavcodec/opus_rc.h | 3 --- > 2 files changed, 5 deletions(-) > > diff --git a/libavcodec/opus_rc.c b/libavcodec/opus_rc.c > index c432eb90c9..2061418e52 100644 > --- a/libavcodec/opus_rc.c > +++ b/libavcodec/opus_rc.c > @@ -383,8 +383,6 @@ void ff_opus_rc_enc_end(OpusRangeCoder *rc, uint8_t *dst, int size) > rng_bytes = rc->rng_cur - rc->buf; > memcpy(dst, rc->buf, rng_bytes); > > - rc->waste = size*8 - (rc->rb.bytes*8 + rc->rb.cachelen) - rng_bytes*8; > - > /* Put the rawbits part, if any */ > if (rc->rb.bytes || rc->rb.cachelen) { > int i, lap; > diff --git a/libavcodec/opus_rc.h b/libavcodec/opus_rc.h > index 627f83229e..1b3cb93a15 100644 > --- a/libavcodec/opus_rc.h > +++ b/libavcodec/opus_rc.h > @@ -49,9 +49,6 @@ typedef struct OpusRangeCoder { > uint8_t *rng_cur; /* Current range coded byte */ > int ext; /* Awaiting propagation */ > int rem; /* Carryout flag */ > - > - /* Encoding stats */ > - int waste; > } OpusRangeCoder; > Not really to patch 1. The purpose of the waste field was to know how many bits were spare and usable to put stuff like encoder settings into. It's only a small field, compilers probably eliminate it anyway, and it's useful for debugging, just leave it there for now. It's not something I'd argue about, so if you'd really like to get rid of it, do tell. LGTM to patches 2-6. Whatever for the opusenc_psy file, I have a rewrite I need to finish at some point. Definite NAK to patch 7. The RC system is very easy to read and well-organized. I'd like to keep it that way than hunt for spare bytes that any LTO trivially removes. I'd accept a patch that changes the encoder array to heap allocated one (better yet a framepool) if you'd still like to save on the struct size. LGTM to patches 8-9. _______________________________________________ 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".