History

ffv1enc_vulkan: minor EC optimizations

Lynne committed 1 year ago

Commit 52595021 parent 7c0a8c01 file · +6 −13Browse files

Showing the changes to libavcodec/vulkan/rangecoder.comp (1 of 1 file). Show all

Unified · Split

libavcodec/vulkan/rangecoder.comp+6−13
@@ -109,14 +109,10 @@ void put_rac_direct(inout RangeCoder c, inout uint8_t state, bool bit) · 108 unmodified lines
109#endif109#endif
110 110
111 int diff = c.range - range1;111 int diff = c.range - range1;
112 if (bit) {112 c.low += bit ? diff : 0;
113 c.low += diff;113 c.range = bit ? range1 : diff;
114 c.range = range1;
115 } else {
116 c.range = diff;
117 }
118 114
119 if (c.range < 0x100)115 if (expectEXT(c.range < 0x100, false))
120 renorm_encoder(c);116 renorm_encoder(c);
121 117
122 state = zero_one_state[(uint(bit) << 8) + state];118 state = zero_one_state[(uint(bit) << 8) + state];
@@ -139,12 +135,9 @@ void put_rac_equi(inout RangeCoder c, bool bit) · 16 unmodified lines
139 debugPrintfEXT("Error: range1 <= 0");135 debugPrintfEXT("Error: range1 <= 0");
140#endif136#endif
141 137
142 if (bit) {138 int diff = c.range - range1;
143 c.low += c.range - range1;139 c.low += bit ? diff : 0;
144 c.range = range1;140 c.range = bit ? range1 : diff;
145 } else {
146 c.range -= range1;
147 }
148 141
149 if (expectEXT(c.range < 0x100, false))142 if (expectEXT(c.range < 0x100, false))
150 renorm_encoder(c);143 renorm_encoder(c);

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