History

avcodec/pgxdec: Hoist branch out of loop

Andreas Rheinhardt committed 4 years ago

Commit 84a80ac1 parent e4a26a61 file · +3 −6Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/pgxdec.c+3−6
@@ -95,16 +95,13 @@ error: · 94 unmodified lines
95 static inline void write_frame_ ##D(AVFrame *frame, GetByteContext *g, \95 static inline void write_frame_ ##D(AVFrame *frame, GetByteContext *g, \
96 int width, int height, int sign, int depth) \96 int width, int height, int sign, int depth) \
97 { \97 { \
98 const unsigned offset = sign ? (1 << (D - 1)) : 0; \
98 int i, j; \99 int i, j; \
99 for (i = 0; i < height; i++) { \100 for (i = 0; i < height; i++) { \
100 PIXEL *line = (PIXEL*)(frame->data[0] + i * frame->linesize[0]); \101 PIXEL *line = (PIXEL*)(frame->data[0] + i * frame->linesize[0]); \
101 for (j = 0; j < width; j++) { \102 for (j = 0; j < width; j++) { \
102 unsigned val; \103 unsigned val = bytestream2_get_ ##suffix##u(g) << (D - depth); \
103 if (sign) \104 val ^= offset; \
104 val = (PIXEL)bytestream2_get_ ##suffix##u(g) + (1 << (depth - 1)); \
105 else \
106 val = bytestream2_get_ ##suffix##u(g); \
107 val <<= (D - depth); \
108 *(line + j) = val; \105 *(line + j) = val; \
109 } \106 } \
110 } \107 } \

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