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

vulkan_ffv1: optimize symbol reader

This was the fastest variant tested.
This commit is contained in:
Lynne
2025-04-02 20:46:12 +00:00
parent defebd74c0
commit fc960dafef

View File

@ -78,13 +78,11 @@ int get_isymbol(inout RangeCoder c, uint64_t state)
state += 21; state += 21;
int a = 1 << e; int a = 1;
int i; for (int i = e - 1; i >= 0; i--) {
for (i = e - 1; i >= 9; i--) a <<= 1;
a |= int(get_rac(c, state + 9)) << i; // 22..31 a |= int(get_rac(c, state + min(i, 9))); // 22..31
}
for (; i >= 0; i--)
a |= int(get_rac(c, state + i)) << i; // 22..31
return get_rac(c, state - 11 + min(e, 10)) ? -a : a; return get_rac(c, state - 11 + min(e, 10)) ? -a : a;
} }