[FFmpeg-devel] [PATCH v4 02/13] avutil/film_grain_params: initialize VCS to UNSPECIFIED

Niklas Haas ffmpeg at haasn.xyz
Mon Mar 18 18:54:10 EET 2024


From: Niklas Haas <git at haasn.dev>

---
 libavutil/film_grain_params.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavutil/film_grain_params.c b/libavutil/film_grain_params.c
index 930d23c7fe9..230ce8d701c 100644
--- a/libavutil/film_grain_params.c
+++ b/libavutil/film_grain_params.c
@@ -30,13 +30,20 @@ AVFilmGrainParams *av_film_grain_params_alloc(size_t *size)
 
 AVFilmGrainParams *av_film_grain_params_create_side_data(AVFrame *frame)
 {
+    AVFilmGrainParams *fgp;
     AVFrameSideData *side_data = av_frame_new_side_data(frame,
                                                         AV_FRAME_DATA_FILM_GRAIN_PARAMS,
                                                         sizeof(AVFilmGrainParams));
     if (!side_data)
         return NULL;
 
-    memset(side_data->data, 0, sizeof(AVFilmGrainParams));
+    fgp = (AVFilmGrainParams *) side_data->data;
+    *fgp = (AVFilmGrainParams) {
+        .color_range     = AVCOL_RANGE_UNSPECIFIED,
+        .color_primaries = AVCOL_PRI_UNSPECIFIED,
+        .color_trc       = AVCOL_TRC_UNSPECIFIED,
+        .color_space     = AVCOL_SPC_UNSPECIFIED,
+    };
 
-    return (AVFilmGrainParams *)side_data->data;
+    return fgp;
 }
-- 
2.44.0



More information about the ffmpeg-devel mailing list