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

ffv1dec: set f->state_transition for default range coder table

The table is only set when f->ac is set to CUSTOM. Setting it
for default range coder tables simplifies hardware accelerator code.
This commit is contained in:
Lynne
2025-02-18 23:47:13 +01:00
parent bc1a3bfd2c
commit 5cf4f145ad

View File

@ -104,6 +104,11 @@ int ff_ffv1_read_extra_header(FFV1Context *f)
if (f->ac == AC_RANGE_CUSTOM_TAB) {
for (int i = 1; i < 256; i++)
f->state_transition[i] = ff_ffv1_get_symbol(&c, state, 1) + c.one_state[i];
} else {
RangeCoder rc;
ff_build_rac_states(&rc, 0.05 * (1LL << 32), 256 - 8);
for (int i = 1; i < 256; i++)
f->state_transition[i] = rc.one_state[i];
}
f->colorspace = ff_ffv1_get_symbol(&c, state, 0); //YUV cs type
@ -219,6 +224,11 @@ int ff_ffv1_parse_header(FFV1Context *f, RangeCoder *c, uint8_t *state)
}
f->state_transition[i] = st;
}
} else {
RangeCoder rc;
ff_build_rac_states(&rc, 0.05 * (1LL << 32), 256 - 8);
for (int i = 1; i < 256; i++)
f->state_transition[i] = rc.one_state[i];
}
colorspace = ff_ffv1_get_symbol(c, state, 0); //YUV cs type