Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 24.93 KB | None | 0 0
  1. From 9e6baf3383bb05ebc0d1c729c7f383f4f8bdc0c4 Mon Sep 17 00:00:00 2001
  2. From: Daniel Kang <daniel.d.kang@gmail.com>
  3. Date: Fri, 17 Dec 2010 22:02:27 -0500
  4. Subject: [PATCH 1/4] pred4x4_down_left_mmxext
  5.  
  6. ---
  7. libavcodec/x86/h264_intrapred.asm    |   28 ++++++++++++++++++++++++++++
  8.  libavcodec/x86/h264_intrapred_init.c |   13 ++++++++-----
  9.  2 files changed, 36 insertions(+), 5 deletions(-)
  10.  
  11. diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
  12. index 7d3ef95..78ecea2 100644
  13. --- a/libavcodec/x86/h264_intrapred.asm
  14. +++ b/libavcodec/x86/h264_intrapred.asm
  15. @@ -1104,3 +1104,31 @@ cglobal pred4x4_vertical_vp8_mmxext, 3,3
  16.      movd [r1+r2*1], m3
  17.      movd [r1+r2*2], m3
  18.      RET
  19. +
  20. +;-----------------------------------------------------------------------------
  21. +; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
  22. +;-----------------------------------------------------------------------------
  23. +
  24. +INIT_MMX
  25. +cglobal pred4x4_down_left_mmxext, 3,3
  26. +    sub       r0, r2
  27. +    mova      m1, [r0]
  28. +    punpckldq m1, [r1]
  29. +    mova      m2, m1
  30. +    mova      m3, m1
  31. +    mova      m4, m1
  32. +    psllq     m1, 8
  33. +    pxor      m2, m1
  34. +    psrlq     m2, 8
  35. +    pxor      m3, m2
  36. +    PRED4x4_LOWPASS m0, m1, m3, m4, m5
  37. +    lea       r1, [r0+r2*2]
  38. +    psrlq     m0, 8
  39. +    movd      [r0+r2*1], m0
  40. +    psrlq     m0, 8
  41. +    movd      [r0+r2*2], m0
  42. +    psrlq     m0, 8
  43. +    movd      [r1+r2*1], m0
  44. +    psrlq     m0, 8
  45. +    movd      [r1+r2*2], m0
  46. +    RET
  47. diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
  48. index 54b8142..1815b9f 100644
  49. --- a/libavcodec/x86/h264_intrapred_init.c
  50. +++ b/libavcodec/x86/h264_intrapred_init.c
  51. @@ -58,6 +58,7 @@ void ff_pred8x8_tm_vp8_mmxext      (uint8_t *src, int stride);
  52.  void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
  53.  void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
  54.  void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
  55. +void ff_pred4x4_down_left_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
  56.  void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
  57.  void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
  58.  void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
  59. @@ -94,12 +95,14 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  60.          h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_mmxext;
  61.          h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
  62.          h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
  63. +        if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
  64. +            h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
  65.          if (codec_id == CODEC_ID_VP8) {
  66. -            h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
  67. -            h->pred8x8  [DC_PRED8x8   ] = ff_pred8x8_dc_rv40_mmxext;
  68. -            h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
  69. -            h->pred4x4  [TM_VP8_PRED  ] = ff_pred4x4_tm_vp8_mmxext;
  70. -            h->pred4x4  [VERT_PRED    ] = ff_pred4x4_vertical_vp8_mmxext;
  71. +            h->pred16x16[PLANE_PRED8x8     ] = ff_pred16x16_tm_vp8_mmxext;
  72. +            h->pred8x8  [DC_PRED8x8        ] = ff_pred8x8_dc_rv40_mmxext;
  73. +            h->pred8x8  [PLANE_PRED8x8     ] = ff_pred8x8_tm_vp8_mmxext;
  74. +            h->pred4x4  [TM_VP8_PRED       ] = ff_pred4x4_tm_vp8_mmxext;
  75. +            h->pred4x4  [VERT_PRED         ] = ff_pred4x4_vertical_vp8_mmxext;
  76.          } else {
  77.              h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2;
  78.              if (codec_id == CODEC_ID_SVQ3) {
  79. --
  80. 1.7.2.2
  81.  
  82.  
  83. From b5797b506450836c65bcb8c607cd9179f27a3530 Mon Sep 17 00:00:00 2001
  84. From: Daniel Kang <daniel.d.kang@gmail.com>
  85. Date: Fri, 17 Dec 2010 23:44:46 -0500
  86. Subject: [PATCH 2/4] pred4x4_vertical_left_mmxext
  87.  
  88. ---
  89. libavcodec/x86/h264_intrapred.asm    |   25 ++++++++++
  90.  libavcodec/x86/h264_intrapred_init.c |   87 +++++++++++++++++----------------
  91.  2 files changed, 70 insertions(+), 42 deletions(-)
  92.  
  93. diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
  94. index 78ecea2..afbaef6 100644
  95. --- a/libavcodec/x86/h264_intrapred.asm
  96. +++ b/libavcodec/x86/h264_intrapred.asm
  97. @@ -1132,3 +1132,28 @@ cglobal pred4x4_down_left_mmxext, 3,3
  98.      psrlq     m0, 8
  99.      movd      [r1+r2*2], m0
  100.      RET
  101. +
  102. +;-----------------------------------------------------------------------------
  103. +; void pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
  104. +;-----------------------------------------------------------------------------
  105. +
  106. +INIT_MMX
  107. +cglobal pred4x4_vertical_left_mmxext, 3,3
  108. +    sub   r0, r2
  109. +    mova  m1, [r0]
  110. +    punpckldq m1, [r1]
  111. +    mova  m3, m1
  112. +    mova  m2, m1
  113. +    psrlq m3, 8
  114. +    psrlq m2, 16
  115. +    mova  m4, m3
  116. +    pavgb m4, m1
  117. +    PRED4x4_LOWPASS m0, m1, m2, m3, m5
  118. +    lea   r1, [r0+r2*2]
  119. +    movh  [r0+r2*1], m4
  120. +    movh  [r0+r2*2], m0
  121. +    psrlq m4, 8
  122. +    psrlq m0, 8
  123. +    movh  [r1+r2*1], m4
  124. +    movh  [r1+r2*2], m0
  125. +    RET
  126. diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
  127. index 1815b9f..9d09ecd 100644
  128. --- a/libavcodec/x86/h264_intrapred_init.c
  129. +++ b/libavcodec/x86/h264_intrapred_init.c
  130. @@ -21,48 +21,49 @@
  131.  #include "libavutil/cpu.h"
  132.  #include "libavcodec/h264pred.h"
  133.  
  134. -void ff_pred16x16_vertical_mmx     (uint8_t *src, int stride);
  135. -void ff_pred16x16_vertical_sse     (uint8_t *src, int stride);
  136. -void ff_pred16x16_horizontal_mmx   (uint8_t *src, int stride);
  137. -void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
  138. -void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
  139. -void ff_pred16x16_dc_mmxext        (uint8_t *src, int stride);
  140. -void ff_pred16x16_dc_sse2          (uint8_t *src, int stride);
  141. -void ff_pred16x16_dc_ssse3         (uint8_t *src, int stride);
  142. -void ff_pred16x16_plane_h264_mmx   (uint8_t *src, int stride);
  143. -void ff_pred16x16_plane_h264_mmx2  (uint8_t *src, int stride);
  144. -void ff_pred16x16_plane_h264_sse2  (uint8_t *src, int stride);
  145. -void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride);
  146. -void ff_pred16x16_plane_rv40_mmx   (uint8_t *src, int stride);
  147. -void ff_pred16x16_plane_rv40_mmx2  (uint8_t *src, int stride);
  148. -void ff_pred16x16_plane_rv40_sse2  (uint8_t *src, int stride);
  149. -void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride);
  150. -void ff_pred16x16_plane_svq3_mmx   (uint8_t *src, int stride);
  151. -void ff_pred16x16_plane_svq3_mmx2  (uint8_t *src, int stride);
  152. -void ff_pred16x16_plane_svq3_sse2  (uint8_t *src, int stride);
  153. -void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride);
  154. -void ff_pred16x16_tm_vp8_mmx       (uint8_t *src, int stride);
  155. -void ff_pred16x16_tm_vp8_mmxext    (uint8_t *src, int stride);
  156. -void ff_pred16x16_tm_vp8_sse2      (uint8_t *src, int stride);
  157. -void ff_pred8x8_dc_rv40_mmxext     (uint8_t *src, int stride);
  158. -void ff_pred8x8_vertical_mmx       (uint8_t *src, int stride);
  159. -void ff_pred8x8_horizontal_mmx     (uint8_t *src, int stride);
  160. -void ff_pred8x8_horizontal_mmxext  (uint8_t *src, int stride);
  161. -void ff_pred8x8_horizontal_ssse3   (uint8_t *src, int stride);
  162. -void ff_pred8x8_plane_mmx          (uint8_t *src, int stride);
  163. -void ff_pred8x8_plane_mmx2         (uint8_t *src, int stride);
  164. -void ff_pred8x8_plane_sse2         (uint8_t *src, int stride);
  165. -void ff_pred8x8_plane_ssse3        (uint8_t *src, int stride);
  166. -void ff_pred8x8_tm_vp8_mmx         (uint8_t *src, int stride);
  167. -void ff_pred8x8_tm_vp8_mmxext      (uint8_t *src, int stride);
  168. -void ff_pred8x8_tm_vp8_sse2        (uint8_t *src, int stride);
  169. -void ff_pred8x8_tm_vp8_ssse3       (uint8_t *src, int stride);
  170. -void ff_pred4x4_dc_mmxext          (uint8_t *src, const uint8_t *topright, int stride);
  171. -void ff_pred4x4_down_left_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
  172. -void ff_pred4x4_tm_vp8_mmx         (uint8_t *src, const uint8_t *topright, int stride);
  173. -void ff_pred4x4_tm_vp8_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
  174. -void ff_pred4x4_tm_vp8_ssse3       (uint8_t *src, const uint8_t *topright, int stride);
  175. -void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  176. +void ff_pred16x16_vertical_mmx      (uint8_t *src, int stride);
  177. +void ff_pred16x16_vertical_sse      (uint8_t *src, int stride);
  178. +void ff_pred16x16_horizontal_mmx    (uint8_t *src, int stride);
  179. +void ff_pred16x16_horizontal_mmxext (uint8_t *src, int stride);
  180. +void ff_pred16x16_horizontal_ssse3  (uint8_t *src, int stride);
  181. +void ff_pred16x16_dc_mmxext         (uint8_t *src, int stride);
  182. +void ff_pred16x16_dc_sse2           (uint8_t *src, int stride);
  183. +void ff_pred16x16_dc_ssse3          (uint8_t *src, int stride);
  184. +void ff_pred16x16_plane_h264_mmx    (uint8_t *src, int stride);
  185. +void ff_pred16x16_plane_h264_mmx2   (uint8_t *src, int stride);
  186. +void ff_pred16x16_plane_h264_sse2   (uint8_t *src, int stride);
  187. +void ff_pred16x16_plane_h264_ssse3  (uint8_t *src, int stride);
  188. +void ff_pred16x16_plane_rv40_mmx    (uint8_t *src, int stride);
  189. +void ff_pred16x16_plane_rv40_mmx2   (uint8_t *src, int stride);
  190. +void ff_pred16x16_plane_rv40_sse2   (uint8_t *src, int stride);
  191. +void ff_pred16x16_plane_rv40_ssse3  (uint8_t *src, int stride);
  192. +void ff_pred16x16_plane_svq3_mmx    (uint8_t *src, int stride);
  193. +void ff_pred16x16_plane_svq3_mmx2   (uint8_t *src, int stride);
  194. +void ff_pred16x16_plane_svq3_sse2   (uint8_t *src, int stride);
  195. +void ff_pred16x16_plane_svq3_ssse3  (uint8_t *src, int stride);
  196. +void ff_pred16x16_tm_vp8_mmx        (uint8_t *src, int stride);
  197. +void ff_pred16x16_tm_vp8_mmxext     (uint8_t *src, int stride);
  198. +void ff_pred16x16_tm_vp8_sse2       (uint8_t *src, int stride);
  199. +void ff_pred8x8_dc_rv40_mmxext      (uint8_t *src, int stride);
  200. +void ff_pred8x8_vertical_mmx        (uint8_t *src, int stride);
  201. +void ff_pred8x8_horizontal_mmx      (uint8_t *src, int stride);
  202. +void ff_pred8x8_horizontal_mmxext   (uint8_t *src, int stride);
  203. +void ff_pred8x8_horizontal_ssse3    (uint8_t *src, int stride);
  204. +void ff_pred8x8_plane_mmx           (uint8_t *src, int stride);
  205. +void ff_pred8x8_plane_mmx2          (uint8_t *src, int stride);
  206. +void ff_pred8x8_plane_sse2          (uint8_t *src, int stride);
  207. +void ff_pred8x8_plane_ssse3         (uint8_t *src, int stride);
  208. +void ff_pred8x8_tm_vp8_mmx          (uint8_t *src, int stride);
  209. +void ff_pred8x8_tm_vp8_mmxext       (uint8_t *src, int stride);
  210. +void ff_pred8x8_tm_vp8_sse2         (uint8_t *src, int stride);
  211. +void ff_pred8x8_tm_vp8_ssse3        (uint8_t *src, int stride);
  212. +void ff_pred4x4_dc_mmxext           (uint8_t *src, const uint8_t *topright, int stride);
  213. +void ff_pred4x4_down_left_mmxext    (uint8_t *src, const uint8_t *topright, int stride);
  214. +void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  215. +void ff_pred4x4_tm_vp8_mmx          (uint8_t *src, const uint8_t *topright, int stride);
  216. +void ff_pred4x4_tm_vp8_mmxext       (uint8_t *src, const uint8_t *topright, int stride);
  217. +void ff_pred4x4_tm_vp8_ssse3        (uint8_t *src, const uint8_t *topright, int stride);
  218. +void ff_pred4x4_vertical_vp8_mmxext (uint8_t *src, const uint8_t *topright, int stride);
  219.  
  220.  void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  221.  {
  222. @@ -97,6 +98,8 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  223.          h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
  224.          if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
  225.              h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
  226. +        if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264)
  227. +            h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_mmxext;
  228.          if (codec_id == CODEC_ID_VP8) {
  229.              h->pred16x16[PLANE_PRED8x8     ] = ff_pred16x16_tm_vp8_mmxext;
  230.              h->pred8x8  [DC_PRED8x8        ] = ff_pred8x8_dc_rv40_mmxext;
  231. --
  232. 1.7.2.2
  233.  
  234.  
  235. From 93be3629839abd06380e48a66f2bfa5a4e3f4c68 Mon Sep 17 00:00:00 2001
  236. From: Daniel Kang <daniel.d.kang@gmail.com>
  237. Date: Sat, 18 Dec 2010 00:02:40 -0500
  238. Subject: [PATCH 3/4] pred4x4_horizontal_up_mmxext
  239.  
  240. ---
  241. libavcodec/x86/h264_intrapred.asm    |   33 +++++++++++++++++++++++++++++++++
  242.  libavcodec/x86/h264_intrapred_init.c |    5 ++++-
  243.  2 files changed, 37 insertions(+), 1 deletions(-)
  244.  
  245. diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
  246. index afbaef6..b9a6341 100644
  247. --- a/libavcodec/x86/h264_intrapred.asm
  248. +++ b/libavcodec/x86/h264_intrapred.asm
  249. @@ -1157,3 +1157,36 @@ cglobal pred4x4_vertical_left_mmxext, 3,3
  250.      movh  [r1+r2*1], m4
  251.      movh  [r1+r2*2], m0
  252.      RET
  253. +
  254. +;-----------------------------------------------------------------------------
  255. +; void pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride)
  256. +;-----------------------------------------------------------------------------
  257. +
  258. +INIT_MMX
  259. +cglobal pred4x4_horizontal_up_mmxext, 3,3
  260. +    sub       r0, r2
  261. +    lea       r1, [r0+r2*2]
  262. +    movq      m0, [r0+r2*1-8]
  263. +    punpckhbw m0, [r0+r2*2-8]
  264. +    movq      m1, [r1+r2*1-8]
  265. +    punpckhbw m1, [r1+r2*2-8]
  266. +    punpckhwd m0, m1
  267. +    movq      m1, m0
  268. +    punpckhbw m1, m1
  269. +    pshufw    m1, m1, 0xFF
  270. +    punpckhdq m0, m1
  271. +    movq      m2, m0
  272. +    movq      m3, m0
  273. +    movq      m7, m0
  274. +    psrlq     m2, 16
  275. +    psrlq     m3, 8
  276. +    pavgb     m7, m3
  277. +    PRED4x4_LOWPASS m4, m0, m2, m3, m5
  278. +    punpcklbw m7, m4
  279. +    movd    [r0+r2*1], m7
  280. +    psrlq    m7, 16
  281. +    movd    [r0+r2*2], m7
  282. +    psrlq    m7, 16
  283. +    movd    [r1+r2*1], m7
  284. +    movd    [r1+r2*2], m1
  285. +    RET
  286. diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
  287. index 9d09ecd..3ca88ea 100644
  288. --- a/libavcodec/x86/h264_intrapred_init.c
  289. +++ b/libavcodec/x86/h264_intrapred_init.c
  290. @@ -60,6 +60,7 @@ void ff_pred8x8_tm_vp8_ssse3        (uint8_t *src, int stride);
  291.  void ff_pred4x4_dc_mmxext           (uint8_t *src, const uint8_t *topright, int stride);
  292.  void ff_pred4x4_down_left_mmxext    (uint8_t *src, const uint8_t *topright, int stride);
  293.  void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  294. +void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  295.  void ff_pred4x4_tm_vp8_mmx          (uint8_t *src, const uint8_t *topright, int stride);
  296.  void ff_pred4x4_tm_vp8_mmxext       (uint8_t *src, const uint8_t *topright, int stride);
  297.  void ff_pred4x4_tm_vp8_ssse3        (uint8_t *src, const uint8_t *topright, int stride);
  298. @@ -98,8 +99,10 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  299.          h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
  300.          if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
  301.              h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
  302. -        if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264)
  303. +        if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) {
  304.              h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_mmxext;
  305. +            h->pred4x4[HOR_UP_PRED         ] = ff_pred4x4_horizontal_up_mmxext;
  306. +        }
  307.          if (codec_id == CODEC_ID_VP8) {
  308.              h->pred16x16[PLANE_PRED8x8     ] = ff_pred16x16_tm_vp8_mmxext;
  309.              h->pred8x8  [DC_PRED8x8        ] = ff_pred8x8_dc_rv40_mmxext;
  310. --
  311. 1.7.2.2
  312.  
  313.  
  314. From 0a4863f8acf6a445cf8978168fefb593e475f189 Mon Sep 17 00:00:00 2001
  315. From: Daniel Kang <daniel.d.kang@gmail.com>
  316. Date: Sat, 18 Dec 2010 19:02:41 -0500
  317. Subject: [PATCH 4/4] pred4x4_horizontal_down
  318.  
  319. ---
  320. libavcodec/x86/h264_intrapred.asm    |   37 +++++++++++++
  321.  libavcodec/x86/h264_intrapred_init.c |   98 +++++++++++++++++----------------
  322.  2 files changed, 87 insertions(+), 48 deletions(-)
  323.  
  324. diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
  325. index b9a6341..41599f1 100644
  326. --- a/libavcodec/x86/h264_intrapred.asm
  327. +++ b/libavcodec/x86/h264_intrapred.asm
  328. @@ -20,6 +20,7 @@
  329.  ;******************************************************************************
  330.  
  331.  %include "x86inc.asm"
  332. +%include "x86util.asm"
  333.  
  334.  SECTION_RODATA
  335.  
  336. @@ -1190,3 +1191,39 @@ cglobal pred4x4_horizontal_up_mmxext, 3,3
  337.      movd    [r1+r2*1], m7
  338.      movd    [r1+r2*2], m1
  339.      RET
  340. +
  341. +;-----------------------------------------------------------------------------
  342. +; void pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride)
  343. +;-----------------------------------------------------------------------------
  344. +
  345. +INIT_MMX
  346. +%define PALIGNR PALIGNR_MMX
  347. +cglobal pred4x4_horizontal_down_mmxext, 3,3
  348. +    sub       r0, r2
  349. +    lea       r1, [r0+r2*2]
  350. +    movh      m0, [r0-4]      ; lt ..
  351. +    punpckldq m0, [r0]        ; t3 t2 t1 t0 lt .. .. ..
  352. +    psllq     m0, 8           ; t2 t1 t0 lt .. .. .. ..
  353. +    movu      m1, [r1+r2*2-8] ; l3
  354. +    punpckhbw m1, [r1+r2*1-8] ; l2 l3
  355. +    movu      m2, [r0+r2*2-8] ; l1
  356. +    punpckhbw m2, [r0+r2*1-8] ; l0 l1
  357. +    punpckhwd m1, m2          ; l0 l1 l2 l3
  358. +    punpckhdq m1, m0          ; t2 t1 t0 lt l0 l1 l2 l3
  359. +    mova      m0, m1
  360. +    mova      m2, m1
  361. +    mova      m5, m1
  362. +    psrlq     m0, 16          ; .. .. t2 t1 t0 lt l0 l1
  363. +    psrlq     m2, 8           ; .. t2 t1 t0 lt l0 l1 l2
  364. +    pavgb     m5, m2
  365. +    PRED4x4_LOWPASS m3, m1, m0, m2, m4
  366. +    punpcklbw m5, m3
  367. +    psrlq     m3, 32
  368. +    PALIGNR   m3, m5, 6, m4
  369. +    movh      [r1+r2*2], m5
  370. +    psrlq     m5, 16
  371. +    movh      [r1+r2*1], m5
  372. +    psrlq     m5, 16
  373. +    movh      [r0+r2*2], m5
  374. +    movh      [r0+r2*1], m3
  375. +    RET
  376. diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
  377. index 3ca88ea..3efb156 100644
  378. --- a/libavcodec/x86/h264_intrapred_init.c
  379. +++ b/libavcodec/x86/h264_intrapred_init.c
  380. @@ -21,50 +21,51 @@
  381.  #include "libavutil/cpu.h"
  382.  #include "libavcodec/h264pred.h"
  383.  
  384. -void ff_pred16x16_vertical_mmx      (uint8_t *src, int stride);
  385. -void ff_pred16x16_vertical_sse      (uint8_t *src, int stride);
  386. -void ff_pred16x16_horizontal_mmx    (uint8_t *src, int stride);
  387. -void ff_pred16x16_horizontal_mmxext (uint8_t *src, int stride);
  388. -void ff_pred16x16_horizontal_ssse3  (uint8_t *src, int stride);
  389. -void ff_pred16x16_dc_mmxext         (uint8_t *src, int stride);
  390. -void ff_pred16x16_dc_sse2           (uint8_t *src, int stride);
  391. -void ff_pred16x16_dc_ssse3          (uint8_t *src, int stride);
  392. -void ff_pred16x16_plane_h264_mmx    (uint8_t *src, int stride);
  393. -void ff_pred16x16_plane_h264_mmx2   (uint8_t *src, int stride);
  394. -void ff_pred16x16_plane_h264_sse2   (uint8_t *src, int stride);
  395. -void ff_pred16x16_plane_h264_ssse3  (uint8_t *src, int stride);
  396. -void ff_pred16x16_plane_rv40_mmx    (uint8_t *src, int stride);
  397. -void ff_pred16x16_plane_rv40_mmx2   (uint8_t *src, int stride);
  398. -void ff_pred16x16_plane_rv40_sse2   (uint8_t *src, int stride);
  399. -void ff_pred16x16_plane_rv40_ssse3  (uint8_t *src, int stride);
  400. -void ff_pred16x16_plane_svq3_mmx    (uint8_t *src, int stride);
  401. -void ff_pred16x16_plane_svq3_mmx2   (uint8_t *src, int stride);
  402. -void ff_pred16x16_plane_svq3_sse2   (uint8_t *src, int stride);
  403. -void ff_pred16x16_plane_svq3_ssse3  (uint8_t *src, int stride);
  404. -void ff_pred16x16_tm_vp8_mmx        (uint8_t *src, int stride);
  405. -void ff_pred16x16_tm_vp8_mmxext     (uint8_t *src, int stride);
  406. -void ff_pred16x16_tm_vp8_sse2       (uint8_t *src, int stride);
  407. -void ff_pred8x8_dc_rv40_mmxext      (uint8_t *src, int stride);
  408. -void ff_pred8x8_vertical_mmx        (uint8_t *src, int stride);
  409. -void ff_pred8x8_horizontal_mmx      (uint8_t *src, int stride);
  410. -void ff_pred8x8_horizontal_mmxext   (uint8_t *src, int stride);
  411. -void ff_pred8x8_horizontal_ssse3    (uint8_t *src, int stride);
  412. -void ff_pred8x8_plane_mmx           (uint8_t *src, int stride);
  413. -void ff_pred8x8_plane_mmx2          (uint8_t *src, int stride);
  414. -void ff_pred8x8_plane_sse2          (uint8_t *src, int stride);
  415. -void ff_pred8x8_plane_ssse3         (uint8_t *src, int stride);
  416. -void ff_pred8x8_tm_vp8_mmx          (uint8_t *src, int stride);
  417. -void ff_pred8x8_tm_vp8_mmxext       (uint8_t *src, int stride);
  418. -void ff_pred8x8_tm_vp8_sse2         (uint8_t *src, int stride);
  419. -void ff_pred8x8_tm_vp8_ssse3        (uint8_t *src, int stride);
  420. -void ff_pred4x4_dc_mmxext           (uint8_t *src, const uint8_t *topright, int stride);
  421. -void ff_pred4x4_down_left_mmxext    (uint8_t *src, const uint8_t *topright, int stride);
  422. -void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  423. -void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  424. -void ff_pred4x4_tm_vp8_mmx          (uint8_t *src, const uint8_t *topright, int stride);
  425. -void ff_pred4x4_tm_vp8_mmxext       (uint8_t *src, const uint8_t *topright, int stride);
  426. -void ff_pred4x4_tm_vp8_ssse3        (uint8_t *src, const uint8_t *topright, int stride);
  427. -void ff_pred4x4_vertical_vp8_mmxext (uint8_t *src, const uint8_t *topright, int stride);
  428. +void ff_pred16x16_vertical_mmx        (uint8_t *src, int stride);
  429. +void ff_pred16x16_vertical_sse        (uint8_t *src, int stride);
  430. +void ff_pred16x16_horizontal_mmx      (uint8_t *src, int stride);
  431. +void ff_pred16x16_horizontal_mmxext   (uint8_t *src, int stride);
  432. +void ff_pred16x16_horizontal_ssse3    (uint8_t *src, int stride);
  433. +void ff_pred16x16_dc_mmxext           (uint8_t *src, int stride);
  434. +void ff_pred16x16_dc_sse2             (uint8_t *src, int stride);
  435. +void ff_pred16x16_dc_ssse3            (uint8_t *src, int stride);
  436. +void ff_pred16x16_plane_h264_mmx      (uint8_t *src, int stride);
  437. +void ff_pred16x16_plane_h264_mmx2     (uint8_t *src, int stride);
  438. +void ff_pred16x16_plane_h264_sse2     (uint8_t *src, int stride);
  439. +void ff_pred16x16_plane_h264_ssse3    (uint8_t *src, int stride);
  440. +void ff_pred16x16_plane_rv40_mmx      (uint8_t *src, int stride);
  441. +void ff_pred16x16_plane_rv40_mmx2     (uint8_t *src, int stride);
  442. +void ff_pred16x16_plane_rv40_sse2     (uint8_t *src, int stride);
  443. +void ff_pred16x16_plane_rv40_ssse3    (uint8_t *src, int stride);
  444. +void ff_pred16x16_plane_svq3_mmx      (uint8_t *src, int stride);
  445. +void ff_pred16x16_plane_svq3_mmx2     (uint8_t *src, int stride);
  446. +void ff_pred16x16_plane_svq3_sse2     (uint8_t *src, int stride);
  447. +void ff_pred16x16_plane_svq3_ssse3    (uint8_t *src, int stride);
  448. +void ff_pred16x16_tm_vp8_mmx          (uint8_t *src, int stride);
  449. +void ff_pred16x16_tm_vp8_mmxext       (uint8_t *src, int stride);
  450. +void ff_pred16x16_tm_vp8_sse2         (uint8_t *src, int stride);
  451. +void ff_pred8x8_dc_rv40_mmxext        (uint8_t *src, int stride);
  452. +void ff_pred8x8_vertical_mmx          (uint8_t *src, int stride);
  453. +void ff_pred8x8_horizontal_mmx        (uint8_t *src, int stride);
  454. +void ff_pred8x8_horizontal_mmxext     (uint8_t *src, int stride);
  455. +void ff_pred8x8_horizontal_ssse3      (uint8_t *src, int stride);
  456. +void ff_pred8x8_plane_mmx             (uint8_t *src, int stride);
  457. +void ff_pred8x8_plane_mmx2            (uint8_t *src, int stride);
  458. +void ff_pred8x8_plane_sse2            (uint8_t *src, int stride);
  459. +void ff_pred8x8_plane_ssse3           (uint8_t *src, int stride);
  460. +void ff_pred8x8_tm_vp8_mmx            (uint8_t *src, int stride);
  461. +void ff_pred8x8_tm_vp8_mmxext         (uint8_t *src, int stride);
  462. +void ff_pred8x8_tm_vp8_sse2           (uint8_t *src, int stride);
  463. +void ff_pred8x8_tm_vp8_ssse3          (uint8_t *src, int stride);
  464. +void ff_pred4x4_dc_mmxext             (uint8_t *src, const uint8_t *topright, int stride);
  465. +void ff_pred4x4_down_left_mmxext      (uint8_t *src, const uint8_t *topright, int stride);
  466. +void ff_pred4x4_vertical_left_mmxext  (uint8_t *src, const uint8_t *topright, int stride);
  467. +void ff_pred4x4_horizontal_up_mmxext  (uint8_t *src, const uint8_t *topright, int stride);
  468. +void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
  469. +void ff_pred4x4_tm_vp8_mmx            (uint8_t *src, const uint8_t *topright, int stride);
  470. +void ff_pred4x4_tm_vp8_mmxext         (uint8_t *src, const uint8_t *topright, int stride);
  471. +void ff_pred4x4_tm_vp8_ssse3          (uint8_t *src, const uint8_t *topright, int stride);
  472. +void ff_pred4x4_vertical_vp8_mmxext   (uint8_t *src, const uint8_t *topright, int stride);
  473.  
  474.  void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  475.  {
  476. @@ -93,10 +94,11 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
  477.      }
  478.  
  479.      if (mm_flags & AV_CPU_FLAG_MMX2) {
  480. -        h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
  481. -        h->pred16x16[DC_PRED8x8  ] = ff_pred16x16_dc_mmxext;
  482. -        h->pred8x8  [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
  483. -        h->pred4x4  [DC_PRED     ] = ff_pred4x4_dc_mmxext;
  484. +        h->pred16x16[HOR_PRED8x8  ] = ff_pred16x16_horizontal_mmxext;
  485. +        h->pred16x16[DC_PRED8x8   ] = ff_pred16x16_dc_mmxext;
  486. +        h->pred8x8  [HOR_PRED8x8  ] = ff_pred8x8_horizontal_mmxext;
  487. +        h->pred4x4  [DC_PRED      ] = ff_pred4x4_dc_mmxext;
  488. +        h->pred4x4  [HOR_DOWN_PRED] = ff_pred4x4_horizontal_down_mmxext;
  489.          if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
  490.              h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
  491.          if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264) {
  492. --
  493. 1.7.2.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement