From 6ca60d4ddd9b34b98b8570d440d79736d060f02a Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 00:04:18 +0200 Subject: [PATCH 1/5] x86: h264_intrapred: port to cpuflags --- libavcodec/x86/h264_intrapred.asm | 230 ++++++++++++++++-------------- 1 file changed, 119 insertions(+), 111 deletions(-) diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm index 94d979c680..dc3d475e44 100644 --- a/libavcodec/x86/h264_intrapred.asm +++ b/libavcodec/x86/h264_intrapred.asm @@ -52,7 +52,8 @@ cextern pw_32 ; void pred16x16_vertical(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -cglobal pred16x16_vertical_8_mmx, 2,3 +INIT_MMX mmx +cglobal pred16x16_vertical_8, 2,3 sub r0, r1 mov r2, 8 movq mm0, [r0+0] @@ -67,7 +68,8 @@ cglobal pred16x16_vertical_8_mmx, 2,3 jg .loop REP_RET -cglobal pred16x16_vertical_8_sse, 2,3 +INIT_XMM sse +cglobal pred16x16_vertical_8, 2,3 sub r0, r1 mov r2, 4 movaps xmm0, [r0] @@ -122,7 +124,6 @@ INIT_MMX mmx2 PRED16x16_H INIT_XMM ssse3 PRED16x16_H -INIT_XMM ;----------------------------------------------------------------------------- ; void pred16x16_dc(uint8_t *src, int stride) @@ -185,13 +186,12 @@ INIT_XMM sse2 PRED16x16_DC INIT_XMM ssse3 PRED16x16_DC -INIT_XMM ;----------------------------------------------------------------------------- ; void pred16x16_tm_vp8(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -%macro PRED16x16_TM_MMX 0 +%macro PRED16x16_TM 0 cglobal pred16x16_tm_vp8_8, 2,5 sub r0, r1 pxor mm7, mm7 @@ -228,12 +228,12 @@ cglobal pred16x16_tm_vp8_8, 2,5 %endmacro INIT_MMX mmx -PRED16x16_TM_MMX +PRED16x16_TM INIT_MMX mmx2 -PRED16x16_TM_MMX -INIT_MMX +PRED16x16_TM -cglobal pred16x16_tm_vp8_8_sse2, 2,6,6 +INIT_XMM sse2 +cglobal pred16x16_tm_vp8_8, 2,6,6 sub r0, r1 pxor xmm2, xmm2 movdqa xmm0, [r0] @@ -548,7 +548,6 @@ INIT_XMM ssse3 H264_PRED16x16_PLANE h264 H264_PRED16x16_PLANE rv40 H264_PRED16x16_PLANE svq3 -INIT_XMM ;----------------------------------------------------------------------------- ; void pred8x8_plane(uint8_t *src, int stride) @@ -723,13 +722,13 @@ INIT_XMM sse2 H264_PRED8x8_PLANE INIT_XMM ssse3 H264_PRED8x8_PLANE -INIT_XMM ;----------------------------------------------------------------------------- ; void pred8x8_vertical(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -cglobal pred8x8_vertical_8_mmx, 2,2 +INIT_MMX mmx +cglobal pred8x8_vertical_8, 2,2 sub r0, r1 movq mm0, [r0] %rep 3 @@ -768,12 +767,12 @@ INIT_MMX mmx2 PRED8x8_H INIT_MMX ssse3 PRED8x8_H -INIT_MMX ;----------------------------------------------------------------------------- ; void pred8x8_top_dc_mmxext(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -cglobal pred8x8_top_dc_8_mmxext, 2,5 +INIT_MMX mmxext +cglobal pred8x8_top_dc_8, 2,5 sub r0, r1 movq mm0, [r0] pxor mm1, mm1 @@ -807,8 +806,8 @@ cglobal pred8x8_top_dc_8_mmxext, 2,5 ; void pred8x8_dc_mmxext(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -INIT_MMX -cglobal pred8x8_dc_8_mmxext, 2,5 +INIT_MMX mmxext +cglobal pred8x8_dc_8, 2,5 sub r0, r1 pxor m7, m7 movd m0, [r0+0] @@ -868,7 +867,8 @@ cglobal pred8x8_dc_8_mmxext, 2,5 ; void pred8x8_dc_rv40(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -cglobal pred8x8_dc_rv40_8_mmxext, 2,7 +INIT_MMX mmxext +cglobal pred8x8_dc_rv40_8, 2,7 mov r4, r0 sub r0, r1 pxor mm0, mm0 @@ -904,7 +904,7 @@ cglobal pred8x8_dc_rv40_8_mmxext, 2,7 ; void pred8x8_tm_vp8(uint8_t *src, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8_TM_MMX 0 +%macro PRED8x8_TM 0 cglobal pred8x8_tm_vp8_8, 2,6 sub r0, r1 pxor mm7, mm7 @@ -940,12 +940,12 @@ cglobal pred8x8_tm_vp8_8, 2,6 %endmacro INIT_MMX mmx -PRED8x8_TM_MMX +PRED8x8_TM INIT_MMX mmx2 -PRED8x8_TM_MMX -INIT_MMX +PRED8x8_TM -cglobal pred8x8_tm_vp8_8_sse2, 2,6,4 +INIT_XMM sse2 +cglobal pred8x8_tm_vp8_8, 2,6,4 sub r0, r1 pxor xmm1, xmm1 movq xmm0, [r0] @@ -973,7 +973,8 @@ cglobal pred8x8_tm_vp8_8_sse2, 2,6,4 jg .loop REP_RET -cglobal pred8x8_tm_vp8_8_ssse3, 2,3,6 +INIT_XMM ssse3 +cglobal pred8x8_tm_vp8_8, 2,3,6 sub r0, r1 movdqa xmm4, [tm_shuf] pxor xmm1, xmm1 @@ -1014,8 +1015,8 @@ cglobal pred8x8_tm_vp8_8_ssse3, 2,3,6 ;----------------------------------------------------------------------------- ; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_TOP_DC 1 -cglobal pred8x8l_top_dc_8_%1, 4,4 +%macro PRED8x8L_TOP_DC 0 +cglobal pred8x8l_top_dc_8, 4,4 sub r0, r3 pxor mm7, mm7 movq mm0, [r0-8] @@ -1061,18 +1062,19 @@ cglobal pred8x8l_top_dc_8_%1, 4,4 RET %endmacro -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -PRED8x8L_TOP_DC mmxext +PRED8x8L_TOP_DC +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_TOP_DC ssse3 +PRED8x8L_TOP_DC ;----------------------------------------------------------------------------- ;void pred8x8l_dc(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_DC 1 -cglobal pred8x8l_dc_8_%1, 4,5 +%macro PRED8x8L_DC 0 +cglobal pred8x8l_dc_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -1164,18 +1166,20 @@ cglobal pred8x8l_dc_8_%1, 4,5 movq [r4+r3*2], mm0 RET %endmacro -INIT_MMX + +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -PRED8x8L_DC mmxext +PRED8x8L_DC +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_DC ssse3 +PRED8x8L_DC ;----------------------------------------------------------------------------- ; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_HORIZONTAL 1 -cglobal pred8x8l_horizontal_8_%1, 4,4 +%macro PRED8x8L_HORIZONTAL 0 +cglobal pred8x8l_horizontal_8, 4,4 sub r0, r3 lea r2, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -1236,18 +1240,19 @@ cglobal pred8x8l_horizontal_8_%1, 4,4 RET %endmacro -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -PRED8x8L_HORIZONTAL mmxext +PRED8x8L_HORIZONTAL +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_HORIZONTAL ssse3 +PRED8x8L_HORIZONTAL ;----------------------------------------------------------------------------- ; void pred8x8l_vertical(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_VERTICAL 1 -cglobal pred8x8l_vertical_8_%1, 4,4 +%macro PRED8x8L_VERTICAL 0 +cglobal pred8x8l_vertical_8, 4,4 sub r0, r3 movq mm0, [r0-8] movq mm3, [r0] @@ -1287,19 +1292,20 @@ cglobal pred8x8l_vertical_8_%1, 4,4 RET %endmacro -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -PRED8x8L_VERTICAL mmxext +PRED8x8L_VERTICAL +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_VERTICAL ssse3 +PRED8x8L_VERTICAL ;----------------------------------------------------------------------------- ;void pred8x8l_down_left(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred8x8l_down_left_8_mmxext, 4,5 +cglobal pred8x8l_down_left_8, 4,5 sub r0, r3 movq mm0, [r0-8] movq mm3, [r0] @@ -1406,8 +1412,8 @@ cglobal pred8x8l_down_left_8_mmxext, 4,5 movq [r0+r3*1], mm1 RET -%macro PRED8x8L_DOWN_LEFT 1 -cglobal pred8x8l_down_left_8_%1, 4,4 +%macro PRED8x8L_DOWN_LEFT 0 +cglobal pred8x8l_down_left_8, 4,4 sub r0, r3 movq mm0, [r0-8] movq mm3, [r0] @@ -1467,7 +1473,7 @@ cglobal pred8x8l_down_left_8_%1, 4,4 lea r2, [r1+r3*2] movdqa xmm1, xmm3 pslldq xmm1, 1 -INIT_XMM +INIT_XMM cpuname PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4 psrldq xmm0, 1 movq [r0+r3*1], xmm0 @@ -1489,20 +1495,20 @@ INIT_XMM RET %endmacro -INIT_MMX +INIT_MMX sse2 %define PALIGNR PALIGNR_MMX -PRED8x8L_DOWN_LEFT sse2 -INIT_MMX +PRED8x8L_DOWN_LEFT +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_DOWN_LEFT ssse3 +PRED8x8L_DOWN_LEFT ;----------------------------------------------------------------------------- ;void pred8x8l_down_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred8x8l_down_right_8_mmxext, 4,5 +cglobal pred8x8l_down_right_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -1633,8 +1639,8 @@ cglobal pred8x8l_down_right_8_mmxext, 4,5 movq [r0+r3*1], mm0 RET -%macro PRED8x8L_DOWN_RIGHT 1 -cglobal pred8x8l_down_right_8_%1, 4,5 +%macro PRED8x8L_DOWN_RIGHT 0 +cglobal pred8x8l_down_right_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -1722,7 +1728,7 @@ cglobal pred8x8l_down_right_8_%1, 4,5 lea r0, [r2+r3*2] movdqa xmm2, xmm3 psrldq xmm2, 1 -INIT_XMM +INIT_XMM cpuname PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4 movdqa xmm1, xmm0 psrldq xmm1, 1 @@ -1743,20 +1749,20 @@ INIT_XMM RET %endmacro -INIT_MMX +INIT_MMX sse2 %define PALIGNR PALIGNR_MMX -PRED8x8L_DOWN_RIGHT sse2 -INIT_MMX +PRED8x8L_DOWN_RIGHT +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_DOWN_RIGHT ssse3 +PRED8x8L_DOWN_RIGHT ;----------------------------------------------------------------------------- ; void pred8x8l_vertical_right(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred8x8l_vertical_right_8_mmxext, 4,5 +cglobal pred8x8l_vertical_right_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -1862,8 +1868,8 @@ cglobal pred8x8l_vertical_right_8_mmxext, 4,5 movq [r4+r3*2], mm5 RET -%macro PRED8x8L_VERTICAL_RIGHT 1 -cglobal pred8x8l_vertical_right_8_%1, 4,5,7 +%macro PRED8x8L_VERTICAL_RIGHT 0 +cglobal pred8x8l_vertical_right_8, 4,5,7 ; manually spill XMM registers for Win64 because ; the code here is initialized with INIT_MMX WIN64_SPILL_XMM 7 @@ -1944,7 +1950,7 @@ cglobal pred8x8l_vertical_right_8_%1, 4,5,7 pslldq xmm0, 1 pslldq xmm1, 2 pavgb xmm2, xmm0 -INIT_XMM +INIT_XMM cpuname PRED4x4_LOWPASS xmm4, xmm3, xmm1, xmm0, xmm5 pandn xmm6, xmm4 movdqa xmm5, xmm4 @@ -1973,19 +1979,19 @@ INIT_XMM RET %endmacro -INIT_MMX +INIT_MMX sse2 %define PALIGNR PALIGNR_MMX -PRED8x8L_VERTICAL_RIGHT sse2 -INIT_MMX +PRED8x8L_VERTICAL_RIGHT +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_VERTICAL_RIGHT ssse3 +PRED8x8L_VERTICAL_RIGHT ;----------------------------------------------------------------------------- ;void pred8x8l_vertical_left(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_VERTICAL_LEFT 1 -cglobal pred8x8l_vertical_left_8_%1, 4,4 +%macro PRED8x8L_VERTICAL_LEFT 0 +cglobal pred8x8l_vertical_left_8, 4,4 sub r0, r3 movq mm0, [r0-8] movq mm3, [r0] @@ -2043,7 +2049,7 @@ cglobal pred8x8l_vertical_left_8_%1, 4,4 pslldq xmm1, 1 pavgb xmm3, xmm2 lea r2, [r1+r3*2] -INIT_XMM +INIT_XMM cpuname PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm4, xmm5 psrldq xmm0, 1 movq [r0+r3*1], xmm3 @@ -2064,19 +2070,19 @@ INIT_XMM RET %endmacro -INIT_MMX +INIT_MMX sse2 %define PALIGNR PALIGNR_MMX -PRED8x8L_VERTICAL_LEFT sse2 +PRED8x8L_VERTICAL_LEFT +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -INIT_MMX -PRED8x8L_VERTICAL_LEFT ssse3 +PRED8x8L_VERTICAL_LEFT ;----------------------------------------------------------------------------- ; void pred8x8l_horizontal_up(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED8x8L_HORIZONTAL_UP 1 -cglobal pred8x8l_horizontal_up_8_%1, 4,4 +%macro PRED8x8L_HORIZONTAL_UP 0 +cglobal pred8x8l_horizontal_up_8, 4,4 sub r0, r3 lea r2, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -2153,19 +2159,20 @@ cglobal pred8x8l_horizontal_up_8_%1, 4,4 RET %endmacro -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -PRED8x8L_HORIZONTAL_UP mmxext +PRED8x8L_HORIZONTAL_UP +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_HORIZONTAL_UP ssse3 +PRED8x8L_HORIZONTAL_UP ;----------------------------------------------------------------------------- ;void pred8x8l_horizontal_down(uint8_t *src, int has_topleft, int has_topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred8x8l_horizontal_down_8_mmxext, 4,5 +cglobal pred8x8l_horizontal_down_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -2279,8 +2286,8 @@ cglobal pred8x8l_horizontal_down_8_mmxext, 4,5 movq [r0+r3*1], mm3 RET -%macro PRED8x8L_HORIZONTAL_DOWN 1 -cglobal pred8x8l_horizontal_down_8_%1, 4,5 +%macro PRED8x8L_HORIZONTAL_DOWN 0 +cglobal pred8x8l_horizontal_down_8, 4,5 sub r0, r3 lea r4, [r0+r3*2] movq mm0, [r0+r3*1-8] @@ -2372,7 +2379,7 @@ cglobal pred8x8l_horizontal_down_8_%1, 4,5 movq2dq xmm5, mm1 pslldq xmm5, 8 por xmm1, xmm5 -INIT_XMM +INIT_XMM cpuname lea r2, [r4+r3*2] movdqa xmm2, xmm1 movdqa xmm3, xmm1 @@ -2403,18 +2410,19 @@ INIT_XMM RET %endmacro -INIT_MMX +INIT_MMX sse2 %define PALIGNR PALIGNR_MMX -PRED8x8L_HORIZONTAL_DOWN sse2 -INIT_MMX +PRED8x8L_HORIZONTAL_DOWN +INIT_MMX ssse3 %define PALIGNR PALIGNR_SSSE3 -PRED8x8L_HORIZONTAL_DOWN ssse3 +PRED8x8L_HORIZONTAL_DOWN ;----------------------------------------------------------------------------- ; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -cglobal pred4x4_dc_8_mmxext, 3,5 +INIT_MMX mmxext +cglobal pred4x4_dc_8, 3,5 pxor mm7, mm7 mov r4, r0 sub r0, r2 @@ -2443,7 +2451,7 @@ cglobal pred4x4_dc_8_mmxext, 3,5 ; void pred4x4_tm_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -%macro PRED4x4_TM_MMX 0 +%macro PRED4x4_TM 0 cglobal pred4x4_tm_vp8_8, 3,6 sub r0, r2 pxor mm7, mm7 @@ -2480,12 +2488,12 @@ cglobal pred4x4_tm_vp8_8, 3,6 %endmacro INIT_MMX mmx -PRED4x4_TM_MMX +PRED4x4_TM INIT_MMX mmx2 -PRED4x4_TM_MMX -INIT_MMX +PRED4x4_TM -cglobal pred4x4_tm_vp8_8_ssse3, 3,3 +INIT_XMM ssse3 +cglobal pred4x4_tm_vp8_8, 3,3 sub r0, r2 movq mm6, [tm_shuf] pxor mm1, mm1 @@ -2524,8 +2532,8 @@ cglobal pred4x4_tm_vp8_8_ssse3, 3,3 ; void pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX -cglobal pred4x4_vertical_vp8_8_mmxext, 3,3 +INIT_MMX mmxext +cglobal pred4x4_vertical_vp8_8, 3,3 sub r0, r2 movd m1, [r0-1] movd m0, [r0] @@ -2543,8 +2551,8 @@ cglobal pred4x4_vertical_vp8_8_mmxext, 3,3 ;----------------------------------------------------------------------------- ; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX -cglobal pred4x4_down_left_8_mmxext, 3,3 +INIT_MMX mmxext +cglobal pred4x4_down_left_8, 3,3 sub r0, r2 movq m1, [r0] punpckldq m1, [r1] @@ -2570,8 +2578,8 @@ cglobal pred4x4_down_left_8_mmxext, 3,3 ; void pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX -cglobal pred4x4_vertical_left_8_mmxext, 3,3 +INIT_MMX mmxext +cglobal pred4x4_vertical_left_8, 3,3 sub r0, r2 movq m1, [r0] punpckldq m1, [r1] @@ -2595,8 +2603,8 @@ cglobal pred4x4_vertical_left_8_mmxext, 3,3 ; void pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX -cglobal pred4x4_horizontal_up_8_mmxext, 3,3 +INIT_MMX mmxext +cglobal pred4x4_horizontal_up_8, 3,3 sub r0, r2 lea r1, [r0+r2*2] movd m0, [r0+r2*1-4] @@ -2628,9 +2636,9 @@ cglobal pred4x4_horizontal_up_8_mmxext, 3,3 ; void pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred4x4_horizontal_down_8_mmxext, 3,3 +cglobal pred4x4_horizontal_down_8, 3,3 sub r0, r2 lea r1, [r0+r2*2] movh m0, [r0-4] ; lt .. @@ -2664,9 +2672,9 @@ cglobal pred4x4_horizontal_down_8_mmxext, 3,3 ; void pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred4x4_vertical_right_8_mmxext, 3,3 +cglobal pred4x4_vertical_right_8, 3,3 sub r0, r2 lea r1, [r0+r2*2] movh m0, [r0] ; ........t3t2t1t0 @@ -2695,9 +2703,9 @@ cglobal pred4x4_vertical_right_8_mmxext, 3,3 ; void pred4x4_down_right_mmxext(uint8_t *src, const uint8_t *topright, int stride) ;----------------------------------------------------------------------------- -INIT_MMX +INIT_MMX mmxext %define PALIGNR PALIGNR_MMX -cglobal pred4x4_down_right_8_mmxext, 3,3 +cglobal pred4x4_down_right_8, 3,3 sub r0, r2 lea r1, [r0+r2*2] movq m1, [r1-8] From e004d175fe2463af8242e390b15350f4745be7b4 Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Thu, 8 Nov 2012 01:38:50 +0100 Subject: [PATCH 2/5] rtpenc_aac: Fix calculation of the header size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the high end byte was always set to zero. Also get rid of an unnecessary multiplication (which in practice couldn't overflow) before shifting. Signed-off-by: Martin Storsjö --- libavformat/rtpenc_aac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c index 86318dfa6e..1b2fa0a78c 100644 --- a/libavformat/rtpenc_aac.c +++ b/libavformat/rtpenc_aac.c @@ -47,8 +47,8 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size) memmove(p + 2, s->buf + 2, au_size); } /* Write the AU header size */ - p[0] = ((au_size * 8) & 0xFF) >> 8; - p[1] = (au_size * 8) & 0xFF; + p[0] = au_size >> 5; + p[1] = (au_size & 0x1F) << 3; ff_rtp_send_data(s1, p, s->buf_ptr - p, 1); From 00f8ad41c78df71c464e98d2c1171a40f205db78 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Mon, 5 Nov 2012 15:36:19 -0500 Subject: [PATCH 3/5] add 24-bit FLAC encoding to Changelog Also move a misplaced line from the 9_beta2 section to --- Changelog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index e2c4273ded..f8079d15fe 100644 --- a/Changelog +++ b/Changelog @@ -2,9 +2,13 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. version : +- ashowinfo audio filter +- 24-bit FLAC encoding + + +version 9_beta2: - metadata (INFO tag) support in WAV muxer - support for building DLLs using MSVC -- ashowinfo audio filter version 9_beta1: From 3ba416408aef99b4d7d92719c0a03dc2c9647025 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 6 Nov 2012 14:24:31 -0500 Subject: [PATCH 4/5] avconv: rescale packet duration to muxer time base when flushing encoders Fixes Bug 385 --- avconv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/avconv.c b/avconv.c index 964847a488..c931c46de5 100644 --- a/avconv.c +++ b/avconv.c @@ -964,6 +964,8 @@ static void flush_encoders(void) pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); + if (pkt.duration > 0) + pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); write_frame(os, &pkt, ost); } From 3a2731cbd31d0c5681ddbc7c78edd5c53c4d0032 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 7 Nov 2012 14:48:28 -0500 Subject: [PATCH 5/5] flacenc: ensure the order is within the min/max range in LPC order search This fixes use of uninitialized values when the FLAC encoder uses the 2-level, 4-level, and 8-level search methods. Fixes failure of the fate-flac-24-comp-8 test when run using valgrind. --- libavcodec/flacenc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 93d4646604..54bc64c9de 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -799,14 +799,16 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) omethod == ORDER_METHOD_8LEVEL) { int levels = 1 << omethod; uint64_t bits[1 << ORDER_METHOD_8LEVEL]; - int order; + int order = -1; int opt_index = levels-1; opt_order = max_order-1; bits[opt_index] = UINT32_MAX; for (i = levels-1; i >= 0; i--) { + int last_order = order; order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; - if (order < 0) - order = 0; + order = av_clip(order, min_order - 1, max_order - 1); + if (order == last_order) + continue; s->flac_dsp.lpc_encode(res, smp, n, order+1, coefs[order], shift[order]); bits[i] = find_subframe_rice_params(s, sub, order+1);