diff mbox series

[FFmpeg-devel,17/35] avcodec/proresenc_anatoliy: reduce DC encoding function prototype differences with Kostya encoder

Message ID 20231211014429.1841681-18-u@pkh.me
State Accepted
Commit dadc5ac24aae78e89c37d5d65c5f30cff28eb577
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
---
 libavcodec/proresenc_anatoliy.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Stefano Sabatini Dec. 18, 2023, 12:26 a.m. UTC | #1
On date Monday 2023-12-11 02:35:18 +0100, Clément Bœsch wrote:
> ---
>  libavcodec/proresenc_anatoliy.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index f8feff850f..97d681467d 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -267,20 +267,20 @@ static av_always_inline int get_level(int val)
>  }

should be good
diff mbox series

Patch

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index f8feff850f..97d681467d 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -267,20 +267,20 @@  static av_always_inline int get_level(int val)
 }
 
 
-static void encode_dc_coeffs(PutBitContext *pb, int16_t *in,
-        int blocks_per_slice, int *qmat)
+static void encode_dcs(PutBitContext *pb, int16_t *blocks,
+                       int blocks_per_slice, int *qmat)
 {
     int prev_dc, codebook;
     int i, sign, idx;
     int new_dc, delta, diff_sign, code;
 
-    prev_dc = (in[0] - 0x4000) / qmat[0];
+    prev_dc = (blocks[0] - 0x4000) / qmat[0];
     codebook = TO_GOLOMB(prev_dc);
     encode_vlc_codeword(pb, FIRST_DC_CB, codebook);
 
     codebook = 5; sign = 0; idx = 64;
     for (i = 1; i < blocks_per_slice; i++, idx += 64) {
-        new_dc    = (in[idx] - 0x4000) / qmat[0];
+        new_dc    = (blocks[idx] - 0x4000) / qmat[0];
         delta     = new_dc - prev_dc;
         diff_sign = DIFF_SIGN(delta, sign);
         code      = TO_GOLOMB2(get_level(delta), diff_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_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);
+    encode_dcs(&pb, blocks, blocks_per_slice, qmat);
     encode_ac_coeffs(&pb, blocks, blocks_per_slice, qmat, ff_prores_scan);
 
     flush_put_bits(&pb);