/* * Copyright (C) 2003 Maxim Stepin ( maxst@hiend3d.com ) * * Copyright (C) 2010 Cameron Zemek ( grom@zeminvaders.net) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "common.h" #include "hqx.h" #define PIXEL00_0 *dp = w[5]; #define PIXEL00_10 *dp = Interp1(w[5], w[1]); #define PIXEL00_11 *dp = Interp1(w[5], w[4]); #define PIXEL00_12 *dp = Interp1(w[5], w[2]); #define PIXEL00_20 *dp = Interp2(w[5], w[4], w[2]); #define PIXEL00_21 *dp = Interp2(w[5], w[1], w[2]); #define PIXEL00_22 *dp = Interp2(w[5], w[1], w[4]); #define PIXEL00_60 *dp = Interp6(w[5], w[2], w[4]); #define PIXEL00_61 *dp = Interp6(w[5], w[4], w[2]); #define PIXEL00_70 *dp = Interp7(w[5], w[4], w[2]); #define PIXEL00_90 *dp = Interp9(w[5], w[4], w[2]); #define PIXEL00_100 *dp = Interp10(w[5], w[4], w[2]); #define PIXEL01_0 *(dp+1) = w[5]; #define PIXEL01_10 *(dp+1) = Interp1(w[5], w[3]); #define PIXEL01_11 *(dp+1) = Interp1(w[5], w[2]); #define PIXEL01_12 *(dp+1) = Interp1(w[5], w[6]); #define PIXEL01_20 *(dp+1) = Interp2(w[5], w[2], w[6]); #define PIXEL01_21 *(dp+1) = Interp2(w[5], w[3], w[6]); #define PIXEL01_22 *(dp+1) = Interp2(w[5], w[3], w[2]); #define PIXEL01_60 *(dp+1) = Interp6(w[5], w[6], w[2]); #define PIXEL01_61 *(dp+1) = Interp6(w[5], w[2], w[6]); #define PIXEL01_70 *(dp+1) = Interp7(w[5], w[2], w[6]); #define PIXEL01_90 *(dp+1) = Interp9(w[5], w[2], w[6]); #define PIXEL01_100 *(dp+1) = Interp10(w[5], w[2], w[6]); #define PIXEL10_0 *(dp+dpL) = w[5]; #define PIXEL10_10 *(dp+dpL) = Interp1(w[5], w[7]); #define PIXEL10_11 *(dp+dpL) = Interp1(w[5], w[8]); #define PIXEL10_12 *(dp+dpL) = Interp1(w[5], w[4]); #define PIXEL10_20 *(dp+dpL) = Interp2(w[5], w[8], w[4]); #define PIXEL10_21 *(dp+dpL) = Interp2(w[5], w[7], w[4]); #define PIXEL10_22 *(dp+dpL) = Interp2(w[5], w[7], w[8]); #define PIXEL10_60 *(dp+dpL) = Interp6(w[5], w[4], w[8]); #define PIXEL10_61 *(dp+dpL) = Interp6(w[5], w[8], w[4]); #define PIXEL10_70 *(dp+dpL) = Interp7(w[5], w[8], w[4]); #define PIXEL10_90 *(dp+dpL) = Interp9(w[5], w[8], w[4]); #define PIXEL10_100 *(dp+dpL) = Interp10(w[5], w[8], w[4]); #define PIXEL11_0 *(dp+dpL+1) = w[5]; #define PIXEL11_10 *(dp+dpL+1) = Interp1(w[5], w[9]); #define PIXEL11_11 *(dp+dpL+1) = Interp1(w[5], w[6]); #define PIXEL11_12 *(dp+dpL+1) = Interp1(w[5], w[8]); #define PIXEL11_20 *(dp+dpL+1) = Interp2(w[5], w[6], w[8]); #define PIXEL11_21 *(dp+dpL+1) = Interp2(w[5], w[9], w[8]); #define PIXEL11_22 *(dp+dpL+1) = Interp2(w[5], w[9], w[6]); #define PIXEL11_60 *(dp+dpL+1) = Interp6(w[5], w[8], w[6]); #define PIXEL11_61 *(dp+dpL+1) = Interp6(w[5], w[6], w[8]); #define PIXEL11_70 *(dp+dpL+1) = Interp7(w[5], w[6], w[8]); #define PIXEL11_90 *(dp+dpL+1) = Interp9(w[5], w[6], w[8]); #define PIXEL11_100 *(dp+dpL+1) = Interp10(w[5], w[6], w[8]); HQX_API void HQX_CALLCONV hq2x_32_rb( uint32_t * sp, uint32_t srb, uint32_t * dp, uint32_t drb, int Xres, int Yres ) { int i, j, k; int prevline, nextline; uint32_t w[10]; int dpL = (drb >> 2); int spL = (srb >> 2); uint8_t *sRowP = (uint8_t *) sp; uint8_t *dRowP = (uint8_t *) dp; uint32_t yuv1, yuv2; // +----+----+----+ // | | | | // | w1 | w2 | w3 | // +----+----+----+ // | | | | // | w4 | w5 | w6 | // +----+----+----+ // | | | | // | w7 | w8 | w9 | // +----+----+----+ for (j=0; j0) prevline = -spL; else prevline = 0; if (j0) { w[1] = *(sp + prevline - 1); w[4] = *(sp - 1); w[7] = *(sp + nextline - 1); } else { w[1] = w[2]; w[4] = w[5]; w[7] = w[8]; } if (i