qpeldsp.c 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. /*
  2. * quarterpel DSP functions
  3. * Copyright (c) 2000, 2001 Fabrice Bellard
  4. * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * @file
  24. * quarterpel DSP functions
  25. */
  26. #include <stddef.h>
  27. #include <stdint.h>
  28. #include "config.h"
  29. #include "libavutil/attributes.h"
  30. #include "copy_block.h"
  31. #include "qpeldsp.h"
  32. #include "diracdsp.h"
  33. #define BIT_DEPTH 8
  34. #include "hpel_template.c"
  35. #include "pel_template.c"
  36. #include "qpel_template.c"
  37. #define QPEL_MC(r, OPNAME, RND, OP) \
  38. static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, const uint8_t *src, \
  39. int dstStride, int srcStride, \
  40. int h) \
  41. { \
  42. const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
  43. int i; \
  44. \
  45. for (i = 0; i < h; i++) { \
  46. OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
  47. OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
  48. OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
  49. OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
  50. OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
  51. OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[8])); \
  52. OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[8]) * 3 - (src[3] + src[7])); \
  53. OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[8]) * 6 + (src[5] + src[7]) * 3 - (src[4] + src[6])); \
  54. dst += dstStride; \
  55. src += srcStride; \
  56. } \
  57. } \
  58. \
  59. static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, const uint8_t *src, \
  60. int dstStride, int srcStride) \
  61. { \
  62. const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
  63. const int w = 8; \
  64. int i; \
  65. \
  66. for (i = 0; i < w; i++) { \
  67. const int src0 = src[0 * srcStride]; \
  68. const int src1 = src[1 * srcStride]; \
  69. const int src2 = src[2 * srcStride]; \
  70. const int src3 = src[3 * srcStride]; \
  71. const int src4 = src[4 * srcStride]; \
  72. const int src5 = src[5 * srcStride]; \
  73. const int src6 = src[6 * srcStride]; \
  74. const int src7 = src[7 * srcStride]; \
  75. const int src8 = src[8 * srcStride]; \
  76. OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
  77. OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
  78. OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
  79. OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
  80. OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
  81. OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src8)); \
  82. OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src8) * 3 - (src3 + src7)); \
  83. OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src8) * 6 + (src5 + src7) * 3 - (src4 + src6)); \
  84. dst++; \
  85. src++; \
  86. } \
  87. } \
  88. \
  89. static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, \
  90. const uint8_t *src, \
  91. int dstStride, int srcStride, \
  92. int h) \
  93. { \
  94. const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
  95. int i; \
  96. \
  97. for (i = 0; i < h; i++) { \
  98. OP(dst[0], (src[0] + src[1]) * 20 - (src[0] + src[2]) * 6 + (src[1] + src[3]) * 3 - (src[2] + src[4])); \
  99. OP(dst[1], (src[1] + src[2]) * 20 - (src[0] + src[3]) * 6 + (src[0] + src[4]) * 3 - (src[1] + src[5])); \
  100. OP(dst[2], (src[2] + src[3]) * 20 - (src[1] + src[4]) * 6 + (src[0] + src[5]) * 3 - (src[0] + src[6])); \
  101. OP(dst[3], (src[3] + src[4]) * 20 - (src[2] + src[5]) * 6 + (src[1] + src[6]) * 3 - (src[0] + src[7])); \
  102. OP(dst[4], (src[4] + src[5]) * 20 - (src[3] + src[6]) * 6 + (src[2] + src[7]) * 3 - (src[1] + src[8])); \
  103. OP(dst[5], (src[5] + src[6]) * 20 - (src[4] + src[7]) * 6 + (src[3] + src[8]) * 3 - (src[2] + src[9])); \
  104. OP(dst[6], (src[6] + src[7]) * 20 - (src[5] + src[8]) * 6 + (src[4] + src[9]) * 3 - (src[3] + src[10])); \
  105. OP(dst[7], (src[7] + src[8]) * 20 - (src[6] + src[9]) * 6 + (src[5] + src[10]) * 3 - (src[4] + src[11])); \
  106. OP(dst[8], (src[8] + src[9]) * 20 - (src[7] + src[10]) * 6 + (src[6] + src[11]) * 3 - (src[5] + src[12])); \
  107. OP(dst[9], (src[9] + src[10]) * 20 - (src[8] + src[11]) * 6 + (src[7] + src[12]) * 3 - (src[6] + src[13])); \
  108. OP(dst[10], (src[10] + src[11]) * 20 - (src[9] + src[12]) * 6 + (src[8] + src[13]) * 3 - (src[7] + src[14])); \
  109. OP(dst[11], (src[11] + src[12]) * 20 - (src[10] + src[13]) * 6 + (src[9] + src[14]) * 3 - (src[8] + src[15])); \
  110. OP(dst[12], (src[12] + src[13]) * 20 - (src[11] + src[14]) * 6 + (src[10] + src[15]) * 3 - (src[9] + src[16])); \
  111. OP(dst[13], (src[13] + src[14]) * 20 - (src[12] + src[15]) * 6 + (src[11] + src[16]) * 3 - (src[10] + src[16])); \
  112. OP(dst[14], (src[14] + src[15]) * 20 - (src[13] + src[16]) * 6 + (src[12] + src[16]) * 3 - (src[11] + src[15])); \
  113. OP(dst[15], (src[15] + src[16]) * 20 - (src[14] + src[16]) * 6 + (src[13] + src[15]) * 3 - (src[12] + src[14])); \
  114. dst += dstStride; \
  115. src += srcStride; \
  116. } \
  117. } \
  118. \
  119. static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, \
  120. const uint8_t *src, \
  121. int dstStride, int srcStride) \
  122. { \
  123. const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
  124. const int w = 16; \
  125. int i; \
  126. \
  127. for (i = 0; i < w; i++) { \
  128. const int src0 = src[0 * srcStride]; \
  129. const int src1 = src[1 * srcStride]; \
  130. const int src2 = src[2 * srcStride]; \
  131. const int src3 = src[3 * srcStride]; \
  132. const int src4 = src[4 * srcStride]; \
  133. const int src5 = src[5 * srcStride]; \
  134. const int src6 = src[6 * srcStride]; \
  135. const int src7 = src[7 * srcStride]; \
  136. const int src8 = src[8 * srcStride]; \
  137. const int src9 = src[9 * srcStride]; \
  138. const int src10 = src[10 * srcStride]; \
  139. const int src11 = src[11 * srcStride]; \
  140. const int src12 = src[12 * srcStride]; \
  141. const int src13 = src[13 * srcStride]; \
  142. const int src14 = src[14 * srcStride]; \
  143. const int src15 = src[15 * srcStride]; \
  144. const int src16 = src[16 * srcStride]; \
  145. OP(dst[0 * dstStride], (src0 + src1) * 20 - (src0 + src2) * 6 + (src1 + src3) * 3 - (src2 + src4)); \
  146. OP(dst[1 * dstStride], (src1 + src2) * 20 - (src0 + src3) * 6 + (src0 + src4) * 3 - (src1 + src5)); \
  147. OP(dst[2 * dstStride], (src2 + src3) * 20 - (src1 + src4) * 6 + (src0 + src5) * 3 - (src0 + src6)); \
  148. OP(dst[3 * dstStride], (src3 + src4) * 20 - (src2 + src5) * 6 + (src1 + src6) * 3 - (src0 + src7)); \
  149. OP(dst[4 * dstStride], (src4 + src5) * 20 - (src3 + src6) * 6 + (src2 + src7) * 3 - (src1 + src8)); \
  150. OP(dst[5 * dstStride], (src5 + src6) * 20 - (src4 + src7) * 6 + (src3 + src8) * 3 - (src2 + src9)); \
  151. OP(dst[6 * dstStride], (src6 + src7) * 20 - (src5 + src8) * 6 + (src4 + src9) * 3 - (src3 + src10)); \
  152. OP(dst[7 * dstStride], (src7 + src8) * 20 - (src6 + src9) * 6 + (src5 + src10) * 3 - (src4 + src11)); \
  153. OP(dst[8 * dstStride], (src8 + src9) * 20 - (src7 + src10) * 6 + (src6 + src11) * 3 - (src5 + src12)); \
  154. OP(dst[9 * dstStride], (src9 + src10) * 20 - (src8 + src11) * 6 + (src7 + src12) * 3 - (src6 + src13)); \
  155. OP(dst[10 * dstStride], (src10 + src11) * 20 - (src9 + src12) * 6 + (src8 + src13) * 3 - (src7 + src14)); \
  156. OP(dst[11 * dstStride], (src11 + src12) * 20 - (src10 + src13) * 6 + (src9 + src14) * 3 - (src8 + src15)); \
  157. OP(dst[12 * dstStride], (src12 + src13) * 20 - (src11 + src14) * 6 + (src10 + src15) * 3 - (src9 + src16)); \
  158. OP(dst[13 * dstStride], (src13 + src14) * 20 - (src12 + src15) * 6 + (src11 + src16) * 3 - (src10 + src16)); \
  159. OP(dst[14 * dstStride], (src14 + src15) * 20 - (src13 + src16) * 6 + (src12 + src16) * 3 - (src11 + src15)); \
  160. OP(dst[15 * dstStride], (src15 + src16) * 20 - (src14 + src16) * 6 + (src13 + src15) * 3 - (src12 + src14)); \
  161. dst++; \
  162. src++; \
  163. } \
  164. } \
  165. \
  166. static void OPNAME ## qpel8_mc10_c(uint8_t *dst, const uint8_t *src, \
  167. ptrdiff_t stride) \
  168. { \
  169. uint8_t half[64]; \
  170. \
  171. put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
  172. OPNAME ## pixels8_l2_8(dst, src, half, stride, stride, 8, 8); \
  173. } \
  174. \
  175. static void OPNAME ## qpel8_mc20_c(uint8_t *dst, const uint8_t *src, \
  176. ptrdiff_t stride) \
  177. { \
  178. OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8); \
  179. } \
  180. \
  181. static void OPNAME ## qpel8_mc30_c(uint8_t *dst, const uint8_t *src, \
  182. ptrdiff_t stride) \
  183. { \
  184. uint8_t half[64]; \
  185. \
  186. put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8); \
  187. OPNAME ## pixels8_l2_8(dst, src + 1, half, stride, stride, 8, 8); \
  188. } \
  189. \
  190. static void OPNAME ## qpel8_mc01_c(uint8_t *dst, const uint8_t *src, \
  191. ptrdiff_t stride) \
  192. { \
  193. uint8_t full[16 * 9]; \
  194. uint8_t half[64]; \
  195. \
  196. copy_block9(full, src, 16, stride, 9); \
  197. put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
  198. OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8); \
  199. } \
  200. \
  201. static void OPNAME ## qpel8_mc02_c(uint8_t *dst, const uint8_t *src, \
  202. ptrdiff_t stride) \
  203. { \
  204. uint8_t full[16 * 9]; \
  205. \
  206. copy_block9(full, src, 16, stride, 9); \
  207. OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16); \
  208. } \
  209. \
  210. static void OPNAME ## qpel8_mc03_c(uint8_t *dst, const uint8_t *src, \
  211. ptrdiff_t stride) \
  212. { \
  213. uint8_t full[16 * 9]; \
  214. uint8_t half[64]; \
  215. \
  216. copy_block9(full, src, 16, stride, 9); \
  217. put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \
  218. OPNAME ## pixels8_l2_8(dst, full + 16, half, stride, 16, 8, 8); \
  219. } \
  220. \
  221. void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, const uint8_t *src, \
  222. ptrdiff_t stride) \
  223. { \
  224. uint8_t full[16 * 9]; \
  225. uint8_t halfH[72]; \
  226. uint8_t halfV[64]; \
  227. uint8_t halfHV[64]; \
  228. \
  229. copy_block9(full, src, 16, stride, 9); \
  230. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  231. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
  232. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  233. OPNAME ## pixels8_l4_8(dst, full, halfH, halfV, halfHV, \
  234. stride, 16, 8, 8, 8, 8); \
  235. } \
  236. \
  237. static void OPNAME ## qpel8_mc11_c(uint8_t *dst, const uint8_t *src, \
  238. ptrdiff_t stride) \
  239. { \
  240. uint8_t full[16 * 9]; \
  241. uint8_t halfH[72]; \
  242. uint8_t halfHV[64]; \
  243. \
  244. copy_block9(full, src, 16, stride, 9); \
  245. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  246. put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
  247. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  248. OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
  249. } \
  250. \
  251. void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, const uint8_t *src, \
  252. ptrdiff_t stride) \
  253. { \
  254. uint8_t full[16 * 9]; \
  255. uint8_t halfH[72]; \
  256. uint8_t halfV[64]; \
  257. uint8_t halfHV[64]; \
  258. \
  259. copy_block9(full, src, 16, stride, 9); \
  260. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  261. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
  262. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  263. OPNAME ## pixels8_l4_8(dst, full + 1, halfH, halfV, halfHV, \
  264. stride, 16, 8, 8, 8, 8); \
  265. } \
  266. \
  267. static void OPNAME ## qpel8_mc31_c(uint8_t *dst, const uint8_t *src, \
  268. ptrdiff_t stride) \
  269. { \
  270. uint8_t full[16 * 9]; \
  271. uint8_t halfH[72]; \
  272. uint8_t halfHV[64]; \
  273. \
  274. copy_block9(full, src, 16, stride, 9); \
  275. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  276. put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
  277. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  278. OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
  279. } \
  280. \
  281. void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, const uint8_t *src, \
  282. ptrdiff_t stride) \
  283. { \
  284. uint8_t full[16 * 9]; \
  285. uint8_t halfH[72]; \
  286. uint8_t halfV[64]; \
  287. uint8_t halfHV[64]; \
  288. \
  289. copy_block9(full, src, 16, stride, 9); \
  290. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  291. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
  292. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  293. OPNAME ## pixels8_l4_8(dst, full + 16, halfH + 8, halfV, halfHV, \
  294. stride, 16, 8, 8, 8, 8); \
  295. } \
  296. \
  297. static void OPNAME ## qpel8_mc13_c(uint8_t *dst, const uint8_t *src, \
  298. ptrdiff_t stride) \
  299. { \
  300. uint8_t full[16 * 9]; \
  301. uint8_t halfH[72]; \
  302. uint8_t halfHV[64]; \
  303. \
  304. copy_block9(full, src, 16, stride, 9); \
  305. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  306. put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
  307. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  308. OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
  309. } \
  310. \
  311. void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, const uint8_t *src, \
  312. ptrdiff_t stride) \
  313. { \
  314. uint8_t full[16 * 9]; \
  315. uint8_t halfH[72]; \
  316. uint8_t halfV[64]; \
  317. uint8_t halfHV[64]; \
  318. \
  319. copy_block9(full, src, 16, stride, 9); \
  320. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  321. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
  322. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  323. OPNAME ## pixels8_l4_8(dst, full + 17, halfH + 8, halfV, halfHV, \
  324. stride, 16, 8, 8, 8, 8); \
  325. } \
  326. \
  327. static void OPNAME ## qpel8_mc33_c(uint8_t *dst, const uint8_t *src, \
  328. ptrdiff_t stride) \
  329. { \
  330. uint8_t full[16 * 9]; \
  331. uint8_t halfH[72]; \
  332. uint8_t halfHV[64]; \
  333. \
  334. copy_block9(full, src, 16, stride, 9); \
  335. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  336. put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
  337. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  338. OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
  339. } \
  340. \
  341. static void OPNAME ## qpel8_mc21_c(uint8_t *dst, const uint8_t *src, \
  342. ptrdiff_t stride) \
  343. { \
  344. uint8_t halfH[72]; \
  345. uint8_t halfHV[64]; \
  346. \
  347. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
  348. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  349. OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8); \
  350. } \
  351. \
  352. static void OPNAME ## qpel8_mc23_c(uint8_t *dst, const uint8_t *src, \
  353. ptrdiff_t stride) \
  354. { \
  355. uint8_t halfH[72]; \
  356. uint8_t halfHV[64]; \
  357. \
  358. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
  359. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  360. OPNAME ## pixels8_l2_8(dst, halfH + 8, halfHV, stride, 8, 8, 8); \
  361. } \
  362. \
  363. void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, const uint8_t *src, \
  364. ptrdiff_t stride) \
  365. { \
  366. uint8_t full[16 * 9]; \
  367. uint8_t halfH[72]; \
  368. uint8_t halfV[64]; \
  369. uint8_t halfHV[64]; \
  370. \
  371. copy_block9(full, src, 16, stride, 9); \
  372. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  373. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16); \
  374. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  375. OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
  376. } \
  377. \
  378. static void OPNAME ## qpel8_mc12_c(uint8_t *dst, const uint8_t *src, \
  379. ptrdiff_t stride) \
  380. { \
  381. uint8_t full[16 * 9]; \
  382. uint8_t halfH[72]; \
  383. \
  384. copy_block9(full, src, 16, stride, 9); \
  385. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  386. put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9); \
  387. OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
  388. } \
  389. \
  390. void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, const uint8_t *src, \
  391. ptrdiff_t stride) \
  392. { \
  393. uint8_t full[16 * 9]; \
  394. uint8_t halfH[72]; \
  395. uint8_t halfV[64]; \
  396. uint8_t halfHV[64]; \
  397. \
  398. copy_block9(full, src, 16, stride, 9); \
  399. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  400. put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full + 1, 8, 16); \
  401. put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8); \
  402. OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8); \
  403. } \
  404. \
  405. static void OPNAME ## qpel8_mc32_c(uint8_t *dst, const uint8_t *src, \
  406. ptrdiff_t stride) \
  407. { \
  408. uint8_t full[16 * 9]; \
  409. uint8_t halfH[72]; \
  410. \
  411. copy_block9(full, src, 16, stride, 9); \
  412. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9); \
  413. put ## RND ## pixels8_l2_8(halfH, halfH, full + 1, 8, 8, 16, 9); \
  414. OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
  415. } \
  416. \
  417. static void OPNAME ## qpel8_mc22_c(uint8_t *dst, const uint8_t *src, \
  418. ptrdiff_t stride) \
  419. { \
  420. uint8_t halfH[72]; \
  421. \
  422. put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9); \
  423. OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8); \
  424. } \
  425. \
  426. static void OPNAME ## qpel16_mc10_c(uint8_t *dst, const uint8_t *src, \
  427. ptrdiff_t stride) \
  428. { \
  429. uint8_t half[256]; \
  430. \
  431. put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
  432. OPNAME ## pixels16_l2_8(dst, src, half, stride, stride, 16, 16); \
  433. } \
  434. \
  435. static void OPNAME ## qpel16_mc20_c(uint8_t *dst, const uint8_t *src, \
  436. ptrdiff_t stride) \
  437. { \
  438. OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16); \
  439. } \
  440. \
  441. static void OPNAME ## qpel16_mc30_c(uint8_t *dst, const uint8_t *src, \
  442. ptrdiff_t stride) \
  443. { \
  444. uint8_t half[256]; \
  445. \
  446. put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16); \
  447. OPNAME ## pixels16_l2_8(dst, src + 1, half, stride, stride, 16, 16); \
  448. } \
  449. \
  450. static void OPNAME ## qpel16_mc01_c(uint8_t *dst, const uint8_t *src, \
  451. ptrdiff_t stride) \
  452. { \
  453. uint8_t full[24 * 17]; \
  454. uint8_t half[256]; \
  455. \
  456. copy_block17(full, src, 24, stride, 17); \
  457. put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
  458. OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16); \
  459. } \
  460. \
  461. static void OPNAME ## qpel16_mc02_c(uint8_t *dst, const uint8_t *src, \
  462. ptrdiff_t stride) \
  463. { \
  464. uint8_t full[24 * 17]; \
  465. \
  466. copy_block17(full, src, 24, stride, 17); \
  467. OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24); \
  468. } \
  469. \
  470. static void OPNAME ## qpel16_mc03_c(uint8_t *dst, const uint8_t *src, \
  471. ptrdiff_t stride) \
  472. { \
  473. uint8_t full[24 * 17]; \
  474. uint8_t half[256]; \
  475. \
  476. copy_block17(full, src, 24, stride, 17); \
  477. put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \
  478. OPNAME ## pixels16_l2_8(dst, full + 24, half, stride, 24, 16, 16); \
  479. } \
  480. \
  481. void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, const uint8_t *src, \
  482. ptrdiff_t stride) \
  483. { \
  484. uint8_t full[24 * 17]; \
  485. uint8_t halfH[272]; \
  486. uint8_t halfV[256]; \
  487. uint8_t halfHV[256]; \
  488. \
  489. copy_block17(full, src, 24, stride, 17); \
  490. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  491. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
  492. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  493. OPNAME ## pixels16_l4_8(dst, full, halfH, halfV, halfHV, \
  494. stride, 24, 16, 16, 16, 16); \
  495. } \
  496. \
  497. static void OPNAME ## qpel16_mc11_c(uint8_t *dst, const uint8_t *src, \
  498. ptrdiff_t stride) \
  499. { \
  500. uint8_t full[24 * 17]; \
  501. uint8_t halfH[272]; \
  502. uint8_t halfHV[256]; \
  503. \
  504. copy_block17(full, src, 24, stride, 17); \
  505. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  506. put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
  507. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  508. OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
  509. } \
  510. \
  511. void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, const uint8_t *src, \
  512. ptrdiff_t stride) \
  513. { \
  514. uint8_t full[24 * 17]; \
  515. uint8_t halfH[272]; \
  516. uint8_t halfV[256]; \
  517. uint8_t halfHV[256]; \
  518. \
  519. copy_block17(full, src, 24, stride, 17); \
  520. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  521. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
  522. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  523. OPNAME ## pixels16_l4_8(dst, full + 1, halfH, halfV, halfHV, \
  524. stride, 24, 16, 16, 16, 16); \
  525. } \
  526. \
  527. static void OPNAME ## qpel16_mc31_c(uint8_t *dst, const uint8_t *src, \
  528. ptrdiff_t stride) \
  529. { \
  530. uint8_t full[24 * 17]; \
  531. uint8_t halfH[272]; \
  532. uint8_t halfHV[256]; \
  533. \
  534. copy_block17(full, src, 24, stride, 17); \
  535. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  536. put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
  537. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  538. OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
  539. } \
  540. \
  541. void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, const uint8_t *src, \
  542. ptrdiff_t stride) \
  543. { \
  544. uint8_t full[24 * 17]; \
  545. uint8_t halfH[272]; \
  546. uint8_t halfV[256]; \
  547. uint8_t halfHV[256]; \
  548. \
  549. copy_block17(full, src, 24, stride, 17); \
  550. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  551. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
  552. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  553. OPNAME ## pixels16_l4_8(dst, full + 24, halfH + 16, halfV, halfHV, \
  554. stride, 24, 16, 16, 16, 16); \
  555. } \
  556. \
  557. static void OPNAME ## qpel16_mc13_c(uint8_t *dst, const uint8_t *src, \
  558. ptrdiff_t stride) \
  559. { \
  560. uint8_t full[24 * 17]; \
  561. uint8_t halfH[272]; \
  562. uint8_t halfHV[256]; \
  563. \
  564. copy_block17(full, src, 24, stride, 17); \
  565. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  566. put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
  567. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  568. OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
  569. } \
  570. \
  571. void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, const uint8_t *src, \
  572. ptrdiff_t stride) \
  573. { \
  574. uint8_t full[24 * 17]; \
  575. uint8_t halfH[272]; \
  576. uint8_t halfV[256]; \
  577. uint8_t halfHV[256]; \
  578. \
  579. copy_block17(full, src, 24, stride, 17); \
  580. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  581. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
  582. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  583. OPNAME ## pixels16_l4_8(dst, full + 25, halfH + 16, halfV, halfHV, \
  584. stride, 24, 16, 16, 16, 16); \
  585. } \
  586. \
  587. static void OPNAME ## qpel16_mc33_c(uint8_t *dst, const uint8_t *src, \
  588. ptrdiff_t stride) \
  589. { \
  590. uint8_t full[24 * 17]; \
  591. uint8_t halfH[272]; \
  592. uint8_t halfHV[256]; \
  593. \
  594. copy_block17(full, src, 24, stride, 17); \
  595. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  596. put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
  597. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  598. OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
  599. } \
  600. \
  601. static void OPNAME ## qpel16_mc21_c(uint8_t *dst, const uint8_t *src, \
  602. ptrdiff_t stride) \
  603. { \
  604. uint8_t halfH[272]; \
  605. uint8_t halfHV[256]; \
  606. \
  607. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
  608. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  609. OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16); \
  610. } \
  611. \
  612. static void OPNAME ## qpel16_mc23_c(uint8_t *dst, const uint8_t *src, \
  613. ptrdiff_t stride) \
  614. { \
  615. uint8_t halfH[272]; \
  616. uint8_t halfHV[256]; \
  617. \
  618. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
  619. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  620. OPNAME ## pixels16_l2_8(dst, halfH + 16, halfHV, stride, 16, 16, 16); \
  621. } \
  622. \
  623. void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, const uint8_t *src, \
  624. ptrdiff_t stride) \
  625. { \
  626. uint8_t full[24 * 17]; \
  627. uint8_t halfH[272]; \
  628. uint8_t halfV[256]; \
  629. uint8_t halfHV[256]; \
  630. \
  631. copy_block17(full, src, 24, stride, 17); \
  632. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  633. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24); \
  634. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  635. OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
  636. } \
  637. \
  638. static void OPNAME ## qpel16_mc12_c(uint8_t *dst, const uint8_t *src, \
  639. ptrdiff_t stride) \
  640. { \
  641. uint8_t full[24 * 17]; \
  642. uint8_t halfH[272]; \
  643. \
  644. copy_block17(full, src, 24, stride, 17); \
  645. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  646. put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17); \
  647. OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
  648. } \
  649. \
  650. void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, const uint8_t *src, \
  651. ptrdiff_t stride) \
  652. { \
  653. uint8_t full[24 * 17]; \
  654. uint8_t halfH[272]; \
  655. uint8_t halfV[256]; \
  656. uint8_t halfHV[256]; \
  657. \
  658. copy_block17(full, src, 24, stride, 17); \
  659. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  660. put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full + 1, 16, 24); \
  661. put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16); \
  662. OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16); \
  663. } \
  664. \
  665. static void OPNAME ## qpel16_mc32_c(uint8_t *dst, const uint8_t *src, \
  666. ptrdiff_t stride) \
  667. { \
  668. uint8_t full[24 * 17]; \
  669. uint8_t halfH[272]; \
  670. \
  671. copy_block17(full, src, 24, stride, 17); \
  672. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17); \
  673. put ## RND ## pixels16_l2_8(halfH, halfH, full + 1, 16, 16, 24, 17); \
  674. OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
  675. } \
  676. \
  677. static void OPNAME ## qpel16_mc22_c(uint8_t *dst, const uint8_t *src, \
  678. ptrdiff_t stride) \
  679. { \
  680. uint8_t halfH[272]; \
  681. \
  682. put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17); \
  683. OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16); \
  684. }
  685. #define op_avg(a, b) a = (((a) + cm[((b) + 16) >> 5] + 1) >> 1)
  686. #define op_put(a, b) a = cm[((b) + 16) >> 5]
  687. #define op_put_no_rnd(a, b) a = cm[((b) + 15) >> 5]
  688. QPEL_MC(0, put_, _, op_put)
  689. QPEL_MC(1, put_no_rnd_, _no_rnd_, op_put_no_rnd)
  690. QPEL_MC(0, avg_, _, op_avg)
  691. #undef op_avg
  692. #undef op_put
  693. #undef op_put_no_rnd
  694. void ff_put_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
  695. {
  696. put_pixels8_8_c(dst, src, stride, 8);
  697. }
  698. void ff_avg_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
  699. {
  700. avg_pixels8_8_c(dst, src, stride, 8);
  701. }
  702. void ff_put_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
  703. {
  704. put_pixels16_8_c(dst, src, stride, 16);
  705. }
  706. void ff_avg_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
  707. {
  708. avg_pixels16_8_c(dst, src, stride, 16);
  709. }
  710. #define put_qpel8_mc00_c ff_put_pixels8x8_c
  711. #define avg_qpel8_mc00_c ff_avg_pixels8x8_c
  712. #define put_qpel16_mc00_c ff_put_pixels16x16_c
  713. #define avg_qpel16_mc00_c ff_avg_pixels16x16_c
  714. #define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c
  715. #define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
  716. void ff_put_pixels8_l2_8(uint8_t *dst, const uint8_t *src1, const uint8_t *src2,
  717. int dst_stride, int src_stride1, int src_stride2,
  718. int h)
  719. {
  720. put_pixels8_l2_8(dst, src1, src2, dst_stride, src_stride1, src_stride2, h);
  721. }
  722. #if CONFIG_DIRAC_DECODER
  723. #define DIRAC_MC(OPNAME)\
  724. void ff_ ## OPNAME ## _dirac_pixels8_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  725. {\
  726. OPNAME ## _pixels8_8_c(dst, src[0], stride, h);\
  727. }\
  728. void ff_ ## OPNAME ## _dirac_pixels16_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  729. {\
  730. OPNAME ## _pixels16_8_c(dst, src[0], stride, h);\
  731. }\
  732. void ff_ ## OPNAME ## _dirac_pixels32_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  733. {\
  734. OPNAME ## _pixels16_8_c(dst , src[0] , stride, h);\
  735. OPNAME ## _pixels16_8_c(dst+16, src[0]+16, stride, h);\
  736. }\
  737. void ff_ ## OPNAME ## _dirac_pixels8_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  738. {\
  739. OPNAME ## _pixels8_l2_8(dst, src[0], src[1], stride, stride, stride, h);\
  740. }\
  741. void ff_ ## OPNAME ## _dirac_pixels16_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  742. {\
  743. OPNAME ## _pixels16_l2_8(dst, src[0], src[1], stride, stride, stride, h);\
  744. }\
  745. void ff_ ## OPNAME ## _dirac_pixels32_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  746. {\
  747. OPNAME ## _pixels16_l2_8(dst , src[0] , src[1] , stride, stride, stride, h);\
  748. OPNAME ## _pixels16_l2_8(dst+16, src[0]+16, src[1]+16, stride, stride, stride, h);\
  749. }\
  750. void ff_ ## OPNAME ## _dirac_pixels8_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  751. {\
  752. OPNAME ## _pixels8_l4_8(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  753. }\
  754. void ff_ ## OPNAME ## _dirac_pixels16_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  755. {\
  756. OPNAME ## _pixels16_l4_8(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  757. }\
  758. void ff_ ## OPNAME ## _dirac_pixels32_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  759. {\
  760. OPNAME ## _pixels16_l4_8(dst , src[0] , src[1] , src[2] , src[3] , stride, stride, stride, stride, stride, h);\
  761. OPNAME ## _pixels16_l4_8(dst+16, src[0]+16, src[1]+16, src[2]+16, src[3]+16, stride, stride, stride, stride, stride, h);\
  762. }
  763. DIRAC_MC(put)
  764. DIRAC_MC(avg)
  765. #endif
  766. av_cold void ff_qpeldsp_init(QpelDSPContext *c)
  767. {
  768. #define dspfunc(PFX, IDX, NUM) \
  769. c->PFX ## _pixels_tab[IDX][0] = PFX ## NUM ## _mc00_c; \
  770. c->PFX ## _pixels_tab[IDX][1] = PFX ## NUM ## _mc10_c; \
  771. c->PFX ## _pixels_tab[IDX][2] = PFX ## NUM ## _mc20_c; \
  772. c->PFX ## _pixels_tab[IDX][3] = PFX ## NUM ## _mc30_c; \
  773. c->PFX ## _pixels_tab[IDX][4] = PFX ## NUM ## _mc01_c; \
  774. c->PFX ## _pixels_tab[IDX][5] = PFX ## NUM ## _mc11_c; \
  775. c->PFX ## _pixels_tab[IDX][6] = PFX ## NUM ## _mc21_c; \
  776. c->PFX ## _pixels_tab[IDX][7] = PFX ## NUM ## _mc31_c; \
  777. c->PFX ## _pixels_tab[IDX][8] = PFX ## NUM ## _mc02_c; \
  778. c->PFX ## _pixels_tab[IDX][9] = PFX ## NUM ## _mc12_c; \
  779. c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
  780. c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
  781. c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
  782. c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \
  783. c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \
  784. c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
  785. dspfunc(put_qpel, 0, 16);
  786. dspfunc(put_qpel, 1, 8);
  787. dspfunc(put_no_rnd_qpel, 0, 16);
  788. dspfunc(put_no_rnd_qpel, 1, 8);
  789. dspfunc(avg_qpel, 0, 16);
  790. dspfunc(avg_qpel, 1, 8);
  791. if (ARCH_X86)
  792. ff_qpeldsp_init_x86(c);
  793. if (ARCH_MIPS)
  794. ff_qpeldsp_init_mips(c);
  795. }