You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/ffv1enc: Fix end handling
This also produces smaller files Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -1315,7 +1315,9 @@ static int encode_float32_remap_segment(FFV1SliceContext *sc,
|
|||||||
if (s.last_val == 0xFFFFFFFF) {
|
if (s.last_val == 0xFFFFFFFF) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
val = 1LL<<32;
|
val = s.last_val + ((1LL<<32) - s.last_val + current_mul - 1) / current_mul * current_mul;
|
||||||
|
av_assert2(val >= (1LL<<32));
|
||||||
|
val += s.lu * current_mul; //ensure a run1 ends
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
val = sc->unit[s.p][s.i].val;
|
val = sc->unit[s.p][s.i].val;
|
||||||
@ -1379,6 +1381,7 @@ static int encode_float32_remap_segment(FFV1SliceContext *sc,
|
|||||||
if (!s.run || s.run1final) {
|
if (!s.run || s.run1final) {
|
||||||
av_assert2(s.mul[ s.current_mul_index ]);
|
av_assert2(s.mul[ s.current_mul_index ]);
|
||||||
if (s.mul[ s.current_mul_index ] < 0) {
|
if (s.mul[ s.current_mul_index ] < 0) {
|
||||||
|
av_assert2(s.i < s.pixel_num);
|
||||||
s.mul[ s.current_mul_index ] *= -1;
|
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);
|
put_symbol_inline(&s.rc, s.state[0][2], s.mul[ s.current_mul_index ], 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user