Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Alexander Strasser <eclipse7@gmx.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo: Remove spec-incompliant inverse quantisation
Date: Thu, 9 Nov 2023 21:55:40 +0100
Message-ID: <ZU1HTBv-gdhqQdFr@metallschleimette> (raw)
In-Reply-To: <CABLWnS82RVQYJFMWAz=tcqseZyfgeLCTDr9=Dj7g8XvUc34bjQ@mail.gmail.com>

On 2023-11-08 17:58 -0500, Vittorio Giovara wrote:
> On Wed, Nov 8, 2023 at 3:46 PM Alexander Strasser <eclipse7@gmx.net> wrote:
>
> > On 2023-11-08 12:40 +0100, Anton Khirnov wrote:
> > > Quoting Michael Niedermayer (2023-10-31 09:40:44)
> > > > On Mon, Oct 30, 2023 at 02:11:27PM +0100, Andreas Rheinhardt wrote:
> > > > > Section 7.4.4 of the MPEG-2 specifications requires that the
> > > > > last bit of the last coefficient be toggled so that the sum
> > > > > of all coefficients is odd; both our decoder and encoder
> > > > > did this only if the bitexact flag has been set (although
> > > > > stuff like this should be behind AV_CODEC_FLAG2_FAST).
> > > > > This patch changes this by removing the spec-incompliant
> > > > > functions.
> > > >
> > > > This commit message should include benchamarks documenting the speed
> > loss
> > > > (of the unquantize, the IDCT and overall)
> > > > It is expected that the speed of some IDCTs will be impacted negativly
> > > > as the non zero terms will prevent the skiping of some significant code
> > > >
> > > > as well as information about how much PSNR improves (to the encoder
> > input)
> > > >
> > > > Also the change is a +-1 in one spot before the IDCT, the IDCT is not
> > bitexactly
> > > > specified in MPEG-2 so one could think of this as a
> > > > correct implementation followed by a IDCT that was sometimes +-1 off
> > > > instead of spec non compliance
> > > >
> > > > Only after the benchmarks and PSNR is presented should we decide if
> > this
> > > > is a change we want
> > >
> > > I disagree that the burden of proof should be on Andreas here. It should
> > > be up to whoever wants to keep this code to show that it is useful.
> >
> > There was an argument presented.
> >
> > That argument could be challenged or otherwise explained why it more
> > important to have this always behave like with bitexact.
> >
> > This could lead to "OK, I think removal is better" or if not benchmarks
> > could lead to one or the other decision.
> >
> > Saying the burden is on whoever wants to keep the code sounds like a way
> > for arbitrary code removal. While I agree getting rid of code can be a good
> > thing, this would definitely take it too far.
> >
>
> To be fair, this is noncompliant spec code, it shouldn't be present at all
> since it produces inconsistent results (with the spec) and there is no
> device particularly needing this functionality.It's not arbitrary code
> removal, it's removing something that is not needed any more since the
> speed impact (pro or against) is negligible on modern computers.

Please see the reply to Anton. I hope it's clearer now what I meant.


> I'm of the opinion that presenting an argument against such a targeted and
> specific code removal with no supportive use case should be noted but not
> acted upon, until relevant proof is brought over. Yes sadly that burden
> should fall on whoever is presenting the argument.

I wouid disagree in general.

Maybe this case is more special (targeted and specific?) then my
current understanding of the matter. IIUC the leading reason for
this patch is removing the code because of spec incompliance which
I think is not so clear and could be argued both ways.


  Alexander
_______________________________________________
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".

  reply	other threads:[~2023-11-09 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 13:11 Andreas Rheinhardt
2023-10-30 18:40 ` Kieran Kunhya
2023-10-31  8:40 ` Michael Niedermayer
2023-11-08 11:40   ` Anton Khirnov
2023-11-08 20:55     ` Alexander Strasser
2023-11-08 22:58       ` Vittorio Giovara
2023-11-09 20:55         ` Alexander Strasser [this message]
2023-11-09 10:13       ` Anton Khirnov
2023-11-09 20:45         ` Alexander Strasser
2023-11-09 20:52           ` Rémi Denis-Courmont
2023-11-09 22:16             ` Michael Niedermayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZU1HTBv-gdhqQdFr@metallschleimette \
    --to=eclipse7@gmx.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git