You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

442 lines
20KB

  1. /*
  2. * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "libavutil/attributes.h"
  21. #include "libavutil/cpu.h"
  22. #include "libavutil/x86/asm.h"
  23. #include "libavutil/x86/cpu.h"
  24. #include "libavcodec/h264dsp.h"
  25. /***********************************/
  26. /* IDCT */
  27. #define IDCT_ADD_FUNC(NUM, DEPTH, OPT) \
  28. void ff_h264_idct ## NUM ## _add_ ## DEPTH ## _ ## OPT(uint8_t *dst, \
  29. int16_t *block, \
  30. int stride);
  31. IDCT_ADD_FUNC(, 8, mmx)
  32. IDCT_ADD_FUNC(, 8, avx)
  33. IDCT_ADD_FUNC(, 10, sse2)
  34. IDCT_ADD_FUNC(_dc, 8, mmxext)
  35. IDCT_ADD_FUNC(_dc, 10, mmxext)
  36. IDCT_ADD_FUNC(8_dc, 8, mmxext)
  37. IDCT_ADD_FUNC(8_dc, 10, sse2)
  38. IDCT_ADD_FUNC(8, 8, mmx)
  39. IDCT_ADD_FUNC(8, 8, sse2)
  40. IDCT_ADD_FUNC(8, 10, sse2)
  41. IDCT_ADD_FUNC(, 10, avx)
  42. IDCT_ADD_FUNC(8_dc, 10, avx)
  43. IDCT_ADD_FUNC(8, 10, avx)
  44. #define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \
  45. void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  46. (uint8_t *dst, const int *block_offset, \
  47. int16_t *block, int stride, const uint8_t nnzc[6 * 8]);
  48. IDCT_ADD_REP_FUNC(8, 4, 8, mmx)
  49. IDCT_ADD_REP_FUNC(8, 4, 8, mmxext)
  50. IDCT_ADD_REP_FUNC(8, 4, 8, sse2)
  51. IDCT_ADD_REP_FUNC(8, 4, 10, sse2)
  52. IDCT_ADD_REP_FUNC(8, 4, 10, avx)
  53. IDCT_ADD_REP_FUNC(, 16, 8, mmx)
  54. IDCT_ADD_REP_FUNC(, 16, 8, mmxext)
  55. IDCT_ADD_REP_FUNC(, 16, 8, sse2)
  56. IDCT_ADD_REP_FUNC(, 16, 10, sse2)
  57. IDCT_ADD_REP_FUNC(, 16intra, 8, mmx)
  58. IDCT_ADD_REP_FUNC(, 16intra, 8, mmxext)
  59. IDCT_ADD_REP_FUNC(, 16intra, 8, sse2)
  60. IDCT_ADD_REP_FUNC(, 16intra, 10, sse2)
  61. IDCT_ADD_REP_FUNC(, 16, 10, avx)
  62. IDCT_ADD_REP_FUNC(, 16intra, 10, avx)
  63. #define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \
  64. void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
  65. (uint8_t **dst, const int *block_offset, \
  66. int16_t *block, int stride, const uint8_t nnzc[6 * 8]);
  67. IDCT_ADD_REP_FUNC2(, 8, 8, mmx)
  68. IDCT_ADD_REP_FUNC2(, 8, 8, mmxext)
  69. IDCT_ADD_REP_FUNC2(, 8, 8, sse2)
  70. IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
  71. IDCT_ADD_REP_FUNC2(, 8, 10, avx)
  72. IDCT_ADD_REP_FUNC2(, 8_422, 8, mmx)
  73. IDCT_ADD_REP_FUNC2(, 8_422, 10, sse2)
  74. IDCT_ADD_REP_FUNC2(, 8_422, 10, avx)
  75. void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul);
  76. void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul);
  77. /***********************************/
  78. /* deblocking */
  79. void ff_h264_loop_filter_strength_mmxext(int16_t bS[2][4][4], uint8_t nnz[40],
  80. int8_t ref[2][40],
  81. int16_t mv[2][40][2],
  82. int bidir, int edges, int step,
  83. int mask_mv0, int mask_mv1, int field);
  84. #define LF_FUNC(DIR, TYPE, DEPTH, OPT) \
  85. void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \
  86. int stride, \
  87. int alpha, \
  88. int beta, \
  89. int8_t *tc0);
  90. #define LF_IFUNC(DIR, TYPE, DEPTH, OPT) \
  91. void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \
  92. int stride, \
  93. int alpha, \
  94. int beta);
  95. #define LF_FUNCS(type, depth) \
  96. LF_FUNC(h, chroma, depth, mmxext) \
  97. LF_IFUNC(h, chroma_intra, depth, mmxext) \
  98. LF_FUNC(h, chroma422, depth, mmxext) \
  99. LF_IFUNC(h, chroma422_intra, depth, mmxext) \
  100. LF_FUNC(v, chroma, depth, mmxext) \
  101. LF_IFUNC(v, chroma_intra, depth, mmxext) \
  102. LF_FUNC(h, luma, depth, mmxext) \
  103. LF_IFUNC(h, luma_intra, depth, mmxext) \
  104. LF_FUNC(h, luma, depth, sse2) \
  105. LF_IFUNC(h, luma_intra, depth, sse2) \
  106. LF_FUNC(v, luma, depth, sse2) \
  107. LF_IFUNC(v, luma_intra, depth, sse2) \
  108. LF_FUNC(h, chroma, depth, sse2) \
  109. LF_IFUNC(h, chroma_intra, depth, sse2) \
  110. LF_FUNC(h, chroma422, depth, sse2) \
  111. LF_IFUNC(h, chroma422_intra, depth, sse2) \
  112. LF_FUNC(v, chroma, depth, sse2) \
  113. LF_IFUNC(v, chroma_intra, depth, sse2) \
  114. LF_FUNC(h, luma, depth, avx) \
  115. LF_IFUNC(h, luma_intra, depth, avx) \
  116. LF_FUNC(v, luma, depth, avx) \
  117. LF_IFUNC(v, luma_intra, depth, avx) \
  118. LF_FUNC(h, chroma, depth, avx) \
  119. LF_IFUNC(h, chroma_intra, depth, avx) \
  120. LF_FUNC(h, chroma422, depth, avx) \
  121. LF_IFUNC(h, chroma422_intra, depth, avx) \
  122. LF_FUNC(v, chroma, depth, avx) \
  123. LF_IFUNC(v, chroma_intra, depth, avx)
  124. LF_FUNC(h, luma_mbaff, 8, sse2)
  125. LF_FUNC(h, luma_mbaff, 8, avx)
  126. LF_FUNCS(uint8_t, 8)
  127. LF_FUNCS(uint16_t, 10)
  128. #if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
  129. LF_FUNC(v8, luma, 8, mmxext)
  130. static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,
  131. int beta, int8_t *tc0)
  132. {
  133. if ((tc0[0] & tc0[1]) >= 0)
  134. ff_deblock_v8_luma_8_mmxext(pix + 0, stride, alpha, beta, tc0);
  135. if ((tc0[2] & tc0[3]) >= 0)
  136. ff_deblock_v8_luma_8_mmxext(pix + 8, stride, alpha, beta, tc0 + 2);
  137. }
  138. LF_IFUNC(v8, luma_intra, 8, mmxext)
  139. static void deblock_v_luma_intra_8_mmxext(uint8_t *pix, int stride,
  140. int alpha, int beta)
  141. {
  142. ff_deblock_v8_luma_intra_8_mmxext(pix + 0, stride, alpha, beta);
  143. ff_deblock_v8_luma_intra_8_mmxext(pix + 8, stride, alpha, beta);
  144. }
  145. #endif /* ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL */
  146. LF_FUNC(v, luma, 10, mmxext)
  147. LF_IFUNC(v, luma_intra, 10, mmxext)
  148. /***********************************/
  149. /* weighted prediction */
  150. #define H264_WEIGHT(W, OPT) \
  151. void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, ptrdiff_t stride, \
  152. int height, int log2_denom, \
  153. int weight, int offset);
  154. #define H264_BIWEIGHT(W, OPT) \
  155. void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src, \
  156. ptrdiff_t stride, int height, \
  157. int log2_denom, int weightd, \
  158. int weights, int offset);
  159. #define H264_BIWEIGHT_MMX(W) \
  160. H264_WEIGHT(W, mmxext) \
  161. H264_BIWEIGHT(W, mmxext)
  162. #define H264_BIWEIGHT_MMX_SSE(W) \
  163. H264_BIWEIGHT_MMX(W) \
  164. H264_WEIGHT(W, sse2) \
  165. H264_BIWEIGHT(W, sse2) \
  166. H264_BIWEIGHT(W, ssse3)
  167. H264_BIWEIGHT_MMX_SSE(16)
  168. H264_BIWEIGHT_MMX_SSE(8)
  169. H264_BIWEIGHT_MMX(4)
  170. #define H264_WEIGHT_10(W, DEPTH, OPT) \
  171. void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
  172. ptrdiff_t stride, \
  173. int height, \
  174. int log2_denom, \
  175. int weight, \
  176. int offset);
  177. #define H264_BIWEIGHT_10(W, DEPTH, OPT) \
  178. void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
  179. uint8_t *src, \
  180. ptrdiff_t stride, \
  181. int height, \
  182. int log2_denom, \
  183. int weightd, \
  184. int weights, \
  185. int offset);
  186. #define H264_BIWEIGHT_10_SSE(W, DEPTH) \
  187. H264_WEIGHT_10(W, DEPTH, sse2) \
  188. H264_WEIGHT_10(W, DEPTH, sse4) \
  189. H264_BIWEIGHT_10(W, DEPTH, sse2) \
  190. H264_BIWEIGHT_10(W, DEPTH, sse4)
  191. H264_BIWEIGHT_10_SSE(16, 10)
  192. H264_BIWEIGHT_10_SSE(8, 10)
  193. H264_BIWEIGHT_10_SSE(4, 10)
  194. av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
  195. const int chroma_format_idc)
  196. {
  197. #if HAVE_YASM
  198. int cpu_flags = av_get_cpu_flags();
  199. if (EXTERNAL_MMXEXT(cpu_flags) && chroma_format_idc <= 1)
  200. c->h264_loop_filter_strength = ff_h264_loop_filter_strength_mmxext;
  201. if (bit_depth == 8) {
  202. if (EXTERNAL_MMX(cpu_flags)) {
  203. c->h264_idct_dc_add =
  204. c->h264_idct_add = ff_h264_idct_add_8_mmx;
  205. c->h264_idct8_dc_add =
  206. c->h264_idct8_add = ff_h264_idct8_add_8_mmx;
  207. c->h264_idct_add16 = ff_h264_idct_add16_8_mmx;
  208. c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmx;
  209. if (chroma_format_idc <= 1) {
  210. c->h264_idct_add8 = ff_h264_idct_add8_8_mmx;
  211. } else {
  212. c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmx;
  213. }
  214. c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmx;
  215. if (cpu_flags & AV_CPU_FLAG_CMOV)
  216. c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_mmx;
  217. }
  218. if (EXTERNAL_MMXEXT(cpu_flags)) {
  219. c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmxext;
  220. c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
  221. c->h264_idct_add16 = ff_h264_idct_add16_8_mmxext;
  222. c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmxext;
  223. if (chroma_format_idc <= 1)
  224. c->h264_idct_add8 = ff_h264_idct_add8_8_mmxext;
  225. c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmxext;
  226. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmxext;
  227. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmxext;
  228. if (chroma_format_idc <= 1) {
  229. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_mmxext;
  230. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
  231. } else {
  232. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_mmxext;
  233. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma422_intra_8_mmxext;
  234. }
  235. #if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
  236. c->h264_v_loop_filter_luma = deblock_v_luma_8_mmxext;
  237. c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmxext;
  238. c->h264_v_loop_filter_luma_intra = deblock_v_luma_intra_8_mmxext;
  239. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmxext;
  240. #endif /* ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL */
  241. c->weight_h264_pixels_tab[0] = ff_h264_weight_16_mmxext;
  242. c->weight_h264_pixels_tab[1] = ff_h264_weight_8_mmxext;
  243. c->weight_h264_pixels_tab[2] = ff_h264_weight_4_mmxext;
  244. c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_mmxext;
  245. c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_mmxext;
  246. c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
  247. }
  248. if (EXTERNAL_SSE2(cpu_flags)) {
  249. c->h264_idct8_add = ff_h264_idct8_add_8_sse2;
  250. c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
  251. c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
  252. if (chroma_format_idc <= 1)
  253. c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
  254. c->h264_idct_add16intra = ff_h264_idct_add16intra_8_sse2;
  255. c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_sse2;
  256. c->weight_h264_pixels_tab[0] = ff_h264_weight_16_sse2;
  257. c->weight_h264_pixels_tab[1] = ff_h264_weight_8_sse2;
  258. c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_sse2;
  259. c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_sse2;
  260. c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_sse2;
  261. c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_sse2;
  262. c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_sse2;
  263. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
  264. #if ARCH_X86_64
  265. c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_sse2;
  266. #endif
  267. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_sse2;
  268. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_sse2;
  269. if (chroma_format_idc <= 1) {
  270. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_sse2;
  271. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_sse2;
  272. } else {
  273. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_sse2;
  274. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma422_intra_8_sse2;
  275. }
  276. }
  277. if (EXTERNAL_SSSE3(cpu_flags)) {
  278. c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;
  279. c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_ssse3;
  280. }
  281. if (EXTERNAL_AVX(cpu_flags)) {
  282. c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_avx;
  283. c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_avx;
  284. c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
  285. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
  286. #if ARCH_X86_64
  287. c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_avx;
  288. #endif
  289. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_avx;
  290. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_avx;
  291. if (chroma_format_idc <= 1) {
  292. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_avx;
  293. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_avx;
  294. } else {
  295. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_avx;
  296. c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma422_intra_8_avx;
  297. }
  298. c->h264_idct_add = ff_h264_idct_add_8_avx;
  299. }
  300. } else if (bit_depth == 10) {
  301. if (EXTERNAL_MMXEXT(cpu_flags)) {
  302. #if ARCH_X86_32
  303. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_mmxext;
  304. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext;
  305. if (chroma_format_idc <= 1) {
  306. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_mmxext;
  307. } else {
  308. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_mmxext;
  309. }
  310. c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_mmxext;
  311. c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_mmxext;
  312. c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_mmxext;
  313. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_mmxext;
  314. #endif /* ARCH_X86_32 */
  315. c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
  316. }
  317. if (EXTERNAL_SSE2(cpu_flags)) {
  318. c->h264_idct_add = ff_h264_idct_add_10_sse2;
  319. c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
  320. c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
  321. if (chroma_format_idc <= 1) {
  322. c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
  323. } else {
  324. c->h264_idct_add8 = ff_h264_idct_add8_422_10_sse2;
  325. }
  326. c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
  327. #if HAVE_ALIGNED_STACK
  328. c->h264_idct8_add = ff_h264_idct8_add_10_sse2;
  329. c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2;
  330. #endif /* HAVE_ALIGNED_STACK */
  331. c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2;
  332. c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2;
  333. c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2;
  334. c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2;
  335. c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2;
  336. c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2;
  337. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_sse2;
  338. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2;
  339. if (chroma_format_idc <= 1) {
  340. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_sse2;
  341. } else {
  342. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_sse2;
  343. }
  344. #if HAVE_ALIGNED_STACK
  345. c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_sse2;
  346. c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_sse2;
  347. c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_sse2;
  348. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
  349. #endif /* HAVE_ALIGNED_STACK */
  350. }
  351. if (EXTERNAL_SSE4(cpu_flags)) {
  352. c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4;
  353. c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4;
  354. c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4;
  355. c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4;
  356. c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
  357. c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
  358. }
  359. if (EXTERNAL_AVX(cpu_flags)) {
  360. c->h264_idct_dc_add =
  361. c->h264_idct_add = ff_h264_idct_add_10_avx;
  362. c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
  363. c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
  364. if (chroma_format_idc <= 1) {
  365. c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
  366. } else {
  367. c->h264_idct_add8 = ff_h264_idct_add8_422_10_avx;
  368. }
  369. c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
  370. #if HAVE_ALIGNED_STACK
  371. c->h264_idct8_add = ff_h264_idct8_add_10_avx;
  372. c->h264_idct8_add4 = ff_h264_idct8_add4_10_avx;
  373. #endif /* HAVE_ALIGNED_STACK */
  374. c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_avx;
  375. c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx;
  376. if (chroma_format_idc <= 1) {
  377. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_avx;
  378. } else {
  379. c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_avx;
  380. }
  381. #if HAVE_ALIGNED_STACK
  382. c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_avx;
  383. c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_avx;
  384. c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_avx;
  385. c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx;
  386. #endif /* HAVE_ALIGNED_STACK */
  387. }
  388. }
  389. #endif
  390. }