| 1684 | } |
| 1685 | |
| 1686 | size_t ff_ffv1_encode_buffer_size(AVCodecContext *avctx) |
| 1687 | { |
| 1688 | FFV1Context *f = avctx->priv_data; |
| 1689 | |
| 1690 | int w = avctx->width + f->num_h_slices; |
| 1691 | int h = avctx->height + f->num_v_slices; |
| 1692 | size_t maxsize = w*h * (1 + f->transparency); |
| 1693 | if (f->chroma_planes) |
| 1694 | maxsize += AV_CEIL_RSHIFT(w, f->chroma_h_shift) * AV_CEIL_RSHIFT(h, f->chroma_v_shift) * 2; |
| 1695 | maxsize += f->slice_count * 800; //for slice header |
| 1696 | if (f->version > 3) { |
| 1697 | maxsize *= f->bits_per_raw_sample + 1; |
| 1698 | if (f->remap_mode) |
| 1699 | maxsize += f->slice_count * 70000 * (1 + 2*f->chroma_planes + f->transparency); |
| 1700 | } else { |
| 1701 | maxsize += f->slice_count * 2 * (avctx->width + avctx->height); //for bug with slices that code some pixels more than once |
| 1702 | maxsize *= 8*(2*f->bits_per_raw_sample + 5); |
| 1703 | } |
| 1704 | maxsize >>= 3; |
| 1705 | maxsize += FF_INPUT_BUFFER_MIN_SIZE; |
| 1706 | |
| 1707 | return maxsize; |
| 1708 | } |
| 1709 | |
| 1710 | static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
| 1711 | const AVFrame *pict, int *got_packet) |
no outgoing calls
no test coverage detected