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

Function vaapi_mpeg4_decode_slice

libavcodec/vaapi_mpeg4.c:158–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
159{
160 H263DecContext *const h = avctx->priv_data;
161 VAAPIDecodePicture *pic = h->c.cur_pic.ptr->hwaccel_picture_private;
162 VASliceParameterBufferMPEG4 slice_param;
163 int err;
164
165 slice_param = (VASliceParameterBufferMPEG4) {
166 .slice_data_size = size,
167 .slice_data_offset = 0,
168 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
169 .macroblock_offset = get_bits_count(&h->gb) % 8,
170 .macroblock_number = 0,
171 .quant_scale = h->c.qscale,
172 };
173
174 err = ff_vaapi_decode_make_slice_buffer(avctx, pic,
175 &slice_param, 1, sizeof(slice_param),
176 buffer, size);
177 if (err < 0) {
178 ff_vaapi_decode_cancel(avctx, pic);
179 return err;
180 }
181
182 return 0;
183}
184
185#if CONFIG_MPEG4_VAAPI_HWACCEL
186const FFHWAccel ff_mpeg4_vaapi_hwaccel = {

Callers

nothing calls this directly

Calls 3

get_bits_countFunction · 0.85
ff_vaapi_decode_cancelFunction · 0.85

Tested by

no test coverage detected