| 156 | } |
| 157 | |
| 158 | static 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 |
| 186 | const FFHWAccel ff_mpeg4_vaapi_hwaccel = { |
nothing calls this directly
no test coverage detected