Browse code

avfilter/xbr: make xbr[234]x a bit more consistent

Clément Bœsch authored on 2014/11/16 05:04:49
Showing 1 changed files
... ...
@@ -181,8 +181,8 @@ static uint32_t pixel_diff(uint32_t x, uint32_t y, const uint32_t *r2y)
181 181
 
182 182
 static void xbr2x(AVFrame * input, AVFrame * output, const uint32_t * r2y)
183 183
 {
184
-    int x,y;
185
-    int next_line = output->linesize[0]>>2;
184
+    int x, y;
185
+    const int nl = output->linesize[0] >> 2;
186 186
 
187 187
     for (y = 0; y < input->height; y++) {
188 188
         INIT_SRC_DST_POINTERS(2)
... ...
@@ -190,12 +190,12 @@ static void xbr2x(AVFrame * input, AVFrame * output, const uint32_t * r2y)
190 190
         for (x = 0; x < input->width; x++) {
191 191
             INIT_21_PIXELS
192 192
 
193
-            E[0] = E[1] = E[next_line] = E[next_line + 1] = PE; // 0, 1, 2, 3
193
+            E[0] = E[1] = E[nl] = E[nl + 1] = PE; // 0, 1, 2, 3
194 194
 
195
-            FILT2(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, next_line, next_line+1);
196
-            FILT2(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, next_line, 0, next_line+1, 1);
197
-            FILT2(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, next_line+1, next_line, 1, 0);
198
-            FILT2(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 1, next_line+1, 0, next_line);
195
+            FILT2(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, nl, nl+1);
196
+            FILT2(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, nl, 0, nl+1, 1);
197
+            FILT2(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, nl+1, nl, 1, 0);
198
+            FILT2(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 1, nl+1, 0, nl);
199 199
 
200 200
             sa0 += 1;
201 201
             sa1 += 1;
... ...
@@ -250,14 +250,14 @@ static void xbr2x(AVFrame * input, AVFrame * output, const uint32_t * r2y)
250 250
 
251 251
 static void xbr3x(AVFrame *input, AVFrame *output, const uint32_t *r2y)
252 252
 {
253
-    const int nl = output->linesize[0]>>2;
253
+    int x, y;
254
+    const int nl = output->linesize[0] >> 2;
254 255
     const int nl1 = nl + nl;
255
-    int x,y;
256 256
 
257 257
     for (y = 0; y < input->height; y++) {
258 258
         INIT_SRC_DST_POINTERS(3)
259 259
 
260
-        for (x = 0; x < input->width; x++){
260
+        for (x = 0; x < input->width; x++) {
261 261
             INIT_21_PIXELS
262 262
 
263 263
             E[0]   = E[1]     = E[2]     = PE;
... ...
@@ -326,11 +326,10 @@ static void xbr3x(AVFrame *input, AVFrame *output, const uint32_t *r2y)
326 326
 
327 327
 static void xbr4x(AVFrame *input, AVFrame *output, const uint32_t *r2y)
328 328
 {
329
-
330
-    const int nl = output->linesize[0]>>2;
329
+    int x, y;
330
+    const int nl = output->linesize[0] >> 2;
331 331
     const int nl1 = nl + nl;
332 332
     const int nl2 = nl1 + nl;
333
-    int x, y;
334 333
 
335 334
     for (y = 0; y < input->height; y++) {
336 335
         INIT_SRC_DST_POINTERS(4)