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.

463 lines
20KB

  1. /*
  2. * Optimized for ia32 CPUs by Nick Kurshev <nickols_k@mail.ru>
  3. * H.263, MPEG-1, MPEG-2 dequantizer & draw_edges by Michael Niedermayer <michaelni@gmx.at>
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include "libavutil/attributes.h"
  22. #include "libavutil/cpu.h"
  23. #include "libavutil/x86/asm.h"
  24. #include "libavutil/x86/cpu.h"
  25. #include "libavcodec/avcodec.h"
  26. #include "libavcodec/mpegvideo.h"
  27. #if HAVE_INLINE_ASM
  28. static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
  29. int16_t *block, int n, int qscale)
  30. {
  31. x86_reg level, qmul, qadd, nCoeffs;
  32. qmul = qscale << 1;
  33. assert(s->block_last_index[n]>=0 || s->h263_aic);
  34. if (!s->h263_aic) {
  35. if (n < 4)
  36. level = block[0] * s->y_dc_scale;
  37. else
  38. level = block[0] * s->c_dc_scale;
  39. qadd = (qscale - 1) | 1;
  40. }else{
  41. qadd = 0;
  42. level= block[0];
  43. }
  44. if(s->ac_pred)
  45. nCoeffs=63;
  46. else
  47. nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
  48. __asm__ volatile(
  49. "movd %1, %%mm6 \n\t" //qmul
  50. "packssdw %%mm6, %%mm6 \n\t"
  51. "packssdw %%mm6, %%mm6 \n\t"
  52. "movd %2, %%mm5 \n\t" //qadd
  53. "pxor %%mm7, %%mm7 \n\t"
  54. "packssdw %%mm5, %%mm5 \n\t"
  55. "packssdw %%mm5, %%mm5 \n\t"
  56. "psubw %%mm5, %%mm7 \n\t"
  57. "pxor %%mm4, %%mm4 \n\t"
  58. ".p2align 4 \n\t"
  59. "1: \n\t"
  60. "movq (%0, %3), %%mm0 \n\t"
  61. "movq 8(%0, %3), %%mm1 \n\t"
  62. "pmullw %%mm6, %%mm0 \n\t"
  63. "pmullw %%mm6, %%mm1 \n\t"
  64. "movq (%0, %3), %%mm2 \n\t"
  65. "movq 8(%0, %3), %%mm3 \n\t"
  66. "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  67. "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  68. "pxor %%mm2, %%mm0 \n\t"
  69. "pxor %%mm3, %%mm1 \n\t"
  70. "paddw %%mm7, %%mm0 \n\t"
  71. "paddw %%mm7, %%mm1 \n\t"
  72. "pxor %%mm0, %%mm2 \n\t"
  73. "pxor %%mm1, %%mm3 \n\t"
  74. "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0
  75. "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0
  76. "pandn %%mm2, %%mm0 \n\t"
  77. "pandn %%mm3, %%mm1 \n\t"
  78. "movq %%mm0, (%0, %3) \n\t"
  79. "movq %%mm1, 8(%0, %3) \n\t"
  80. "add $16, %3 \n\t"
  81. "jng 1b \n\t"
  82. ::"r" (block+nCoeffs), "rm"(qmul), "rm" (qadd), "r" (2*(-nCoeffs))
  83. : "memory"
  84. );
  85. block[0]= level;
  86. }
  87. static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,
  88. int16_t *block, int n, int qscale)
  89. {
  90. x86_reg qmul, qadd, nCoeffs;
  91. qmul = qscale << 1;
  92. qadd = (qscale - 1) | 1;
  93. assert(s->block_last_index[n]>=0 || s->h263_aic);
  94. nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
  95. __asm__ volatile(
  96. "movd %1, %%mm6 \n\t" //qmul
  97. "packssdw %%mm6, %%mm6 \n\t"
  98. "packssdw %%mm6, %%mm6 \n\t"
  99. "movd %2, %%mm5 \n\t" //qadd
  100. "pxor %%mm7, %%mm7 \n\t"
  101. "packssdw %%mm5, %%mm5 \n\t"
  102. "packssdw %%mm5, %%mm5 \n\t"
  103. "psubw %%mm5, %%mm7 \n\t"
  104. "pxor %%mm4, %%mm4 \n\t"
  105. ".p2align 4 \n\t"
  106. "1: \n\t"
  107. "movq (%0, %3), %%mm0 \n\t"
  108. "movq 8(%0, %3), %%mm1 \n\t"
  109. "pmullw %%mm6, %%mm0 \n\t"
  110. "pmullw %%mm6, %%mm1 \n\t"
  111. "movq (%0, %3), %%mm2 \n\t"
  112. "movq 8(%0, %3), %%mm3 \n\t"
  113. "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  114. "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  115. "pxor %%mm2, %%mm0 \n\t"
  116. "pxor %%mm3, %%mm1 \n\t"
  117. "paddw %%mm7, %%mm0 \n\t"
  118. "paddw %%mm7, %%mm1 \n\t"
  119. "pxor %%mm0, %%mm2 \n\t"
  120. "pxor %%mm1, %%mm3 \n\t"
  121. "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0
  122. "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0
  123. "pandn %%mm2, %%mm0 \n\t"
  124. "pandn %%mm3, %%mm1 \n\t"
  125. "movq %%mm0, (%0, %3) \n\t"
  126. "movq %%mm1, 8(%0, %3) \n\t"
  127. "add $16, %3 \n\t"
  128. "jng 1b \n\t"
  129. ::"r" (block+nCoeffs), "rm"(qmul), "rm" (qadd), "r" (2*(-nCoeffs))
  130. : "memory"
  131. );
  132. }
  133. static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s,
  134. int16_t *block, int n, int qscale)
  135. {
  136. x86_reg nCoeffs;
  137. const uint16_t *quant_matrix;
  138. int block0;
  139. assert(s->block_last_index[n]>=0);
  140. nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
  141. if (n < 4)
  142. block0 = block[0] * s->y_dc_scale;
  143. else
  144. block0 = block[0] * s->c_dc_scale;
  145. /* XXX: only MPEG-1 */
  146. quant_matrix = s->intra_matrix;
  147. __asm__ volatile(
  148. "pcmpeqw %%mm7, %%mm7 \n\t"
  149. "psrlw $15, %%mm7 \n\t"
  150. "movd %2, %%mm6 \n\t"
  151. "packssdw %%mm6, %%mm6 \n\t"
  152. "packssdw %%mm6, %%mm6 \n\t"
  153. "mov %3, %%"FF_REG_a" \n\t"
  154. ".p2align 4 \n\t"
  155. "1: \n\t"
  156. "movq (%0, %%"FF_REG_a"), %%mm0\n\t"
  157. "movq 8(%0, %%"FF_REG_a"), %%mm1\n\t"
  158. "movq (%1, %%"FF_REG_a"), %%mm4\n\t"
  159. "movq 8(%1, %%"FF_REG_a"), %%mm5\n\t"
  160. "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
  161. "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
  162. "pxor %%mm2, %%mm2 \n\t"
  163. "pxor %%mm3, %%mm3 \n\t"
  164. "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  165. "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  166. "pxor %%mm2, %%mm0 \n\t"
  167. "pxor %%mm3, %%mm1 \n\t"
  168. "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
  169. "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
  170. "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q
  171. "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q
  172. "pxor %%mm4, %%mm4 \n\t"
  173. "pxor %%mm5, %%mm5 \n\t" // FIXME slow
  174. "pcmpeqw (%0, %%"FF_REG_a"), %%mm4\n\t" // block[i] == 0 ? -1 : 0
  175. "pcmpeqw 8(%0, %%"FF_REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
  176. "psraw $3, %%mm0 \n\t"
  177. "psraw $3, %%mm1 \n\t"
  178. "psubw %%mm7, %%mm0 \n\t"
  179. "psubw %%mm7, %%mm1 \n\t"
  180. "por %%mm7, %%mm0 \n\t"
  181. "por %%mm7, %%mm1 \n\t"
  182. "pxor %%mm2, %%mm0 \n\t"
  183. "pxor %%mm3, %%mm1 \n\t"
  184. "psubw %%mm2, %%mm0 \n\t"
  185. "psubw %%mm3, %%mm1 \n\t"
  186. "pandn %%mm0, %%mm4 \n\t"
  187. "pandn %%mm1, %%mm5 \n\t"
  188. "movq %%mm4, (%0, %%"FF_REG_a")\n\t"
  189. "movq %%mm5, 8(%0, %%"FF_REG_a")\n\t"
  190. "add $16, %%"FF_REG_a" \n\t"
  191. "js 1b \n\t"
  192. ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
  193. : "%"FF_REG_a, "memory"
  194. );
  195. block[0]= block0;
  196. }
  197. static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s,
  198. int16_t *block, int n, int qscale)
  199. {
  200. x86_reg nCoeffs;
  201. const uint16_t *quant_matrix;
  202. assert(s->block_last_index[n]>=0);
  203. nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
  204. quant_matrix = s->inter_matrix;
  205. __asm__ volatile(
  206. "pcmpeqw %%mm7, %%mm7 \n\t"
  207. "psrlw $15, %%mm7 \n\t"
  208. "movd %2, %%mm6 \n\t"
  209. "packssdw %%mm6, %%mm6 \n\t"
  210. "packssdw %%mm6, %%mm6 \n\t"
  211. "mov %3, %%"FF_REG_a" \n\t"
  212. ".p2align 4 \n\t"
  213. "1: \n\t"
  214. "movq (%0, %%"FF_REG_a"), %%mm0\n\t"
  215. "movq 8(%0, %%"FF_REG_a"), %%mm1\n\t"
  216. "movq (%1, %%"FF_REG_a"), %%mm4\n\t"
  217. "movq 8(%1, %%"FF_REG_a"), %%mm5\n\t"
  218. "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
  219. "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
  220. "pxor %%mm2, %%mm2 \n\t"
  221. "pxor %%mm3, %%mm3 \n\t"
  222. "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  223. "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  224. "pxor %%mm2, %%mm0 \n\t"
  225. "pxor %%mm3, %%mm1 \n\t"
  226. "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
  227. "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
  228. "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2
  229. "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2
  230. "paddw %%mm7, %%mm0 \n\t" // abs(block[i])*2 + 1
  231. "paddw %%mm7, %%mm1 \n\t" // abs(block[i])*2 + 1
  232. "pmullw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q
  233. "pmullw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q
  234. "pxor %%mm4, %%mm4 \n\t"
  235. "pxor %%mm5, %%mm5 \n\t" // FIXME slow
  236. "pcmpeqw (%0, %%"FF_REG_a"), %%mm4\n\t" // block[i] == 0 ? -1 : 0
  237. "pcmpeqw 8(%0, %%"FF_REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
  238. "psraw $4, %%mm0 \n\t"
  239. "psraw $4, %%mm1 \n\t"
  240. "psubw %%mm7, %%mm0 \n\t"
  241. "psubw %%mm7, %%mm1 \n\t"
  242. "por %%mm7, %%mm0 \n\t"
  243. "por %%mm7, %%mm1 \n\t"
  244. "pxor %%mm2, %%mm0 \n\t"
  245. "pxor %%mm3, %%mm1 \n\t"
  246. "psubw %%mm2, %%mm0 \n\t"
  247. "psubw %%mm3, %%mm1 \n\t"
  248. "pandn %%mm0, %%mm4 \n\t"
  249. "pandn %%mm1, %%mm5 \n\t"
  250. "movq %%mm4, (%0, %%"FF_REG_a")\n\t"
  251. "movq %%mm5, 8(%0, %%"FF_REG_a")\n\t"
  252. "add $16, %%"FF_REG_a" \n\t"
  253. "js 1b \n\t"
  254. ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
  255. : "%"FF_REG_a, "memory"
  256. );
  257. }
  258. static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s,
  259. int16_t *block, int n, int qscale)
  260. {
  261. x86_reg nCoeffs;
  262. const uint16_t *quant_matrix;
  263. int block0;
  264. assert(s->block_last_index[n]>=0);
  265. if(s->alternate_scan) nCoeffs= 63; //FIXME
  266. else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
  267. if (n < 4)
  268. block0 = block[0] * s->y_dc_scale;
  269. else
  270. block0 = block[0] * s->c_dc_scale;
  271. quant_matrix = s->intra_matrix;
  272. __asm__ volatile(
  273. "pcmpeqw %%mm7, %%mm7 \n\t"
  274. "psrlw $15, %%mm7 \n\t"
  275. "movd %2, %%mm6 \n\t"
  276. "packssdw %%mm6, %%mm6 \n\t"
  277. "packssdw %%mm6, %%mm6 \n\t"
  278. "mov %3, %%"FF_REG_a" \n\t"
  279. ".p2align 4 \n\t"
  280. "1: \n\t"
  281. "movq (%0, %%"FF_REG_a"), %%mm0\n\t"
  282. "movq 8(%0, %%"FF_REG_a"), %%mm1\n\t"
  283. "movq (%1, %%"FF_REG_a"), %%mm4\n\t"
  284. "movq 8(%1, %%"FF_REG_a"), %%mm5\n\t"
  285. "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
  286. "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
  287. "pxor %%mm2, %%mm2 \n\t"
  288. "pxor %%mm3, %%mm3 \n\t"
  289. "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  290. "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  291. "pxor %%mm2, %%mm0 \n\t"
  292. "pxor %%mm3, %%mm1 \n\t"
  293. "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
  294. "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
  295. "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q
  296. "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q
  297. "pxor %%mm4, %%mm4 \n\t"
  298. "pxor %%mm5, %%mm5 \n\t" // FIXME slow
  299. "pcmpeqw (%0, %%"FF_REG_a"), %%mm4\n\t" // block[i] == 0 ? -1 : 0
  300. "pcmpeqw 8(%0, %%"FF_REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
  301. "psraw $3, %%mm0 \n\t"
  302. "psraw $3, %%mm1 \n\t"
  303. "pxor %%mm2, %%mm0 \n\t"
  304. "pxor %%mm3, %%mm1 \n\t"
  305. "psubw %%mm2, %%mm0 \n\t"
  306. "psubw %%mm3, %%mm1 \n\t"
  307. "pandn %%mm0, %%mm4 \n\t"
  308. "pandn %%mm1, %%mm5 \n\t"
  309. "movq %%mm4, (%0, %%"FF_REG_a")\n\t"
  310. "movq %%mm5, 8(%0, %%"FF_REG_a")\n\t"
  311. "add $16, %%"FF_REG_a" \n\t"
  312. "jng 1b \n\t"
  313. ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
  314. : "%"FF_REG_a, "memory"
  315. );
  316. block[0]= block0;
  317. //Note, we do not do mismatch control for intra as errors cannot accumulate
  318. }
  319. static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s,
  320. int16_t *block, int n, int qscale)
  321. {
  322. x86_reg nCoeffs;
  323. const uint16_t *quant_matrix;
  324. assert(s->block_last_index[n]>=0);
  325. if(s->alternate_scan) nCoeffs= 63; //FIXME
  326. else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
  327. quant_matrix = s->inter_matrix;
  328. __asm__ volatile(
  329. "pcmpeqw %%mm7, %%mm7 \n\t"
  330. "psrlq $48, %%mm7 \n\t"
  331. "movd %2, %%mm6 \n\t"
  332. "packssdw %%mm6, %%mm6 \n\t"
  333. "packssdw %%mm6, %%mm6 \n\t"
  334. "mov %3, %%"FF_REG_a" \n\t"
  335. ".p2align 4 \n\t"
  336. "1: \n\t"
  337. "movq (%0, %%"FF_REG_a"), %%mm0\n\t"
  338. "movq 8(%0, %%"FF_REG_a"), %%mm1\n\t"
  339. "movq (%1, %%"FF_REG_a"), %%mm4\n\t"
  340. "movq 8(%1, %%"FF_REG_a"), %%mm5\n\t"
  341. "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
  342. "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
  343. "pxor %%mm2, %%mm2 \n\t"
  344. "pxor %%mm3, %%mm3 \n\t"
  345. "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
  346. "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
  347. "pxor %%mm2, %%mm0 \n\t"
  348. "pxor %%mm3, %%mm1 \n\t"
  349. "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
  350. "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
  351. "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2
  352. "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2
  353. "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*2*q
  354. "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*2*q
  355. "paddw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q
  356. "paddw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q
  357. "pxor %%mm4, %%mm4 \n\t"
  358. "pxor %%mm5, %%mm5 \n\t" // FIXME slow
  359. "pcmpeqw (%0, %%"FF_REG_a"), %%mm4\n\t" // block[i] == 0 ? -1 : 0
  360. "pcmpeqw 8(%0, %%"FF_REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
  361. "psrlw $4, %%mm0 \n\t"
  362. "psrlw $4, %%mm1 \n\t"
  363. "pxor %%mm2, %%mm0 \n\t"
  364. "pxor %%mm3, %%mm1 \n\t"
  365. "psubw %%mm2, %%mm0 \n\t"
  366. "psubw %%mm3, %%mm1 \n\t"
  367. "pandn %%mm0, %%mm4 \n\t"
  368. "pandn %%mm1, %%mm5 \n\t"
  369. "pxor %%mm4, %%mm7 \n\t"
  370. "pxor %%mm5, %%mm7 \n\t"
  371. "movq %%mm4, (%0, %%"FF_REG_a")\n\t"
  372. "movq %%mm5, 8(%0, %%"FF_REG_a")\n\t"
  373. "add $16, %%"FF_REG_a" \n\t"
  374. "jng 1b \n\t"
  375. "movd 124(%0, %3), %%mm0 \n\t"
  376. "movq %%mm7, %%mm6 \n\t"
  377. "psrlq $32, %%mm7 \n\t"
  378. "pxor %%mm6, %%mm7 \n\t"
  379. "movq %%mm7, %%mm6 \n\t"
  380. "psrlq $16, %%mm7 \n\t"
  381. "pxor %%mm6, %%mm7 \n\t"
  382. "pslld $31, %%mm7 \n\t"
  383. "psrlq $15, %%mm7 \n\t"
  384. "pxor %%mm7, %%mm0 \n\t"
  385. "movd %%mm0, 124(%0, %3) \n\t"
  386. ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "r" (-2*nCoeffs)
  387. : "%"FF_REG_a, "memory"
  388. );
  389. }
  390. #endif /* HAVE_INLINE_ASM */
  391. av_cold void ff_mpv_common_init_x86(MpegEncContext *s)
  392. {
  393. #if HAVE_INLINE_ASM
  394. int cpu_flags = av_get_cpu_flags();
  395. if (INLINE_MMX(cpu_flags)) {
  396. s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
  397. s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
  398. s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
  399. s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_mmx;
  400. if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT))
  401. s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
  402. s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
  403. }
  404. #endif /* HAVE_INLINE_ASM */
  405. }