comparison dsputil.c @ 3029:7a92269a3ccd libavcodec

tweak h264_biweight
author lorenm
date Mon, 09 Jan 2006 03:38:37 +0000
parents c75fb0747e74
children 0b546eab515d
comparison
equal deleted inserted replaced
3028:1fadd4c26175 3029:7a92269a3ccd
2487 2487
2488 #define op_scale1(x) block[x] = clip_uint8( (block[x]*weight + offset) >> log2_denom ) 2488 #define op_scale1(x) block[x] = clip_uint8( (block[x]*weight + offset) >> log2_denom )
2489 #define op_scale2(x) dst[x] = clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) 2489 #define op_scale2(x) dst[x] = clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
2490 #define H264_WEIGHT(W,H) \ 2490 #define H264_WEIGHT(W,H) \
2491 static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \ 2491 static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \
2492 int attribute_unused x, y; \ 2492 int y; \
2493 offset <<= log2_denom; \ 2493 offset <<= log2_denom; \
2494 if(log2_denom) offset += 1<<(log2_denom-1); \ 2494 if(log2_denom) offset += 1<<(log2_denom-1); \
2495 for(y=0; y<H; y++, block += stride){ \ 2495 for(y=0; y<H; y++, block += stride){ \
2496 op_scale1(0); \ 2496 op_scale1(0); \
2497 op_scale1(1); \ 2497 op_scale1(1); \
2512 op_scale1(13); \ 2512 op_scale1(13); \
2513 op_scale1(14); \ 2513 op_scale1(14); \
2514 op_scale1(15); \ 2514 op_scale1(15); \
2515 } \ 2515 } \
2516 } \ 2516 } \
2517 static void biweight_h264_pixels ## W ## x ## H ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offsetd, int offsets){ \ 2517 static void biweight_h264_pixels ## W ## x ## H ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \
2518 int attribute_unused x, y; \ 2518 int y; \
2519 int offset = (offsets + offsetd + 1) >> 1; \ 2519 offset = ((offset + 1) | 1) << log2_denom; \
2520 offset = ((offset << 1) + 1) << log2_denom; \
2521 for(y=0; y<H; y++, dst += stride, src += stride){ \ 2520 for(y=0; y<H; y++, dst += stride, src += stride){ \
2522 op_scale2(0); \ 2521 op_scale2(0); \
2523 op_scale2(1); \ 2522 op_scale2(1); \
2524 if(W==2) continue; \ 2523 if(W==2) continue; \
2525 op_scale2(2); \ 2524 op_scale2(2); \