diff mbox series

[FFmpeg-devel,8/9] avcodec/dynamic_hdr_vivid: reindent after the previous commit

Message ID tencent_157627303894965A4D5BA00FCD89CFC85507@qq.com
State New
Headers show
Series [FFmpeg-devel,1/9] libavutil/hdr_dynamic_vivid_metadata: fix three spline params | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili Feb. 24, 2023, 9:08 p.m. UTC
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 mbox series

Patch

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
-                        }
+                    }
                 }
             }