| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at> | ||
| 3 | * | ||
| 4 | * This file is part of FFmpeg. | ||
| 5 | * | ||
| 6 | * FFmpeg is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU Lesser General Public | ||
| 8 | * License as published by the Free Software Foundation; either | ||
| 9 | * version 2.1 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * Lesser General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU Lesser General Public | ||
| 17 | * License along with FFmpeg; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include "swscale_internal.h" | ||
| 22 | |||
| 23 | 1 | void ff_hyscale_fast_c(SwsInternal *c, int16_t *dst, int dstWidth, | |
| 24 | const uint8_t *src, int srcW, int xInc) | ||
| 25 | { | ||
| 26 | int i; | ||
| 27 | 1 | unsigned int xpos = 0; | |
| 28 |
2/2✓ Branch 0 taken 40032 times.
✓ Branch 1 taken 1 times.
|
40033 | for (i = 0; i < dstWidth; i++) { |
| 29 | 40032 | register unsigned int xx = xpos >> 16; | |
| 30 | 40032 | register unsigned int xalpha = (xpos & 0xFFFF) >> 9; | |
| 31 | 40032 | dst[i] = (src[xx] << 7) + (src[xx + 1] - src[xx]) * xalpha; | |
| 32 | 40032 | xpos += xInc; | |
| 33 | } | ||
| 34 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
|
2 | for (i=dstWidth-1; (i*(int64_t)xInc)>>16 >=srcW-1; i--) |
| 35 | 1 | dst[i] = src[srcW-1]*128; | |
| 36 | 1 | } | |
| 37 | |||
| 38 | 1 | void ff_hcscale_fast_c(SwsInternal *c, int16_t *dst1, int16_t *dst2, | |
| 39 | int dstWidth, const uint8_t *src1, | ||
| 40 | const uint8_t *src2, int srcW, int xInc) | ||
| 41 | { | ||
| 42 | int i; | ||
| 43 | 1 | unsigned int xpos = 0; | |
| 44 |
2/2✓ Branch 0 taken 40032 times.
✓ Branch 1 taken 1 times.
|
40033 | for (i = 0; i < dstWidth; i++) { |
| 45 | 40032 | register unsigned int xx = xpos >> 16; | |
| 46 | 40032 | register unsigned int xalpha = (xpos & 0xFFFF) >> 9; | |
| 47 | 40032 | dst1[i] = (src1[xx] * (xalpha ^ 127) + src1[xx + 1] * xalpha); | |
| 48 | 40032 | dst2[i] = (src2[xx] * (xalpha ^ 127) + src2[xx + 1] * xalpha); | |
| 49 | 40032 | xpos += xInc; | |
| 50 | } | ||
| 51 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
|
2 | for (i=dstWidth-1; (i*(int64_t)xInc)>>16 >=srcW-1; i--) { |
| 52 | 1 | dst1[i] = src1[srcW-1]*128; | |
| 53 | 1 | dst2[i] = src2[srcW-1]*128; | |
| 54 | } | ||
| 55 | 1 | } | |
| 56 |