ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Tue 
Mar 25 11:57:25 2025 +0100| [ffd537bcc2da727495f860382a5c899e4fbe6dff] | 
committer: Michael Niedermayer

avcodec/ffv1enc: Eliminate encode_mul()

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ffd537bcc2da727495f860382a5c899e4fbe6dff
---

 libavcodec/ffv1enc.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 6818de9249..162bf7b804 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1289,15 +1289,6 @@ static inline void copy_state(RemapEncoderState *dst, 
const RemapEncoderState *s
     dst->run1start_last_val = src->run1start_last_val;
 }
 
-static inline void encode_mul(RemapEncoderState *s, int mul_index)
-{
-    av_assert2(s->mul[ mul_index ]);
-    if (s->mul[ mul_index ] < 0) {
-        s->mul[ mul_index ] *= -1;
-        put_symbol_inline(&s->rc, s->state[0][2], s->mul[ mul_index ], 0, 
NULL, NULL);
-    }
-}
-
 static int encode_float32_remap_segment(FFV1SliceContext *sc,
                                         RemapEncoderState *state_arg, int 
update, int final)
 {
@@ -1386,7 +1377,11 @@ static int encode_float32_remap_segment(FFV1SliceContext 
*sc,
             s.last_val = val;
             s.current_mul_index = ((s.last_val + 1) * s.mul_count) >> 32;
             if (!s.run || s.run1final) {
-                encode_mul(&s, s.current_mul_index);
+                av_assert2(s.mul[ s.current_mul_index ]);
+                if (s.mul[ s.current_mul_index ] < 0) {
+                    s.mul[ s.current_mul_index ] *= -1;
+                    put_symbol_inline(&s.rc, s.state[0][2], s.mul[ 
s.current_mul_index ], 0, NULL, NULL);
+                }
                 s.compact_index ++;
             }
         }

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

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

Reply via email to