Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 32.92 KB | None | 0 0
  1. From cebf0b6632c096d894951b8a877cccc84dbc3f80 Mon Sep 17 00:00:00 2001
  2. From: Daniel Kang <daniel.d.kang@gmail.com>
  3. Date: Tue, 24 May 2011 15:14:38 -0400
  4. Subject: [PATCH 1/2] Add IDCT functions for 10-bit H.264.
  5.  
  6. Ports the majority of IDCT functions for 10-bit H.264.
  7.  
  8. Some code was ported from x264.
  9. ---
  10. libavcodec/x86/Makefile            |    3 +-
  11.  libavcodec/x86/h264_idct_10bit.asm |  433 ++++++++++++++++++++++++++++++++++++
  12.  libavcodec/x86/h264dsp_mmx.c       |   59 +++++
  13.  3 files changed, 494 insertions(+), 1 deletions(-)
  14.  create mode 100644 libavcodec/x86/h264_idct_10bit.asm
  15.  
  16. diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
  17. index ba664ab..38b736e 100644
  18. --- a/libavcodec/x86/Makefile
  19. +++ b/libavcodec/x86/Makefile
  20. @@ -12,8 +12,9 @@ YASM-OBJS-$(CONFIG_FFT)                += x86/fft_mmx.o                 \
  21.  MMX-OBJS-$(CONFIG_H264DSP)             += x86/h264dsp_mmx.o
  22.  YASM-OBJS-$(CONFIG_H264DSP)            += x86/h264_deblock.o            \
  23.                                            x86/h264_deblock_10bit.o      \
  24. -                                          x86/h264_weight.o             \
  25.                                            x86/h264_idct.o               \
  26. +                                          x86/h264_idct_10bit.o         \
  27. +                                          x86/h264_weight.o             \
  28.  
  29.  YASM-OBJS-$(CONFIG_H264PRED)           += x86/h264_intrapred.o
  30.  MMX-OBJS-$(CONFIG_H264PRED)            += x86/h264_intrapred_init.o
  31. diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm
  32. new file mode 100644
  33. index 0000000..c16489a
  34. --- /dev/null
  35. +++ b/libavcodec/x86/h264_idct_10bit.asm
  36. @@ -0,0 +1,433 @@
  37. +;*****************************************************************************
  38. +;* MMX/SSE2/AVX-optimized 10-bit H.264 iDCT code
  39. +;*****************************************************************************
  40. +;* Copyright (C) 2005-2011 x264 project
  41. +;*
  42. +;* Authors: Daniel Kang <daniel.d.kang@gmail.com>
  43. +;*
  44. +;* This file is part of Libav.
  45. +;*
  46. +;* Libav is free software; you can redistribute it and/or
  47. +;* modify it under the terms of the GNU Lesser General Public
  48. +;* License as published by the Free Software Foundation; either
  49. +;* version 2.1 of the License, or (at your option) any later version.
  50. +;*
  51. +;* Libav is distributed in the hope that it will be useful,
  52. +;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  53. +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  54. +;* Lesser General Public License for more details.
  55. +;*
  56. +;* You should have received a copy of the GNU Lesser General Public
  57. +;* License along with Libav; if not, write to the Free Software
  58. +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  59. +;******************************************************************************
  60. +
  61. +%include "x86inc.asm"
  62. +%include "x86util.asm"
  63. +
  64. +SECTION_RODATA
  65. +
  66. +pw_pixel_max: times 8 dw ((1 << 10)-1)
  67. +pd_32:        times 4 dd 32
  68. +scan8_mem: db 4+1*8, 5+1*8, 4+2*8, 5+2*8
  69. +           db 6+1*8, 7+1*8, 6+2*8, 7+2*8
  70. +           db 4+3*8, 5+3*8, 4+4*8, 5+4*8
  71. +           db 6+3*8, 7+3*8, 6+4*8, 7+4*8
  72. +           db 1+1*8, 2+1*8
  73. +           db 1+2*8, 2+2*8
  74. +           db 1+4*8, 2+4*8
  75. +           db 1+5*8, 2+5*8
  76. +
  77. +%ifdef PIC
  78. +%define scan8 r11
  79. +%else
  80. +%define scan8 scan8_mem
  81. +%endif
  82. +
  83. +SECTION .text
  84. +
  85. +;-----------------------------------------------------------------------------
  86. +; void h264_idct_add(pixel *dst, dctcoef *block, int stride)
  87. +;-----------------------------------------------------------------------------
  88. +%macro STORE_DIFFx2 6
  89. +    psrad       %1, 6
  90. +    psrad       %2, 6
  91. +    packssdw    %1, %2
  92. +    movq        %3, [%5]
  93. +    movhps      %3, [%5+%6]
  94. +    paddsw      %1, %3
  95. +    CLIPW       %1, %4, [pw_pixel_max]
  96. +    movq      [%5], %1
  97. +    movhps [%5+%6], %1
  98. +%endmacro
  99. +
  100. +;dst, in, stride
  101. +%macro IDCT4_ADD_10 3
  102. +    mova  m0, [%2+ 0]
  103. +    mova  m1, [%2+16]
  104. +    mova  m2, [%2+32]
  105. +    mova  m3, [%2+48]
  106. +    IDCT4_1D d,0,1,2,3,4,5
  107. +    TRANSPOSE4x4D 0,1,2,3,4
  108. +    paddd m0, [pd_32]
  109. +    IDCT4_1D d,0,1,2,3,4,5
  110. +    pxor  m5, m5
  111. +    STORE_DIFFx2 m0, m1, m4, m5, %1, %3
  112. +    lea   %1, [%1+%3*2]
  113. +    STORE_DIFFx2 m2, m3, m4, m5, %1, %3
  114. +%endmacro
  115. +
  116. +%macro IDCT_ADD_10 1
  117. +cglobal h264_idct_add_10_%1, 3,3
  118. +    IDCT4_ADD_10 r0, r1, r2
  119. +    RET
  120. +%endmacro
  121. +
  122. +INIT_XMM
  123. +IDCT_ADD_10 sse2
  124. +%ifdef HAVE_AVX
  125. +INIT_AVX
  126. +IDCT_ADD_10 avx
  127. +%endif
  128. +
  129. +;-----------------------------------------------------------------------------
  130. +; h264_idct_add16(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
  131. +;-----------------------------------------------------------------------------
  132. +;;;;;;; NO FATE SAMPLES TRIGGER THIS
  133. +%macro IDCT_ADD16_10 1
  134. +cglobal h264_idct_add16_10_%1, 5,7
  135. +    xor          r5, r5
  136. +%ifdef PIC
  137. +    lea         r11, [scan8_mem]
  138. +%endif
  139. +.nextblock
  140. +    movzx        r6, byte [scan8+r5]
  141. +    movzx        r6, byte [r4+r6]
  142. +    cmp          byte [r4+r6], 0
  143. +    jz .skipblock
  144. +    mov         r6d, dword [r1+r5*4]
  145. +    add          r6, r0
  146. +    IDCT4_ADD_10 r6, r2, r3
  147. +.skipblock
  148. +    inc          r5
  149. +    add          r2, 64
  150. +    cmp          r5, 16
  151. +    jl .nextblock
  152. +    REP_RET
  153. +%endmacro
  154. +
  155. +INIT_XMM
  156. +IDCT_ADD16_10 sse2
  157. +%ifdef HAVE_AVX
  158. +INIT_AVX
  159. +IDCT_ADD16_10 avx
  160. +%endif
  161. +
  162. +;-----------------------------------------------------------------------------
  163. +; h264_idct_add16intra(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
  164. +;-----------------------------------------------------------------------------
  165. +%macro IDCT_ADD16INTRA_10 1
  166. +cglobal h264_idct_add16intra_10_%1,5,7
  167. +    xor          r5, r5
  168. +%ifdef PIC
  169. +    lea         r11, [scan8_mem]
  170. +%endif
  171. +.nextblock
  172. +    movzx        r6, byte [scan8+r5]
  173. +    movzx        r6, byte [r4+r6]
  174. +    or          r6d, dword [r2]
  175. +    test         r6, r6
  176. +    jz .skipblock
  177. +    mov         r6d, dword [r1+r5*4]
  178. +    lea          r6, [r0+r6]
  179. +    IDCT4_ADD_10 r6, r2, r3
  180. +.skipblock
  181. +    inc          r5
  182. +    add          r2, 64
  183. +    cmp          r5, 16
  184. +    jl .nextblock
  185. +    REP_RET
  186. +%endmacro
  187. +
  188. +INIT_XMM
  189. +IDCT_ADD16INTRA_10 sse2
  190. +%ifdef HAVE_AVX
  191. +INIT_AVX
  192. +IDCT_ADD16INTRA_10 avx
  193. +%endif
  194. +
  195. +
  196. +;-----------------------------------------------------------------------------
  197. +; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
  198. +;-----------------------------------------------------------------------------
  199. +%macro IDCT_ADD8 1
  200. +h264_idct_add8_10_plane_%1:
  201. +.nextblock
  202. +    movzx        r6, byte [scan8+r5]
  203. +    movzx        r6, byte [r4+r6]
  204. +    or          r6d, dword [r2]
  205. +    test         r6, r6
  206. +    jz .skipblock
  207. +%ifdef ARCH_X86_64
  208. +    mov         r0d, dword [r1+r5*4]
  209. +    add          r0, [r10]
  210. +%else
  211. +    mov          r0, r1m ; XXX r1m here is actually r0m of the calling func
  212. +    mov          r0, [r0]
  213. +    add          r0, dword [r1+r5*4]
  214. +%endif
  215. +    IDCT4_ADD_10 r0, r2, r3
  216. +.skipblock
  217. +    inc          r5
  218. +    add          r2, 64
  219. +    test         r5, 3
  220. +    jnz .nextblock
  221. +    rep ret
  222. +
  223. +cglobal h264_idct_add8_10_%1,5,7,0
  224. +    mov          r5, 16
  225. +    add          r2, 1024
  226. +%ifdef PIC
  227. +    lea         r11, [scan8_mem]
  228. +%endif
  229. +%ifdef ARCH_X86_64
  230. +    mov         r10, r0
  231. +%endif
  232. +    call         h264_idct_add8_10_plane_%1
  233. +%ifdef ARCH_X86_64
  234. +    add         r10, gprsize
  235. +%else
  236. +    add        r0mp, gprsize
  237. +%endif
  238. +    call         h264_idct_add8_10_plane_%1
  239. +    RET
  240. +%endmacro ; IDCT_ADD8
  241. +
  242. +INIT_XMM
  243. +IDCT_ADD8 sse2
  244. +%ifdef HAVE_AVX
  245. +INIT_AVX
  246. +IDCT_ADD8 avx
  247. +%endif
  248. +
  249. +;-----------------------------------------------------------------------------
  250. +; void h264_idct_dc_add(pixel *dst, dctcoef *block, int stride)
  251. +;-----------------------------------------------------------------------------
  252. +%macro IDCT_DC_ADD_OP_10 0
  253. +    mova      m1, [r0+ 0]
  254. +    mova      m2, [r0+r2]
  255. +    mova      m3, [r1+ 0]
  256. +    mova      m4, [r1+r2]
  257. +    pxor      m5, m5
  258. +    paddw     m1, m0
  259. +    paddw     m2, m0
  260. +    paddw     m3, m0
  261. +    paddw     m4, m0
  262. +    CLIPW     m1, m5, m6
  263. +    CLIPW     m2, m5, m6
  264. +    CLIPW     m3, m5, m6
  265. +    CLIPW     m4, m5, m6
  266. +    mova [r0+ 0], m1
  267. +    mova [r0+r2], m2
  268. +    mova [r1+ 0], m3
  269. +    mova [r1+r2], m4
  270. +%endmacro
  271. +
  272. +INIT_MMX
  273. +cglobal h264_idct_dc_add_10_mmx2,3,3
  274. +    movd      m0, dword [r1]
  275. +    paddd     m0, [pd_32]
  276. +    psrad     m0, 6
  277. +    lea       r1, [r0+r2*2]
  278. +    pshufw    m0, m0, 0
  279. +    mova      m6, [pw_pixel_max]
  280. +    IDCT_DC_ADD_OP_10
  281. +    RET
  282. +
  283. +;-----------------------------------------------------------------------------
  284. +; void h264_idct8_dc_add(pixel *dst, dctcoef *block, int stride)
  285. +;-----------------------------------------------------------------------------
  286. +%macro IDCT8_DC_ADD 1
  287. +cglobal h264_idct8_dc_add_10_%1,3,3,7
  288. +    mov      r1d, dword [r1]
  289. +    add       r1, 32
  290. +    sar       r1, 6
  291. +    movd      m0, r1d
  292. +    lea       r1, [r0+r2*2]
  293. +    SPLATW    m0, m0, 0
  294. +    mova      m6, [pw_pixel_max]
  295. +    IDCT_DC_ADD_OP_10
  296. +    lea       r0, [r0+r2*4]
  297. +    lea       r1, [r0+r2*2]
  298. +    IDCT_DC_ADD_OP_10
  299. +    RET
  300. +%endmacro
  301. +
  302. +INIT_XMM
  303. +IDCT8_DC_ADD sse2
  304. +%ifdef HAVE_AVX
  305. +INIT_AVX
  306. +IDCT8_DC_ADD avx
  307. +%endif
  308. +
  309. +;-----------------------------------------------------------------------------
  310. +; void h264_idct8_add(pixel *dst, dctcoef *block, int stride)
  311. +;-----------------------------------------------------------------------------
  312. +%macro IDCT8_1D 2
  313. +    SWAP         0, 1
  314. +    psrad        m4, m5, 1
  315. +    psrad        m1, m0, 1
  316. +    paddd        m4, m5
  317. +    paddd        m1, m0
  318. +    paddd        m4, m7
  319. +    paddd        m1, m5
  320. +    psubd        m4, m0
  321. +    paddd        m1, m3
  322. +
  323. +    psubd        m0, m3
  324. +    psubd        m5, m3
  325. +    paddd        m0, m7
  326. +    psubd        m5, m7
  327. +    psrad        m3, 1
  328. +    psrad        m7, 1
  329. +    psubd        m0, m3
  330. +    psubd        m5, m7
  331. +
  332. +    SWAP         1, 7
  333. +    psrad        m1, m7, 2
  334. +    psrad        m3, m4, 2
  335. +    paddd        m3, m0
  336. +    psrad        m0, 2
  337. +    paddd        m1, m5
  338. +    psrad        m5, 2
  339. +    psubd        m0, m4
  340. +    psubd        m7, m5
  341. +
  342. +    SWAP         5, 6
  343. +    psrad        m4, m2, 1
  344. +    psrad        m6, m5, 1
  345. +    psubd        m4, m5
  346. +    paddd        m6, m2
  347. +
  348. +    mova         m2, %1
  349. +    mova         m5, %2
  350. +    SUMSUB_BA    d, 5, 2
  351. +    SUMSUB_BA    d, 6, 5
  352. +    SUMSUB_BA    d, 4, 2
  353. +    SUMSUB_BA    d, 7, 6
  354. +    SUMSUB_BA    d, 0, 4
  355. +    SUMSUB_BA    d, 3, 2
  356. +    SUMSUB_BA    d, 1, 5
  357. +    SWAP         7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
  358. +%endmacro
  359. +
  360. +%macro IDCT8_1D_FULL 1
  361. +    mova         m7, [%1+112*2]
  362. +    mova         m6, [%1+ 96*2]
  363. +    mova         m5, [%1+ 80*2]
  364. +    mova         m3, [%1+ 48*2]
  365. +    mova         m2, [%1+ 32*2]
  366. +    mova         m1, [%1+ 16*2]
  367. +    IDCT8_1D   [%1], [%1+ 64*2]
  368. +%endmacro
  369. +
  370. +; %1=int16_t *block, %2=int16_t *dstblock
  371. +%macro IDCT8_ADD_SSE_START 2
  372. +    IDCT8_1D_FULL %1
  373. +    mova         [%1], m7
  374. +    TRANSPOSE4x4D   0,1,2,3,7
  375. +    mova           m7, [%1]
  376. +    mova    [%2     ], m0
  377. +    mova    [%2+16*2], m1
  378. +    mova    [%2+32*2], m2
  379. +    mova    [%2+48*2], m3
  380. +    TRANSPOSE4x4D   4,5,6,7,3
  381. +    mova    [%2+ 8*2], m4
  382. +    mova    [%2+24*2], m5
  383. +    mova    [%2+40*2], m6
  384. +    mova    [%2+56*2], m7
  385. +%endmacro
  386. +
  387. +; %1=uint8_t *dst, %2=int16_t *block, %3=int stride
  388. +%macro IDCT8_ADD_SSE_END 3
  389. +    IDCT8_1D_FULL %2
  390. +    mova    [%2     ], m5
  391. +    mova    [%2+16*2], m6
  392. +    mova    [%2+32*2], m7
  393. +
  394. +    pxor         m7, m7
  395. +    STORE_DIFFx2 m0, m1, m5, m7, %1, %3
  396. +    lea          %1, [%1+%3*2]
  397. +    STORE_DIFFx2 m2, m3, m5, m7, %1, %3
  398. +    mova         m0, [%2     ]
  399. +    mova         m1, [%2+16*2]
  400. +    mova         m2, [%2+32*2]
  401. +    lea          %1, [%1+%3*2]
  402. +    STORE_DIFFx2 m4, m0, m5, m7, %1, %3
  403. +    lea          %1, [%1+%3*2]
  404. +    STORE_DIFFx2 m1, m2, m5, m7, %1, %3
  405. +%endmacro
  406. +
  407. +%macro IDCT8_ADD 1
  408. +cglobal h264_idct8_add_10_%1, 3,4,8
  409. +    %assign pad 256+16-gprsize-(stack_offset&15)
  410. +    SUB         rsp, pad
  411. +
  412. +    add   dword [r1], 32
  413. +    IDCT8_ADD_SSE_START r1   , rsp
  414. +    IDCT8_ADD_SSE_START r1+16, rsp+128
  415. +    lea          r3, [r0+8]
  416. +    IDCT8_ADD_SSE_END   r0  , rsp,    r2
  417. +    IDCT8_ADD_SSE_END   r3  , rsp+16, r2
  418. +
  419. +    ADD         rsp, pad
  420. +    RET
  421. +%endmacro
  422. +
  423. +INIT_XMM
  424. +IDCT8_ADD sse2
  425. +%ifdef HAVE_AVX
  426. +INIT_AVX
  427. +IDCT8_ADD avx
  428. +%endif
  429. +
  430. +;-----------------------------------------------------------------------------
  431. +; h264_idct8_add4(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
  432. +;-----------------------------------------------------------------------------
  433. +%macro IDCT8_ADD4 1
  434. +cglobal h264_idct8_add4_10_%1, 5,7,8
  435. +    %assign pad 256+16-gprsize-(stack_offset&15)
  436. +    SUB         rsp, pad
  437. +    xor          r5, r5
  438. +%ifdef PIC
  439. +    lea         r11, [scan8_mem]
  440. +%endif
  441. +.nextblock
  442. +    movzx        r6, byte [scan8+r5]
  443. +    movzx        r6, byte [r4+r6]
  444. +    test         r6, r6
  445. +    jz .skipblock
  446. +    mov         r6d, dword [r1+r5*4]
  447. +    lea          r6, [r0+r6]
  448. +    add  dword [r2], 32
  449. +    IDCT8_ADD_SSE_START r2   , rsp
  450. +    IDCT8_ADD_SSE_START r2+16, rsp+128
  451. +    IDCT8_ADD_SSE_END   r6   , rsp,    r3
  452. +    mov         r6d, dword [r1+r5*4]
  453. +    lea          r6, [r0+r6+8]
  454. +    IDCT8_ADD_SSE_END   r6  , rsp+16,  r3
  455. +.skipblock
  456. +    add          r5, 4
  457. +    add          r2, 256
  458. +    cmp          r5, 16
  459. +    jl .nextblock
  460. +    ADD         rsp, pad
  461. +    RET
  462. +%endmacro ; IDCT8_ADD4
  463. +
  464. +INIT_XMM
  465. +IDCT8_ADD4 sse2
  466. +%ifdef HAVE_AVX
  467. +INIT_AVX
  468. +IDCT8_ADD4 avx
  469. +%endif
  470. diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
  471. index 1c07d14..3e880bf 100644
  472. --- a/libavcodec/x86/h264dsp_mmx.c
  473. +++ b/libavcodec/x86/h264dsp_mmx.c
  474. @@ -27,6 +27,43 @@ DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1  ) = 0x0103010301030103ULL;
  475.  
  476.  /***********************************/
  477.  /* IDCT */
  478. +#define IDCT_ADD_FUNC(NUM, DEPTH, OPT) \
  479. +void ff_h264_idct ## NUM ## _add_ ## DEPTH ## _ ## OPT (uint8_t *dst, int16_t *block, int stride);
  480. +
  481. +IDCT_ADD_FUNC(, 10, sse2)
  482. +IDCT_ADD_FUNC(_dc, 10, mmx2)
  483. +IDCT_ADD_FUNC(8_dc, 10, sse2)
  484. +IDCT_ADD_FUNC(8, 10, sse2)
  485. +#if HAVE_AVX
  486. +IDCT_ADD_FUNC(, 10, avx)
  487. +IDCT_ADD_FUNC(8_dc, 10, avx)
  488. +IDCT_ADD_FUNC(8, 10, avx)
  489. +#endif
  490. +
  491. +
  492. +#define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \
  493. +void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  494. +                              (uint8_t *dst, const int *block_offset, \
  495. +                              DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  496. +
  497. +IDCT_ADD_REP_FUNC(8, 4, 10, sse2)
  498. +IDCT_ADD_REP_FUNC(8, 4, 10, avx)
  499. +IDCT_ADD_REP_FUNC(, 16, 10, sse2)
  500. +IDCT_ADD_REP_FUNC(, 16intra, 10, sse2)
  501. +#if HAVE_AVX
  502. +IDCT_ADD_REP_FUNC(, 16, 10, avx)
  503. +IDCT_ADD_REP_FUNC(, 16intra, 10, avx)
  504. +#endif
  505. +
  506. +
  507. +#define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \
  508. +void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  509. +                              (uint8_t **dst, const int *block_offset, \
  510. +                              DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  511. +IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
  512. +#if HAVE_AVX
  513. +IDCT_ADD_REP_FUNC2(, 8, 10, avx)
  514. +#endif
  515.  
  516.  void ff_h264_idct_add_mmx     (uint8_t *dst, int16_t *block, int stride);
  517.  void ff_h264_idct8_add_mmx    (uint8_t *dst, int16_t *block, int stride);
  518. @@ -418,7 +455,17 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  519.              c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_mmxext;
  520.              c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_mmxext;
  521.  #endif
  522. +            c->h264_idct_dc_add= ff_h264_idct_dc_add_10_mmx2;
  523.              if (mm_flags&AV_CPU_FLAG_SSE2) {
  524. +                c->h264_idct_add       = ff_h264_idct_add_10_sse2;
  525. +                c->h264_idct8_dc_add   = ff_h264_idct8_dc_add_10_sse2;
  526. +                c->h264_idct8_add      = ff_h264_idct8_add_10_sse2;
  527. +
  528. +                c->h264_idct_add16     = ff_h264_idct_add16_10_sse2;
  529. +                c->h264_idct8_add4     = ff_h264_idct8_add4_10_sse2;
  530. +                c->h264_idct_add8      = ff_h264_idct_add8_10_sse2;
  531. +                c->h264_idct_add16intra= ff_h264_idct_add16intra_10_sse2;
  532. +
  533.                  c->h264_v_loop_filter_chroma= ff_deblock_v_chroma_10_sse2;
  534.                  c->h264_v_loop_filter_chroma_intra= ff_deblock_v_chroma_intra_10_sse2;
  535.  #if HAVE_ALIGNED_STACK
  536. @@ -428,7 +475,18 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  537.                  c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
  538.  #endif
  539.              }
  540. +#if HAVE_AVX
  541.              if (mm_flags&AV_CPU_FLAG_AVX) {
  542. +                c->h264_idct_dc_add    =
  543. +                c->h264_idct_add       = ff_h264_idct_add_10_avx;
  544. +                c->h264_idct8_add      = ff_h264_idct8_add_10_avx;
  545. +                c->h264_idct8_dc_add   = ff_h264_idct8_dc_add_10_avx;
  546. +
  547. +                c->h264_idct_add16     = ff_h264_idct_add16_10_avx;
  548. +                c->h264_idct8_add4     = ff_h264_idct8_add4_10_avx;
  549. +                c->h264_idct_add8      = ff_h264_idct_add8_10_avx;
  550. +                c->h264_idct_add16intra= ff_h264_idct_add16intra_10_avx;
  551. +
  552.                  c->h264_v_loop_filter_chroma= ff_deblock_v_chroma_10_avx;
  553.                  c->h264_v_loop_filter_chroma_intra= ff_deblock_v_chroma_intra_10_avx;
  554.  #if HAVE_ALIGNED_STACK
  555. @@ -438,6 +496,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  556.                  c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx;
  557.  #endif
  558.              }
  559. +#endif // HAVE_AVX
  560.          }
  561.      }
  562.  #endif
  563. --
  564. 1.7.4
  565.  
  566.  
  567. From 38fb7a8b426d39b836583da800b74cf614c800a6 Mon Sep 17 00:00:00 2001
  568. From: Daniel Kang <daniel.d.kang@gmail.com>
  569. Date: Tue, 24 May 2011 15:15:08 -0400
  570. Subject: [PATCH 2/2] Update 8-bit H.264 IDCT assembly cosmetics.
  571.  
  572. ---
  573. libavcodec/h264dsp.h         |    1 -
  574.  libavcodec/x86/h264_idct.asm |   38 ++++++++++----------
  575.  libavcodec/x86/h264dsp_mmx.c |   82 +++++++++++++++++------------------------
  576.  3 files changed, 53 insertions(+), 68 deletions(-)
  577.  
  578. diff --git a/libavcodec/h264dsp.h b/libavcodec/h264dsp.h
  579. index 87a1dd9..864c118 100644
  580. --- a/libavcodec/h264dsp.h
  581. +++ b/libavcodec/h264dsp.h
  582. @@ -66,7 +66,6 @@ typedef struct H264DSPContext{
  583.      void (*h264_idct_dc_add)(uint8_t *dst/*align 4*/, DCTELEM *block/*align 16*/, int stride);
  584.      void (*h264_idct8_dc_add)(uint8_t *dst/*align 8*/, DCTELEM *block/*align 16*/, int stride);
  585.  
  586. -    void (*h264_dct)(DCTELEM block[4][4]);
  587.      void (*h264_idct_add16)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
  588.      void (*h264_idct8_add4)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
  589.      void (*h264_idct_add8)(uint8_t **dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
  590. diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
  591. index ae70a30..f90f41c 100644
  592. --- a/libavcodec/x86/h264_idct.asm
  593. +++ b/libavcodec/x86/h264_idct.asm
  594. @@ -73,7 +73,7 @@ SECTION .text
  595.  
  596.  INIT_MMX
  597.  ; ff_h264_idct_add_mmx(uint8_t *dst, int16_t *block, int stride)
  598. -cglobal h264_idct_add_mmx, 3, 3, 0
  599. +cglobal h264_idct_add_8_mmx, 3, 3, 0
  600.      IDCT4_ADD    r0, r1, r2
  601.      RET
  602.  
  603. @@ -125,7 +125,7 @@ cglobal h264_idct_add_mmx, 3, 3, 0
  604.      SUMSUB_BA    w, 0, 4
  605.      SUMSUB_BA    w, 3, 2
  606.      SUMSUB_BA    w, 1, 5
  607. -    SWAP          7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
  608. +    SWAP         7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
  609.  %endmacro
  610.  
  611.  %macro IDCT8_1D_FULL 1
  612. @@ -177,7 +177,7 @@ cglobal h264_idct_add_mmx, 3, 3, 0
  613.  
  614.  INIT_MMX
  615.  ; ff_h264_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
  616. -cglobal h264_idct8_add_mmx, 3, 4, 0
  617. +cglobal h264_idct8_add_8_mmx, 3, 4, 0
  618.      %assign pad 128+4-(stack_offset&7)
  619.      SUB         rsp, pad
  620.  
  621. @@ -237,7 +237,7 @@ cglobal h264_idct8_add_mmx, 3, 4, 0
  622.  
  623.  INIT_XMM
  624.  ; ff_h264_idct8_add_sse2(uint8_t *dst, int16_t *block, int stride)
  625. -cglobal h264_idct8_add_sse2, 3, 4, 10
  626. +cglobal h264_idct8_add_8_sse2, 3, 4, 10
  627.      IDCT8_ADD_SSE r0, r1, r2, r3
  628.      RET
  629.  
  630. @@ -261,7 +261,7 @@ cglobal h264_idct8_add_sse2, 3, 4, 10
  631.      packuswb     m1, m1
  632.  %endmacro
  633.  
  634. -%macro DC_ADD_MMX2_OP 3-4
  635. +%macro DC_ADD_MMX2_OP 4
  636.      %1           m2, [%2     ]
  637.      %1           m3, [%2+%3  ]
  638.      %1           m4, [%2+%3*2]
  639. @@ -282,13 +282,13 @@ cglobal h264_idct8_add_sse2, 3, 4, 10
  640.  
  641.  INIT_MMX
  642.  ; ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
  643. -cglobal h264_idct_dc_add_mmx2, 3, 3, 0
  644. +cglobal h264_idct_dc_add_8_mmx2, 3, 3, 0
  645.      DC_ADD_MMX2_INIT r1, r2
  646.      DC_ADD_MMX2_OP movh, r0, r2, r1
  647.      RET
  648.  
  649.  ; ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
  650. -cglobal h264_idct8_dc_add_mmx2, 3, 3, 0
  651. +cglobal h264_idct8_dc_add_8_mmx2, 3, 3, 0
  652.      DC_ADD_MMX2_INIT r1, r2
  653.      DC_ADD_MMX2_OP mova, r0, r2, r1
  654.      lea          r0, [r0+r2*4]
  655. @@ -297,7 +297,7 @@ cglobal h264_idct8_dc_add_mmx2, 3, 3, 0
  656.  
  657.  ; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset,
  658.  ;             DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  659. -cglobal h264_idct_add16_mmx, 5, 7, 0
  660. +cglobal h264_idct_add16_8_mmx, 5, 7, 0
  661.      xor          r5, r5
  662.  %ifdef PIC
  663.      lea         r11, [scan8_mem]
  664. @@ -319,7 +319,7 @@ cglobal h264_idct_add16_mmx, 5, 7, 0
  665.  
  666.  ; ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset,
  667.  ;                        DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  668. -cglobal h264_idct8_add4_mmx, 5, 7, 0
  669. +cglobal h264_idct8_add4_8_mmx, 5, 7, 0
  670.      %assign pad 128+4-(stack_offset&7)
  671.      SUB         rsp, pad
  672.  
  673. @@ -351,7 +351,7 @@ cglobal h264_idct8_add4_mmx, 5, 7, 0
  674.  
  675.  ; ff_h264_idct_add16_mmx2(uint8_t *dst, const int *block_offset,
  676.  ;                         DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  677. -cglobal h264_idct_add16_mmx2, 5, 7, 0
  678. +cglobal h264_idct_add16_8_mmx2, 5, 7, 0
  679.      xor          r5, r5
  680.  %ifdef PIC
  681.      lea         r11, [scan8_mem]
  682. @@ -398,7 +398,7 @@ cglobal h264_idct_add16_mmx2, 5, 7, 0
  683.  
  684.  ; ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset,
  685.  ;                             DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  686. -cglobal h264_idct_add16intra_mmx, 5, 7, 0
  687. +cglobal h264_idct_add16intra_8_mmx, 5, 7, 0
  688.      xor          r5, r5
  689.  %ifdef PIC
  690.      lea         r11, [scan8_mem]
  691. @@ -421,7 +421,7 @@ cglobal h264_idct_add16intra_mmx, 5, 7, 0
  692.  
  693.  ; ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset,
  694.  ;                              DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  695. -cglobal h264_idct_add16intra_mmx2, 5, 7, 0
  696. +cglobal h264_idct_add16intra_8_mmx2, 5, 7, 0
  697.      xor          r5, r5
  698.  %ifdef PIC
  699.      lea         r11, [scan8_mem]
  700. @@ -466,7 +466,7 @@ cglobal h264_idct_add16intra_mmx2, 5, 7, 0
  701.  
  702.  ; ff_h264_idct8_add4_mmx2(uint8_t *dst, const int *block_offset,
  703.  ;                         DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  704. -cglobal h264_idct8_add4_mmx2, 5, 7, 0
  705. +cglobal h264_idct8_add4_8_mmx2, 5, 7, 0
  706.      %assign pad 128+4-(stack_offset&7)
  707.      SUB         rsp, pad
  708.  
  709. @@ -529,7 +529,7 @@ cglobal h264_idct8_add4_mmx2, 5, 7, 0
  710.  INIT_XMM
  711.  ; ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset,
  712.  ;                         DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  713. -cglobal h264_idct8_add4_sse2, 5, 7, 10
  714. +cglobal h264_idct8_add4_8_sse2, 5, 7, 10
  715.      xor          r5, r5
  716.  %ifdef PIC
  717.      lea         r11, [scan8_mem]
  718. @@ -607,7 +607,7 @@ h264_idct_add8_mmx_plane:
  719.  
  720.  ; ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset,
  721.  ;                       DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  722. -cglobal h264_idct_add8_mmx, 5, 7, 0
  723. +cglobal h264_idct_add8_8_mmx, 5, 7, 0
  724.      mov          r5, 16
  725.      add          r2, 512
  726.  %ifdef PIC
  727. @@ -668,7 +668,7 @@ h264_idct_add8_mmx2_plane
  728.  
  729.  ; ff_h264_idct_add8_mmx2(uint8_t **dest, const int *block_offset,
  730.  ;                        DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  731. -cglobal h264_idct_add8_mmx2, 5, 7, 0
  732. +cglobal h264_idct_add8_8_mmx2, 5, 7, 0
  733.      mov          r5, 16
  734.      add          r2, 512
  735.  %ifdef ARCH_X86_64
  736. @@ -744,7 +744,7 @@ x264_add8x4_idct_sse2:
  737.  
  738.  ; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset,
  739.  ;                         DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  740. -cglobal h264_idct_add16_sse2, 5, 5, 8
  741. +cglobal h264_idct_add16_8_sse2, 5, 5, 8
  742.  %ifdef ARCH_X86_64
  743.      mov        r10, r0
  744.  %endif
  745. @@ -791,7 +791,7 @@ cglobal h264_idct_add16_sse2, 5, 5, 8
  746.  
  747.  ; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset,
  748.  ;                              DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  749. -cglobal h264_idct_add16intra_sse2, 5, 7, 8
  750. +cglobal h264_idct_add16intra_8_sse2, 5, 7, 8
  751.  %ifdef ARCH_X86_64
  752.      mov        r10, r0
  753.  %endif
  754. @@ -840,7 +840,7 @@ cglobal h264_idct_add16intra_sse2, 5, 7, 8
  755.  
  756.  ; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset,
  757.  ;                        DCTELEM *block, int stride, const uint8_t nnzc[6*8])
  758. -cglobal h264_idct_add8_sse2, 5, 7, 8
  759. +cglobal h264_idct_add8_8_sse2, 5, 7, 8
  760.      add          r2, 512
  761.  %ifdef ARCH_X86_64
  762.      mov         r10, r0
  763. diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
  764. index 3e880bf..54a82f0 100644
  765. --- a/libavcodec/x86/h264dsp_mmx.c
  766. +++ b/libavcodec/x86/h264dsp_mmx.c
  767. @@ -30,9 +30,14 @@ DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1  ) = 0x0103010301030103ULL;
  768.  #define IDCT_ADD_FUNC(NUM, DEPTH, OPT) \
  769.  void ff_h264_idct ## NUM ## _add_ ## DEPTH ## _ ## OPT (uint8_t *dst, int16_t *block, int stride);
  770.  
  771. +IDCT_ADD_FUNC(, 8, mmx)
  772.  IDCT_ADD_FUNC(, 10, sse2)
  773. +IDCT_ADD_FUNC(_dc, 8, mmx2)
  774.  IDCT_ADD_FUNC(_dc, 10, mmx2)
  775. +IDCT_ADD_FUNC(8_dc, 8, mmx2)
  776.  IDCT_ADD_FUNC(8_dc, 10, sse2)
  777. +IDCT_ADD_FUNC(8, 8, mmx)
  778. +IDCT_ADD_FUNC(8, 8, sse2)
  779.  IDCT_ADD_FUNC(8, 10, sse2)
  780.  #if HAVE_AVX
  781.  IDCT_ADD_FUNC(, 10, avx)
  782. @@ -46,9 +51,18 @@ void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  783.                                (uint8_t *dst, const int *block_offset, \
  784.                                DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  785.  
  786. +IDCT_ADD_REP_FUNC(8, 4, 8, mmx)
  787. +IDCT_ADD_REP_FUNC(8, 4, 8, mmx2)
  788. +IDCT_ADD_REP_FUNC(8, 4, 8, sse2)
  789.  IDCT_ADD_REP_FUNC(8, 4, 10, sse2)
  790.  IDCT_ADD_REP_FUNC(8, 4, 10, avx)
  791. +IDCT_ADD_REP_FUNC(, 16, 8, mmx)
  792. +IDCT_ADD_REP_FUNC(, 16, 8, mmx2)
  793. +IDCT_ADD_REP_FUNC(, 16, 8, sse2)
  794.  IDCT_ADD_REP_FUNC(, 16, 10, sse2)
  795. +IDCT_ADD_REP_FUNC(, 16intra, 8, mmx)
  796. +IDCT_ADD_REP_FUNC(, 16intra, 8, mmx2)
  797. +IDCT_ADD_REP_FUNC(, 16intra, 8, sse2)
  798.  IDCT_ADD_REP_FUNC(, 16intra, 10, sse2)
  799.  #if HAVE_AVX
  800.  IDCT_ADD_REP_FUNC(, 16, 10, avx)
  801. @@ -60,42 +74,14 @@ IDCT_ADD_REP_FUNC(, 16intra, 10, avx)
  802.  void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  803.                                (uint8_t **dst, const int *block_offset, \
  804.                                DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  805. +IDCT_ADD_REP_FUNC2(, 8, 8, mmx)
  806. +IDCT_ADD_REP_FUNC2(, 8, 8, mmx2)
  807. +IDCT_ADD_REP_FUNC2(, 8, 8, sse2)
  808.  IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
  809.  #if HAVE_AVX
  810.  IDCT_ADD_REP_FUNC2(, 8, 10, avx)
  811.  #endif
  812.  
  813. -void ff_h264_idct_add_mmx     (uint8_t *dst, int16_t *block, int stride);
  814. -void ff_h264_idct8_add_mmx    (uint8_t *dst, int16_t *block, int stride);
  815. -void ff_h264_idct8_add_sse2   (uint8_t *dst, int16_t *block, int stride);
  816. -void ff_h264_idct_dc_add_mmx2 (uint8_t *dst, int16_t *block, int stride);
  817. -void ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride);
  818. -
  819. -void ff_h264_idct_add16_mmx      (uint8_t *dst, const int *block_offset,
  820. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  821. -void ff_h264_idct8_add4_mmx      (uint8_t *dst, const int *block_offset,
  822. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  823. -void ff_h264_idct_add16_mmx2     (uint8_t *dst, const int *block_offset,
  824. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  825. -void ff_h264_idct_add16intra_mmx (uint8_t *dst, const int *block_offset,
  826. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  827. -void ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset,
  828. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  829. -void ff_h264_idct8_add4_mmx2     (uint8_t *dst, const int *block_offset,
  830. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  831. -void ff_h264_idct8_add4_sse2     (uint8_t *dst, const int *block_offset,
  832. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  833. -void ff_h264_idct_add8_mmx       (uint8_t **dest, const int *block_offset,
  834. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  835. -void ff_h264_idct_add8_mmx2      (uint8_t **dest, const int *block_offset,
  836. -                                  DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
  837. -
  838. -void ff_h264_idct_add16_sse2     (uint8_t *dst, const int *block_offset, DCTELEM *block,
  839. -                                  int stride, const uint8_t nnzc[6*8]);
  840. -void ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block,
  841. -                                  int stride, const uint8_t nnzc[6*8]);
  842. -void ff_h264_idct_add8_sse2      (uint8_t **dest, const int *block_offset, DCTELEM *block,
  843. -                                  int stride, const uint8_t nnzc[6*8]);
  844.  void ff_h264_luma_dc_dequant_idct_mmx (DCTELEM *output, DCTELEM *input, int qmul);
  845.  void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul);
  846.  
  847. @@ -351,23 +337,23 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  848.  #if HAVE_YASM
  849.      if (mm_flags & AV_CPU_FLAG_MMX) {
  850.          c->h264_idct_dc_add=
  851. -        c->h264_idct_add= ff_h264_idct_add_mmx;
  852. +        c->h264_idct_add= ff_h264_idct_add_8_mmx;
  853.          c->h264_idct8_dc_add=
  854. -        c->h264_idct8_add= ff_h264_idct8_add_mmx;
  855. +        c->h264_idct8_add= ff_h264_idct8_add_8_mmx;
  856.  
  857. -        c->h264_idct_add16     = ff_h264_idct_add16_mmx;
  858. -        c->h264_idct8_add4     = ff_h264_idct8_add4_mmx;
  859. -        c->h264_idct_add8      = ff_h264_idct_add8_mmx;
  860. -        c->h264_idct_add16intra= ff_h264_idct_add16intra_mmx;
  861. +        c->h264_idct_add16     = ff_h264_idct_add16_8_mmx;
  862. +        c->h264_idct8_add4     = ff_h264_idct8_add4_8_mmx;
  863. +        c->h264_idct_add8      = ff_h264_idct_add8_8_mmx;
  864. +        c->h264_idct_add16intra= ff_h264_idct_add16intra_8_mmx;
  865.          c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_mmx;
  866.  
  867.          if (mm_flags & AV_CPU_FLAG_MMX2) {
  868. -            c->h264_idct_dc_add= ff_h264_idct_dc_add_mmx2;
  869. -            c->h264_idct8_dc_add= ff_h264_idct8_dc_add_mmx2;
  870. -            c->h264_idct_add16     = ff_h264_idct_add16_mmx2;
  871. -            c->h264_idct8_add4     = ff_h264_idct8_add4_mmx2;
  872. -            c->h264_idct_add8      = ff_h264_idct_add8_mmx2;
  873. -            c->h264_idct_add16intra= ff_h264_idct_add16intra_mmx2;
  874. +            c->h264_idct_dc_add= ff_h264_idct_dc_add_8_mmx2;
  875. +            c->h264_idct8_dc_add= ff_h264_idct8_dc_add_8_mmx2;
  876. +            c->h264_idct_add16     = ff_h264_idct_add16_8_mmx2;
  877. +            c->h264_idct8_add4     = ff_h264_idct8_add4_8_mmx2;
  878. +            c->h264_idct_add8      = ff_h264_idct_add8_8_mmx2;
  879. +            c->h264_idct_add16intra= ff_h264_idct_add16intra_8_mmx2;
  880.  
  881.              c->h264_v_loop_filter_chroma= ff_deblock_v_chroma_8_mmxext;
  882.              c->h264_h_loop_filter_chroma= ff_deblock_h_chroma_8_mmxext;
  883. @@ -398,8 +384,8 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  884.              c->biweight_h264_pixels_tab[7]= ff_h264_biweight_4x2_mmx2;
  885.  
  886.              if (mm_flags&AV_CPU_FLAG_SSE2) {
  887. -                c->h264_idct8_add = ff_h264_idct8_add_sse2;
  888. -                c->h264_idct8_add4= ff_h264_idct8_add4_sse2;
  889. +                c->h264_idct8_add = ff_h264_idct8_add_8_sse2;
  890. +                c->h264_idct8_add4= ff_h264_idct8_add4_8_sse2;
  891.                  c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_sse2;
  892.  
  893.                  c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_sse2;
  894. @@ -421,9 +407,9 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth)
  895.                  c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
  896.  #endif
  897.  
  898. -                c->h264_idct_add16 = ff_h264_idct_add16_sse2;
  899. -                c->h264_idct_add8  = ff_h264_idct_add8_sse2;
  900. -                c->h264_idct_add16intra = ff_h264_idct_add16intra_sse2;
  901. +                c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
  902. +                c->h264_idct_add8  = ff_h264_idct_add8_8_sse2;
  903. +                c->h264_idct_add16intra = ff_h264_idct_add16intra_8_sse2;
  904.              }
  905.              if (mm_flags&AV_CPU_FLAG_SSSE3) {
  906.                  c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_ssse3;
  907. --
  908. 1.7.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement