diff mbox series

[FFmpeg-devel,26/35] avcodec/proresenc_anatoliy: only pass down the first scale to encode_dcs()

Message ID 20231211014429.1841681-27-u@pkh.me
State Accepted
Commit a026f98f292e7669b51436a6db0a5ccf90b15be4
Headers show
Series [FFmpeg-devel,01/35] avcodec/proresenc_kostya: remove an unnecessary parenthesis level in MAKE_CODE() macro | expand

Commit Message

Clément Bœsch Dec. 11, 2023, 1:35 a.m. UTC
This matches encode_dcs() prototype from proresenc_kostya.
---
 libavcodec/proresenc_anatoliy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stefano Sabatini Dec. 18, 2023, 10:36 p.m. UTC | #1
On date Monday 2023-12-11 02:35:27 +0100, Clément Bœsch wrote:
> This matches encode_dcs() prototype from proresenc_kostya.
> ---
>  libavcodec/proresenc_anatoliy.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

LGTM.
diff mbox series

Patch

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 56baeb9956..bdf7bface4 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -267,19 +267,19 @@  static av_always_inline int get_level(int val)
 
 
 static void encode_dcs(PutBitContext *pb, int16_t *blocks,
-                       int blocks_per_slice, int *qmat)
+                       int blocks_per_slice, int scale)
 {
     int i;
     int codebook = 5, code, dc, prev_dc, delta, sign, new_sign;
     int diff_sign;
 
-    prev_dc = (blocks[0] - 0x4000) / qmat[0];
+    prev_dc = (blocks[0] - 0x4000) / scale;
     encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));
     sign     = 0;
     blocks  += 64;
 
     for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
-        dc        = (blocks[0] - 0x4000) / qmat[0];
+        dc        = (blocks[0] - 0x4000) / scale;
         delta     = dc - prev_dc;
         new_sign  = GET_SIGN(delta);
         diff_sign = new_sign ^ sign;
@@ -388,7 +388,7 @@  static int encode_slice_plane(int16_t *blocks, int mb_count, uint8_t *buf, unsig
     blocks_per_slice = mb_count << (2 - sub_sample_chroma);
     init_put_bits(&pb, buf, buf_size);
 
-    encode_dcs(&pb, blocks, blocks_per_slice, qmat);
+    encode_dcs(&pb, blocks, blocks_per_slice, qmat[0]);
     encode_ac_coeffs(&pb, blocks, blocks_per_slice, qmat, ff_prores_scan);
 
     flush_put_bits(&pb);