Lines Matching defs:ctx
139 static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
164 ctx->qmat[ff_zigzag_direct[i]];
174 FICContext *ctx = avctx->priv_data;
188 int stride = ctx->frame->linesize[p];
189 uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride;
192 for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) {
195 if ((ret = fic_decode_block(ctx, &gb, dst + x, stride,
218 FICContext *ctx = avctx->priv_data;
219 uint8_t *ptr = ctx->cursor_buf;
246 dstptr[i] = ctx->final_frame->data[i] +
247 (ctx->final_frame->linesize[i] * (cur_y >> !!i)) +
257 fic_alpha_blend(dstptr[0] + ctx->final_frame->linesize[0],
264 dstptr[0] += ctx->final_frame->linesize[0] * 2;
265 dstptr[1] += ctx->final_frame->linesize[1];
266 dstptr[2] += ctx->final_frame->linesize[2];
273 FICContext *ctx = avctx->priv_data;
280 int skip_cursor = ctx->skip_cursor;
283 if ((ret = ff_reget_buffer(avctx, ctx->frame, 0)) < 0)
298 if (!ctx->final_frame) {
312 ctx->qmat = src[23] ? fic_qmat_hq : fic_qmat_lq;
348 if (!skip_cursor && avpkt->size < CURSOR_OFFSET + sizeof(ctx->cursor_buf)) {
353 ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices;
354 if (ctx->slice_h % 16)
355 ctx->slice_h = FFALIGN(ctx->slice_h - 16, 16);
361 if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
367 av_fast_malloc(&ctx->slice_data, &ctx->slice_data_size,
368 nslices * sizeof(ctx->slice_data[0]));
369 if (!ctx->slice_data_size) {
373 memset(ctx->slice_data, 0, nslices * sizeof(ctx->slice_data[0]));
378 int y_off = ctx->slice_h * slice;
379 int slice_h = ctx->slice_h;
387 slice_h = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16);
399 ctx->slice_data[slice].src = sdata + slice_off;
400 ctx->slice_data[slice].src_size = slice_size;
401 ctx->slice_data[slice].slice_h = slice_h;
402 ctx->slice_data[slice].y_off = y_off;
405 if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
406 NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
409 ctx->frame->key_frame = 1;
410 ctx->frame->pict_type = AV_PICTURE_TYPE_I;
412 if (ctx->slice_data[slice].p_frame) {
413 ctx->frame->key_frame = 0;
414 ctx->frame->pict_type = AV_PICTURE_TYPE_P;
418 av_frame_free(&ctx->final_frame);
419 ctx->final_frame = av_frame_clone(ctx->frame);
420 if (!ctx->final_frame) {
426 if ((ret = ff_reget_buffer(avctx, ctx->final_frame, 0)) < 0) {
433 memcpy(ctx->cursor_buf, src + CURSOR_OFFSET, sizeof(ctx->cursor_buf));
439 if ((ret = av_frame_ref(rframe, ctx->final_frame)) < 0)
447 FICContext *ctx = avctx->priv_data;
449 av_freep(&ctx->slice_data);
450 av_frame_free(&ctx->final_frame);
451 av_frame_free(&ctx->frame);
458 FICContext *ctx = avctx->priv_data;
461 ctx->avctx = avctx;
462 ctx->aligned_width = FFALIGN(avctx->width, 16);
463 ctx->aligned_height = FFALIGN(avctx->height, 16);
468 ctx->frame = av_frame_alloc();
469 if (!ctx->frame)