* Replace the current MB with a flat dc-only version. */
| 77 | * Replace the current MB with a flat dc-only version. |
| 78 | */ |
| 79 | static void put_dc(ERContext *s, uint8_t *dest_y, uint8_t *dest_cb, |
| 80 | uint8_t *dest_cr, int mb_x, int mb_y) |
| 81 | { |
| 82 | int *linesize = s->cur_pic.f->linesize; |
| 83 | int dc, dcu, dcv, y, i; |
| 84 | for (i = 0; i < 4; i++) { |
| 85 | dc = s->dc_val[0][mb_x * 2 + (i & 1) + (mb_y * 2 + (i >> 1)) * s->b8_stride]; |
| 86 | if (dc < 0) |
| 87 | dc = 0; |
| 88 | else if (dc > 2040) |
| 89 | dc = 2040; |
| 90 | for (y = 0; y < 8; y++) { |
| 91 | int x; |
| 92 | for (x = 0; x < 8; x++) |
| 93 | dest_y[x + (i & 1) * 8 + (y + (i >> 1) * 8) * linesize[0]] = dc / 8; |
| 94 | } |
| 95 | } |
| 96 | dcu = s->dc_val[1][mb_x + mb_y * s->mb_stride]; |
| 97 | dcv = s->dc_val[2][mb_x + mb_y * s->mb_stride]; |
| 98 | if (dcu < 0) |
| 99 | dcu = 0; |
| 100 | else if (dcu > 2040) |
| 101 | dcu = 2040; |
| 102 | if (dcv < 0) |
| 103 | dcv = 0; |
| 104 | else if (dcv > 2040) |
| 105 | dcv = 2040; |
| 106 | |
| 107 | if (dest_cr) |
| 108 | for (y = 0; y < 8; y++) { |
| 109 | int x; |
| 110 | for (x = 0; x < 8; x++) { |
| 111 | dest_cb[x + y * linesize[1]] = dcu / 8; |
| 112 | dest_cr[x + y * linesize[2]] = dcv / 8; |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | static void filter181(int16_t *data, int width, int height, ptrdiff_t stride) |
| 118 | { |