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

Function fill_vaapi_ReferenceFrames

libavcodec/vaapi_h264.c:121–145  ·  view source on GitHub ↗

Fills in VA API reference frames array. */

Source from the content-addressed store, hash-verified

119
120/** Fills in VA API reference frames array. */
121static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param,
122 H264Context *h)
123{
124 DPB dpb;
125 int i;
126
127 dpb.size = 0;
128 dpb.max_size = FF_ARRAY_ELEMS(pic_param->ReferenceFrames);
129 dpb.va_pics = pic_param->ReferenceFrames;
130 for (i = 0; i < dpb.max_size; i++)
131 init_vaapi_pic(&dpb.va_pics[i]);
132
133 for (i = 0; i < h->short_ref_count; i++) {
134 Picture * const pic = h->short_ref[i];
135 if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
136 return -1;
137 }
138
139 for (i = 0; i < 16; i++) {
140 Picture * const pic = h->long_ref[i];
141 if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
142 return -1;
143 }
144 return 0;
145}
146
147/**
148 * Fills in VA API reference picture lists from the FFmpeg reference

Callers 1

start_frameFunction · 0.85

Calls 2

init_vaapi_picFunction · 0.85
dpb_addFunction · 0.85

Tested by

no test coverage detected