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

Function ff_ffv1_encode_buffer_size

libavcodec/ffv1enc.c:1686–1708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686size_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
1710static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
1711 const AVFrame *pict, int *got_packet)

Callers 3

encode_frameFunction · 0.85
vulkan_encode_ffv1_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected