History

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.

Lynne committed 1 year ago

Commit 5cf4f141 parent bc1a3bf1 file · +10 −0Browse files

Unified · Split

libavcodec/ffv1_parse.c+10−0
@@ -104,6 +104,11 @@ int ff_ffv1_read_extra_header(FFV1Context *f) · 103 unmodified lines
104 if (f->ac == AC_RANGE_CUSTOM_TAB) {104 if (f->ac == AC_RANGE_CUSTOM_TAB) {
105 for (int i = 1; i < 256; i++)105 for (int i = 1; i < 256; i++)
106 f->state_transition[i] = ff_ffv1_get_symbol(&c, state, 1) + c.one_state[i];106 f->state_transition[i] = ff_ffv1_get_symbol(&c, state, 1) + c.one_state[i];
107 } else {
108 RangeCoder rc;
109 ff_build_rac_states(&rc, 0.05 * (1LL << 32), 256 - 8);
110 for (int i = 1; i < 256; i++)
111 f->state_transition[i] = rc.one_state[i];
107 }112 }
108 113
109 f->colorspace = ff_ffv1_get_symbol(&c, state, 0); //YUV cs type114 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) · 109 unmodified lines
219 }224 }
220 f->state_transition[i] = st;225 f->state_transition[i] = st;
221 }226 }
227 } else {
228 RangeCoder rc;
229 ff_build_rac_states(&rc, 0.05 * (1LL << 32), 256 - 8);
230 for (int i = 1; i < 256; i++)
231 f->state_transition[i] = rc.one_state[i];
222 }232 }
223 233
224 colorspace = ff_ffv1_get_symbol(c, state, 0); //YUV cs type234 colorspace = ff_ffv1_get_symbol(c, state, 0); //YUV cs type

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t