[FFmpeg-devel] [PATCH 1/4] avcodec/frame: add AV_FRAME_FLAG_LOSSLESS
Michael Niedermayer
michael at niedermayer.cc
Tue Dec 17 00:24:54 EET 2024
Hi
On Mon, Dec 16, 2024 at 10:05:35AM +0100, Anton Khirnov wrote:
> Quoting Marton Balint (2024-12-16 09:47:39)
> >
> >
> > On Mon, 16 Dec 2024, Anton Khirnov wrote:
> >
> > > Quoting Marton Balint (2024-12-15 01:02:42)
> > >> Signed-off-by: Marton Balint <cus at passwd.hu>
> > >> ---
> > >> doc/APIchanges | 3 +++
> > >> libavcodec/version.h | 2 +-
> > >> libavutil/frame.h | 4 ++++
> > >> 3 files changed, 8 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/doc/APIchanges b/doc/APIchanges
> > >> index 3a75b803a9..bfba0946d3 100644
> > >> --- a/doc/APIchanges
> > >> +++ b/doc/APIchanges
> > >> @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
> > >>
> > >> API changes, most recent first:
> > >>
> > >> +2024-12-xx - xxxxxxxxxx - lavc 61.27.100 - frame.h
> > >> + Add AV_FRAME_FLAG_LOSSLESS.
> > >
> > > I feel ambivalent about this. This is really a decoder property, and
> > > attaching it to frames allows it propagate far away to places where it
> > > makes no sense (the same holds for other existing AVFrame fields, but
> > > I'd prefer for them to be removed).
> >
> > The way this flag is set in patch 2 in the series kind of shows why this
> > is a per-frame property, directly originated from the bitstream of codecs
> > supporting both lossy and lossless encoding. The encoder for such codecs
> > is allowed to decide on a frame-by-frame basis if it will use lossy or
> > lossless encoding.
>
> I realize this can change per-frame, my point is that it's a per-frame
> property of the decoding process,
> not of the decoded frame itself.
Thats not really true
If you take a lossless decoded frame and a lossy decoded frame
i mean just the 2d array of RGB samples
you can tell them apart
not only do they have different artifacts and statistics but fundamentally
you will not be able to produce a lossy representation from a lossless
2d array of samples. (Because that would make the lossy compression lossless)
Also there is a human user interrest in this. "is what i see here lossless?"
There may even be a legal interrest in such things when a video is evidence
Furthermore a encoder trying to preserve lossless frames needs to know
what is lossless.
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241216/3f92f9fd/attachment.sig>
More information about the ffmpeg-devel
mailing list