[FFmpeg-cvslog] lavc/vvc_ps: Add alf raw syntax into VVCALF

Fei Wang git at videolan.org
Fri Nov 1 06:15:42 EET 2024


ffmpeg | branch: master | Fei Wang <fei.w.wang at intel.com> | Mon Oct 28 16:55:23 2024 +0800| [a94aa2d61e3f67a93c3e01f0107803a30c387a58] | committer: Haihao Xiang

lavc/vvc_ps: Add alf raw syntax into VVCALF

Signed-off-by: Fei Wang <fei.w.wang at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a94aa2d61e3f67a93c3e01f0107803a30c387a58
---

 libavcodec/vvc/ps.c | 10 +++++++++-
 libavcodec/vvc/ps.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c
index ff9a6c7a15..f32f1cc5a1 100644
--- a/libavcodec/vvc/ps.c
+++ b/libavcodec/vvc/ps.c
@@ -1043,13 +1043,21 @@ static void alf_derive(VVCALF *alf, const H266RawAPS *aps)
     alf_cc(alf, aps);
 }
 
+static void alf_free(FFRefStructOpaque unused, void *obj)
+{
+    VVCALF *alf = obj;
+
+    ff_refstruct_unref(&alf->r);
+}
+
 static int aps_decode_alf(const VVCALF **alf, const H266RawAPS *aps)
 {
-    VVCALF *a = ff_refstruct_allocz(sizeof(*a));
+    VVCALF *a = ff_refstruct_alloc_ext(sizeof(*a), 0, NULL, alf_free);
     if (!a)
         return AVERROR(ENOMEM);
 
     alf_derive(a, aps);
+    ff_refstruct_replace(&a->r, aps);
     ff_refstruct_replace(alf, a);
     ff_refstruct_unref(&a);
 
diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h
index 9203e2c57f..3ec2238c17 100644
--- a/libavcodec/vvc/ps.h
+++ b/libavcodec/vvc/ps.h
@@ -169,6 +169,7 @@ typedef struct VVCPH {
 #define ALF_NUM_COEFF_CC         7
 
 typedef struct VVCALF {
+    const H266RawAPS *r;
     int16_t luma_coeff     [ALF_NUM_FILTERS_LUMA][ALF_NUM_COEFF_LUMA];
     uint8_t luma_clip_idx  [ALF_NUM_FILTERS_LUMA][ALF_NUM_COEFF_LUMA];
 



More information about the ffmpeg-cvslog mailing list