Split up computation of the offset in the same way that the range coder version does it.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -139,7 +139,8 @@ void decode_line(inout SliceContext sc, ivec2 sp, int w, · 138 unmodified lines | |||
| 139 | ivec2 pr = get_pred(dec[p], sp, ivec2(x, y), 0, w, | 139 | ivec2 pr = get_pred(dec[p], sp, ivec2(x, y), 0, w, |
| 140 | quant_table_idx, extend_lookup[quant_table_idx] > 0); | 140 | quant_table_idx, extend_lookup[quant_table_idx] > 0); |
| 141 | 141 | ||
| 142 | VlcState sb = VlcState(uint64_t(slice_state) + state_off + VLC_STATE_SIZE*abs(pr[0])); | 142 | uint context_off = state_off + VLC_STATE_SIZE*abs(pr[0]); |
| 143 | VlcState sb = VlcState(uint64_t(slice_state) + context_off); | ||
| 143 | 144 | ||
| 144 | if (pr[0] == 0 && run_mode == 0) | 145 | if (pr[0] == 0 && run_mode == 0) |
| 145 | run_mode = 1; | 146 | run_mode = 1; |