diff mbox series

[FFmpeg-devel,01/20] avcodec/hevc_sei: Use proper type for NALU type

Message ID DB6PR0101MB2214F50F230E6F64A2428AED8FBC9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit aba0cc44656be6ee283349713ac888501ca597ba
Headers show
Series [FFmpeg-devel,01/20] avcodec/hevc_sei: Use proper type for NALU type | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 2, 2022, 10:20 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/hevc_sei.c | 2 +-
 libavcodec/hevc_sei.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Soft Works July 2, 2022, 11:28 p.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: Sunday, July 3, 2022 12:21 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Subject: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper
> type for NALU type
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---

Nice! That's helpful for the QSV SEI parsing. The one missing bit 
is the HDR data (AVMasteringDisplayMetadata and AVContentLightMetadata)
assignment which still seems to remain in hevcdec. Would it make sense
for factor this out as well?

Thank you very much,
softworkz
Andreas Rheinhardt Nov. 23, 2022, 3:19 a.m. UTC | #2
Soft Works:
> 
> 
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
>> Andreas Rheinhardt
>> Sent: Sunday, July 3, 2022 12:21 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> Subject: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper
>> type for NALU type
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
> 
> Nice! That's helpful for the QSV SEI parsing. The one missing bit 
> is the HDR data (AVMasteringDisplayMetadata and AVContentLightMetadata)
> assignment which still seems to remain in hevcdec. Would it make sense
> for factor this out as well?
> 

While the H.264 and HEVC syntax and semantics for these coincide, the
HEVC implementation of it is not completely spec-compliant with respect
to its persistency: The persistence ends when the coded video sequence
ends and if the new coded video sequence does not have these SEIs, then
we would need to attach an AVMasteringDisplayMetadata and/or
AVContentLightMetadata just to cancel the earlier values. I just don't
want to enter this and this includes not extending it to H.264.
Anyway, I have now rebased this patchset on top of master:
https://github.com/mkver/FFmpeg/tree/h2645_sei (with no noteworthy
conflicts; basically the only change is that the second to last commit
now adds proper newlines to the newly created files). I intend to apply
it in two days unless there are objections.

- Andreas
Soft Works Nov. 23, 2022, 4:15 a.m. UTC | #3
> -----Original Message-----
> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Sent: Wednesday, November 23, 2022 4:20 AM
> To: Soft Works <softworkz@hotmail.com>; FFmpeg development
> discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use
> proper type for NALU type
> 
> Soft Works:
> >
> >
> >> -----Original Message-----
> >> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> >> Andreas Rheinhardt
> >> Sent: Sunday, July 3, 2022 12:21 AM
> >> To: ffmpeg-devel@ffmpeg.org
> >> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> Subject: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper
> >> type for NALU type
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> ---
> >
> > Nice! That's helpful for the QSV SEI parsing. The one missing bit
> > is the HDR data (AVMasteringDisplayMetadata and
> AVContentLightMetadata)
> > assignment which still seems to remain in hevcdec. Would it make
> sense
> > for factor this out as well?
> >
> 
> While the H.264 and HEVC syntax and semantics for these coincide, the
> HEVC implementation of it is not completely spec-compliant with
> respect
> to its persistency: The persistence ends when the coded video
> sequence
> ends and if the new coded video sequence does not have these SEIs,
> then
> we would need to attach an AVMasteringDisplayMetadata and/or
> AVContentLightMetadata just to cancel the earlier values. I just
> don't
> want to enter this and this includes not extending it to H.264.
> Anyway, I have now rebased this patchset on top of master:
> https://github.com/mkver/FFmpeg/tree/h2645_sei (with no noteworthy
> conflicts; basically the only change is that the second to last
> commit
> now adds proper newlines to the newly created files). I intend to
> apply
> it in two days unless there are objections.
> 
> - Andreas


Hi,

I'm not sure whether you seen the patchset I had submitted 
meanwhile? It doesn't go as far as yours in a way that I didn't 
try to merge H264/5 functionality, but now it consequently splits
out the bits that are meant for common use.
I was able to eliminate all those makefile dependencies which you
had criticized (for valid reasons).

I hadn't seen any hint from you whether you are intending to 
proceed with your patchset, that's why I didn't know whether 
I should have waited. But I don't mind when you apply yours 
now, I will look into it and adapt.

Maybe you find the time to take only a quick look and let me 
know whether this goes into the right direction?
https://github.com/ffstaging/FFmpeg/pull/31/files

Thanks,
softworkz
Soft Works Nov. 23, 2022, 5:05 a.m. UTC | #4
> -----Original Message-----
> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Sent: Wednesday, November 23, 2022 4:20 AM
> To: Soft Works <softworkz@hotmail.com>; FFmpeg development
> discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use
> proper type for NALU type
> 
> Soft Works:
> >
> >
> >> -----Original Message-----
> >> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> >> Andreas Rheinhardt
> >> Sent: Sunday, July 3, 2022 12:21 AM
> >> To: ffmpeg-devel@ffmpeg.org
> >> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> Subject: [FFmpeg-devel] [PATCH 01/20] avcodec/hevc_sei: Use proper
> >> type for NALU type
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> ---
> >
> > Nice! That's helpful for the QSV SEI parsing. The one missing bit
> > is the HDR data (AVMasteringDisplayMetadata and
> AVContentLightMetadata)
> > assignment which still seems to remain in hevcdec. Would it make
> sense
> > for factor this out as well?
> >
> 
> While the H.264 and HEVC syntax and semantics for these coincide, the
> HEVC implementation of it is not completely spec-compliant with
> respect
> to its persistency: The persistence ends when the coded video
> sequence
> ends and if the new coded video sequence does not have these SEIs,
> then
> we would need to attach an AVMasteringDisplayMetadata and/or
> AVContentLightMetadata just to cancel the earlier values. I just
> don't
> want to enter this and this includes not extending it to H.264.

Just to clarify - by "factoring out" AVMasteringDisplayMetadata
and AVContentLightMetadata, I didn't mean in a way that it gets
unified to handle H.264 and H.265. I just meant to move it into
a separate module, so that it can be used by qsvdec.c without needing
to link to the whole H.265 implementation.

sw
diff mbox series

Patch

diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index 953633f4bd..631373e06f 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -550,7 +550,7 @@  static int decode_nal_sei_message(GetByteContext *gb, void *logctx, HEVCSEI *s,
 }
 
 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
-                           const HEVCParamSets *ps, int type)
+                           const HEVCParamSets *ps, enum HEVCNALUnitType type)
 {
     GetByteContext gbyte;
     int ret;
diff --git a/libavcodec/hevc_sei.h b/libavcodec/hevc_sei.h
index f198402333..ef987f6781 100644
--- a/libavcodec/hevc_sei.h
+++ b/libavcodec/hevc_sei.h
@@ -26,6 +26,7 @@ 
 #include "libavutil/buffer.h"
 
 #include "get_bits.h"
+#include "hevc.h"
 #include "sei.h"
 
 
@@ -154,7 +155,7 @@  typedef struct HEVCSEI {
 struct HEVCParamSets;
 
 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
-                           const struct HEVCParamSets *ps, int type);
+                           const struct HEVCParamSets *ps, enum HEVCNALUnitType type);
 
 /**
  * Reset SEI values that are stored on the Context.