summaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-03 05:19:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-03 05:19:30 +0200
commit99eb31e263a24bc6c5a7a3f455a2bcb04a60e70e (patch)
tree83aab2f083fd3d6923d4e76fe0cc0c41ef7aef35 /libavcodec/x86
parent9034001b17077e9da5205c4344eb1b88b9882f03 (diff)
parentf190f676bc93a7e80344f2feeb3b9b44604d4717 (diff)
downloadffmpeg-streaming-99eb31e263a24bc6c5a7a3f455a2bcb04a60e70e.zip
ffmpeg-streaming-99eb31e263a24bc6c5a7a3f455a2bcb04a60e70e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits) Replace custom DEBUG preprocessor trickery by the standard one. vorbis: Remove non-compiling debug statement. vorbis: Remove pointless DEBUG #ifdef around debug output macros. cook: Remove non-compiling debug output. Remove pointless #ifdefs around function declarations in a header. Replace #ifdef + av_log() combinations by av_dlog(). Replace custom debug output functions by av_dlog(). cook: Remove unused debug functions. Remove stray extra arguments from av_dlog() invocations. targa: fix big-endian build v4l2: remove one forgotten use of AVFormatParameters.pix_fmt. vfwcap: add a framerate private option. v4l2: add a framerate private option. libdc1394: add a framerate private option. fbdev: add a framerate private option. bktr: add a framerate private option. oma: check avio_read() return value nutdec: remove unused variable Remove unused variables swscale: allocate larger buffer to handle altivec overreads. ... Conflicts: ffmpeg.c libavcodec/dca.c libavcodec/dirac.c libavcodec/error_resilience.c libavcodec/h264.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pthread.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/shorten.c libavcodec/truemotion2.c libavcodec/utils.c libavdevice/dv1394.c libavdevice/fbdev.c libavdevice/libdc1394.c libavdevice/v4l2.c libavformat/4xm.c libavformat/apetag.c libavformat/asfdec.c libavformat/avidec.c libavformat/mmf.c libavformat/mpeg.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/oggdec.c libavformat/oggparseogm.c libavformat/rl2.c libavformat/rmdec.c libavformat/rpl.c libavformat/rtpdec_latm.c libavformat/sauce.c libavformat/sol.c libswscale/utils.c tests/ref/vsynth1/error tests/ref/vsynth2/error Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/h264_idct_10bit.asm178
-rw-r--r--libavcodec/x86/h264_intrapred.asm6
-rw-r--r--libavcodec/x86/h264_intrapred_init.c8
3 files changed, 84 insertions, 108 deletions
diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm
index 3d0004e..3f7cf4c 100644
--- a/libavcodec/x86/h264_idct_10bit.asm
+++ b/libavcodec/x86/h264_idct_10bit.asm
@@ -133,7 +133,7 @@ ADD4x4IDCT avx
%macro ADD16_OP 3
cmp byte [r4+%3], 0
jz .skipblock%2
- mov r5d, dword [r1+%2*4]
+ mov r5d, [r1+%2*4]
call add4x4_idct_%1
.skipblock%2:
%if %2<15
@@ -159,7 +159,7 @@ cglobal h264_idct_add16_10_%1, 5,6
ADD16_OP %1, 13, 7+3*8
ADD16_OP %1, 14, 6+4*8
ADD16_OP %1, 15, 7+4*8
- RET
+ REP_RET
%endmacro
INIT_XMM
@@ -201,7 +201,7 @@ IDCT_ADD16_10 avx
INIT_MMX
cglobal h264_idct_dc_add_10_mmx2,3,3
- movd m0, dword [r1]
+ movd m0, [r1]
paddd m0, [pd_32]
psrad m0, 6
lea r1, [r2*3]
@@ -215,7 +215,7 @@ cglobal h264_idct_dc_add_10_mmx2,3,3
;-----------------------------------------------------------------------------
%macro IDCT8_DC_ADD 1
cglobal h264_idct8_dc_add_10_%1,3,3,7
- mov r1d, dword [r1]
+ mov r1d, [r1]
add r1, 32
sar r1, 6
movd m0, r1d
@@ -240,26 +240,27 @@ IDCT8_DC_ADD avx
;-----------------------------------------------------------------------------
%macro AC 2
.ac%2
- mov r5d, dword [r1+(%2+0)*4]
+ mov r5d, [r1+(%2+0)*4]
call add4x4_idct_%1
- mov r5d, dword [r1+(%2+1)*4]
+ mov r5d, [r1+(%2+1)*4]
add r2, 64
call add4x4_idct_%1
add r2, 64
jmp .skipadd%2
%endmacro
+%assign last_block 16
%macro ADD16_OP_INTRA 3
- cmp word [r4+%3], 0
+ cmp word [r4+%3], 0
jnz .ac%2
- mov r6d, dword [r2+ 0]
- or r6d, dword [r2+64]
+ mov r5d, [r2+ 0]
+ or r5d, [r2+64]
jz .skipblock%2
- mov r5d, dword [r1+(%2+0)*4]
+ mov r5d, [r1+(%2+0)*4]
call idct_dc_add_%1
.skipblock%2:
-%if %2<15
- add r2, 128
+%if %2<last_block-2
+ add r2, 128
%endif
.skipadd%2:
%endmacro
@@ -287,12 +288,15 @@ cglobal h264_idct_add16intra_10_%1,5,7,8
ADD16_OP_INTRA %1, 10, 4+4*8
ADD16_OP_INTRA %1, 12, 6+3*8
ADD16_OP_INTRA %1, 14, 6+4*8
- RET
-%assign i 14
-%rep 8
- AC %1, i
-%assign i i-2
-%endrep
+ REP_RET
+ AC %1, 8
+ AC %1, 10
+ AC %1, 12
+ AC %1, 14
+ AC %1, 0
+ AC %1, 2
+ AC %1, 4
+ AC %1, 6
%endmacro
INIT_XMM
@@ -302,47 +306,33 @@ INIT_AVX
IDCT_ADD16INTRA_10 avx
%endif
+%assign last_block 24
;-----------------------------------------------------------------------------
; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
;-----------------------------------------------------------------------------
%macro IDCT_ADD8 1
cglobal h264_idct_add8_10_%1,5,7
- mov r5, 16
- add r2, 1024
-%ifdef PIC
- lea r11, [scan8_mem]
-%endif
-%ifdef ARCH_X86_64
- mov r10, r0
-%endif
-.nextblock:
- movzx r6, byte [scan8+r5]
- movzx r6, byte [r4+r6]
- or r6d, dword [r2]
- test r6, r6
- jz .skipblock
%ifdef ARCH_X86_64
- mov r0d, dword [r1+r5*4]
- add r0, [r10]
-%else
- mov r0, r0m
- mov r0, [r0]
- add r0, dword [r1+r5*4]
+ mov r10, r0
%endif
- IDCT4_ADD_10 r0, r2, r3
-.skipblock:
- inc r5
- add r2, 64
- test r5, 3
- jnz .nextblock
+ add r2, 1024
+ mov r0, [r0]
+ ADD16_OP_INTRA %1, 16, 1+1*8
+ ADD16_OP_INTRA %1, 18, 1+2*8
%ifdef ARCH_X86_64
- add r10, gprsize
+ mov r0, [r10+gprsize]
%else
- add r0mp, gprsize
+ mov r0, r0m
+ mov r0, [r0+gprsize]
%endif
- test r5, 4
- jnz .nextblock
+ ADD16_OP_INTRA %1, 20, 1+4*8
+ ADD16_OP_INTRA %1, 22, 1+5*8
REP_RET
+ AC %1, 16
+ AC %1, 18
+ AC %1, 20
+ AC %1, 22
+
%endmacro ; IDCT_ADD8
INIT_XMM
@@ -356,51 +346,51 @@ IDCT_ADD8 avx
; void h264_idct8_add(pixel *dst, dctcoef *block, int stride)
;-----------------------------------------------------------------------------
%macro IDCT8_1D 2
- SWAP 0, 1
- psrad m4, m5, 1
- psrad m1, m0, 1
- paddd m4, m5
- paddd m1, m0
- paddd m4, m7
- paddd m1, m5
- psubd m4, m0
- paddd m1, m3
-
- psubd m0, m3
- psubd m5, m3
- paddd m0, m7
- psubd m5, m7
- psrad m3, 1
- psrad m7, 1
- psubd m0, m3
- psubd m5, m7
-
- SWAP 1, 7
- psrad m1, m7, 2
- psrad m3, m4, 2
- paddd m3, m0
- psrad m0, 2
- paddd m1, m5
- psrad m5, 2
- psubd m0, m4
- psubd m7, m5
-
- SWAP 5, 6
- psrad m4, m2, 1
- psrad m6, m5, 1
- psubd m4, m5
- paddd m6, m2
-
- mova m2, %1
- mova m5, %2
- SUMSUB_BA d, 5, 2
- SUMSUB_BA d, 6, 5
- SUMSUB_BA d, 4, 2
- SUMSUB_BA d, 7, 6
- SUMSUB_BA d, 0, 4
- SUMSUB_BA d, 3, 2
- SUMSUB_BA d, 1, 5
- SWAP 7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
+ SWAP 0, 1
+ psrad m4, m5, 1
+ psrad m1, m0, 1
+ paddd m4, m5
+ paddd m1, m0
+ paddd m4, m7
+ paddd m1, m5
+ psubd m4, m0
+ paddd m1, m3
+
+ psubd m0, m3
+ psubd m5, m3
+ paddd m0, m7
+ psubd m5, m7
+ psrad m3, 1
+ psrad m7, 1
+ psubd m0, m3
+ psubd m5, m7
+
+ SWAP 1, 7
+ psrad m1, m7, 2
+ psrad m3, m4, 2
+ paddd m3, m0
+ psrad m0, 2
+ paddd m1, m5
+ psrad m5, 2
+ psubd m0, m4
+ psubd m7, m5
+
+ SWAP 5, 6
+ psrad m4, m2, 1
+ psrad m6, m5, 1
+ psubd m4, m5
+ paddd m6, m2
+
+ mova m2, %1
+ mova m5, %2
+ SUMSUB_BA d, 5, 2
+ SUMSUB_BA d, 6, 5
+ SUMSUB_BA d, 4, 2
+ SUMSUB_BA d, 7, 6
+ SUMSUB_BA d, 0, 4
+ SUMSUB_BA d, 3, 2
+ SUMSUB_BA d, 1, 5
+ SWAP 7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
%endmacro
%macro IDCT8_1D_FULL 1
@@ -536,7 +526,7 @@ IDCT8_ADD avx
%macro IDCT8_ADD4_OP 3
cmp byte [r4+%3], 0
jz .skipblock%2
- mov r0d, dword [r6+%2*4]
+ mov r0d, [r6+%2*4]
add r0, r5
call h264_idct8_add1_10_%1
.skipblock%2:
diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
index 191eb8d..a9da6a1 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -836,7 +836,6 @@ PRED8x8_H ssse3
;-----------------------------------------------------------------------------
; void pred8x8_top_dc_mmxext(uint8_t *src, int stride)
;-----------------------------------------------------------------------------
-%ifdef CONFIG_GPL
cglobal pred8x8_top_dc_mmxext, 2,5
sub r0, r1
movq mm0, [r0]
@@ -927,7 +926,6 @@ cglobal pred8x8_dc_mmxext, 2,5
movq [r4+r1*1], m1
movq [r4+r1*2], m1
RET
-%endif
;-----------------------------------------------------------------------------
; void pred8x8_dc_rv40(uint8_t *src, int stride)
@@ -1083,7 +1081,6 @@ cglobal pred8x8_tm_vp8_ssse3, 2,3,6
;-----------------------------------------------------------------------------
; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride)
;-----------------------------------------------------------------------------
-%ifdef CONFIG_GPL
%macro PRED8x8L_TOP_DC 1
cglobal pred8x8l_top_dc_%1, 4,4
sub r0, r3
@@ -2476,7 +2473,6 @@ PRED8x8L_HORIZONTAL_DOWN sse2
INIT_MMX
%define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL_DOWN ssse3
-%endif
;-----------------------------------------------------------------------------
; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride)
@@ -2608,7 +2604,6 @@ cglobal pred4x4_vertical_vp8_mmxext, 3,3
;-----------------------------------------------------------------------------
; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
;-----------------------------------------------------------------------------
-%ifdef CONFIG_GPL
INIT_MMX
cglobal pred4x4_down_left_mmxext, 3,3
sub r0, r2
@@ -2786,4 +2781,3 @@ cglobal pred4x4_down_right_mmxext, 3,3
psrlq m0, 8
movh [r0+r2*1], m0
RET
-%endif
diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
index fa5b86f..f001242 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -129,7 +129,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
-#if CONFIG_GPL
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext;
h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_mmxext;
@@ -142,9 +141,7 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_mmxext;
h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext;
h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext;
-#endif
h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext;
-#if CONFIG_GPL
if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264)
@@ -156,7 +153,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
h->pred8x8 [TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext;
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_mmxext;
}
-#endif
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
@@ -181,13 +177,11 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
if (mm_flags & AV_CPU_FLAG_SSE2) {
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
-#if CONFIG_GPL
h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2;
h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_sse2;
h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2;
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2;
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2;
-#endif
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
@@ -207,7 +201,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
-#if CONFIG_GPL
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3;
h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_ssse3;
@@ -218,7 +211,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3;
h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3;
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3;
-#endif
if (codec_id == CODEC_ID_VP8) {
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3;
OpenPOWER on IntegriCloud