Advertisement
Guest User

Untitled

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