| 102 | } |
| 103 | |
| 104 | static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride, |
| 105 | const uint8_t *table) |
| 106 | { |
| 107 | int j; |
| 108 | int out = 0; |
| 109 | int c; |
| 110 | int t; |
| 111 | |
| 112 | if(width&1) |
| 113 | return -1; |
| 114 | |
| 115 | for (j = 0; j < height; j++){ |
| 116 | out = 0; |
| 117 | while (out < width){ |
| 118 | c = ir2_get_code(&ctx->gb); |
| 119 | if(c >= 0x80) { /* we have a skip */ |
| 120 | c -= 0x7F; |
| 121 | out += c * 2; |
| 122 | } else { /* add two deltas from table */ |
| 123 | t = dst[out] + (((table[c * 2] - 128)*3) >> 2); |
| 124 | t= av_clip_uint8(t); |
| 125 | dst[out] = t; |
| 126 | out++; |
| 127 | t = dst[out] + (((table[(c * 2) + 1] - 128)*3) >> 2); |
| 128 | t= av_clip_uint8(t); |
| 129 | dst[out] = t; |
| 130 | out++; |
| 131 | } |
| 132 | } |
| 133 | dst += stride; |
| 134 | } |
| 135 | return 0; |
| 136 | } |
| 137 | |
| 138 | static int ir2_decode_frame(AVCodecContext *avctx, |
| 139 | void *data, int *data_size, |
no test coverage detected