1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/ffv1enc: Eliminate encode_mul()

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-03-25 11:57:25 +01:00
parent 8804ae158b
commit ffd537bcc2

View File

@ -1289,15 +1289,6 @@ static inline void copy_state(RemapEncoderState *dst, const RemapEncoderState *s
dst->run1start_last_val = src->run1start_last_val; 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, static int encode_float32_remap_segment(FFV1SliceContext *sc,
RemapEncoderState *state_arg, int update, int final) RemapEncoderState *state_arg, int update, int final)
{ {
@ -1386,7 +1377,11 @@ static int encode_float32_remap_segment(FFV1SliceContext *sc,
s.last_val = val; s.last_val = val;
s.current_mul_index = ((s.last_val + 1) * s.mul_count) >> 32; s.current_mul_index = ((s.last_val + 1) * s.mul_count) >> 32;
if (!s.run || s.run1final) { 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 ++; s.compact_index ++;
} }
} }