Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

feather.h

Go to the documentation of this file.
00001 /* Only for odd N */
00002 #define DO_FEATHER_MAX_N 30
00003 
00004 #define DO_FEATHER_3(type, int_type, max, N); \
00005 { \
00006         int offset = N / 2; \
00007         int frame_w = input->get_w(); \
00008         int frame_h = input->get_h(); \
00009         int start_in = start_out - offset; \
00010         int end_in = end_out + offset; \
00011         type **in_rows = (type**)input->get_rows(); \
00012         type **out_rows = (type**)output->get_rows(); \
00013         int i,j; \
00014         int_type tmp1, tmp2; \
00015         int_type SR0, SR1; \
00016         int_type *SC0 = new int_type[(frame_w + offset * 2) * 2]; \
00017         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 2); \
00018         for (i = start_in; i < end_in; i++) \
00019         { \
00020                 type *in_row; \
00021                 if (i < 0) \
00022                         in_row = in_rows[0]; \
00023                 else if (i >= frame_h) \
00024                         in_row = in_rows[frame_h - 1]; \
00025                 else \
00026                         in_row = in_rows[i]; \
00027                 SR0 = SR1 = 0; \
00028               { \
00029                         type *out_row; \
00030                         if (i >= start_out + offset && i<= end_out + offset) \
00031                                 out_row = out_rows[i - offset]; \
00032                         else \
00033                                 out_row = 0; \
00034                         int_type *SC = SC0; \
00035                         for (j = 0; j < frame_w + offset * 2; j++) \
00036                         { \
00037                                 if (j < offset) \
00038                                         tmp1 = in_row[0]; \
00039                                 else if (j >= frame_w + offset) \
00040                                         tmp1 = in_row[frame_w - 1]; \
00041                                 else \
00042                                         tmp1 = in_row[j - offset]; \
00043                                 tmp2 = SR0 + tmp1; \
00044                                 SR0 = tmp1; \
00045                                 tmp1 = SR1 + tmp2; \
00046                                 SR1 = tmp2; \
00047                                 tmp2 = SC[0] + tmp1; \
00048                                 SC[0] = tmp1; \
00049                                 if (j >= offset * 2) \
00050                                         if (out_row) out_row[j - offset * 2] = (8 + SC[1] + tmp2) >> 4; \
00051                                 SC[1] = tmp2; \
00052                                 SC += 2;\
00053                         } \
00054                 } \
00055         } \
00056         delete [] SC0; \
00057 }
00058 #define DO_FEATHER_5(type, int_type, max, N); \
00059 { \
00060         int offset = N / 2; \
00061         int frame_w = input->get_w(); \
00062         int frame_h = input->get_h(); \
00063         int start_in = start_out - offset; \
00064         int end_in = end_out + offset; \
00065         type **in_rows = (type**)input->get_rows(); \
00066         type **out_rows = (type**)output->get_rows(); \
00067         int i,j; \
00068         int_type tmp1, tmp2; \
00069         int_type SR0, SR1, SR2, SR3; \
00070         int_type *SC0 = new int_type[(frame_w + offset * 2) * 4]; \
00071         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 4); \
00072         for (i = start_in; i < end_in; i++) \
00073         { \
00074                 type *in_row; \
00075                 if (i < 0) \
00076                         in_row = in_rows[0]; \
00077                 else if (i >= frame_h) \
00078                         in_row = in_rows[frame_h - 1]; \
00079                 else \
00080                         in_row = in_rows[i]; \
00081                 SR0 = SR1 = SR2 = SR3 = 0; \
00082               { \
00083                         type *out_row; \
00084                         if (i >= start_out + offset && i<= end_out + offset) \
00085                                 out_row = out_rows[i - offset]; \
00086                         else \
00087                                 out_row = 0; \
00088                         int_type *SC = SC0; \
00089                         for (j = 0; j < frame_w + offset * 2; j++) \
00090                         { \
00091                                 if (j < offset) \
00092                                         tmp1 = in_row[0]; \
00093                                 else if (j >= frame_w + offset) \
00094                                         tmp1 = in_row[frame_w - 1]; \
00095                                 else \
00096                                         tmp1 = in_row[j - offset]; \
00097                                 tmp2 = SR0 + tmp1; \
00098                                 SR0 = tmp1; \
00099                                 tmp1 = SR1 + tmp2; \
00100                                 SR1 = tmp2; \
00101                                 tmp2 = SR2 + tmp1; \
00102                                 SR2 = tmp1; \
00103                                 tmp1 = SR3 + tmp2; \
00104                                 SR3 = tmp2; \
00105                                 tmp2 = SC[0] + tmp1; \
00106                                 SC[0] = tmp1; \
00107                                 tmp1 = SC[1] + tmp2; \
00108                                 SC[1] = tmp2; \
00109                                 tmp2 = SC[2] + tmp1; \
00110                                 SC[2] = tmp1; \
00111                                 if (j >= offset * 2) \
00112                                         if (out_row) out_row[j - offset * 2] = (128 + SC[3] + tmp2) >> 8; \
00113                                 SC[3] = tmp2; \
00114                                 SC += 4;\
00115                         } \
00116                 } \
00117         } \
00118         delete [] SC0; \
00119 }
00120 #define DO_FEATHER_7(type, int_type, max, N); \
00121 { \
00122         int offset = N / 2; \
00123         int frame_w = input->get_w(); \
00124         int frame_h = input->get_h(); \
00125         int start_in = start_out - offset; \
00126         int end_in = end_out + offset; \
00127         type **in_rows = (type**)input->get_rows(); \
00128         type **out_rows = (type**)output->get_rows(); \
00129         int i,j; \
00130         int_type tmp1, tmp2; \
00131         int_type SR0, SR1, SR2, SR3, SR4, SR5; \
00132         int_type *SC0 = new int_type[(frame_w + offset * 2) * 6]; \
00133         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 6); \
00134         for (i = start_in; i < end_in; i++) \
00135         { \
00136                 type *in_row; \
00137                 if (i < 0) \
00138                         in_row = in_rows[0]; \
00139                 else if (i >= frame_h) \
00140                         in_row = in_rows[frame_h - 1]; \
00141                 else \
00142                         in_row = in_rows[i]; \
00143                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = 0; \
00144               { \
00145                         type *out_row; \
00146                         if (i >= start_out + offset && i<= end_out + offset) \
00147                                 out_row = out_rows[i - offset]; \
00148                         else \
00149                                 out_row = 0; \
00150                         int_type *SC = SC0; \
00151                         for (j = 0; j < frame_w + offset * 2; j++) \
00152                         { \
00153                                 if (j < offset) \
00154                                         tmp1 = in_row[0]; \
00155                                 else if (j >= frame_w + offset) \
00156                                         tmp1 = in_row[frame_w - 1]; \
00157                                 else \
00158                                         tmp1 = in_row[j - offset]; \
00159                                 tmp2 = SR0 + tmp1; \
00160                                 SR0 = tmp1; \
00161                                 tmp1 = SR1 + tmp2; \
00162                                 SR1 = tmp2; \
00163                                 tmp2 = SR2 + tmp1; \
00164                                 SR2 = tmp1; \
00165                                 tmp1 = SR3 + tmp2; \
00166                                 SR3 = tmp2; \
00167                                 tmp2 = SR4 + tmp1; \
00168                                 SR4 = tmp1; \
00169                                 tmp1 = SR5 + tmp2; \
00170                                 SR5 = tmp2; \
00171                                 tmp2 = SC[0] + tmp1; \
00172                                 SC[0] = tmp1; \
00173                                 tmp1 = SC[1] + tmp2; \
00174                                 SC[1] = tmp2; \
00175                                 tmp2 = SC[2] + tmp1; \
00176                                 SC[2] = tmp1; \
00177                                 tmp1 = SC[3] + tmp2; \
00178                                 SC[3] = tmp2; \
00179                                 tmp2 = SC[4] + tmp1; \
00180                                 SC[4] = tmp1; \
00181                                 if (j >= offset * 2) \
00182                                         if (out_row) out_row[j - offset * 2] = (2048 + SC[5] + tmp2) >> 12; \
00183                                 SC[5] = tmp2; \
00184                                 SC += 6;\
00185                         } \
00186                 } \
00187         } \
00188         delete [] SC0; \
00189 }
00190 #define DO_FEATHER_9(type, int_type, max, N); \
00191 { \
00192         int offset = N / 2; \
00193         int frame_w = input->get_w(); \
00194         int frame_h = input->get_h(); \
00195         int start_in = start_out - offset; \
00196         int end_in = end_out + offset; \
00197         type **in_rows = (type**)input->get_rows(); \
00198         type **out_rows = (type**)output->get_rows(); \
00199         int i,j; \
00200         int_type tmp1, tmp2; \
00201         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7; \
00202         int_type *SC0 = new int_type[(frame_w + offset * 2) * 8]; \
00203         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 8); \
00204         for (i = start_in; i < end_in; i++) \
00205         { \
00206                 type *in_row; \
00207                 if (i < 0) \
00208                         in_row = in_rows[0]; \
00209                 else if (i >= frame_h) \
00210                         in_row = in_rows[frame_h - 1]; \
00211                 else \
00212                         in_row = in_rows[i]; \
00213                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = 0; \
00214               { \
00215                         type *out_row; \
00216                         if (i >= start_out + offset && i<= end_out + offset) \
00217                                 out_row = out_rows[i - offset]; \
00218                         else \
00219                                 out_row = 0; \
00220                         int_type *SC = SC0; \
00221                         for (j = 0; j < frame_w + offset * 2; j++) \
00222                         { \
00223                                 if (j < offset) \
00224                                         tmp1 = in_row[0]; \
00225                                 else if (j >= frame_w + offset) \
00226                                         tmp1 = in_row[frame_w - 1]; \
00227                                 else \
00228                                         tmp1 = in_row[j - offset]; \
00229                                 tmp2 = SR0 + tmp1; \
00230                                 SR0 = tmp1; \
00231                                 tmp1 = SR1 + tmp2; \
00232                                 SR1 = tmp2; \
00233                                 tmp2 = SR2 + tmp1; \
00234                                 SR2 = tmp1; \
00235                                 tmp1 = SR3 + tmp2; \
00236                                 SR3 = tmp2; \
00237                                 tmp2 = SR4 + tmp1; \
00238                                 SR4 = tmp1; \
00239                                 tmp1 = SR5 + tmp2; \
00240                                 SR5 = tmp2; \
00241                                 tmp2 = SR6 + tmp1; \
00242                                 SR6 = tmp1; \
00243                                 tmp1 = SR7 + tmp2; \
00244                                 SR7 = tmp2; \
00245                                 tmp2 = SC[0] + tmp1; \
00246                                 SC[0] = tmp1; \
00247                                 tmp1 = SC[1] + tmp2; \
00248                                 SC[1] = tmp2; \
00249                                 tmp2 = SC[2] + tmp1; \
00250                                 SC[2] = tmp1; \
00251                                 tmp1 = SC[3] + tmp2; \
00252                                 SC[3] = tmp2; \
00253                                 tmp2 = SC[4] + tmp1; \
00254                                 SC[4] = tmp1; \
00255                                 tmp1 = SC[5] + tmp2; \
00256                                 SC[5] = tmp2; \
00257                                 tmp2 = SC[6] + tmp1; \
00258                                 SC[6] = tmp1; \
00259                                 if (j >= offset * 2) \
00260                                         if (out_row) out_row[j - offset * 2] = (32768 + SC[7] + tmp2) >> 16; \
00261                                 SC[7] = tmp2; \
00262                                 SC += 8;\
00263                         } \
00264                 } \
00265         } \
00266         delete [] SC0; \
00267 }
00268 #define DO_FEATHER_11(type, int_type, max, N); \
00269 { \
00270         int offset = N / 2; \
00271         int frame_w = input->get_w(); \
00272         int frame_h = input->get_h(); \
00273         int start_in = start_out - offset; \
00274         int end_in = end_out + offset; \
00275         type **in_rows = (type**)input->get_rows(); \
00276         type **out_rows = (type**)output->get_rows(); \
00277         int i,j; \
00278         int_type tmp1, tmp2; \
00279         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9; \
00280         int_type *SC0 = new int_type[(frame_w + offset * 2) * 10]; \
00281         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 10); \
00282         for (i = start_in; i < end_in; i++) \
00283         { \
00284                 type *in_row; \
00285                 if (i < 0) \
00286                         in_row = in_rows[0]; \
00287                 else if (i >= frame_h) \
00288                         in_row = in_rows[frame_h - 1]; \
00289                 else \
00290                         in_row = in_rows[i]; \
00291                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = 0; \
00292               { \
00293                         type *out_row; \
00294                         if (i >= start_out + offset && i<= end_out + offset) \
00295                                 out_row = out_rows[i - offset]; \
00296                         else \
00297                                 out_row = 0; \
00298                         int_type *SC = SC0; \
00299                         for (j = 0; j < frame_w + offset * 2; j++) \
00300                         { \
00301                                 if (j < offset) \
00302                                         tmp1 = in_row[0]; \
00303                                 else if (j >= frame_w + offset) \
00304                                         tmp1 = in_row[frame_w - 1]; \
00305                                 else \
00306                                         tmp1 = in_row[j - offset]; \
00307                                 tmp2 = SR0 + tmp1; \
00308                                 SR0 = tmp1; \
00309                                 tmp1 = SR1 + tmp2; \
00310                                 SR1 = tmp2; \
00311                                 tmp2 = SR2 + tmp1; \
00312                                 SR2 = tmp1; \
00313                                 tmp1 = SR3 + tmp2; \
00314                                 SR3 = tmp2; \
00315                                 tmp2 = SR4 + tmp1; \
00316                                 SR4 = tmp1; \
00317                                 tmp1 = SR5 + tmp2; \
00318                                 SR5 = tmp2; \
00319                                 tmp2 = SR6 + tmp1; \
00320                                 SR6 = tmp1; \
00321                                 tmp1 = SR7 + tmp2; \
00322                                 SR7 = tmp2; \
00323                                 tmp2 = SR8 + tmp1; \
00324                                 SR8 = tmp1; \
00325                                 tmp1 = SR9 + tmp2; \
00326                                 SR9 = tmp2; \
00327                                 tmp2 = SC[0] + tmp1; \
00328                                 SC[0] = tmp1; \
00329                                 tmp1 = SC[1] + tmp2; \
00330                                 SC[1] = tmp2; \
00331                                 tmp2 = SC[2] + tmp1; \
00332                                 SC[2] = tmp1; \
00333                                 tmp1 = SC[3] + tmp2; \
00334                                 SC[3] = tmp2; \
00335                                 tmp2 = SC[4] + tmp1; \
00336                                 SC[4] = tmp1; \
00337                                 tmp1 = SC[5] + tmp2; \
00338                                 SC[5] = tmp2; \
00339                                 tmp2 = SC[6] + tmp1; \
00340                                 SC[6] = tmp1; \
00341                                 tmp1 = SC[7] + tmp2; \
00342                                 SC[7] = tmp2; \
00343                                 tmp2 = SC[8] + tmp1; \
00344                                 SC[8] = tmp1; \
00345                                 if (j >= offset * 2) \
00346                                         if (out_row) out_row[j - offset * 2] = (524288 + SC[9] + tmp2) >> 20; \
00347                                 SC[9] = tmp2; \
00348                                 SC += 10;\
00349                         } \
00350                 } \
00351         } \
00352         delete [] SC0; \
00353 }
00354 #define DO_FEATHER_13(type, int_type, max, N); \
00355 { \
00356         int offset = N / 2; \
00357         int frame_w = input->get_w(); \
00358         int frame_h = input->get_h(); \
00359         int start_in = start_out - offset; \
00360         int end_in = end_out + offset; \
00361         type **in_rows = (type**)input->get_rows(); \
00362         type **out_rows = (type**)output->get_rows(); \
00363         int i,j; \
00364         int_type tmp1, tmp2; \
00365         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11; \
00366         int_type *SC0 = new int_type[(frame_w + offset * 2) * 12]; \
00367         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 12); \
00368         for (i = start_in; i < end_in; i++) \
00369         { \
00370                 type *in_row; \
00371                 if (i < 0) \
00372                         in_row = in_rows[0]; \
00373                 else if (i >= frame_h) \
00374                         in_row = in_rows[frame_h - 1]; \
00375                 else \
00376                         in_row = in_rows[i]; \
00377                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = 0; \
00378               { \
00379                         type *out_row; \
00380                         if (i >= start_out + offset && i<= end_out + offset) \
00381                                 out_row = out_rows[i - offset]; \
00382                         else \
00383                                 out_row = 0; \
00384                         int_type *SC = SC0; \
00385                         for (j = 0; j < frame_w + offset * 2; j++) \
00386                         { \
00387                                 if (j < offset) \
00388                                         tmp1 = in_row[0]; \
00389                                 else if (j >= frame_w + offset) \
00390                                         tmp1 = in_row[frame_w - 1]; \
00391                                 else \
00392                                         tmp1 = in_row[j - offset]; \
00393                                 tmp2 = SR0 + tmp1; \
00394                                 SR0 = tmp1; \
00395                                 tmp1 = SR1 + tmp2; \
00396                                 SR1 = tmp2; \
00397                                 tmp2 = SR2 + tmp1; \
00398                                 SR2 = tmp1; \
00399                                 tmp1 = SR3 + tmp2; \
00400                                 SR3 = tmp2; \
00401                                 tmp2 = SR4 + tmp1; \
00402                                 SR4 = tmp1; \
00403                                 tmp1 = SR5 + tmp2; \
00404                                 SR5 = tmp2; \
00405                                 tmp2 = SR6 + tmp1; \
00406                                 SR6 = tmp1; \
00407                                 tmp1 = SR7 + tmp2; \
00408                                 SR7 = tmp2; \
00409                                 tmp2 = SR8 + tmp1; \
00410                                 SR8 = tmp1; \
00411                                 tmp1 = SR9 + tmp2; \
00412                                 SR9 = tmp2; \
00413                                 tmp2 = SR10 + tmp1; \
00414                                 SR10 = tmp1; \
00415                                 tmp1 = SR11 + tmp2; \
00416                                 SR11 = tmp2; \
00417                                 tmp2 = SC[0] + tmp1; \
00418                                 SC[0] = tmp1; \
00419                                 tmp1 = SC[1] + tmp2; \
00420                                 SC[1] = tmp2; \
00421                                 tmp2 = SC[2] + tmp1; \
00422                                 SC[2] = tmp1; \
00423                                 tmp1 = SC[3] + tmp2; \
00424                                 SC[3] = tmp2; \
00425                                 tmp2 = SC[4] + tmp1; \
00426                                 SC[4] = tmp1; \
00427                                 tmp1 = SC[5] + tmp2; \
00428                                 SC[5] = tmp2; \
00429                                 tmp2 = SC[6] + tmp1; \
00430                                 SC[6] = tmp1; \
00431                                 tmp1 = SC[7] + tmp2; \
00432                                 SC[7] = tmp2; \
00433                                 tmp2 = SC[8] + tmp1; \
00434                                 SC[8] = tmp1; \
00435                                 tmp1 = SC[9] + tmp2; \
00436                                 SC[9] = tmp2; \
00437                                 tmp2 = SC[10] + tmp1; \
00438                                 SC[10] = tmp1; \
00439                                 if (j >= offset * 2) \
00440                                         if (out_row) out_row[j - offset * 2] = (8388608 + SC[11] + tmp2) >> 24; \
00441                                 SC[11] = tmp2; \
00442                                 SC += 12;\
00443                         } \
00444                 } \
00445         } \
00446         delete [] SC0; \
00447 }
00448 #define DO_FEATHER_15(type, int_type, max, N); \
00449 { \
00450         int offset = N / 2; \
00451         int frame_w = input->get_w(); \
00452         int frame_h = input->get_h(); \
00453         int start_in = start_out - offset; \
00454         int end_in = end_out + offset; \
00455         type **in_rows = (type**)input->get_rows(); \
00456         type **out_rows = (type**)output->get_rows(); \
00457         int i,j; \
00458         int_type tmp1, tmp2; \
00459         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13; \
00460         int_type *SC0 = new int_type[(frame_w + offset * 2) * 14]; \
00461         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 14); \
00462         for (i = start_in; i < end_in; i++) \
00463         { \
00464                 type *in_row; \
00465                 if (i < 0) \
00466                         in_row = in_rows[0]; \
00467                 else if (i >= frame_h) \
00468                         in_row = in_rows[frame_h - 1]; \
00469                 else \
00470                         in_row = in_rows[i]; \
00471                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = 0; \
00472               { \
00473                         type *out_row; \
00474                         if (i >= start_out + offset && i<= end_out + offset) \
00475                                 out_row = out_rows[i - offset]; \
00476                         else \
00477                                 out_row = 0; \
00478                         int_type *SC = SC0; \
00479                         for (j = 0; j < frame_w + offset * 2; j++) \
00480                         { \
00481                                 if (j < offset) \
00482                                         tmp1 = in_row[0]; \
00483                                 else if (j >= frame_w + offset) \
00484                                         tmp1 = in_row[frame_w - 1]; \
00485                                 else \
00486                                         tmp1 = in_row[j - offset]; \
00487                                 tmp2 = SR0 + tmp1; \
00488                                 SR0 = tmp1; \
00489                                 tmp1 = SR1 + tmp2; \
00490                                 SR1 = tmp2; \
00491                                 tmp2 = SR2 + tmp1; \
00492                                 SR2 = tmp1; \
00493                                 tmp1 = SR3 + tmp2; \
00494                                 SR3 = tmp2; \
00495                                 tmp2 = SR4 + tmp1; \
00496                                 SR4 = tmp1; \
00497                                 tmp1 = SR5 + tmp2; \
00498                                 SR5 = tmp2; \
00499                                 tmp2 = SR6 + tmp1; \
00500                                 SR6 = tmp1; \
00501                                 tmp1 = SR7 + tmp2; \
00502                                 SR7 = tmp2; \
00503                                 tmp2 = SR8 + tmp1; \
00504                                 SR8 = tmp1; \
00505                                 tmp1 = SR9 + tmp2; \
00506                                 SR9 = tmp2; \
00507                                 tmp2 = SR10 + tmp1; \
00508                                 SR10 = tmp1; \
00509                                 tmp1 = SR11 + tmp2; \
00510                                 SR11 = tmp2; \
00511                                 tmp2 = SR12 + tmp1; \
00512                                 SR12 = tmp1; \
00513                                 tmp1 = SR13 + tmp2; \
00514                                 SR13 = tmp2; \
00515                                 tmp2 = SC[0] + tmp1; \
00516                                 SC[0] = tmp1; \
00517                                 tmp1 = SC[1] + tmp2; \
00518                                 SC[1] = tmp2; \
00519                                 tmp2 = SC[2] + tmp1; \
00520                                 SC[2] = tmp1; \
00521                                 tmp1 = SC[3] + tmp2; \
00522                                 SC[3] = tmp2; \
00523                                 tmp2 = SC[4] + tmp1; \
00524                                 SC[4] = tmp1; \
00525                                 tmp1 = SC[5] + tmp2; \
00526                                 SC[5] = tmp2; \
00527                                 tmp2 = SC[6] + tmp1; \
00528                                 SC[6] = tmp1; \
00529                                 tmp1 = SC[7] + tmp2; \
00530                                 SC[7] = tmp2; \
00531                                 tmp2 = SC[8] + tmp1; \
00532                                 SC[8] = tmp1; \
00533                                 tmp1 = SC[9] + tmp2; \
00534                                 SC[9] = tmp2; \
00535                                 tmp2 = SC[10] + tmp1; \
00536                                 SC[10] = tmp1; \
00537                                 tmp1 = SC[11] + tmp2; \
00538                                 SC[11] = tmp2; \
00539                                 tmp2 = SC[12] + tmp1; \
00540                                 SC[12] = tmp1; \
00541                                 if (j >= offset * 2) \
00542                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<27) + SC[13] + tmp2) >> 28; \
00543                                 SC[13] = tmp2; \
00544                                 SC += 14;\
00545                         } \
00546                 } \
00547         } \
00548         delete [] SC0; \
00549 }
00550 #define DO_FEATHER_17(type, int_type, max, N); \
00551 { \
00552         int offset = N / 2; \
00553         int frame_w = input->get_w(); \
00554         int frame_h = input->get_h(); \
00555         int start_in = start_out - offset; \
00556         int end_in = end_out + offset; \
00557         type **in_rows = (type**)input->get_rows(); \
00558         type **out_rows = (type**)output->get_rows(); \
00559         int i,j; \
00560         int_type tmp1, tmp2; \
00561         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15; \
00562         int_type *SC0 = new int_type[(frame_w + offset * 2) * 16]; \
00563         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 16); \
00564         for (i = start_in; i < end_in; i++) \
00565         { \
00566                 type *in_row; \
00567                 if (i < 0) \
00568                         in_row = in_rows[0]; \
00569                 else if (i >= frame_h) \
00570                         in_row = in_rows[frame_h - 1]; \
00571                 else \
00572                         in_row = in_rows[i]; \
00573                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = 0; \
00574               { \
00575                         type *out_row; \
00576                         if (i >= start_out + offset && i<= end_out + offset) \
00577                                 out_row = out_rows[i - offset]; \
00578                         else \
00579                                 out_row = 0; \
00580                         int_type *SC = SC0; \
00581                         for (j = 0; j < frame_w + offset * 2; j++) \
00582                         { \
00583                                 if (j < offset) \
00584                                         tmp1 = in_row[0]; \
00585                                 else if (j >= frame_w + offset) \
00586                                         tmp1 = in_row[frame_w - 1]; \
00587                                 else \
00588                                         tmp1 = in_row[j - offset]; \
00589                                 tmp2 = SR0 + tmp1; \
00590                                 SR0 = tmp1; \
00591                                 tmp1 = SR1 + tmp2; \
00592                                 SR1 = tmp2; \
00593                                 tmp2 = SR2 + tmp1; \
00594                                 SR2 = tmp1; \
00595                                 tmp1 = SR3 + tmp2; \
00596                                 SR3 = tmp2; \
00597                                 tmp2 = SR4 + tmp1; \
00598                                 SR4 = tmp1; \
00599                                 tmp1 = SR5 + tmp2; \
00600                                 SR5 = tmp2; \
00601                                 tmp2 = SR6 + tmp1; \
00602                                 SR6 = tmp1; \
00603                                 tmp1 = SR7 + tmp2; \
00604                                 SR7 = tmp2; \
00605                                 tmp2 = SR8 + tmp1; \
00606                                 SR8 = tmp1; \
00607                                 tmp1 = SR9 + tmp2; \
00608                                 SR9 = tmp2; \
00609                                 tmp2 = SR10 + tmp1; \
00610                                 SR10 = tmp1; \
00611                                 tmp1 = SR11 + tmp2; \
00612                                 SR11 = tmp2; \
00613                                 tmp2 = SR12 + tmp1; \
00614                                 SR12 = tmp1; \
00615                                 tmp1 = SR13 + tmp2; \
00616                                 SR13 = tmp2; \
00617                                 tmp2 = SR14 + tmp1; \
00618                                 SR14 = tmp1; \
00619                                 tmp1 = SR15 + tmp2; \
00620                                 SR15 = tmp2; \
00621                                 tmp2 = SC[0] + tmp1; \
00622                                 SC[0] = tmp1; \
00623                                 tmp1 = SC[1] + tmp2; \
00624                                 SC[1] = tmp2; \
00625                                 tmp2 = SC[2] + tmp1; \
00626                                 SC[2] = tmp1; \
00627                                 tmp1 = SC[3] + tmp2; \
00628                                 SC[3] = tmp2; \
00629                                 tmp2 = SC[4] + tmp1; \
00630                                 SC[4] = tmp1; \
00631                                 tmp1 = SC[5] + tmp2; \
00632                                 SC[5] = tmp2; \
00633                                 tmp2 = SC[6] + tmp1; \
00634                                 SC[6] = tmp1; \
00635                                 tmp1 = SC[7] + tmp2; \
00636                                 SC[7] = tmp2; \
00637                                 tmp2 = SC[8] + tmp1; \
00638                                 SC[8] = tmp1; \
00639                                 tmp1 = SC[9] + tmp2; \
00640                                 SC[9] = tmp2; \
00641                                 tmp2 = SC[10] + tmp1; \
00642                                 SC[10] = tmp1; \
00643                                 tmp1 = SC[11] + tmp2; \
00644                                 SC[11] = tmp2; \
00645                                 tmp2 = SC[12] + tmp1; \
00646                                 SC[12] = tmp1; \
00647                                 tmp1 = SC[13] + tmp2; \
00648                                 SC[13] = tmp2; \
00649                                 tmp2 = SC[14] + tmp1; \
00650                                 SC[14] = tmp1; \
00651                                 if (j >= offset * 2) \
00652                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<31) + SC[15] + tmp2) >> 32; \
00653                                 SC[15] = tmp2; \
00654                                 SC += 16;\
00655                         } \
00656                 } \
00657         } \
00658         delete [] SC0; \
00659 }
00660 #define DO_FEATHER_19(type, int_type, max, N); \
00661 { \
00662         int offset = N / 2; \
00663         int frame_w = input->get_w(); \
00664         int frame_h = input->get_h(); \
00665         int start_in = start_out - offset; \
00666         int end_in = end_out + offset; \
00667         type **in_rows = (type**)input->get_rows(); \
00668         type **out_rows = (type**)output->get_rows(); \
00669         int i,j; \
00670         int_type tmp1, tmp2; \
00671         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17; \
00672         int_type *SC0 = new int_type[(frame_w + offset * 2) * 18]; \
00673         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 18); \
00674         for (i = start_in; i < end_in; i++) \
00675         { \
00676                 type *in_row; \
00677                 if (i < 0) \
00678                         in_row = in_rows[0]; \
00679                 else if (i >= frame_h) \
00680                         in_row = in_rows[frame_h - 1]; \
00681                 else \
00682                         in_row = in_rows[i]; \
00683                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = 0; \
00684               { \
00685                         type *out_row; \
00686                         if (i >= start_out + offset && i<= end_out + offset) \
00687                                 out_row = out_rows[i - offset]; \
00688                         else \
00689                                 out_row = 0; \
00690                         int_type *SC = SC0; \
00691                         for (j = 0; j < frame_w + offset * 2; j++) \
00692                         { \
00693                                 if (j < offset) \
00694                                         tmp1 = in_row[0]; \
00695                                 else if (j >= frame_w + offset) \
00696                                         tmp1 = in_row[frame_w - 1]; \
00697                                 else \
00698                                         tmp1 = in_row[j - offset]; \
00699                                 tmp2 = SR0 + tmp1; \
00700                                 SR0 = tmp1; \
00701                                 tmp1 = SR1 + tmp2; \
00702                                 SR1 = tmp2; \
00703                                 tmp2 = SR2 + tmp1; \
00704                                 SR2 = tmp1; \
00705                                 tmp1 = SR3 + tmp2; \
00706                                 SR3 = tmp2; \
00707                                 tmp2 = SR4 + tmp1; \
00708                                 SR4 = tmp1; \
00709                                 tmp1 = SR5 + tmp2; \
00710                                 SR5 = tmp2; \
00711                                 tmp2 = SR6 + tmp1; \
00712                                 SR6 = tmp1; \
00713                                 tmp1 = SR7 + tmp2; \
00714                                 SR7 = tmp2; \
00715                                 tmp2 = SR8 + tmp1; \
00716                                 SR8 = tmp1; \
00717                                 tmp1 = SR9 + tmp2; \
00718                                 SR9 = tmp2; \
00719                                 tmp2 = SR10 + tmp1; \
00720                                 SR10 = tmp1; \
00721                                 tmp1 = SR11 + tmp2; \
00722                                 SR11 = tmp2; \
00723                                 tmp2 = SR12 + tmp1; \
00724                                 SR12 = tmp1; \
00725                                 tmp1 = SR13 + tmp2; \
00726                                 SR13 = tmp2; \
00727                                 tmp2 = SR14 + tmp1; \
00728                                 SR14 = tmp1; \
00729                                 tmp1 = SR15 + tmp2; \
00730                                 SR15 = tmp2; \
00731                                 tmp2 = SR16 + tmp1; \
00732                                 SR16 = tmp1; \
00733                                 tmp1 = SR17 + tmp2; \
00734                                 SR17 = tmp2; \
00735                                 tmp2 = SC[0] + tmp1; \
00736                                 SC[0] = tmp1; \
00737                                 tmp1 = SC[1] + tmp2; \
00738                                 SC[1] = tmp2; \
00739                                 tmp2 = SC[2] + tmp1; \
00740                                 SC[2] = tmp1; \
00741                                 tmp1 = SC[3] + tmp2; \
00742                                 SC[3] = tmp2; \
00743                                 tmp2 = SC[4] + tmp1; \
00744                                 SC[4] = tmp1; \
00745                                 tmp1 = SC[5] + tmp2; \
00746                                 SC[5] = tmp2; \
00747                                 tmp2 = SC[6] + tmp1; \
00748                                 SC[6] = tmp1; \
00749                                 tmp1 = SC[7] + tmp2; \
00750                                 SC[7] = tmp2; \
00751                                 tmp2 = SC[8] + tmp1; \
00752                                 SC[8] = tmp1; \
00753                                 tmp1 = SC[9] + tmp2; \
00754                                 SC[9] = tmp2; \
00755                                 tmp2 = SC[10] + tmp1; \
00756                                 SC[10] = tmp1; \
00757                                 tmp1 = SC[11] + tmp2; \
00758                                 SC[11] = tmp2; \
00759                                 tmp2 = SC[12] + tmp1; \
00760                                 SC[12] = tmp1; \
00761                                 tmp1 = SC[13] + tmp2; \
00762                                 SC[13] = tmp2; \
00763                                 tmp2 = SC[14] + tmp1; \
00764                                 SC[14] = tmp1; \
00765                                 tmp1 = SC[15] + tmp2; \
00766                                 SC[15] = tmp2; \
00767                                 tmp2 = SC[16] + tmp1; \
00768                                 SC[16] = tmp1; \
00769                                 if (j >= offset * 2) \
00770                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<35) + SC[17] + tmp2) >> 36; \
00771                                 SC[17] = tmp2; \
00772                                 SC += 18;\
00773                         } \
00774                 } \
00775         } \
00776         delete [] SC0; \
00777 }
00778 #define DO_FEATHER_21(type, int_type, max, N); \
00779 { \
00780         int offset = N / 2; \
00781         int frame_w = input->get_w(); \
00782         int frame_h = input->get_h(); \
00783         int start_in = start_out - offset; \
00784         int end_in = end_out + offset; \
00785         type **in_rows = (type**)input->get_rows(); \
00786         type **out_rows = (type**)output->get_rows(); \
00787         int i,j; \
00788         int_type tmp1, tmp2; \
00789         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17, SR18, SR19; \
00790         int_type *SC0 = new int_type[(frame_w + offset * 2) * 20]; \
00791         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 20); \
00792         for (i = start_in; i < end_in; i++) \
00793         { \
00794                 type *in_row; \
00795                 if (i < 0) \
00796                         in_row = in_rows[0]; \
00797                 else if (i >= frame_h) \
00798                         in_row = in_rows[frame_h - 1]; \
00799                 else \
00800                         in_row = in_rows[i]; \
00801                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = SR18 = SR19 = 0; \
00802               { \
00803                         type *out_row; \
00804                         if (i >= start_out + offset && i<= end_out + offset) \
00805                                 out_row = out_rows[i - offset]; \
00806                         else \
00807                                 out_row = 0; \
00808                         int_type *SC = SC0; \
00809                         for (j = 0; j < frame_w + offset * 2; j++) \
00810                         { \
00811                                 if (j < offset) \
00812                                         tmp1 = in_row[0]; \
00813                                 else if (j >= frame_w + offset) \
00814                                         tmp1 = in_row[frame_w - 1]; \
00815                                 else \
00816                                         tmp1 = in_row[j - offset]; \
00817                                 tmp2 = SR0 + tmp1; \
00818                                 SR0 = tmp1; \
00819                                 tmp1 = SR1 + tmp2; \
00820                                 SR1 = tmp2; \
00821                                 tmp2 = SR2 + tmp1; \
00822                                 SR2 = tmp1; \
00823                                 tmp1 = SR3 + tmp2; \
00824                                 SR3 = tmp2; \
00825                                 tmp2 = SR4 + tmp1; \
00826                                 SR4 = tmp1; \
00827                                 tmp1 = SR5 + tmp2; \
00828                                 SR5 = tmp2; \
00829                                 tmp2 = SR6 + tmp1; \
00830                                 SR6 = tmp1; \
00831                                 tmp1 = SR7 + tmp2; \
00832                                 SR7 = tmp2; \
00833                                 tmp2 = SR8 + tmp1; \
00834                                 SR8 = tmp1; \
00835                                 tmp1 = SR9 + tmp2; \
00836                                 SR9 = tmp2; \
00837                                 tmp2 = SR10 + tmp1; \
00838                                 SR10 = tmp1; \
00839                                 tmp1 = SR11 + tmp2; \
00840                                 SR11 = tmp2; \
00841                                 tmp2 = SR12 + tmp1; \
00842                                 SR12 = tmp1; \
00843                                 tmp1 = SR13 + tmp2; \
00844                                 SR13 = tmp2; \
00845                                 tmp2 = SR14 + tmp1; \
00846                                 SR14 = tmp1; \
00847                                 tmp1 = SR15 + tmp2; \
00848                                 SR15 = tmp2; \
00849                                 tmp2 = SR16 + tmp1; \
00850                                 SR16 = tmp1; \
00851                                 tmp1 = SR17 + tmp2; \
00852                                 SR17 = tmp2; \
00853                                 tmp2 = SR18 + tmp1; \
00854                                 SR18 = tmp1; \
00855                                 tmp1 = SR19 + tmp2; \
00856                                 SR19 = tmp2; \
00857                                 tmp2 = SC[0] + tmp1; \
00858                                 SC[0] = tmp1; \
00859                                 tmp1 = SC[1] + tmp2; \
00860                                 SC[1] = tmp2; \
00861                                 tmp2 = SC[2] + tmp1; \
00862                                 SC[2] = tmp1; \
00863                                 tmp1 = SC[3] + tmp2; \
00864                                 SC[3] = tmp2; \
00865                                 tmp2 = SC[4] + tmp1; \
00866                                 SC[4] = tmp1; \
00867                                 tmp1 = SC[5] + tmp2; \
00868                                 SC[5] = tmp2; \
00869                                 tmp2 = SC[6] + tmp1; \
00870                                 SC[6] = tmp1; \
00871                                 tmp1 = SC[7] + tmp2; \
00872                                 SC[7] = tmp2; \
00873                                 tmp2 = SC[8] + tmp1; \
00874                                 SC[8] = tmp1; \
00875                                 tmp1 = SC[9] + tmp2; \
00876                                 SC[9] = tmp2; \
00877                                 tmp2 = SC[10] + tmp1; \
00878                                 SC[10] = tmp1; \
00879                                 tmp1 = SC[11] + tmp2; \
00880                                 SC[11] = tmp2; \
00881                                 tmp2 = SC[12] + tmp1; \
00882                                 SC[12] = tmp1; \
00883                                 tmp1 = SC[13] + tmp2; \
00884                                 SC[13] = tmp2; \
00885                                 tmp2 = SC[14] + tmp1; \
00886                                 SC[14] = tmp1; \
00887                                 tmp1 = SC[15] + tmp2; \
00888                                 SC[15] = tmp2; \
00889                                 tmp2 = SC[16] + tmp1; \
00890                                 SC[16] = tmp1; \
00891                                 tmp1 = SC[17] + tmp2; \
00892                                 SC[17] = tmp2; \
00893                                 tmp2 = SC[18] + tmp1; \
00894                                 SC[18] = tmp1; \
00895                                 if (j >= offset * 2) \
00896                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<39) + SC[19] + tmp2) >> 40; \
00897                                 SC[19] = tmp2; \
00898                                 SC += 20;\
00899                         } \
00900                 } \
00901         } \
00902         delete [] SC0; \
00903 }
00904 #define DO_FEATHER_23(type, int_type, max, N); \
00905 { \
00906         int offset = N / 2; \
00907         int frame_w = input->get_w(); \
00908         int frame_h = input->get_h(); \
00909         int start_in = start_out - offset; \
00910         int end_in = end_out + offset; \
00911         type **in_rows = (type**)input->get_rows(); \
00912         type **out_rows = (type**)output->get_rows(); \
00913         int i,j; \
00914         int_type tmp1, tmp2; \
00915         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17, SR18, SR19, SR20, SR21; \
00916         int_type *SC0 = new int_type[(frame_w + offset * 2) * 22]; \
00917         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 22); \
00918         for (i = start_in; i < end_in; i++) \
00919         { \
00920                 type *in_row; \
00921                 if (i < 0) \
00922                         in_row = in_rows[0]; \
00923                 else if (i >= frame_h) \
00924                         in_row = in_rows[frame_h - 1]; \
00925                 else \
00926                         in_row = in_rows[i]; \
00927                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = SR18 = SR19 = SR20 = SR21 = 0; \
00928               { \
00929                         type *out_row; \
00930                         if (i >= start_out + offset && i<= end_out + offset) \
00931                                 out_row = out_rows[i - offset]; \
00932                         else \
00933                                 out_row = 0; \
00934                         int_type *SC = SC0; \
00935                         for (j = 0; j < frame_w + offset * 2; j++) \
00936                         { \
00937                                 if (j < offset) \
00938                                         tmp1 = in_row[0]; \
00939                                 else if (j >= frame_w + offset) \
00940                                         tmp1 = in_row[frame_w - 1]; \
00941                                 else \
00942                                         tmp1 = in_row[j - offset]; \
00943                                 tmp2 = SR0 + tmp1; \
00944                                 SR0 = tmp1; \
00945                                 tmp1 = SR1 + tmp2; \
00946                                 SR1 = tmp2; \
00947                                 tmp2 = SR2 + tmp1; \
00948                                 SR2 = tmp1; \
00949                                 tmp1 = SR3 + tmp2; \
00950                                 SR3 = tmp2; \
00951                                 tmp2 = SR4 + tmp1; \
00952                                 SR4 = tmp1; \
00953                                 tmp1 = SR5 + tmp2; \
00954                                 SR5 = tmp2; \
00955                                 tmp2 = SR6 + tmp1; \
00956                                 SR6 = tmp1; \
00957                                 tmp1 = SR7 + tmp2; \
00958                                 SR7 = tmp2; \
00959                                 tmp2 = SR8 + tmp1; \
00960                                 SR8 = tmp1; \
00961                                 tmp1 = SR9 + tmp2; \
00962                                 SR9 = tmp2; \
00963                                 tmp2 = SR10 + tmp1; \
00964                                 SR10 = tmp1; \
00965                                 tmp1 = SR11 + tmp2; \
00966                                 SR11 = tmp2; \
00967                                 tmp2 = SR12 + tmp1; \
00968                                 SR12 = tmp1; \
00969                                 tmp1 = SR13 + tmp2; \
00970                                 SR13 = tmp2; \
00971                                 tmp2 = SR14 + tmp1; \
00972                                 SR14 = tmp1; \
00973                                 tmp1 = SR15 + tmp2; \
00974                                 SR15 = tmp2; \
00975                                 tmp2 = SR16 + tmp1; \
00976                                 SR16 = tmp1; \
00977                                 tmp1 = SR17 + tmp2; \
00978                                 SR17 = tmp2; \
00979                                 tmp2 = SR18 + tmp1; \
00980                                 SR18 = tmp1; \
00981                                 tmp1 = SR19 + tmp2; \
00982                                 SR19 = tmp2; \
00983                                 tmp2 = SR20 + tmp1; \
00984                                 SR20 = tmp1; \
00985                                 tmp1 = SR21 + tmp2; \
00986                                 SR21 = tmp2; \
00987                                 tmp2 = SC[0] + tmp1; \
00988                                 SC[0] = tmp1; \
00989                                 tmp1 = SC[1] + tmp2; \
00990                                 SC[1] = tmp2; \
00991                                 tmp2 = SC[2] + tmp1; \
00992                                 SC[2] = tmp1; \
00993                                 tmp1 = SC[3] + tmp2; \
00994                                 SC[3] = tmp2; \
00995                                 tmp2 = SC[4] + tmp1; \
00996                                 SC[4] = tmp1; \
00997                                 tmp1 = SC[5] + tmp2; \
00998                                 SC[5] = tmp2; \
00999                                 tmp2 = SC[6] + tmp1; \
01000                                 SC[6] = tmp1; \
01001                                 tmp1 = SC[7] + tmp2; \
01002                                 SC[7] = tmp2; \
01003                                 tmp2 = SC[8] + tmp1; \
01004                                 SC[8] = tmp1; \
01005                                 tmp1 = SC[9] + tmp2; \
01006                                 SC[9] = tmp2; \
01007                                 tmp2 = SC[10] + tmp1; \
01008                                 SC[10] = tmp1; \
01009                                 tmp1 = SC[11] + tmp2; \
01010                                 SC[11] = tmp2; \
01011                                 tmp2 = SC[12] + tmp1; \
01012                                 SC[12] = tmp1; \
01013                                 tmp1 = SC[13] + tmp2; \
01014                                 SC[13] = tmp2; \
01015                                 tmp2 = SC[14] + tmp1; \
01016                                 SC[14] = tmp1; \
01017                                 tmp1 = SC[15] + tmp2; \
01018                                 SC[15] = tmp2; \
01019                                 tmp2 = SC[16] + tmp1; \
01020                                 SC[16] = tmp1; \
01021                                 tmp1 = SC[17] + tmp2; \
01022                                 SC[17] = tmp2; \
01023                                 tmp2 = SC[18] + tmp1; \
01024                                 SC[18] = tmp1; \
01025                                 tmp1 = SC[19] + tmp2; \
01026                                 SC[19] = tmp2; \
01027                                 tmp2 = SC[20] + tmp1; \
01028                                 SC[20] = tmp1; \
01029                                 if (j >= offset * 2) \
01030                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<43) + SC[21] + tmp2) >> 44; \
01031                                 SC[21] = tmp2; \
01032                                 SC += 22;\
01033                         } \
01034                 } \
01035         } \
01036         delete [] SC0; \
01037 }
01038 #define DO_FEATHER_25(type, int_type, max, N); \
01039 { \
01040         int offset = N / 2; \
01041         int frame_w = input->get_w(); \
01042         int frame_h = input->get_h(); \
01043         int start_in = start_out - offset; \
01044         int end_in = end_out + offset; \
01045         type **in_rows = (type**)input->get_rows(); \
01046         type **out_rows = (type**)output->get_rows(); \
01047         int i,j; \
01048         int_type tmp1, tmp2; \
01049         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17, SR18, SR19, SR20, SR21, SR22, SR23; \
01050         int_type *SC0 = new int_type[(frame_w + offset * 2) * 24]; \
01051         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 24); \
01052         for (i = start_in; i < end_in; i++) \
01053         { \
01054                 type *in_row; \
01055                 if (i < 0) \
01056                         in_row = in_rows[0]; \
01057                 else if (i >= frame_h) \
01058                         in_row = in_rows[frame_h - 1]; \
01059                 else \
01060                         in_row = in_rows[i]; \
01061                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = SR18 = SR19 = SR20 = SR21 = SR22 = SR23 = 0; \
01062               { \
01063                         type *out_row; \
01064                         if (i >= start_out + offset && i<= end_out + offset) \
01065                                 out_row = out_rows[i - offset]; \
01066                         else \
01067                                 out_row = 0; \
01068                         int_type *SC = SC0; \
01069                         for (j = 0; j < frame_w + offset * 2; j++) \
01070                         { \
01071                                 if (j < offset) \
01072                                         tmp1 = in_row[0]; \
01073                                 else if (j >= frame_w + offset) \
01074                                         tmp1 = in_row[frame_w - 1]; \
01075                                 else \
01076                                         tmp1 = in_row[j - offset]; \
01077                                 tmp2 = SR0 + tmp1; \
01078                                 SR0 = tmp1; \
01079                                 tmp1 = SR1 + tmp2; \
01080                                 SR1 = tmp2; \
01081                                 tmp2 = SR2 + tmp1; \
01082                                 SR2 = tmp1; \
01083                                 tmp1 = SR3 + tmp2; \
01084                                 SR3 = tmp2; \
01085                                 tmp2 = SR4 + tmp1; \
01086                                 SR4 = tmp1; \
01087                                 tmp1 = SR5 + tmp2; \
01088                                 SR5 = tmp2; \
01089                                 tmp2 = SR6 + tmp1; \
01090                                 SR6 = tmp1; \
01091                                 tmp1 = SR7 + tmp2; \
01092                                 SR7 = tmp2; \
01093                                 tmp2 = SR8 + tmp1; \
01094                                 SR8 = tmp1; \
01095                                 tmp1 = SR9 + tmp2; \
01096                                 SR9 = tmp2; \
01097                                 tmp2 = SR10 + tmp1; \
01098                                 SR10 = tmp1; \
01099                                 tmp1 = SR11 + tmp2; \
01100                                 SR11 = tmp2; \
01101                                 tmp2 = SR12 + tmp1; \
01102                                 SR12 = tmp1; \
01103                                 tmp1 = SR13 + tmp2; \
01104                                 SR13 = tmp2; \
01105                                 tmp2 = SR14 + tmp1; \
01106                                 SR14 = tmp1; \
01107                                 tmp1 = SR15 + tmp2; \
01108                                 SR15 = tmp2; \
01109                                 tmp2 = SR16 + tmp1; \
01110                                 SR16 = tmp1; \
01111                                 tmp1 = SR17 + tmp2; \
01112                                 SR17 = tmp2; \
01113                                 tmp2 = SR18 + tmp1; \
01114                                 SR18 = tmp1; \
01115                                 tmp1 = SR19 + tmp2; \
01116                                 SR19 = tmp2; \
01117                                 tmp2 = SR20 + tmp1; \
01118                                 SR20 = tmp1; \
01119                                 tmp1 = SR21 + tmp2; \
01120                                 SR21 = tmp2; \
01121                                 tmp2 = SR22 + tmp1; \
01122                                 SR22 = tmp1; \
01123                                 tmp1 = SR23 + tmp2; \
01124                                 SR23 = tmp2; \
01125                                 tmp2 = SC[0] + tmp1; \
01126                                 SC[0] = tmp1; \
01127                                 tmp1 = SC[1] + tmp2; \
01128                                 SC[1] = tmp2; \
01129                                 tmp2 = SC[2] + tmp1; \
01130                                 SC[2] = tmp1; \
01131                                 tmp1 = SC[3] + tmp2; \
01132                                 SC[3] = tmp2; \
01133                                 tmp2 = SC[4] + tmp1; \
01134                                 SC[4] = tmp1; \
01135                                 tmp1 = SC[5] + tmp2; \
01136                                 SC[5] = tmp2; \
01137                                 tmp2 = SC[6] + tmp1; \
01138                                 SC[6] = tmp1; \
01139                                 tmp1 = SC[7] + tmp2; \
01140                                 SC[7] = tmp2; \
01141                                 tmp2 = SC[8] + tmp1; \
01142                                 SC[8] = tmp1; \
01143                                 tmp1 = SC[9] + tmp2; \
01144                                 SC[9] = tmp2; \
01145                                 tmp2 = SC[10] + tmp1; \
01146                                 SC[10] = tmp1; \
01147                                 tmp1 = SC[11] + tmp2; \
01148                                 SC[11] = tmp2; \
01149                                 tmp2 = SC[12] + tmp1; \
01150                                 SC[12] = tmp1; \
01151                                 tmp1 = SC[13] + tmp2; \
01152                                 SC[13] = tmp2; \
01153                                 tmp2 = SC[14] + tmp1; \
01154                                 SC[14] = tmp1; \
01155                                 tmp1 = SC[15] + tmp2; \
01156                                 SC[15] = tmp2; \
01157                                 tmp2 = SC[16] + tmp1; \
01158                                 SC[16] = tmp1; \
01159                                 tmp1 = SC[17] + tmp2; \
01160                                 SC[17] = tmp2; \
01161                                 tmp2 = SC[18] + tmp1; \
01162                                 SC[18] = tmp1; \
01163                                 tmp1 = SC[19] + tmp2; \
01164                                 SC[19] = tmp2; \
01165                                 tmp2 = SC[20] + tmp1; \
01166                                 SC[20] = tmp1; \
01167                                 tmp1 = SC[21] + tmp2; \
01168                                 SC[21] = tmp2; \
01169                                 tmp2 = SC[22] + tmp1; \
01170                                 SC[22] = tmp1; \
01171                                 if (j >= offset * 2) \
01172                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<47) + SC[23] + tmp2) >> 48; \
01173                                 SC[23] = tmp2; \
01174                                 SC += 24;\
01175                         } \
01176                 } \
01177         } \
01178         delete [] SC0; \
01179 }
01180 #define DO_FEATHER_27(type, int_type, max, N); \
01181 { \
01182         int offset = N / 2; \
01183         int frame_w = input->get_w(); \
01184         int frame_h = input->get_h(); \
01185         int start_in = start_out - offset; \
01186         int end_in = end_out + offset; \
01187         type **in_rows = (type**)input->get_rows(); \
01188         type **out_rows = (type**)output->get_rows(); \
01189         int i,j; \
01190         int_type tmp1, tmp2; \
01191         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17, SR18, SR19, SR20, SR21, SR22, SR23, SR24, SR25; \
01192         int_type *SC0 = new int_type[(frame_w + offset * 2) * 26]; \
01193         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 26); \
01194         for (i = start_in; i < end_in; i++) \
01195         { \
01196                 type *in_row; \
01197                 if (i < 0) \
01198                         in_row = in_rows[0]; \
01199                 else if (i >= frame_h) \
01200                         in_row = in_rows[frame_h - 1]; \
01201                 else \
01202                         in_row = in_rows[i]; \
01203                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = SR18 = SR19 = SR20 = SR21 = SR22 = SR23 = SR24 = SR25 = 0; \
01204               { \
01205                         type *out_row; \
01206                         if (i >= start_out + offset && i<= end_out + offset) \
01207                                 out_row = out_rows[i - offset]; \
01208                         else \
01209                                 out_row = 0; \
01210                         int_type *SC = SC0; \
01211                         for (j = 0; j < frame_w + offset * 2; j++) \
01212                         { \
01213                                 if (j < offset) \
01214                                         tmp1 = in_row[0]; \
01215                                 else if (j >= frame_w + offset) \
01216                                         tmp1 = in_row[frame_w - 1]; \
01217                                 else \
01218                                         tmp1 = in_row[j - offset]; \
01219                                 tmp2 = SR0 + tmp1; \
01220                                 SR0 = tmp1; \
01221                                 tmp1 = SR1 + tmp2; \
01222                                 SR1 = tmp2; \
01223                                 tmp2 = SR2 + tmp1; \
01224                                 SR2 = tmp1; \
01225                                 tmp1 = SR3 + tmp2; \
01226                                 SR3 = tmp2; \
01227                                 tmp2 = SR4 + tmp1; \
01228                                 SR4 = tmp1; \
01229                                 tmp1 = SR5 + tmp2; \
01230                                 SR5 = tmp2; \
01231                                 tmp2 = SR6 + tmp1; \
01232                                 SR6 = tmp1; \
01233                                 tmp1 = SR7 + tmp2; \
01234                                 SR7 = tmp2; \
01235                                 tmp2 = SR8 + tmp1; \
01236                                 SR8 = tmp1; \
01237                                 tmp1 = SR9 + tmp2; \
01238                                 SR9 = tmp2; \
01239                                 tmp2 = SR10 + tmp1; \
01240                                 SR10 = tmp1; \
01241                                 tmp1 = SR11 + tmp2; \
01242                                 SR11 = tmp2; \
01243                                 tmp2 = SR12 + tmp1; \
01244                                 SR12 = tmp1; \
01245                                 tmp1 = SR13 + tmp2; \
01246                                 SR13 = tmp2; \
01247                                 tmp2 = SR14 + tmp1; \
01248                                 SR14 = tmp1; \
01249                                 tmp1 = SR15 + tmp2; \
01250                                 SR15 = tmp2; \
01251                                 tmp2 = SR16 + tmp1; \
01252                                 SR16 = tmp1; \
01253                                 tmp1 = SR17 + tmp2; \
01254                                 SR17 = tmp2; \
01255                                 tmp2 = SR18 + tmp1; \
01256                                 SR18 = tmp1; \
01257                                 tmp1 = SR19 + tmp2; \
01258                                 SR19 = tmp2; \
01259                                 tmp2 = SR20 + tmp1; \
01260                                 SR20 = tmp1; \
01261                                 tmp1 = SR21 + tmp2; \
01262                                 SR21 = tmp2; \
01263                                 tmp2 = SR22 + tmp1; \
01264                                 SR22 = tmp1; \
01265                                 tmp1 = SR23 + tmp2; \
01266                                 SR23 = tmp2; \
01267                                 tmp2 = SR24 + tmp1; \
01268                                 SR24 = tmp1; \
01269                                 tmp1 = SR25 + tmp2; \
01270                                 SR25 = tmp2; \
01271                                 tmp2 = SC[0] + tmp1; \
01272                                 SC[0] = tmp1; \
01273                                 tmp1 = SC[1] + tmp2; \
01274                                 SC[1] = tmp2; \
01275                                 tmp2 = SC[2] + tmp1; \
01276                                 SC[2] = tmp1; \
01277                                 tmp1 = SC[3] + tmp2; \
01278                                 SC[3] = tmp2; \
01279                                 tmp2 = SC[4] + tmp1; \
01280                                 SC[4] = tmp1; \
01281                                 tmp1 = SC[5] + tmp2; \
01282                                 SC[5] = tmp2; \
01283                                 tmp2 = SC[6] + tmp1; \
01284                                 SC[6] = tmp1; \
01285                                 tmp1 = SC[7] + tmp2; \
01286                                 SC[7] = tmp2; \
01287                                 tmp2 = SC[8] + tmp1; \
01288                                 SC[8] = tmp1; \
01289                                 tmp1 = SC[9] + tmp2; \
01290                                 SC[9] = tmp2; \
01291                                 tmp2 = SC[10] + tmp1; \
01292                                 SC[10] = tmp1; \
01293                                 tmp1 = SC[11] + tmp2; \
01294                                 SC[11] = tmp2; \
01295                                 tmp2 = SC[12] + tmp1; \
01296                                 SC[12] = tmp1; \
01297                                 tmp1 = SC[13] + tmp2; \
01298                                 SC[13] = tmp2; \
01299                                 tmp2 = SC[14] + tmp1; \
01300                                 SC[14] = tmp1; \
01301                                 tmp1 = SC[15] + tmp2; \
01302                                 SC[15] = tmp2; \
01303                                 tmp2 = SC[16] + tmp1; \
01304                                 SC[16] = tmp1; \
01305                                 tmp1 = SC[17] + tmp2; \
01306                                 SC[17] = tmp2; \
01307                                 tmp2 = SC[18] + tmp1; \
01308                                 SC[18] = tmp1; \
01309                                 tmp1 = SC[19] + tmp2; \
01310                                 SC[19] = tmp2; \
01311                                 tmp2 = SC[20] + tmp1; \
01312                                 SC[20] = tmp1; \
01313                                 tmp1 = SC[21] + tmp2; \
01314                                 SC[21] = tmp2; \
01315                                 tmp2 = SC[22] + tmp1; \
01316                                 SC[22] = tmp1; \
01317                                 tmp1 = SC[23] + tmp2; \
01318                                 SC[23] = tmp2; \
01319                                 tmp2 = SC[24] + tmp1; \
01320                                 SC[24] = tmp1; \
01321                                 if (j >= offset * 2) \
01322                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<51) + SC[25] + tmp2) >> 52; \
01323                                 SC[25] = tmp2; \
01324                                 SC += 26;\
01325                         } \
01326                 } \
01327         } \
01328         delete [] SC0; \
01329 }
01330 #define DO_FEATHER_29(type, int_type, max, N); \
01331 { \
01332         int offset = N / 2; \
01333         int frame_w = input->get_w(); \
01334         int frame_h = input->get_h(); \
01335         int start_in = start_out - offset; \
01336         int end_in = end_out + offset; \
01337         type **in_rows = (type**)input->get_rows(); \
01338         type **out_rows = (type**)output->get_rows(); \
01339         int i,j; \
01340         int_type tmp1, tmp2; \
01341         int_type SR0, SR1, SR2, SR3, SR4, SR5, SR6, SR7, SR8, SR9, SR10, SR11, SR12, SR13, SR14, SR15, SR16, SR17, SR18, SR19, SR20, SR21, SR22, SR23, SR24, SR25, SR26, SR27; \
01342         int_type *SC0 = new int_type[(frame_w + offset * 2) * 28]; \
01343         memset(SC0, 0, sizeof(int_type) * (frame_w  + offset * 2) * 28); \
01344         for (i = start_in; i < end_in; i++) \
01345         { \
01346                 type *in_row; \
01347                 if (i < 0) \
01348                         in_row = in_rows[0]; \
01349                 else if (i >= frame_h) \
01350                         in_row = in_rows[frame_h - 1]; \
01351                 else \
01352                         in_row = in_rows[i]; \
01353                 SR0 = SR1 = SR2 = SR3 = SR4 = SR5 = SR6 = SR7 = SR8 = SR9 = SR10 = SR11 = SR12 = SR13 = SR14 = SR15 = SR16 = SR17 = SR18 = SR19 = SR20 = SR21 = SR22 = SR23 = SR24 = SR25 = SR26 = SR27 = 0; \
01354               { \
01355                         type *out_row; \
01356                         if (i >= start_out + offset && i<= end_out + offset) \
01357                                 out_row = out_rows[i - offset]; \
01358                         else \
01359                                 out_row = 0; \
01360                         int_type *SC = SC0; \
01361                         for (j = 0; j < frame_w + offset * 2; j++) \
01362                         { \
01363                                 if (j < offset) \
01364                                         tmp1 = in_row[0]; \
01365                                 else if (j >= frame_w + offset) \
01366                                         tmp1 = in_row[frame_w - 1]; \
01367                                 else \
01368                                         tmp1 = in_row[j - offset]; \
01369                                 tmp2 = SR0 + tmp1; \
01370                                 SR0 = tmp1; \
01371                                 tmp1 = SR1 + tmp2; \
01372                                 SR1 = tmp2; \
01373                                 tmp2 = SR2 + tmp1; \
01374                                 SR2 = tmp1; \
01375                                 tmp1 = SR3 + tmp2; \
01376                                 SR3 = tmp2; \
01377                                 tmp2 = SR4 + tmp1; \
01378                                 SR4 = tmp1; \
01379                                 tmp1 = SR5 + tmp2; \
01380                                 SR5 = tmp2; \
01381                                 tmp2 = SR6 + tmp1; \
01382                                 SR6 = tmp1; \
01383                                 tmp1 = SR7 + tmp2; \
01384                                 SR7 = tmp2; \
01385                                 tmp2 = SR8 + tmp1; \
01386                                 SR8 = tmp1; \
01387                                 tmp1 = SR9 + tmp2; \
01388                                 SR9 = tmp2; \
01389                                 tmp2 = SR10 + tmp1; \
01390                                 SR10 = tmp1; \
01391                                 tmp1 = SR11 + tmp2; \
01392                                 SR11 = tmp2; \
01393                                 tmp2 = SR12 + tmp1; \
01394                                 SR12 = tmp1; \
01395                                 tmp1 = SR13 + tmp2; \
01396                                 SR13 = tmp2; \
01397                                 tmp2 = SR14 + tmp1; \
01398                                 SR14 = tmp1; \
01399                                 tmp1 = SR15 + tmp2; \
01400                                 SR15 = tmp2; \
01401                                 tmp2 = SR16 + tmp1; \
01402                                 SR16 = tmp1; \
01403                                 tmp1 = SR17 + tmp2; \
01404                                 SR17 = tmp2; \
01405                                 tmp2 = SR18 + tmp1; \
01406                                 SR18 = tmp1; \
01407                                 tmp1 = SR19 + tmp2; \
01408                                 SR19 = tmp2; \
01409                                 tmp2 = SR20 + tmp1; \
01410                                 SR20 = tmp1; \
01411                                 tmp1 = SR21 + tmp2; \
01412                                 SR21 = tmp2; \
01413                                 tmp2 = SR22 + tmp1; \
01414                                 SR22 = tmp1; \
01415                                 tmp1 = SR23 + tmp2; \
01416                                 SR23 = tmp2; \
01417                                 tmp2 = SR24 + tmp1; \
01418                                 SR24 = tmp1; \
01419                                 tmp1 = SR25 + tmp2; \
01420                                 SR25 = tmp2; \
01421                                 tmp2 = SR26 + tmp1; \
01422                                 SR26 = tmp1; \
01423                                 tmp1 = SR27 + tmp2; \
01424                                 SR27 = tmp2; \
01425                                 tmp2 = SC[0] + tmp1; \
01426                                 SC[0] = tmp1; \
01427                                 tmp1 = SC[1] + tmp2; \
01428                                 SC[1] = tmp2; \
01429                                 tmp2 = SC[2] + tmp1; \
01430                                 SC[2] = tmp1; \
01431                                 tmp1 = SC[3] + tmp2; \
01432                                 SC[3] = tmp2; \
01433                                 tmp2 = SC[4] + tmp1; \
01434                                 SC[4] = tmp1; \
01435                                 tmp1 = SC[5] + tmp2; \
01436                                 SC[5] = tmp2; \
01437                                 tmp2 = SC[6] + tmp1; \
01438                                 SC[6] = tmp1; \
01439                                 tmp1 = SC[7] + tmp2; \
01440                                 SC[7] = tmp2; \
01441                                 tmp2 = SC[8] + tmp1; \
01442                                 SC[8] = tmp1; \
01443                                 tmp1 = SC[9] + tmp2; \
01444                                 SC[9] = tmp2; \
01445                                 tmp2 = SC[10] + tmp1; \
01446                                 SC[10] = tmp1; \
01447                                 tmp1 = SC[11] + tmp2; \
01448                                 SC[11] = tmp2; \
01449                                 tmp2 = SC[12] + tmp1; \
01450                                 SC[12] = tmp1; \
01451                                 tmp1 = SC[13] + tmp2; \
01452                                 SC[13] = tmp2; \
01453                                 tmp2 = SC[14] + tmp1; \
01454                                 SC[14] = tmp1; \
01455                                 tmp1 = SC[15] + tmp2; \
01456                                 SC[15] = tmp2; \
01457                                 tmp2 = SC[16] + tmp1; \
01458                                 SC[16] = tmp1; \
01459                                 tmp1 = SC[17] + tmp2; \
01460                                 SC[17] = tmp2; \
01461                                 tmp2 = SC[18] + tmp1; \
01462                                 SC[18] = tmp1; \
01463                                 tmp1 = SC[19] + tmp2; \
01464                                 SC[19] = tmp2; \
01465                                 tmp2 = SC[20] + tmp1; \
01466                                 SC[20] = tmp1; \
01467                                 tmp1 = SC[21] + tmp2; \
01468                                 SC[21] = tmp2; \
01469                                 tmp2 = SC[22] + tmp1; \
01470                                 SC[22] = tmp1; \
01471                                 tmp1 = SC[23] + tmp2; \
01472                                 SC[23] = tmp2; \
01473                                 tmp2 = SC[24] + tmp1; \
01474                                 SC[24] = tmp1; \
01475                                 tmp1 = SC[25] + tmp2; \
01476                                 SC[25] = tmp2; \
01477                                 tmp2 = SC[26] + tmp1; \
01478                                 SC[26] = tmp1; \
01479                                 if (j >= offset * 2) \
01480                                         if (out_row) out_row[j - offset * 2] = (((uint64_t)1 <<55) + SC[27] + tmp2) >> 56; \
01481                                 SC[27] = tmp2; \
01482                                 SC += 28;\
01483                         } \
01484                 } \
01485         } \
01486         delete [] SC0; \
01487 }
01488 
01489 /* THIS WORKS ONLY FOR ODD N >= 3 */
01490 #define DO_FEATHER_N(type, int_type, max, N) \
01491 { \
01492         switch(input->get_color_model()) \
01493         { \
01494                 case BC_A8: \
01495                         switch (N) \
01496                         { \
01497                                 case 3: \
01498                                         DO_FEATHER_3(unsigned char, uint16_t, max, 3); \
01499                                         return 1; \
01500                                         break; \
01501                                 case 5: \
01502                                         DO_FEATHER_5(unsigned char, uint16_t, max, 5); \
01503                                         return 1; \
01504                                         break; \
01505                                 case 7: \
01506                                         DO_FEATHER_7(unsigned char, uint32_t, max, 7); \
01507                                         return 1; \
01508                                         break; \
01509                                 case 9: \
01510                                         DO_FEATHER_9(unsigned char, uint32_t, max, 9); \
01511                                         return 1; \
01512                                         break; \
01513                                 case 11: \
01514                                         DO_FEATHER_11(unsigned char, uint32_t, max, 11); \
01515                                         return 1; \
01516                                         break; \
01517                                 case 13: \
01518                                         DO_FEATHER_13(unsigned char, uint32_t, max, 13); \
01519                                         return 1; \
01520                                         break; \
01521                                 case 15: \
01522                                         DO_FEATHER_15(unsigned char, uint64_t, max, 15); \
01523                                         return 1; \
01524                                         break; \
01525                                 case 17: \
01526                                         DO_FEATHER_17(unsigned char, uint64_t, max, 17); \
01527                                         return 1; \
01528                                         break; \
01529                                 case 19: \
01530                                         DO_FEATHER_19(unsigned char, uint64_t, max, 19); \
01531                                         return 1; \
01532                                         break; \
01533                                 case 21: \
01534                                         DO_FEATHER_21(unsigned char, uint64_t, max, 21); \
01535                                         return 1; \
01536                                         break; \
01537                                 case 23: \
01538                                         DO_FEATHER_23(unsigned char, uint64_t, max, 23); \
01539                                         return 1; \
01540                                         break; \
01541                                 case 25: \
01542                                         DO_FEATHER_25(unsigned char, uint64_t, max, 25); \
01543                                         return 1; \
01544                                         break; \
01545                                 case 27: \
01546                                         DO_FEATHER_27(unsigned char, uint64_t, max, 27); \
01547                                         return 1; \
01548                                         break; \
01549                                 case 29: \
01550                                         DO_FEATHER_29(unsigned char, uint64_t, max, 29); \
01551                                         return 1; \
01552                                         break; \
01553                                 default: \
01554                                         return 0; \
01555                         } \
01556                 case BC_A16: \
01557                         switch (N) \
01558                         { \
01559                                 case 3: \
01560                                         DO_FEATHER_3(uint16_t, uint32_t, max, 3); \
01561                                         return 1; \
01562                                         break; \
01563                                 case 5: \
01564                                         DO_FEATHER_5(uint16_t, uint32_t, max, 5); \
01565                                         return 1; \
01566                                         break; \
01567                                 case 7: \
01568                                         DO_FEATHER_7(uint16_t, uint32_t, max, 7); \
01569                                         return 1; \
01570                                         break; \
01571                                 case 9: \
01572                                         DO_FEATHER_9(uint16_t, uint32_t, max, 9); \
01573                                         return 1; \
01574                                         break; \
01575                                 case 11: \
01576                                         DO_FEATHER_11(uint16_t, uint64_t, max, 11); \
01577                                         return 1; \
01578                                         break; \
01579                                 case 13: \
01580                                         DO_FEATHER_13(uint16_t, uint64_t, max, 13); \
01581                                         return 1; \
01582                                         break; \
01583                                 case 15: \
01584                                         DO_FEATHER_15(uint16_t, uint64_t, max, 15); \
01585                                         return 1; \
01586                                         break; \
01587                                 case 17: \
01588                                         DO_FEATHER_17(uint16_t, uint64_t, max, 17); \
01589                                         return 1; \
01590                                         break; \
01591                                 case 19: \
01592                                         DO_FEATHER_19(uint16_t, uint64_t, max, 19); \
01593                                         return 1; \
01594                                         break; \
01595                                 case 21: \
01596                                         DO_FEATHER_21(uint16_t, uint64_t, max, 21); \
01597                                         return 1; \
01598                                         break; \
01599                                 case 23: \
01600                                         DO_FEATHER_23(uint16_t, uint64_t, max, 23); \
01601                                         return 1; \
01602                                         break; \
01603                                 case 25: \
01604                                         DO_FEATHER_25(uint16_t, uint64_t, max, 25); \
01605                                         return 1; \
01606                                         break; \
01607                                 default: \
01608                                         return 0; \
01609                         } \
01610         } \
01611         return 0; \
01612 } 

Generated on Sun Jan 8 13:38:54 2006 for Cinelerra-svn by  doxygen 1.4.4