[FFmpeg-devel] [PATCH 35/35] avcodec/proresenc_kostya: make a few cosmetics in encode_acs()

Clément Bœsch u at pkh.me
Mon Dec 11 03:35:36 EET 2023


Unify cosmetics with encode_acs() from proresenc_anatoliy.
---
 libavcodec/proresenc_kostya.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index c6c045be73..05e90bb236 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -437,11 +437,10 @@ static void encode_acs(PutBitContext *pb, int16_t *blocks,
     int idx, i;
     int prev_run = 4;
     int prev_level = 2;
-    int run, level;
+    int run = 0, level;
     int max_coeffs, abs_level;
 
     max_coeffs = blocks_per_slice << 6;
-    run        = 0;
 
     for (i = 1; i < 64; i++) {
         for (idx = scan[i]; idx < max_coeffs; idx += 64) {
@@ -449,13 +448,12 @@ static void encode_acs(PutBitContext *pb, int16_t *blocks,
             if (level) {
                 abs_level = FFABS(level);
                 encode_vlc_codeword(pb, ff_prores_run_to_cb[prev_run], run);
-                encode_vlc_codeword(pb, ff_prores_lev_to_cb[prev_level],
-                                    abs_level - 1);
+                encode_vlc_codeword(pb, ff_prores_lev_to_cb[prev_level], abs_level - 1);
                 put_sbits(pb, 1, GET_SIGN(level));
 
                 prev_run   = FFMIN(run, 15);
                 prev_level = FFMIN(abs_level, 9);
-                run    = 0;
+                run        = 0;
             } else {
                 run++;
             }
-- 
2.43.0



More information about the ffmpeg-devel mailing list