/* * 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_1M *dp = Interp1(w[5], w[1]); #define PIXEL00_1U *dp = Interp1(w[5], w[2]); #define PIXEL00_1L *dp = Interp1(w[5], w[4]); #define PIXEL00_2 *dp = Interp2(w[5], w[4], w[2]); #define PIXEL00_4 *dp = Interp4(w[5], w[4], w[2]); #define PIXEL00_5 *dp = Interp5(w[4], w[2]); #define PIXEL00_C *dp = w[5]; #define PIXEL01_1 *(dp+1) = Interp1(w[5], w[2]); #define PIXEL01_3 *(dp+1) = Interp3(w[5], w[2]); #define PIXEL01_6 *(dp+1) = Interp1(w[2], w[5]); #define PIXEL01_C *(dp+1) = w[5]; #define PIXEL02_1M *(dp+2) = Interp1(w[5], w[3]); #define PIXEL02_1U *(dp+2) = Interp1(w[5], w[2]); #define PIXEL02_1R *(dp+2) = Interp1(w[5], w[6]); #define PIXEL02_2 *(dp+2) = Interp2(w[5], w[2], w[6]); #define PIXEL02_4 *(dp+2) = Interp4(w[5], w[2], w[6]); #define PIXEL02_5 *(dp+2) = Interp5(w[2], w[6]); #define PIXEL02_C *(dp+2) = w[5]; #define PIXEL10_1 *(dp+dpL) = Interp1(w[5], w[4]); #define PIXEL10_3 *(dp+dpL) = Interp3(w[5], w[4]); #define PIXEL10_6 *(dp+dpL) = Interp1(w[4], w[5]); #define PIXEL10_C *(dp+dpL) = w[5]; #define PIXEL11 *(dp+dpL+1) = w[5]; #define PIXEL12_1 *(dp+dpL+2) = Interp1(w[5], w[6]); #define PIXEL12_3 *(dp+dpL+2) = Interp3(w[5], w[6]); #define PIXEL12_6 *(dp+dpL+2) = Interp1(w[6], w[5]); #define PIXEL12_C *(dp+dpL+2) = w[5]; #define PIXEL20_1M *(dp+dpL+dpL) = Interp1(w[5], w[7]); #define PIXEL20_1D *(dp+dpL+dpL) = Interp1(w[5], w[8]); #define PIXEL20_1L *(dp+dpL+dpL) = Interp1(w[5], w[4]); #define PIXEL20_2 *(dp+dpL+dpL) = Interp2(w[5], w[8], w[4]); #define PIXEL20_4 *(dp+dpL+dpL) = Interp4(w[5], w[8], w[4]); #define PIXEL20_5 *(dp+dpL+dpL) = Interp5(w[8], w[4]); #define PIXEL20_C *(dp+dpL+dpL) = w[5]; #define PIXEL21_1 *(dp+dpL+dpL+1) = Interp1(w[5], w[8]); #define PIXEL21_3 *(dp+dpL+dpL+1) = Interp3(w[5], w[8]); #define PIXEL21_6 *(dp+dpL+dpL+1) = Interp1(w[8], w[5]); #define PIXEL21_C *(dp+dpL+dpL+1) = w[5]; #define PIXEL22_1M *(dp+dpL+dpL+2) = Interp1(w[5], w[9]); #define PIXEL22_1D *(dp+dpL+dpL+2) = Interp1(w[5], w[8]); #define PIXEL22_1R *(dp+dpL+dpL+2) = Interp1(w[5], w[6]); #define PIXEL22_2 *(dp+dpL+dpL+2) = Interp2(w[5], w[6], w[8]); #define PIXEL22_4 *(dp+dpL+dpL+2) = Interp4(w[5], w[6], w[8]); #define PIXEL22_5 *(dp+dpL+dpL+2) = Interp5(w[6], w[8]); #define PIXEL22_C *(dp+dpL+dpL+2) = w[5]; HQX_API void HQX_CALLCONV hq3x_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