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/x86/h264dsp_mmx.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/x86/h264dsp_mmx.c')
-rw-r--r-- | libavcodec/x86/h264dsp_mmx.c | 177 |
1 files changed, 64 insertions, 113 deletions
diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c index 71beb262c9..b337462aec 100644 --- a/libavcodec/x86/h264dsp_mmx.c +++ b/libavcodec/x86/h264dsp_mmx.c @@ -298,63 +298,53 @@ LF_IFUNC(v, luma_intra, 10, mmxext) /***********************************/ /* weighted prediction */ -#define H264_WEIGHT(W, H, OPT) \ -void ff_h264_weight_ ## W ## x ## H ## _ ## OPT(uint8_t *dst, \ - int stride, int log2_denom, int weight, int offset); +#define H264_WEIGHT(W, OPT) \ +void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, \ + int stride, int height, int log2_denom, int weight, int offset); -#define H264_BIWEIGHT(W, H, OPT) \ -void ff_h264_biweight_ ## W ## x ## H ## _ ## OPT(uint8_t *dst, \ - uint8_t *src, int stride, int log2_denom, int weightd, \ +#define H264_BIWEIGHT(W, OPT) \ +void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, \ + uint8_t *src, int stride, int height, int log2_denom, int weightd, \ int weights, int offset); -#define H264_BIWEIGHT_MMX(W,H) \ -H264_WEIGHT (W, H, mmx2) \ -H264_BIWEIGHT(W, H, mmx2) - -#define H264_BIWEIGHT_MMX_SSE(W,H) \ -H264_BIWEIGHT_MMX(W, H) \ -H264_WEIGHT (W, H, sse2) \ -H264_BIWEIGHT (W, H, sse2) \ -H264_BIWEIGHT (W, H, ssse3) - -H264_BIWEIGHT_MMX_SSE(16, 16) -H264_BIWEIGHT_MMX_SSE(16, 8) -H264_BIWEIGHT_MMX_SSE( 8, 16) -H264_BIWEIGHT_MMX_SSE( 8, 8) -H264_BIWEIGHT_MMX_SSE( 8, 4) -H264_BIWEIGHT_MMX ( 4, 8) -H264_BIWEIGHT_MMX ( 4, 4) -H264_BIWEIGHT_MMX ( 4, 2) - -#define H264_WEIGHT_10(W, H, DEPTH, OPT) \ -void ff_h264_weight_ ## W ## x ## H ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \ - int stride, int log2_denom, int weight, int offset); - -#define H264_BIWEIGHT_10(W, H, DEPTH, OPT) \ -void ff_h264_biweight_ ## W ## x ## H ## _ ## DEPTH ## _ ## OPT \ - (uint8_t *dst, uint8_t *src, int stride, int log2_denom, \ +#define H264_BIWEIGHT_MMX(W) \ +H264_WEIGHT (W, mmx2) \ +H264_BIWEIGHT(W, mmx2) + +#define H264_BIWEIGHT_MMX_SSE(W) \ +H264_BIWEIGHT_MMX(W) \ +H264_WEIGHT (W, sse2) \ +H264_BIWEIGHT (W, sse2) \ +H264_BIWEIGHT (W, ssse3) + +H264_BIWEIGHT_MMX_SSE(16) +H264_BIWEIGHT_MMX_SSE( 8) +H264_BIWEIGHT_MMX ( 4) + +#define H264_WEIGHT_10(W, DEPTH, OPT) \ +void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \ + int stride, int height, int log2_denom, int weight, int offset); + +#define H264_BIWEIGHT_10(W, DEPTH, OPT) \ +void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT \ + (uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, \ int weightd, int weights, int offset); -#define H264_BIWEIGHT_10_SSE(W, H, DEPTH) \ -H264_WEIGHT_10 (W, H, DEPTH, sse2) \ -H264_WEIGHT_10 (W, H, DEPTH, sse4) \ -H264_BIWEIGHT_10(W, H, DEPTH, sse2) \ -H264_BIWEIGHT_10(W, H, DEPTH, sse4) - -H264_BIWEIGHT_10_SSE(16, 16, 10) -H264_BIWEIGHT_10_SSE(16, 8, 10) -H264_BIWEIGHT_10_SSE( 8, 16, 10) -H264_BIWEIGHT_10_SSE( 8, 8, 10) -H264_BIWEIGHT_10_SSE( 8, 4, 10) -H264_BIWEIGHT_10_SSE( 4, 8, 10) -H264_BIWEIGHT_10_SSE( 4, 4, 10) -H264_BIWEIGHT_10_SSE( 4, 2, 10) +#define H264_BIWEIGHT_10_SSE(W, DEPTH) \ +H264_WEIGHT_10 (W, DEPTH, sse2) \ +H264_WEIGHT_10 (W, DEPTH, sse4) \ +H264_BIWEIGHT_10(W, DEPTH, sse2) \ +H264_BIWEIGHT_10(W, DEPTH, sse4) + +H264_BIWEIGHT_10_SSE(16, 10) +H264_BIWEIGHT_10_SSE( 8, 10) +H264_BIWEIGHT_10_SSE( 4, 10) void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) { int mm_flags = av_get_cpu_flags(); - if (mm_flags & AV_CPU_FLAG_MMX2) { + if (chroma_format_idc == 1 && mm_flags & AV_CPU_FLAG_MMX2) { c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2; } @@ -394,23 +384,13 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmxext; c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmxext; #endif - c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_mmx2; - c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_mmx2; - c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_mmx2; - c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_mmx2; - c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_mmx2; - c->weight_h264_pixels_tab[5]= ff_h264_weight_4x8_mmx2; - c->weight_h264_pixels_tab[6]= ff_h264_weight_4x4_mmx2; - c->weight_h264_pixels_tab[7]= ff_h264_weight_4x2_mmx2; - - c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_mmx2; - c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_mmx2; - c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_mmx2; - c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_mmx2; - c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_mmx2; - c->biweight_h264_pixels_tab[5]= ff_h264_biweight_4x8_mmx2; - c->biweight_h264_pixels_tab[6]= ff_h264_biweight_4x4_mmx2; - c->biweight_h264_pixels_tab[7]= ff_h264_biweight_4x2_mmx2; + c->weight_h264_pixels_tab[0]= ff_h264_weight_16_mmx2; + c->weight_h264_pixels_tab[1]= ff_h264_weight_8_mmx2; + c->weight_h264_pixels_tab[2]= ff_h264_weight_4_mmx2; + + c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16_mmx2; + c->biweight_h264_pixels_tab[1]= ff_h264_biweight_8_mmx2; + c->biweight_h264_pixels_tab[2]= ff_h264_biweight_4_mmx2; if (mm_flags&AV_CPU_FLAG_SSE2) { c->h264_idct8_add = ff_h264_idct8_add_8_sse2; @@ -422,17 +402,11 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom c->h264_idct_add16intra = ff_h264_idct_add16intra_8_sse2; c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_sse2; - c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_sse2; - c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_sse2; - c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_sse2; - c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_sse2; - c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_sse2; + c->weight_h264_pixels_tab[0]= ff_h264_weight_16_sse2; + c->weight_h264_pixels_tab[1]= ff_h264_weight_8_sse2; - c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_sse2; - c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_sse2; - c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_sse2; - c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_sse2; - c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_sse2; + c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16_sse2; + c->biweight_h264_pixels_tab[1]= ff_h264_biweight_8_sse2; #if HAVE_ALIGNED_STACK c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_sse2; @@ -442,11 +416,8 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom #endif } if (mm_flags&AV_CPU_FLAG_SSSE3) { - c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_ssse3; - c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_ssse3; - c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_ssse3; - c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_ssse3; - c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_ssse3; + c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16_ssse3; + c->biweight_h264_pixels_tab[1]= ff_h264_biweight_8_ssse3; } if (HAVE_AVX && mm_flags&AV_CPU_FLAG_AVX) { #if HAVE_ALIGNED_STACK @@ -485,23 +456,13 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2; #endif - c->weight_h264_pixels_tab[0] = ff_h264_weight_16x16_10_sse2; - c->weight_h264_pixels_tab[1] = ff_h264_weight_16x8_10_sse2; - c->weight_h264_pixels_tab[2] = ff_h264_weight_8x16_10_sse2; - c->weight_h264_pixels_tab[3] = ff_h264_weight_8x8_10_sse2; - c->weight_h264_pixels_tab[4] = ff_h264_weight_8x4_10_sse2; - c->weight_h264_pixels_tab[5] = ff_h264_weight_4x8_10_sse2; - c->weight_h264_pixels_tab[6] = ff_h264_weight_4x4_10_sse2; - c->weight_h264_pixels_tab[7] = ff_h264_weight_4x2_10_sse2; - - c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16x16_10_sse2; - c->biweight_h264_pixels_tab[1] = ff_h264_biweight_16x8_10_sse2; - c->biweight_h264_pixels_tab[2] = ff_h264_biweight_8x16_10_sse2; - c->biweight_h264_pixels_tab[3] = ff_h264_biweight_8x8_10_sse2; - c->biweight_h264_pixels_tab[4] = ff_h264_biweight_8x4_10_sse2; - c->biweight_h264_pixels_tab[5] = ff_h264_biweight_4x8_10_sse2; - c->biweight_h264_pixels_tab[6] = ff_h264_biweight_4x4_10_sse2; - c->biweight_h264_pixels_tab[7] = ff_h264_biweight_4x2_10_sse2; + c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2; + c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2; + c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2; + + c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2; + c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2; + c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2; c->h264_v_loop_filter_chroma= ff_deblock_v_chroma_10_sse2; c->h264_v_loop_filter_chroma_intra= ff_deblock_v_chroma_intra_10_sse2; @@ -513,23 +474,13 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom #endif } if (mm_flags&AV_CPU_FLAG_SSE4) { - c->weight_h264_pixels_tab[0] = ff_h264_weight_16x16_10_sse4; - c->weight_h264_pixels_tab[1] = ff_h264_weight_16x8_10_sse4; - c->weight_h264_pixels_tab[2] = ff_h264_weight_8x16_10_sse4; - c->weight_h264_pixels_tab[3] = ff_h264_weight_8x8_10_sse4; - c->weight_h264_pixels_tab[4] = ff_h264_weight_8x4_10_sse4; - c->weight_h264_pixels_tab[5] = ff_h264_weight_4x8_10_sse4; - c->weight_h264_pixels_tab[6] = ff_h264_weight_4x4_10_sse4; - c->weight_h264_pixels_tab[7] = ff_h264_weight_4x2_10_sse4; - - c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16x16_10_sse4; - c->biweight_h264_pixels_tab[1] = ff_h264_biweight_16x8_10_sse4; - c->biweight_h264_pixels_tab[2] = ff_h264_biweight_8x16_10_sse4; - c->biweight_h264_pixels_tab[3] = ff_h264_biweight_8x8_10_sse4; - c->biweight_h264_pixels_tab[4] = ff_h264_biweight_8x4_10_sse4; - c->biweight_h264_pixels_tab[5] = ff_h264_biweight_4x8_10_sse4; - c->biweight_h264_pixels_tab[6] = ff_h264_biweight_4x4_10_sse4; - c->biweight_h264_pixels_tab[7] = ff_h264_biweight_4x2_10_sse4; + c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4; + c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4; + c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4; + + c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4; + c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4; + c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4; } #if HAVE_AVX if (mm_flags&AV_CPU_FLAG_AVX) { |