MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ir2_decode_plane_inter

Function ir2_decode_plane_inter

libavcodec/indeo2.c:104–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static 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
138static int ir2_decode_frame(AVCodecContext *avctx,
139 void *data, int *data_size,

Callers 1

ir2_decode_frameFunction · 0.85

Calls 2

ir2_get_codeFunction · 0.85
av_clip_uint8Function · 0.85

Tested by

no test coverage detected