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

Function get_encode_buffer

libavcodec/snowenc.c:142–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142static int get_encode_buffer(SnowContext *s, AVFrame *frame)
143{
144 int ret;
145
146 frame->width = s->avctx->width + 2 * EDGE_WIDTH;
147 frame->height = s->avctx->height + 2 * EDGE_WIDTH;
148
149 ret = ff_encode_alloc_frame(s->avctx, frame);
150 if (ret < 0)
151 return ret;
152 for (int i = 0; frame->data[i]; i++) {
153 int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) *
154 frame->linesize[i] +
155 (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0));
156 frame->data[i] += offset;
157 }
158 frame->width = s->avctx->width;
159 frame->height = s->avctx->height;
160
161 return 0;
162}
163
164static av_cold int encode_init(AVCodecContext *avctx)
165{

Callers 2

encode_initFunction · 0.85
encode_frameFunction · 0.85

Calls 1

ff_encode_alloc_frameFunction · 0.85

Tested by

no test coverage detected