Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack@foxmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Zhao Zhili <zhilizhao@tencent.com>
Subject: [FFmpeg-devel] [PATCH 8/9] avcodec/dynamic_hdr_vivid: reindent after the previous commit
Date: Sat, 25 Feb 2023 05:08:47 +0800
Message-ID: <tencent_157627303894965A4D5BA00FCD89CFC85507@qq.com> (raw)
In-Reply-To: <20230224210848.535436-1-quinkblack@foxmail.com>

From: Zhao Zhili <zhilizhao@tencent.com>

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavcodec/dynamic_hdr_vivid.c | 64 +++++++++++++++++-----------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index 8fa69d87b5..8b5105ea12 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -92,42 +92,42 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
                         tm_params->base_param_Delta_enable_mode = get_bits(gb, 3);
                         tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
                     }
-                        if (get_bits_left(gb) < 1)
+                    if (get_bits_left(gb) < 1)
+                        return AVERROR_INVALIDDATA;
+                    tm_params->three_Spline_enable_flag = get_bits(gb, 1);
+                    if (tm_params->three_Spline_enable_flag) {
+                        AVHDRVivid3SplineParams *three_spline;
+
+                        if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
+                            return AVERROR_INVALIDDATA;
+                        tm_params->three_Spline_num = get_bits(gb, 1) + 1;
+                        if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_spline))
                             return AVERROR_INVALIDDATA;
-                        tm_params->three_Spline_enable_flag = get_bits(gb, 1);
-                        if (tm_params->three_Spline_enable_flag) {
-                            AVHDRVivid3SplineParams *three_spline;
-
-                            if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
-                                return AVERROR_INVALIDDATA;
-                            tm_params->three_Spline_num = get_bits(gb, 1) + 1;
-                            if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_spline))
-                                return AVERROR_INVALIDDATA;
-                            for (int j = 0; j < tm_params->three_Spline_num; j++) {
-                                three_spline = tm_params->three_spline + j;
-                                three_spline->th_mode = get_bits(gb, 2);
-                                if (three_spline->th_mode == 0 || three_spline->th_mode == 2) {
-                                    if (get_bits_left(gb) < 8)
-                                        return AVERROR_INVALIDDATA;
-                                    three_spline->th_enable_mb = (AVRational){get_bits(gb, 8),  255};
-                                }
-                                three_spline->th_enable = (AVRational){get_bits(gb, 12),  4095};
-                                three_spline->th_delta1 = (AVRational){get_bits(gb, 10),  1023};
-                                three_spline->th_delta2 = (AVRational){get_bits(gb, 10),  1023};
-                                three_spline->enable_strength = (AVRational){get_bits(gb,  8),  255};
+                        for (int j = 0; j < tm_params->three_Spline_num; j++) {
+                            three_spline = tm_params->three_spline + j;
+                            three_spline->th_mode = get_bits(gb, 2);
+                            if (three_spline->th_mode == 0 || three_spline->th_mode == 2) {
+                                if (get_bits_left(gb) < 8)
+                                    return AVERROR_INVALIDDATA;
+                                three_spline->th_enable_mb = (AVRational){get_bits(gb, 8),  255};
                             }
+                            three_spline->th_enable = (AVRational){get_bits(gb, 12),  4095};
+                            three_spline->th_delta1 = (AVRational){get_bits(gb, 10),  1023};
+                            three_spline->th_delta2 = (AVRational){get_bits(gb, 10),  1023};
+                            three_spline->enable_strength = (AVRational){get_bits(gb,  8),  255};
+                        }
 #if FF_API_HDR_VIVID_THREE_SPLINE
-                            three_spline = tm_params->three_spline;
-                            AV_NOWARN_DEPRECATED(
-                            tm_params->three_Spline_TH_mode = three_spline->th_mode;
-                            tm_params->three_Spline_TH_enable_MB = three_spline->th_enable_mb;
-                            tm_params->three_Spline_TH_enable = three_spline->th_enable;
-                            tm_params->three_Spline_TH_Delta1 = three_spline->th_delta1;
-                            tm_params->three_Spline_TH_Delta2 = three_spline->th_delta2;
-                            tm_params->three_Spline_enable_Strength = three_spline->enable_strength;
-                            )
+                        three_spline = tm_params->three_spline;
+                        AV_NOWARN_DEPRECATED(
+                        tm_params->three_Spline_TH_mode = three_spline->th_mode;
+                        tm_params->three_Spline_TH_enable_MB = three_spline->th_enable_mb;
+                        tm_params->three_Spline_TH_enable = three_spline->th_enable;
+                        tm_params->three_Spline_TH_Delta1 = three_spline->th_delta1;
+                        tm_params->three_Spline_TH_Delta2 = three_spline->th_delta2;
+                        tm_params->three_Spline_enable_Strength = three_spline->enable_strength;
+                        )
 #endif
-                        }
+                    }
                 }
             }
 
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2023-02-24 13:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230224210848.535436-1-quinkblack@foxmail.com>
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 2/9] avcodec/dynamic_hdr_vivid: fix three spline params Zhao Zhili
2023-02-24 13:33   ` James Almer
2023-02-24 15:52     ` [FFmpeg-devel] [PATCH v2 1/9] libavutil/hdr_dynamic_vivid_metadata: " Zhao Zhili
2023-03-17  3:16       ` "zhilizhao(赵志立)"
     [not found]     ` <20230224155222.194400-1-quinkblack@foxmail.com>
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 2/9] avcodec/dynamic_hdr_vivid: " Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 3/9] avfilter/vf_showinfo: fix HDR vivid info Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 4/9] fftools/ffprobe: " Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 5/9] libavcodec/dynamic_hdr_vivid: fix start code check Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 6/9] avcodec/dynamic_hdr_vivid: fix base_param_Delta Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 7/9] avcodec/dynamic_hdr_vivid: fix base_enable_flag control Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 8/9] avcodec/dynamic_hdr_vivid: reindent after the previous commit Zhao Zhili
2023-02-24 15:52       ` [FFmpeg-devel] [PATCH v2 9/9] fftools/ffprobe: fix print_dynamic_hdr_vivid Zhao Zhili
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 3/9] avfilter/vf_showinfo: fix HDR vivid info Zhao Zhili
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 4/9] fftools/ffprobe: " Zhao Zhili
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 5/9] libavcodec/dynamic_hdr_vivid: fix start code check Zhao Zhili
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 6/9] avcodec/dynamic_hdr_vivid: fix base_param_Delta Zhao Zhili
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 7/9] avcodec/dynamic_hdr_vivid: fix base_enable_flag control Zhao Zhili
2023-02-24 21:08 ` Zhao Zhili [this message]
2023-02-24 21:08 ` [FFmpeg-devel] [PATCH 9/9] fftools/ffprobe: fix print_dynamic_hdr_vivid Zhao Zhili

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_157627303894965A4D5BA00FCD89CFC85507@qq.com \
    --to=quinkblack@foxmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=zhilizhao@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git