diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-22 01:03:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-22 01:16:41 +0200 |
commit | aedc908601de7396751a9a4504e064782d9f6a0b (patch) | |
tree | 8f04b899142439893bac426ac83d05c4068b099c /libavcodec/h264dsp_template.c | |
parent | 1a7090bfafe986d4470ba8059c815939171ddb74 (diff) | |
parent | f4b51d061f0f34e36be876b562b8abe47f4b9c1c (diff) | |
download | ffmpeg-aedc908601de7396751a9a4504e064782d9f6a0b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (35 commits)
flvdec: Do not call parse_keyframes_index with a NULL stream
libspeexdec: include system headers before local headers
libspeexdec: return meaningful error codes
libspeexdec: cosmetics: reindent
libspeexdec: decode one frame at a time.
swscale: fix signed shift overflows in ff_yuv2rgb_c_init_tables()
Move timefilter code from lavf to lavd.
mov: add support for hdvd and pgapmetadata atoms
mov: rename function _stik, some indentation cosmetics
mov: rename function _int8 to remove ambiguity, some indentation cosmetics
mov: parse the gnre atom
mp3on4: check for allocation failures in decode_init_mp3on4()
mp3on4: create a separate flush function for MP3onMP4.
mp3on4: ensure that the frame channel count does not exceed the codec channel count.
mp3on4: set channel layout
mp3on4: fix the output channel order
mp3on4: allocate temp buffer with av_malloc() instead of on the stack.
mp3on4: copy MPADSPContext from first context to all contexts.
fmtconvert: port float_to_int16_interleave() 2-channel x86 inline asm to yasm
fmtconvert: port int32_to_float_fmul_scalar() x86 inline asm to yasm
...
Conflicts:
libavcodec/arm/h264dsp_init_arm.c
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_ps.c
libavcodec/h264dsp_template.c
libavcodec/h264idct_template.c
libavcodec/h264pred.c
libavcodec/h264pred_template.c
libavcodec/x86/h264dsp_mmx.c
libavdevice/Makefile
libavdevice/jack_audio.c
libavformat/Makefile
libavformat/flvdec.c
libavformat/flvenc.c
libavutil/pixfmt.h
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264dsp_template.c')
-rw-r--r-- | libavcodec/h264dsp_template.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c index 3023541634..4d5faf01c0 100644 --- a/libavcodec/h264dsp_template.c +++ b/libavcodec/h264dsp_template.c @@ -29,14 +29,16 @@ #define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom ) #define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) -#define H264_WEIGHT(W,H) \ -static void FUNCC(weight_h264_pixels ## W ## x ## H)(uint8_t *p_block, int stride, int log2_denom, int weight, int offset){ \ +#define H264_WEIGHT(W) \ +static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int height, \ + int log2_denom, int weight, int offset) \ +{ \ int y; \ - pixel *block = (pixel*)p_block; \ + pixel *block = (pixel*)_block; \ stride >>= sizeof(pixel)-1; \ offset <<= (log2_denom + (BIT_DEPTH-8)); \ if(log2_denom) offset += 1<<(log2_denom-1); \ - for(y=0; y<H; y++, block += stride){ \ + for (y = 0; y < height; y++, block += stride) { \ op_scale1(0); \ op_scale1(1); \ if(W==2) continue; \ @@ -58,14 +60,16 @@ static void FUNCC(weight_h264_pixels ## W ## x ## H)(uint8_t *p_block, int strid op_scale1(15); \ } \ } \ -static void FUNCC(biweight_h264_pixels ## W ## x ## H)(uint8_t *_dst, uint8_t *_src, int stride, int log2_denom, int weightd, int weights, int offset){ \ +static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, int stride, int height, \ + int log2_denom, int weightd, int weights, int offset) \ +{ \ int y; \ pixel *dst = (pixel*)_dst; \ pixel *src = (pixel*)_src; \ stride >>= sizeof(pixel)-1; \ offset <<= (BIT_DEPTH-8); \ offset = ((offset + 1) | 1) << log2_denom; \ - for(y=0; y<H; y++, dst += stride, src += stride){ \ + for (y = 0; y < height; y++, dst += stride, src += stride) { \ op_scale2(0); \ op_scale2(1); \ if(W==2) continue; \ @@ -88,16 +92,10 @@ static void FUNCC(biweight_h264_pixels ## W ## x ## H)(uint8_t *_dst, uint8_t *_ } \ } -H264_WEIGHT(16,16) -H264_WEIGHT(16,8) -H264_WEIGHT(8,16) -H264_WEIGHT(8,8) -H264_WEIGHT(8,4) -H264_WEIGHT(4,8) -H264_WEIGHT(4,4) -H264_WEIGHT(4,2) -H264_WEIGHT(2,4) -H264_WEIGHT(2,2) +H264_WEIGHT(16) +H264_WEIGHT(8) +H264_WEIGHT(4) +H264_WEIGHT(2) #undef op_scale1 #undef op_scale2 |