diff options
author | Jan Ekström <jeebjp@gmail.com> | 2023-07-12 21:15:10 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2023-07-27 21:45:43 +0300 |
commit | 91e1d11d1405f325f6f52e2c8dd5bbbf2462e190 (patch) | |
tree | 7ccfdd254dc9fb7b62f9005697c1b265533cfd16 | |
parent | 43e63ff20a51e0296c446a9deec613df6fd52cb8 (diff) | |
download | ffmpeg-91e1d11d1405f325f6f52e2c8dd5bbbf2462e190.tar.gz |
avcodec/hevcdec: simplify decrementing of MDCV/CLL flags
Mostly done to be able to update the comment so that it no longer
mentions the same flag twice.
-rw-r--r-- | libavcodec/hevcdec.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 1fe91238d4..15276edd33 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2760,17 +2760,15 @@ static int set_side_data(HEVCContext *s) AVFrame *out = s->ref->frame; int ret; - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.common.mastering_display.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.common.mastering_display.present--; - } - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.common.content_light.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.common.content_light.present--; + // Decrement the mastering display and content light level flag when IRAP + // frame has no_rasl_output_flag=1 so the side data persists for the entire + // coded video sequence. + if (IS_IRAP(s) && s->no_rasl_output_flag) { + if (s->sei.common.mastering_display.present > 0) + s->sei.common.mastering_display.present--; + + if (s->sei.common.content_light.present > 0) + s->sei.common.content_light.present--; } ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, NULL, |