Lines Matching defs:avctx

298 static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
300 SCPRContext *s = avctx->priv_data;
304 uint32_t clr = 0, r, g, b, backstep = linesize - avctx->width;
311 while (k < avctx->width + 1) {
325 if (y >= avctx->height)
332 if (x >= avctx->width) {
341 while (x < avctx->width && y < avctx->height) {
360 ret = decode_run_i(avctx, ptype, run, &x, &y, clr,
370 static int decompress_p(AVCodecContext *avctx,
374 SCPRContext *s = avctx->priv_data;
377 int backstep = linesize - avctx->width;
451 by + mvy + sy1 >= avctx->height || bx + mvx + sx1 >= avctx->width)
454 for (i = 0; i < sy2 - sy1 && (by + sy1 + i) < avctx->height && (by + mvy + sy1 + i) < avctx->height; i++) {
455 for (j = 0; j < sx2 - sx1 && (bx + sx1 + j) < avctx->width && (bx + mvx + sx1 + j) < avctx->width; j++) {
463 if (bx >= avctx->width)
466 for (; by < y * 16 + sy2 && by < avctx->height;) {
485 ret = decode_run_p(avctx, ptype, run, x, y, clr,
498 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
501 SCPRContext *s = avctx->priv_data;
505 if (avctx->bits_per_coded_sample == 16) {
506 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
510 if ((ret = ff_reget_buffer(avctx, s->current_frame, 0)) < 0)
522 ret = decompress_i(avctx, (uint32_t *)s->current_frame->data[0],
529 ret = decompress_i(avctx, (uint32_t *)s->current_frame->data[0],
534 ret = decompress_i3(avctx, (uint32_t *)s->current_frame->data[0],
545 if (avctx->bits_per_coded_sample == 16) {
556 for (y = 0; y < avctx->height; y++) {
558 av_memcpy_backptr((uint8_t*)(dst+1), 4, 4*avctx->width - 4);
565 ret = decompress_p(avctx, (uint32_t *)s->current_frame->data[0],
570 ret = decompress_p3(avctx, (uint32_t *)s->current_frame->data[0],
586 if (avctx->bits_per_coded_sample != 16) {
599 for (y = 0; y < avctx->height; y++) {
603 int w = avctx->width>>1;
610 for (; x < avctx->width * 4; x++) {
621 frame->data[0] += frame->linesize[0] * (avctx->height - 1);
629 static av_cold int decode_init(AVCodecContext *avctx)
631 SCPRContext *s = avctx->priv_data;
633 switch (avctx->bits_per_coded_sample) {
634 case 16: avctx->pix_fmt = AV_PIX_FMT_RGB0; break;
636 case 32: avctx->pix_fmt = AV_PIX_FMT_BGR0; break;
638 av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", avctx->bits_per_coded_sample);
645 s->cxshift = avctx->bits_per_coded_sample == 16 ? 0 : 2;
646 s->cbits = avctx->bits_per_coded_sample == 16 ? 0x1F : 0xFF;
647 s->nbx = (avctx->width + 15) / 16;
648 s->nby = (avctx->height + 15) / 16;
662 static av_cold int decode_close(AVCodecContext *avctx)
664 SCPRContext *s = avctx->priv_data;