[FFmpeg-cvslog] avcodec/h264_sei: honor the Film Grain Characteristics cancel flag

James Almer git at videolan.org
Mon Jul 26 05:54:25 EEST 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Jul 25 23:09:00 2021 -0300| [f7958d0883286479a6c9cd91e68e506dfa02ed7c] | committer: James Almer

avcodec/h264_sei: honor the Film Grain Characteristics cancel flag

Film Grain persistence is cancelled when it's true.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/h264_sei.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index b1785c6198..7797f24650 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -420,9 +420,9 @@ static int decode_alternative_transfer(H264SEIAlternativeTransfer *h,
 static int decode_film_grain_characteristics(H264SEIFilmGrainCharacteristics *h,
                                              GetBitContext *gb)
 {
-    int film_grain_characteristics_cancel_flag = get_bits1(gb);
+    h->present = !get_bits1(gb); // film_grain_characteristics_cancel_flag
 
-    if (!film_grain_characteristics_cancel_flag) {
+    if (h->present) {
         memset(h, 0, sizeof(*h));
         h->model_id = get_bits(gb, 8);
         h->separate_colour_description_present_flag = get_bits1(gb);



More information about the ffmpeg-cvslog mailing list