Guest User

Untitled

a guest
Jan 4th, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.87 KB | None | 0 0
  1. From 5a22639093d55d05ddfc5156a7a1069db875731b Mon Sep 17 00:00:00 2001
  2. From: David Conrad <lessen42@gmail.com>
  3. Date: Mon, 26 Jul 2010 17:05:14 -0400
  4. Subject: [PATCH 1/3] Generate quant tables progmaatically
  5.  
  6. ---
  7. libavcodec/diracdec.c | 70 ++++++++++++++++++++++++++++---------------------
  8. 1 files changed, 40 insertions(+), 30 deletions(-)
  9.  
  10. diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
  11. index 7c43eaf..4ea8574 100644
  12. --- a/libavcodec/diracdec.c
  13. +++ b/libavcodec/diracdec.c
  14. @@ -240,38 +240,47 @@ static const uint8_t default_qmat[][4][4] = {
  15. { { 3, 1, 1, 0}, { 0, 4, 4, 2}, { 0, 6, 6, 5}, { 0, 9, 9, 7} },
  16. };
  17.  
  18. -static const int qscale_tab[MAX_QUANT+1] = {
  19. - 4, 5, 6, 7, 8, 10, 11, 13,
  20. - 16, 19, 23, 27, 32, 38, 45, 54,
  21. - 64, 76, 91, 108, 128, 152, 181, 215,
  22. - 256, 304, 362, 431, 512, 609, 724, 861,
  23. - 1024, 1218, 1448, 1722, 2048, 2435, 2896, 3444,
  24. - 4096, 4871, 5793, 6889, 8192, 9742, 11585, 13777,
  25. - 16384, 19484, 23170, 27554, 32768, 38968, 46341, 55109,
  26. - 65536, 77936
  27. -};
  28. +static int qscale_tab[MAX_QUANT+1];
  29. +static int qoffset_intra_tab[MAX_QUANT+1];
  30. +static int qoffset_inter_tab[MAX_QUANT+1];
  31.  
  32. -static const int qoffset_intra_tab[MAX_QUANT+1] = {
  33. - 1, 2, 3, 4, 4, 5, 6, 7,
  34. - 8, 10, 12, 14, 16, 19, 23, 27,
  35. - 32, 38, 46, 54, 64, 76, 91, 108,
  36. - 128, 152, 181, 216, 256, 305, 362, 431,
  37. - 512, 609, 724, 861, 1024, 1218, 1448, 1722,
  38. - 2048, 2436, 2897, 3445, 4096, 4871, 5793, 6889,
  39. - 8192, 9742, 11585, 13777, 16384, 19484, 23171, 27555,
  40. - 32768, 38968
  41. -};
  42. +static int quant_factor(int quant)
  43. +{
  44. + uint64_t base = 1 << (quant >> 2);
  45. + switch(quant & 3) {
  46. + case 1:
  47. + return (503829 * base + 52958) / 105917;
  48. + case 2:
  49. + return (665857 * base + 58854) / 117708;
  50. + case 3:
  51. + return (440253 * base + 32722) / 65444;
  52. + }
  53. + return base << 2;
  54. +}
  55.  
  56. -static const int qoffset_inter_tab[MAX_QUANT+1] = {
  57. - 1, 2, 2, 3, 3, 4, 4, 5,
  58. - 6, 7, 9, 10, 12, 14, 17, 20,
  59. - 24, 29, 34, 41, 48, 57, 68, 81,
  60. - 96, 114, 136, 162, 192, 228, 272, 323,
  61. - 384, 457, 543, 646, 768, 913, 1086, 1292,
  62. - 1536, 1827, 2172, 2583, 3072, 3653, 4344, 5166,
  63. - 6144, 7307, 8689, 10333, 12288, 14613, 17378, 20666,
  64. - 24576, 29226
  65. -};
  66. +static int quant_offset(int quant, int intra)
  67. +{
  68. + if (quant == 0)
  69. + return 1;
  70. +
  71. + if (intra) {
  72. + if (quant == 1)
  73. + return 2;
  74. + else
  75. + return (quant_factor(quant) + 1) >> 1;
  76. + } else
  77. + return (3 * quant_factor(quant) + 4) >> 3;
  78. +}
  79. +
  80. +static void init_quant_tables(void)
  81. +{
  82. + int i;
  83. + for (i = 0; i <= MAX_QUANT; i++) {
  84. + qscale_tab[i] = quant_factor(i);
  85. + qoffset_intra_tab[i] = quant_offset(i, 1);
  86. + qoffset_inter_tab[i] = quant_offset(i, 0);
  87. + }
  88. +}
  89.  
  90. // magic number division by 3 from schroedinger
  91. static inline int divide3(int x)
  92. @@ -397,6 +406,7 @@ static av_cold int dirac_decode_init(AVCodecContext *avctx)
  93.  
  94. dsputil_init(&s->dsp, avctx);
  95. ff_diracdsp_init(&s->diracdsp);
  96. + init_quant_tables();
  97.  
  98. return 0;
  99. }
  100. --
  101. 1.7.2
  102.  
  103.  
  104. From 9d97bf0e5a97ab9e014cf5e6a4f72112378f449e Mon Sep 17 00:00:00 2001
  105. From: David Conrad <lessen42@gmail.com>
  106. Date: Tue, 27 Jul 2010 07:17:44 -0400
  107. Subject: [PATCH 2/3] Some work to fixing dirac's annoying hpel edge extension
  108.  
  109. ---
  110. libavcodec/diracdec.c | 64 +++++++++++++++++++++++++++++++-----------------
  111. 1 files changed, 41 insertions(+), 23 deletions(-)
  112.  
  113. diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
  114. index 4ea8574..80e6cae 100644
  115. --- a/libavcodec/diracdec.c
  116. +++ b/libavcodec/diracdec.c
  117. @@ -1263,7 +1263,7 @@ static const uint8_t epel_weights[4][4][4] = {
  118. * @return the index of the put_dirac_pixels_tab function to use
  119. * 0 for 1 plane (fpel,hpel), 1 for 2 planes (qpel), 2 for 4 planes (qpel), and 3 for epel
  120. */
  121. -static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
  122. +static int mc_subpel(DiracContext *s, DiracBlock *block, uint8_t *src[5],
  123. int x, int y, int ref, int plane)
  124. {
  125. Plane *p = &s->plane[plane];
  126. @@ -1317,7 +1317,7 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
  127. // [0]: F [1]: H
  128. // [2]: V [3]: C
  129. if (!epel) {
  130. - // check if we really only need 2 planes since either mx or my is
  131. + // check if we really only need 2 planes since one of mx or my is
  132. // a hpel position. (epel weights of 0 handle this there)
  133. if (!(mx&3)) {
  134. // mx == 0: average [0] and [2]
  135. @@ -1330,26 +1330,28 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
  136. nplanes = 2;
  137. }
  138. } else {
  139. - // adjust the ordering if needed so the weights work
  140. - if (mx > 4) {
  141. - FFSWAP(const uint8_t *, src[0], src[1]);
  142. - FFSWAP(const uint8_t *, src[2], src[3]);
  143. - }
  144. - if (my > 4) {
  145. - FFSWAP(const uint8_t *, src[0], src[2]);
  146. - FFSWAP(const uint8_t *, src[1], src[3]);
  147. - }
  148. - src[4] = epel_weights[my&3][mx&3];
  149. + // adjust mx, my to work for right/bottom halves
  150. + // FIXME: check if we can do this without the branch here and above
  151. + if (mx > 4)
  152. + mx = 8-mx;
  153. + if (my > 4)
  154. + my = 8-my;
  155. + src[4][0] = (4-mx)*(4-my);
  156. + src[4][1] = ( mx)*(4-my);
  157. + src[4][2] = (4-mx)*( my);
  158. + src[4][3] = ( mx)*( my);
  159. }
  160. }
  161.  
  162. // fixme: v/h _edge_pos
  163. - if ((unsigned)x > p->width +EDGE_WIDTH/2 - p->xblen ||
  164. - (unsigned)y > p->height+EDGE_WIDTH/2 - p->yblen) {
  165. + // if ((unsigned)x > p->width +EDGE_WIDTH/2 - p->xblen ||
  166. + // (unsigned)y > p->height+EDGE_WIDTH/2 - p->yblen) {
  167. + if (x < 0 || x >= p->width - p->xblen ||
  168. + y < 0 || y >= p->height - p->yblen) {
  169. for (i = 0; i < nplanes; i++) {
  170. ff_emulated_edge_mc(s->edge_emu_buffer[i], src[i], p->stride,
  171. p->xblen, p->yblen, x, y,
  172. - p->width+EDGE_WIDTH/2, p->height+EDGE_WIDTH/2);
  173. + p->width, p->height);
  174. src[i] = s->edge_emu_buffer[i];
  175. }
  176. }
  177. @@ -1377,9 +1379,12 @@ static void block_mc(DiracContext *s, DiracBlock *block,
  178. int plane, int dstx, int dsty)
  179. {
  180. Plane *p = &s->plane[plane];
  181. - const uint8_t *src[5];
  182. + uint8_t *src[5];
  183. + uint8_t weights[4];
  184. int idx;
  185.  
  186. + src[4] = weights;
  187. +
  188. switch (block->ref&3) {
  189. case 0: // DC
  190. add_dc(mctmp, block->u.dc[plane], p->stride, obmc_weight, p->xblen, p->yblen);
  191. @@ -1450,9 +1455,11 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
  192. // which for 4:2:2 means an h edge of 16 and v edge of 8
  193. // just use 8 for everything for the moment
  194. int i, edge = EDGE_WIDTH/2;
  195. + uint8_t **hpel = ref->hpel[plane];
  196. + int linesize = ref->linesize[plane];
  197.  
  198. - ref->hpel[plane][0] = ref->data[plane];
  199. - s->dsp.draw_edges(ref->hpel[plane][0], ref->linesize[plane], width, height, edge);
  200. + hpel[0] = ref->data[plane];
  201. + s->dsp.draw_edges(hpel[0], linesize, width, height, edge);
  202.  
  203. // no need for hpel if we only have fpel vectors
  204. if (!s->mv_precision)
  205. @@ -1460,18 +1467,29 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
  206.  
  207. for (i = 1; i < 4; i++) {
  208. if (!ref->hpel_base[plane][i])
  209. - ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->linesize[plane] + 32);
  210. + ref->hpel_base[plane][i] = av_malloc((height+2*edge) * linesize + 32);
  211. // we need to be 16-byte aligned even for chroma
  212. - ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->linesize[plane] + 16;
  213. + hpel[i] = ref->hpel_base[plane][i] + edge*linesize + 16;
  214. }
  215.  
  216. if (!ref->interpolated[plane]) {
  217. - s->diracdsp.dirac_hpel_filter(ref->hpel[plane][1], ref->hpel[plane][2],
  218. - ref->hpel[plane][3], ref->hpel[plane][0],
  219. - ref->linesize[plane], width, height);
  220. + s->diracdsp.dirac_hpel_filter(hpel[1], hpel[2], hpel[3], hpel[0],
  221. + linesize, width, height);
  222. +#if 0
  223. s->dsp.draw_edges(ref->hpel[plane][1], ref->linesize[plane], width, height, edge);
  224. s->dsp.draw_edges(ref->hpel[plane][2], ref->linesize[plane], width, height, edge);
  225. s->dsp.draw_edges(ref->hpel[plane][3], ref->linesize[plane], width, height, edge);
  226. +#else
  227. + for (i = 0; i < height; i++) {
  228. + hpel[1][i*linesize + width-1] = hpel[0][i*linesize + width-1];
  229. + hpel[3][i*linesize + width-1] = hpel[2][i*linesize + width-1];
  230. + }
  231. + for (i = 0; i < width; i++) {
  232. + hpel[2][(height-1)*linesize + i] = hpel[0][(height-1)*linesize + i];
  233. + hpel[3][(height-1)*linesize + i] = hpel[1][(height-1)*linesize + i];
  234. + }
  235. + hpel[3][(height-1)*linesize + width-1] = hpel[0][(height-1)*linesize + width-1];
  236. +#endif
  237. }
  238. ref->interpolated[plane] = 1;
  239. }
  240. --
  241. 1.7.2
  242.  
  243.  
  244. From d748794df9c9ee3af41ae9d10828ac9f7dbf63a6 Mon Sep 17 00:00:00 2001
  245. From: David Conrad <lessen42@gmail.com>
  246. Date: Thu, 29 Jul 2010 01:56:15 -0400
  247. Subject: [PATCH 3/3] WIP: new MC
  248.  
  249. ---
  250. libavcodec/diracdec.c | 68 ++++++++++++++++++++++--------------------------
  251. libavcodec/diracdsp.c | 62 ++++++++++++++++++++++++++++++++++++++------
  252. libavcodec/diracdsp.h | 10 +++---
  253. libavcodec/dsputil.c | 45 --------------------------------
  254. 4 files changed, 89 insertions(+), 96 deletions(-)
  255.  
  256. diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
  257. index 80e6cae..1cb70b2 100644
  258. --- a/libavcodec/diracdec.c
  259. +++ b/libavcodec/diracdec.c
  260. @@ -1260,10 +1260,14 @@ static const uint8_t epel_weights[4][4][4] = {
  261. * interpolation from and set src[] to the location in each hpel plane
  262. * to MC from.
  263. *
  264. + * The fpel and destination buffer may have a different stride than
  265. + * subpel planes, due to edge emulation or
  266. + *
  267. * @return the index of the put_dirac_pixels_tab function to use
  268. * 0 for 1 plane (fpel,hpel), 1 for 2 planes (qpel), 2 for 4 planes (qpel), and 3 for epel
  269. */
  270. -static int mc_subpel(DiracContext *s, DiracBlock *block, uint8_t *src[5],
  271. +static int mc_subpel(DiracContext *s, DiracBlock *block,
  272. + uint8_t *src[5], int stride[2],
  273. int x, int y, int ref, int plane)
  274. {
  275. Plane *p = &s->plane[plane];
  276. @@ -1271,6 +1275,7 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, uint8_t *src[5],
  277. int motion_x = block->u.mv[ref][0];
  278. int motion_y = block->u.mv[ref][1];
  279. int mx, my, i, epel, nplanes = 0;
  280. + int fpel_used;
  281.  
  282. if (plane) {
  283. motion_x >>= s->chroma_x_shift;
  284. @@ -1292,55 +1297,44 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, uint8_t *src[5],
  285.  
  286. // hpel position
  287. if (!((mx|my)&3)) {
  288. + plane = ((my>>1)+(mx>>2));
  289. nplanes = 1;
  290. - src[0] = ref_hpel[(my>>1)+(mx>>2)] + y*p->stride + x;
  291. + fpel_used = !plane;
  292. + src[0] = ref_hpel[plane] + y*stride[!fpel_used] + x;
  293. +
  294. +
  295. +
  296. + // if we're copying soley from the fpel plane, set the hpel stride appropriately
  297. + stride[1] = stride[!fpel_used];
  298. } else {
  299. // qpel or epel
  300. nplanes = 4;
  301. - for (i = 0; i < 4; i++)
  302. - src[i] = ref_hpel[i] + y*p->stride + x;
  303. + fpel_used = 1;
  304. + src[0] = ref_hpel[0] + y*stride[0] + x;
  305. + src[1] = ref_hpel[1] + y*stride[1] + x;
  306. + src[2] = ref_hpel[2] + y*stride[1] + x;
  307. + src[3] = ref_hpel[3] + y*stride[1] + x;
  308.  
  309. // if we're interpolating in the right/bottom halves, adjust the planes as needed
  310. - // we increment x/y because the edge changes for half of the pixels
  311. + // we increment x/y because the edge changes for half of the pixels (is this right?)
  312. + // mx/my need to be adjusted so the correct bilinear weights are calculated
  313. if (mx > 4) {
  314. - src[0] += 1;
  315. - src[2] += 1;
  316. + src[0]++;
  317. + src[2]++;
  318. + mx = 8-mx;
  319. x++;
  320. }
  321. if (my > 4) {
  322. - src[0] += p->stride;
  323. - src[1] += p->stride;
  324. + src[0] += stride[0];
  325. + src[1] += stride[1];
  326. + my = 8-my;
  327. y++;
  328. }
  329.  
  330. - // hpel planes are:
  331. - // [0]: F [1]: H
  332. - // [2]: V [3]: C
  333. - if (!epel) {
  334. - // check if we really only need 2 planes since one of mx or my is
  335. - // a hpel position. (epel weights of 0 handle this there)
  336. - if (!(mx&3)) {
  337. - // mx == 0: average [0] and [2]
  338. - // mx == 4: average [1] and [3]
  339. - src[!mx] = src[2 + !!mx];
  340. - nplanes = 2;
  341. - } else if (!(my&3)) {
  342. - src[0] = src[(my>>1) ];
  343. - src[1] = src[(my>>1)+1];
  344. - nplanes = 2;
  345. - }
  346. - } else {
  347. - // adjust mx, my to work for right/bottom halves
  348. - // FIXME: check if we can do this without the branch here and above
  349. - if (mx > 4)
  350. - mx = 8-mx;
  351. - if (my > 4)
  352. - my = 8-my;
  353. - src[4][0] = (4-mx)*(4-my);
  354. - src[4][1] = ( mx)*(4-my);
  355. - src[4][2] = (4-mx)*( my);
  356. - src[4][3] = ( mx)*( my);
  357. - }
  358. + src[4][0] = (4-mx)*(4-my);
  359. + src[4][1] = ( mx)*(4-my);
  360. + src[4][2] = (4-mx)*( my);
  361. + src[4][3] = ( mx)*( my);
  362. }
  363.  
  364. // fixme: v/h _edge_pos
  365. diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c
  366. index 27318b1..c2e9676 100644
  367. --- a/libavcodec/diracdsp.c
  368. +++ b/libavcodec/diracdsp.c
  369. @@ -50,15 +50,59 @@ static void dirac_hpel_filter(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8
  370. }
  371. }
  372.  
  373. +#define DIRAC_MC(OPNAME)\
  374. +void ff_ ## OPNAME ## _dirac_pixels8_c(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h)\
  375. +{\
  376. + OPNAME ## _pixels8_c(dst, src[0], stride, h);\
  377. +}\
  378. +void ff_ ## OPNAME ## _dirac_pixels16_c(uint8_t *dst, const uint8_t *src[5], int stride, int hpel_stride, int h)\
  379. +{\
  380. + OPNAME ## _pixels16_c(dst, src[0], stride, h);\
  381. +}\
  382. +void ff_ ## OPNAME ## _dirac_pixels32_c(uint8_t *dst, const uint8_t *src[5], int stride, int hpel_stride, int h)\
  383. +{\
  384. + OPNAME ## _pixels16_c(dst , src[0] , stride, h);\
  385. + OPNAME ## _pixels16_c(dst+16, src[0]+16, stride, h);\
  386. +}\
  387. +void ff_ ## OPNAME ## _dirac_pixels8_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int hpel_stride, int h)\
  388. +{\
  389. + OPNAME ## _pixels8_l2(dst, src[0], src[1], stride, stride, stride, h);\
  390. +}\
  391. +void ff_ ## OPNAME ## _dirac_pixels16_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int hpel_stride, int h)\
  392. +{\
  393. + OPNAME ## _pixels16_l2(dst, src[0], src[1], stride, stride, stride, h);\
  394. +}\
  395. +void ff_ ## OPNAME ## _dirac_pixels32_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int hpel_stride, int h)\
  396. +{\
  397. + OPNAME ## _pixels16_l2(dst , src[0] , src[1] , stride, stride, stride, h);\
  398. + OPNAME ## _pixels16_l2(dst+16, src[0]+16, src[1]+16, stride, stride, stride, h);\
  399. +}\
  400. +void ff_ ## OPNAME ## _dirac_pixels8_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  401. +{\
  402. + OPNAME ## _pixels8_l4(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  403. +}\
  404. +void ff_ ## OPNAME ## _dirac_pixels16_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  405. +{\
  406. + OPNAME ## _pixels16_l4(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  407. +}\
  408. +void ff_ ## OPNAME ## _dirac_pixels32_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  409. +{\
  410. + OPNAME ## _pixels16_l4(dst , src[0] , src[1] , src[2] , src[3] , stride, stride, stride, stride, stride, h);\
  411. + OPNAME ## _pixels16_l4(dst+16, src[0]+16, src[1]+16, src[2]+16, src[3]+16, stride, stride, stride, stride, stride, h);\
  412. +}
  413. +DIRAC_MC(put)
  414. +DIRAC_MC(avg)
  415. +
  416. +
  417. #define PIXOP_BILINEAR(PFX, OP, WIDTH) \
  418. -static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  419. +static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, uint8_t *src[5], int stride, int h)\
  420. {\
  421. int x;\
  422. - const uint8_t *s0 = src[0];\
  423. - const uint8_t *s1 = src[1];\
  424. - const uint8_t *s2 = src[2];\
  425. - const uint8_t *s3 = src[3];\
  426. - const uint8_t *w = src[4];\
  427. + uint8_t *s0 = src[0];\
  428. + uint8_t *s1 = src[1];\
  429. + uint8_t *s2 = src[2];\
  430. + uint8_t *s3 = src[3];\
  431. + uint8_t *w = src[4];\
  432. \
  433. while (h--) {\
  434. for (x = 0; x < WIDTH; x++) {\
  435. @@ -67,9 +111,9 @@ static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, co
  436. \
  437. dst += stride;\
  438. s0 += stride;\
  439. - s1 += stride;\
  440. - s2 += stride;\
  441. - s3 += stride;\
  442. + s1 += hpel_stride;\
  443. + s2 += hpel_stride;\
  444. + s3 += hpel_stride;\
  445. }\
  446. }
  447.  
  448. diff --git a/libavcodec/diracdsp.h b/libavcodec/diracdsp.h
  449. index 2135ee9..6ebe080 100644
  450. --- a/libavcodec/diracdsp.h
  451. +++ b/libavcodec/diracdsp.h
  452. @@ -36,8 +36,8 @@ typedef struct {
  453. * src[0-3] is each of the hpel planes
  454. * src[4] is the 1/8 pel weights if needed
  455. */
  456. - void (*put_dirac_pixels_tab[3][4])(uint8_t *dst, const uint8_t *src[5], int stride, int h);
  457. - void (*avg_dirac_pixels_tab[3][4])(uint8_t *dst, const uint8_t *src[5], int stride, int h);
  458. + void (*put_dirac_pixels_tab[3][4])(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h);
  459. + void (*avg_dirac_pixels_tab[3][4])(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h);
  460.  
  461. void (*put_signed_rect_clamped)(uint8_t *dst/*align 16*/, int dst_stride, const int16_t *src/*align 16*/, int src_stride, int width, int height/*mod 2*/);
  462. void (*put_rect_clamped)(uint8_t *dst/*align 16*/, int dst_stride, const int16_t *src/*align 16*/, int src_stride, int width, int height/*mod 2*/);
  463. @@ -49,9 +49,9 @@ typedef struct {
  464. } DiracDSPContext;
  465.  
  466. #define DECL_DIRAC_PIXOP(PFX, EXT) \
  467. - void ff_ ## PFX ## _dirac_pixels8_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h); \
  468. - void ff_ ## PFX ## _dirac_pixels16_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h); \
  469. - void ff_ ## PFX ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h)
  470. + void ff_ ## PFX ## _dirac_pixels8_ ## EXT(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h); \
  471. + void ff_ ## PFX ## _dirac_pixels16_ ## EXT(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h); \
  472. + void ff_ ## PFX ## _dirac_pixels32_ ## EXT(uint8_t *dst, uint8_t *src[5], int stride, int hpel_stride, int h)
  473.  
  474. DECL_DIRAC_PIXOP(put, c);
  475. DECL_DIRAC_PIXOP(avg, c);
  476. diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
  477. index 8fb1e3d..0346343 100644
  478. --- a/libavcodec/dsputil.c
  479. +++ b/libavcodec/dsputil.c
  480. @@ -2620,51 +2620,6 @@ static void avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, int stride){
  481. }
  482. #endif /* CONFIG_RV40_DECODER */
  483.  
  484. -#if CONFIG_DIRAC_DECODER
  485. -#define DIRAC_MC(OPNAME)\
  486. -void ff_ ## OPNAME ## _dirac_pixels8_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  487. -{\
  488. - OPNAME ## _pixels8_c(dst, src[0], stride, h);\
  489. -}\
  490. -void ff_ ## OPNAME ## _dirac_pixels16_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  491. -{\
  492. - OPNAME ## _pixels16_c(dst, src[0], stride, h);\
  493. -}\
  494. -void ff_ ## OPNAME ## _dirac_pixels32_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  495. -{\
  496. - OPNAME ## _pixels16_c(dst , src[0] , stride, h);\
  497. - OPNAME ## _pixels16_c(dst+16, src[0]+16, stride, h);\
  498. -}\
  499. -void ff_ ## OPNAME ## _dirac_pixels8_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  500. -{\
  501. - OPNAME ## _pixels8_l2(dst, src[0], src[1], stride, stride, stride, h);\
  502. -}\
  503. -void ff_ ## OPNAME ## _dirac_pixels16_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  504. -{\
  505. - OPNAME ## _pixels16_l2(dst, src[0], src[1], stride, stride, stride, h);\
  506. -}\
  507. -void ff_ ## OPNAME ## _dirac_pixels32_l2_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  508. -{\
  509. - OPNAME ## _pixels16_l2(dst , src[0] , src[1] , stride, stride, stride, h);\
  510. - OPNAME ## _pixels16_l2(dst+16, src[0]+16, src[1]+16, stride, stride, stride, h);\
  511. -}\
  512. -void ff_ ## OPNAME ## _dirac_pixels8_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  513. -{\
  514. - OPNAME ## _pixels8_l4(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  515. -}\
  516. -void ff_ ## OPNAME ## _dirac_pixels16_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  517. -{\
  518. - OPNAME ## _pixels16_l4(dst, src[0], src[1], src[2], src[3], stride, stride, stride, stride, stride, h);\
  519. -}\
  520. -void ff_ ## OPNAME ## _dirac_pixels32_l4_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
  521. -{\
  522. - OPNAME ## _pixels16_l4(dst , src[0] , src[1] , src[2] , src[3] , stride, stride, stride, stride, stride, h);\
  523. - OPNAME ## _pixels16_l4(dst+16, src[0]+16, src[1]+16, src[2]+16, src[3]+16, stride, stride, stride, stride, stride, h);\
  524. -}
  525. -DIRAC_MC(put)
  526. -DIRAC_MC(avg)
  527. -#endif
  528. -
  529. static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int w){
  530. uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
  531. int i;
  532. --
  533. 1.7.2
Add Comment
Please, Sign In to add comment