diff options
author | Michael Niedermayer | 2012-07-31 22:41:00 +0200 |
---|---|---|
committer | Michael Niedermayer | 2012-07-31 22:41:00 +0200 |
commit | d1dad7c824c14939a0e18fa262f3e51957de6e3e (patch) | |
tree | 615f6ba80611f53e520d2ae479d9d4409077a78d /libavcodec | |
parent | d2ca5dd0f33b0fdbb5d2a7429c8f71ff1dffffb7 (diff) | |
parent | f2ed006c90ccb65cd143d8b0fcfc28ffb98c4289 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpc8: return more meaningful error codes.
mpc: return more meaningful error codes.
wv,mpc8: don't return apetag data in packets.
rtmp: do not warn about receiving metadata packets
x86: h264dsp: Adjust YASM #ifdefs
x86: yadif: Mark mmxext optimizations as such
h264: convert loop filter strength dsp function to yasm.
Improve descriptiveness of a number of codec and container long names
Conflicts:
libavcodec/flvdec.c
libavcodec/libopenjpegdec.c
libavformat/apetag.c
libavformat/mp3dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacdec.c | 2 | ||||
-rw-r--r-- | libavcodec/aacenc.c | 2 | ||||
-rw-r--r-- | libavcodec/amrnbdec.c | 2 | ||||
-rw-r--r-- | libavcodec/amrwbdec.c | 2 | ||||
-rw-r--r-- | libavcodec/assdec.c | 2 | ||||
-rw-r--r-- | libavcodec/assenc.c | 2 | ||||
-rw-r--r-- | libavcodec/bmp.c | 2 | ||||
-rw-r--r-- | libavcodec/bmpenc.c | 2 | ||||
-rw-r--r-- | libavcodec/cavsdec.c | 2 | ||||
-rw-r--r-- | libavcodec/cook.c | 2 | ||||
-rw-r--r-- | libavcodec/flvdec.c | 2 | ||||
-rw-r--r-- | libavcodec/flvenc.c | 2 | ||||
-rw-r--r-- | libavcodec/libfaac.c | 2 | ||||
-rw-r--r-- | libavcodec/libilbc.c | 4 | ||||
-rw-r--r-- | libavcodec/libopencore-amr.c | 6 | ||||
-rw-r--r-- | libavcodec/libvo-aacenc.c | 2 | ||||
-rw-r--r-- | libavcodec/libvo-amrwbenc.c | 4 | ||||
-rw-r--r-- | libavcodec/libxavs.c | 2 | ||||
-rw-r--r-- | libavcodec/tta.c | 2 | ||||
-rw-r--r-- | libavcodec/x86/h264_deblock.asm | 168 | ||||
-rw-r--r-- | libavcodec/x86/h264dsp_mmx.c | 164 |
21 files changed, 198 insertions, 180 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index fa71c77ddc..a71bae2887 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -2914,7 +2914,7 @@ AVCodec ff_aac_latm_decoder = { .init = latm_decode_init, .close = aac_decode_close, .decode = latm_decode_frame, - .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Codec LATM syntax)"), + .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"), .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 7696e96bdf..b002b8c305 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -829,6 +829,6 @@ AVCodec ff_aac_encoder = { CODEC_CAP_EXPERIMENTAL, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"), + .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), .priv_class = &aacenc_class, }; diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index 46e4856beb..c791110dc7 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -1080,7 +1080,7 @@ AVCodec ff_amrnb_decoder = { .init = amrnb_decode_init, .decode = amrnb_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate NarrowBand"), + .long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"), .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index beb3bd79a3..afd8d64b1b 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -1262,7 +1262,7 @@ AVCodec ff_amrwb_decoder = { .init = amrwb_decode_init, .decode = amrwb_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate WideBand"), + .long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"), .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index 979af2a221..fc5ba14b4b 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -68,7 +68,7 @@ static int ass_decode_close(AVCodecContext *avctx) AVCodec ff_ass_decoder = { .name = "ass", - .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"), + .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"), .type = AVMEDIA_TYPE_SUBTITLE, .id = CODEC_ID_SSA, .init = ass_decode_init, diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c index 103f2ff276..87a8dd62c0 100644 --- a/libavcodec/assenc.c +++ b/libavcodec/assenc.c @@ -59,7 +59,7 @@ static int ass_encode_frame(AVCodecContext *avctx, AVCodec ff_ass_encoder = { .name = "ass", - .long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"), + .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"), .type = AVMEDIA_TYPE_SUBTITLE, .id = CODEC_ID_SSA, .init = ass_encode_init, diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index b6bc830662..91e0829029 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -358,5 +358,5 @@ AVCodec ff_bmp_decoder = { .close = bmp_decode_end, .decode = bmp_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("BMP image"), + .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), }; diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index 455d2a9c80..2c60d16deb 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -179,5 +179,5 @@ AVCodec ff_bmp_encoder = { PIX_FMT_MONOBLACK, PIX_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("BMP image"), + .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), }; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index a0b257466b..9212e474ea 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -740,5 +740,5 @@ AVCodec ff_cavs_decoder = { .decode = cavs_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = cavs_flush, - .long_name = NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"), + .long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), }; diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 292148a043..d27530caf9 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1319,5 +1319,5 @@ AVCodec ff_cook_decoder = { .close = cook_decode_close, .decode = cook_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("COOK"), + .long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"), }; diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index ce7c722806..ce7ae2c2c3 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -128,6 +128,6 @@ AVCodec ff_flv_decoder = { .decode = ff_h263_decode_frame, .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, .max_lowres = 3, - .long_name = NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), + .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .pix_fmts = ff_pixfmt_list_420, }; diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index 8cc2c9a604..397ca86ee3 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -95,6 +95,6 @@ AVCodec ff_flv_encoder = { .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), + .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .priv_class = &flv_class, }; diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c index c174f7af36..77b0cca00e 100644 --- a/libavcodec/libfaac.c +++ b/libavcodec/libfaac.c @@ -245,7 +245,7 @@ AVCodec ff_libfaac_encoder = { .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"), + .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Coding)"), .profiles = NULL_IF_CONFIG_SMALL(profiles), .channel_layouts = faac_channel_layouts, }; diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index afdbaf0ebc..384dcb9c8f 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -114,7 +114,7 @@ AVCodec ff_libilbc_decoder = { .init = ilbc_decode_init, .decode = ilbc_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Internet Low Bitrate Codec (iLBC)"), + .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), .priv_class = &ilbc_dec_class, }; @@ -209,7 +209,7 @@ AVCodec ff_libilbc_encoder = { .close = ilbc_encode_close, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Internet Low Bitrate Codec (iLBC)"), + .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), .defaults = ilbc_encode_defaults, .priv_class = &ilbc_enc_class, }; diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 85e6117a20..fc00841936 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -180,7 +180,7 @@ AVCodec ff_libopencore_amrnb_decoder = { .close = amr_nb_decode_close, .decode = amr_nb_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"), + .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), }; static av_cold int amr_nb_encode_init(AVCodecContext *avctx) @@ -297,7 +297,7 @@ AVCodec ff_libopencore_amrnb_encoder = { .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"), + .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), .priv_class = &class, }; @@ -384,7 +384,7 @@ AVCodec ff_libopencore_amrwb_decoder = { .close = amr_wb_decode_close, .decode = amr_wb_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Wide-Band"), + .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"), }; #endif /* CONFIG_LIBOPENCORE_AMRWB */ diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c index d9bde3ac95..cdd606813b 100644 --- a/libavcodec/libvo-aacenc.c +++ b/libavcodec/libvo-aacenc.c @@ -197,5 +197,5 @@ AVCodec ff_libvo_aacenc_encoder = { .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC"), + .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC (Advanced Audio Coding)"), }; diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c index 8884e9da31..c1026869c5 100644 --- a/libavcodec/libvo-amrwbenc.c +++ b/libavcodec/libvo-amrwbenc.c @@ -148,7 +148,7 @@ AVCodec ff_libvo_amrwbenc_encoder = { .close = amr_wb_encode_close, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn Adaptive " - "Multi-Rate (AMR) Wide-Band"), + .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB " + "(Adaptive Multi-Rate Wide-Band)"), .priv_class = &class, }; diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 39da64ca14..1d1deac340 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -424,7 +424,7 @@ AVCodec ff_libxavs_encoder = { .close = XAVS_close, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"), + .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"), .priv_class = &class, .defaults = xavs_defaults, }; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 84fa632960..51731706e8 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -474,5 +474,5 @@ AVCodec ff_tta_decoder = { .close = tta_decode_close, .decode = tta_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("True Audio (TTA)"), + .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), }; diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm index ea422e3b3a..a4ab08722a 100644 --- a/libavcodec/x86/h264_deblock.asm +++ b/libavcodec/x86/h264_deblock.asm @@ -27,6 +27,10 @@ %include "libavutil/x86/x86inc.asm" %include "libavutil/x86/x86util.asm" +SECTION_RODATA + +pb_3_1: times 4 db 3, 1 + SECTION .text cextern pb_0 @@ -921,3 +925,167 @@ ff_chroma_intra_body_mmx2: paddb m1, m5 paddb m2, m6 ret + +;----------------------------------------------------------------------------- +; void h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40], +; int8_t ref[2][40], int16_t mv[2][40][2], +; int bidir, int edges, int step, +; int mask_mv0, int mask_mv1, int field); +; +; bidir is 0 or 1 +; edges is 1 or 4 +; step is 1 or 2 +; mask_mv0 is 0 or 3 +; mask_mv1 is 0 or 1 +; field is 0 or 1 +;----------------------------------------------------------------------------- +%macro loop_filter_strength_iteration 7 ; edges, step, mask_mv, + ; dir, d_idx, mask_dir, bidir +%define edgesd %1 +%define stepd %2 +%define mask_mvd %3 +%define dir %4 +%define d_idx %5 +%define mask_dir %6 +%define bidir %7 + xor b_idxd, b_idxd ; for (b_idx = 0; b_idx < edges; b_idx += step) +%%.b_idx_loop: +%if mask_dir == 0 + pxor m0, m0 +%endif + test b_idxd, dword mask_mvd + jnz %%.skip_loop_iter ; if (!(b_idx & mask_mv)) +%if bidir == 1 + movd m2, [refq+b_idxq+d_idx+12] ; { ref0[bn] } + punpckldq m2, [refq+b_idxq+d_idx+52] ; { ref0[bn], ref1[bn] } + pshufw m0, [refq+b_idxq+12], 0x44 ; { ref0[b], ref0[b] } + pshufw m1, [refq+b_idxq+52], 0x44 ; { ref1[b], ref1[b] } + pshufw m3, m2, 0x4E ; { ref1[bn], ref0[bn] } + psubb m0, m2 ; { ref0[b] != ref0[bn], + ; ref0[b] != ref1[bn] } + psubb m1, m3 ; { ref1[b] != ref1[bn], + ; ref1[b] != ref0[bn] } + + por m0, m1 + mova m1, [mvq+b_idxq*4+(d_idx+12)*4] + mova m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize] + mova m3, m1 + mova m4, m2 + psubw m1, [mvq+b_idxq*4+12*4] + psubw m2, [mvq+b_idxq*4+12*4+mmsize] + psubw m3, [mvq+b_idxq*4+52*4] + psubw m4, [mvq+b_idxq*4+52*4+mmsize] + packsswb m1, m2 + packsswb m3, m4 + paddb m1, m6 + paddb m3, m6 + psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit + psubusb m3, m5 + packsswb m1, m3 + + por m0, m1 + mova m1, [mvq+b_idxq*4+(d_idx+52)*4] + mova m2, [mvq+b_idxq*4+(d_idx+52)*4+mmsize] + mova m3, m1 + mova m4, m2 + psubw m1, [mvq+b_idxq*4+12*4] + psubw m2, [mvq+b_idxq*4+12*4+mmsize] + psubw m3, [mvq+b_idxq*4+52*4] + psubw m4, [mvq+b_idxq*4+52*4+mmsize] + packsswb m1, m2 + packsswb m3, m4 + paddb m1, m6 + paddb m3, m6 + psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit + psubusb m3, m5 + packsswb m1, m3 + + pshufw m1, m1, 0x4E + por m0, m1 + pshufw m1, m0, 0x4E + pminub m0, m1 +%else ; bidir == 0 + movd m0, [refq+b_idxq+12] + psubb m0, [refq+b_idxq+d_idx+12] ; ref[b] != ref[bn] + + mova m1, [mvq+b_idxq*4+12*4] + mova m2, [mvq+b_idxq*4+12*4+mmsize] + psubw m1, [mvq+b_idxq*4+(d_idx+12)*4] + psubw m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize] + packsswb m1, m2 + paddb m1, m6 + psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit + packsswb m1, m1 + por m0, m1 +%endif ; bidir == 1/0 + +%%.skip_loop_iter: + movd m1, [nnzq+b_idxq+12] + por m1, [nnzq+b_idxq+d_idx+12] ; nnz[b] || nnz[bn] + + pminub m1, m7 + pminub m0, m7 + psllw m1, 1 + pxor m2, m2 + pmaxub m1, m0 + punpcklbw m1, m2 + movq [bsq+b_idxq+32*dir], m1 + + add b_idxd, dword stepd + cmp b_idxd, dword edgesd + jl %%.b_idx_loop +%endmacro + +INIT_MMX mmx2 +cglobal h264_loop_filter_strength, 9, 9, 0, bs, nnz, ref, mv, bidir, edges, \ + step, mask_mv0, mask_mv1, field +%define b_idxq bidirq +%define b_idxd bidird + cmp dword fieldm, 0 + mova m7, [pb_1] + mova m5, [pb_3] + je .nofield + mova m5, [pb_3_1] +.nofield: + mova m6, m5 + paddb m5, m5 + + shl dword stepd, 3 + shl dword edgesd, 3 +%if ARCH_X86_32 +%define mask_mv0d mask_mv0m +%define mask_mv1d mask_mv1m +%endif + shl dword mask_mv1d, 3 + shl dword mask_mv0d, 3 + + cmp dword bidird, 0 + jne .bidir + loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8, 0, 0 + loop_filter_strength_iteration 32, 8, mask_mv0d, 0, -1, -1, 0 + + mova m0, [bsq+mmsize*0] + mova m1, [bsq+mmsize*1] + mova m2, [bsq+mmsize*2] + mova m3, [bsq+mmsize*3] + TRANSPOSE4x4W 0, 1, 2, 3, 4 + mova [bsq+mmsize*0], m0 + mova [bsq+mmsize*1], m1 + mova [bsq+mmsize*2], m2 + mova [bsq+mmsize*3], m3 + RET + +.bidir: + loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8, 0, 1 + loop_filter_strength_iteration 32, 8, mask_mv0d, 0, -1, -1, 1 + + mova m0, [bsq+mmsize*0] + mova m1, [bsq+mmsize*1] + mova m2, [bsq+mmsize*2] + mova m3, [bsq+mmsize*3] + TRANSPOSE4x4W 0, 1, 2, 3, 4 + mova [bsq+mmsize*0], m0 + mova [bsq+mmsize*1], m1 + mova [bsq+mmsize*2], m2 + mova [bsq+mmsize*3], m3 + RET diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c index d767c687ad..54d83f0a45 100644 --- a/libavcodec/x86/h264dsp_mmx.c +++ b/libavcodec/x86/h264dsp_mmx.c @@ -88,158 +88,10 @@ void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul /***********************************/ /* deblocking */ -#define h264_loop_filter_strength_iteration_mmx2(bS, nz, ref, mv, bidir, edges, step, mask_mv, dir, d_idx, mask_dir) \ - do { \ - x86_reg b_idx; \ - mask_mv <<= 3; \ - for( b_idx=0; b_idx<edges; b_idx+=step ) { \ - if (!mask_dir) \ - __asm__ volatile( \ - "pxor %%mm0, %%mm0 \n\t" \ - :: \ - ); \ - if(!(mask_mv & b_idx)) { \ - if(bidir) { \ - __asm__ volatile( \ - "movd %a3(%0,%2), %%mm2 \n" \ - "punpckldq %a4(%0,%2), %%mm2 \n" /* { ref0[bn], ref1[bn] } */ \ - "pshufw $0x44, 12(%0,%2), %%mm0 \n" /* { ref0[b], ref0[b] } */ \ - "pshufw $0x44, 52(%0,%2), %%mm1 \n" /* { ref1[b], ref1[b] } */ \ - "pshufw $0x4E, %%mm2, %%mm3 \n" \ - "psubb %%mm2, %%mm0 \n" /* { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] } */ \ - "psubb %%mm3, %%mm1 \n" /* { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] } */ \ - \ - "por %%mm1, %%mm0 \n" \ - "movq %a5(%1,%2,4), %%mm1 \n" \ - "movq %a6(%1,%2,4), %%mm2 \n" \ - "movq %%mm1, %%mm3 \n" \ - "movq %%mm2, %%mm4 \n" \ - "psubw 48(%1,%2,4), %%mm1 \n" \ - "psubw 56(%1,%2,4), %%mm2 \n" \ - "psubw 208(%1,%2,4), %%mm3 \n" \ - "psubw 216(%1,%2,4), %%mm4 \n" \ - "packsswb %%mm2, %%mm1 \n" \ - "packsswb %%mm4, %%mm3 \n" \ - "paddb %%mm6, %%mm1 \n" \ - "paddb %%mm6, %%mm3 \n" \ - "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \ - "psubusb %%mm5, %%mm3 \n" \ - "packsswb %%mm3, %%mm1 \n" \ - \ - "por %%mm1, %%mm0 \n" \ - "movq %a7(%1,%2,4), %%mm1 \n" \ - "movq %a8(%1,%2,4), %%mm2 \n" \ - "movq %%mm1, %%mm3 \n" \ - "movq %%mm2, %%mm4 \n" \ - "psubw 48(%1,%2,4), %%mm1 \n" \ - "psubw 56(%1,%2,4), %%mm2 \n" \ - "psubw 208(%1,%2,4), %%mm3 \n" \ - "psubw 216(%1,%2,4), %%mm4 \n" \ - "packsswb %%mm2, %%mm1 \n" \ - "packsswb %%mm4, %%mm3 \n" \ - "paddb %%mm6, %%mm1 \n" \ - "paddb %%mm6, %%mm3 \n" \ - "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \ - "psubusb %%mm5, %%mm3 \n" \ - "packsswb %%mm3, %%mm1 \n" \ - \ - "pshufw $0x4E, %%mm1, %%mm1 \n" \ - "por %%mm1, %%mm0 \n" \ - "pshufw $0x4E, %%mm0, %%mm1 \n" \ - "pminub %%mm1, %%mm0 \n" \ - ::"r"(ref), \ - "r"(mv), \ - "r"(b_idx), \ - "i"(d_idx+12), \ - "i"(d_idx+52), \ - "i"(d_idx*4+48), \ - "i"(d_idx*4+56), \ - "i"(d_idx*4+208), \ - "i"(d_idx*4+216) \ - ); \ - } else { \ - __asm__ volatile( \ - "movd 12(%0,%2), %%mm0 \n" \ - "psubb %a3(%0,%2), %%mm0 \n" /* ref[b] != ref[bn] */ \ - "movq 48(%1,%2,4), %%mm1 \n" \ - "movq 56(%1,%2,4), %%mm2 \n" \ - "psubw %a4(%1,%2,4), %%mm1 \n" \ - "psubw %a5(%1,%2,4), %%mm2 \n" \ - "packsswb %%mm2, %%mm1 \n" \ - "paddb %%mm6, %%mm1 \n" \ - "psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \ - "packsswb %%mm1, %%mm1 \n" \ - "por %%mm1, %%mm0 \n" \ - ::"r"(ref), \ - "r"(mv), \ - "r"(b_idx), \ - "i"(d_idx+12), \ - "i"(d_idx*4+48), \ - "i"(d_idx*4+56) \ - ); \ - } \ - } \ - __asm__ volatile( \ - "movd 12(%0,%1), %%mm1 \n" \ - "por %a2(%0,%1), %%mm1 \n" /* nnz[b] || nnz[bn] */ \ - ::"r"(nnz), \ - "r"(b_idx), \ - "i"(d_idx+12) \ - ); \ - __asm__ volatile( \ - "pminub %%mm7, %%mm1 \n" \ - "pminub %%mm7, %%mm0 \n" \ - "psllw $1, %%mm1 \n" \ - "pxor %%mm2, %%mm2 \n" \ - "pmaxub %%mm0, %%mm1 \n" \ - "punpcklbw %%mm2, %%mm1 \n" \ - "movq %%mm1, %a1(%0,%2) \n" \ - ::"r"(bS), \ - "i"(32*dir), \ - "r"(b_idx) \ - :"memory" \ - ); \ - } \ - } while (0) - -static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], - int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) { - __asm__ volatile( - "movq %0, %%mm7 \n" - "movq %1, %%mm6 \n" - ::"m"(ff_pb_1), "m"(ff_pb_3) - ); - if(field) - __asm__ volatile( - "movq %0, %%mm6 \n" - ::"m"(ff_pb_3_1) - ); - __asm__ volatile( - "movq %%mm6, %%mm5 \n" - "paddb %%mm5, %%mm5 \n" - :); - - // could do a special case for dir==0 && edges==1, but it only reduces the - // average filter time by 1.2% - step <<= 3; - edges <<= 3; - h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, edges, step, mask_mv1, 1, -8, 0); - h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, 32, 8, mask_mv0, 0, -1, -1); - - __asm__ volatile( - "movq (%0), %%mm0 \n\t" - "movq 8(%0), %%mm1 \n\t" - "movq 16(%0), %%mm2 \n\t" - "movq 24(%0), %%mm3 \n\t" - TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4) - "movq %%mm0, (%0) \n\t" - "movq %%mm3, 8(%0) \n\t" - "movq %%mm4, 16(%0) \n\t" - "movq %%mm2, 24(%0) \n\t" - ::"r"(bS[0]) - :"memory" - ); -} +void ff_h264_loop_filter_strength_mmx2(int16_t bS[2][4][4], uint8_t nnz[40], + int8_t ref[2][40], int16_t mv[2][40][2], + int bidir, int edges, int step, + int mask_mv0, int mask_mv1, int field); #define LF_FUNC(DIR, TYPE, DEPTH, OPT) \ void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *pix, int stride, \ @@ -342,14 +194,14 @@ H264_BIWEIGHT_10_SSE( 4, 10) void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) { +#if HAVE_YASM int mm_flags = av_get_cpu_flags(); if (chroma_format_idc == 1 && mm_flags & AV_CPU_FLAG_MMX2) { - c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2; + c->h264_loop_filter_strength = ff_h264_loop_filter_strength_mmx2; } if (bit_depth == 8) { -#if HAVE_YASM if (mm_flags & AV_CPU_FLAG_MMX) { c->h264_idct_dc_add = c->h264_idct_add = ff_h264_idct_add_8_mmx; @@ -430,9 +282,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom } } } -#endif } else if (bit_depth == 10) { -#if HAVE_YASM if (mm_flags & AV_CPU_FLAG_MMX) { if (mm_flags & AV_CPU_FLAG_MMX2) { #if ARCH_X86_32 @@ -510,6 +360,6 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom #endif /* HAVE_AVX */ } } -#endif } +#endif } |