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

Function vaapi_mpeg4_decode_slice

libavcodec/vaapi_mpeg4.c:122–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
123{
124 MpegEncContext * const s = avctx->priv_data;
125 VASliceParameterBufferMPEG4 *slice_param;
126
127 dprintf(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
128
129 /* video_plane_with_short_video_header() contains all GOBs
130 * in-order, and this is what VA API (Intel backend) expects: only
131 * a single slice param. So fake macroblock_number for FFmpeg so
132 * that we don't call vaapi_mpeg4_decode_slice() again
133 */
134 if (avctx->codec->id == CODEC_ID_H263)
135 size = s->gb.buffer_end - buffer;
136
137 /* Fill in VASliceParameterBufferMPEG4 */
138 slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
139 if (!slice_param)
140 return -1;
141 slice_param->macroblock_offset = get_bits_count(&s->gb) % 8;
142 slice_param->macroblock_number = s->mb_y * s->mb_width + s->mb_x;
143 slice_param->quant_scale = s->qscale;
144
145 if (avctx->codec->id == CODEC_ID_H263)
146 s->mb_y = s->mb_height;
147
148 return 0;
149}
150
151#if CONFIG_MPEG4_VAAPI_HWACCEL
152AVHWAccel mpeg4_vaapi_hwaccel = {

Callers

nothing calls this directly

Calls 2

ff_vaapi_alloc_sliceFunction · 0.85
get_bits_countFunction · 0.85

Tested by

no test coverage detected