Lines Matching refs:state
62 static void put_lines_bits(AVCodecContext *avctx, int planes, int row_width, int pixel_size, State * state, uint8_t * row, AVFrame *p)
64 int pl_byte = state->pl / 8;
65 int pl_bit = state->pl & 7;
66 for (int y = 0; y < state->vdup && (state->y + y) < avctx->height; y++)
69 p->data[0][ (state->y + y) * p->linesize[0] + (x * 8 + 7 - i) * pixel_size + pl_byte] |= !!(row[x] & (1 << i)) << pl_bit;
71 state->pl++;
72 if (state->pl >= planes) {
73 state->pl = 0;
74 state->y += state->vdup;
75 state->vdup = 1;
79 static void put_lines_bytes(AVCodecContext *avctx, int planes, int row_width, int pixel_size, State * state, uint8_t * row, AVFrame *p)
81 for (int y = 0; y < state->vdup && (state->y + y) < avctx->height; y++)
82 memcpy(p->data[0] + (state->y + y) * p->linesize[0], row, avctx->width * pixel_size);
84 state->y += state->vdup;
85 state->vdup = 1;
101 State state = {.y = 0, .pl = 0, .x = 0, .vdup = 1};
102 void (*put_lines)(AVCodecContext *avctx, int planes, int row_width, int pixel_size, State * state, uint8_t * row, AVFrame *p);
271 put_lines(avctx, planes, row_width, pixel_size, &state, row + state.pl * row_width, p); \
272 if (state.y >= avctx->height) goto abort; \
279 row[state.pl * row_width + x++] = v; \
281 put_lines(avctx, planes, row_width, pixel_size, &state, row + state.pl * row_width, p); \
282 if (state.y >= avctx->height) goto abort; \
330 state.vdup = *b++;
331 if (!state.vdup)
332 state.vdup = 256;