20 #include <va/va_dec_vp8.h>
31 return VA_INVALID_SURFACE;
40 VAPictureParameterBufferVP8 pp;
41 VAProbabilityDataBufferVP8 prob;
42 VAIQMatrixBufferVP8
quant;
47 pp = (VAPictureParameterBufferVP8) {
48 .frame_width = avctx->
width,
49 .frame_height = avctx->
height,
54 .out_of_loop_frame = VA_INVALID_SURFACE,
83 for (i = 0; i < 3; i++)
86 for (i = 0; i < 4; i++) {
94 pp.loop_filter_level[i] = av_clip_uintp2(pp.loop_filter_level[i], 6);
97 for (i = 0; i < 4; i++) {
98 pp.loop_filter_deltas_ref_frame[i] = s->
lf_delta.
ref[i];
103 static const uint8_t keyframe_y_mode_probs[4] = {
106 static const uint8_t keyframe_uv_mode_probs[3] = {
109 memcpy(pp.y_mode_probs, keyframe_y_mode_probs, 4);
110 memcpy(pp.uv_mode_probs, keyframe_uv_mode_probs, 3);
112 for (i = 0; i < 4; i++)
114 for (i = 0; i < 3; i++)
117 for (i = 0; i < 2; i++)
118 for (j = 0; j < 19; j++)
119 pp.mv_probs[i][j] = s->
prob->
mvc[i][j];
126 VAPictureParameterBufferType,
131 for (i = 0; i < 4; i++) {
132 for (j = 0; j < 8; j++) {
133 static const int coeff_bands_inverse[8] = {
134 0, 1, 2, 3, 5, 6, 4, 15
136 int coeff_pos = coeff_bands_inverse[j];
138 for (k = 0; k < 3; k++) {
139 memcpy(prob.dct_coeff_probs[i][j][k],
146 VAProbabilityBufferType,
147 &prob,
sizeof(prob));
151 for (i = 0; i < 4; i++) {
156 quant.quantization_index[i][0] = av_clip_uintp2(base_qi, 7);
157 quant.quantization_index[i][1] = av_clip_uintp2(base_qi + s->
quant.
ydc_delta, 7);
158 quant.quantization_index[i][2] = av_clip_uintp2(base_qi + s->
quant.
y2dc_delta, 7);
159 quant.quantization_index[i][3] = av_clip_uintp2(base_qi + s->
quant.
y2ac_delta, 7);
160 quant.quantization_index[i][4] = av_clip_uintp2(base_qi + s->
quant.
uvdc_delta, 7);
161 quant.quantization_index[i][5] = av_clip_uintp2(base_qi + s->
quant.
uvac_delta, 7);
165 VAIQMatrixBufferType,
166 &quant,
sizeof(quant));
191 VASliceParameterBufferVP8
sp;
194 unsigned int header_size = 3 + 7 * s->
keyframe;
196 unsigned int data_size = size - header_size;
198 sp = (VASliceParameterBufferVP8) {
199 .slice_data_size = data_size,
200 .slice_data_offset = 0,
201 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
209 for (i = 0; i < 8; i++)
static int vaapi_vp8_end_frame(AVCodecContext *avctx)
ptrdiff_t const GLvoid * data
int8_t sign_bias[4]
one state [0, 1] per ref frame type
static av_cold int init(AVCodecContext *avctx)
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
uint8_t token[4][16][3][NUM_DCT_TOKENS-1]
const AVHWAccel ff_vp8_vaapi_hwaccel
int ff_vaapi_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
static av_cold int uninit(AVCodecContext *avctx)
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
static int vaapi_vp8_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int num_coeff_partitions
All coefficients are contained in separate arith coding contexts.
static VASurfaceID vaapi_vp8_surface_id(VP8Frame *vf)
struct VP8Context::@150 coder_state_at_header_end
const char * name
Name of the hardware accelerated codec.
int ff_vaapi_decode_init(AVCodecContext *avctx)
int width
picture width / height.
struct VP8Context::@149 lf_delta
int8_t ref[4]
filter strength adjustment for macroblocks that reference: [0] - intra / VP56_FRAME_CURRENT [1] - VP5...
VASurfaceID output_surface
int coeff_partition_size[8]
struct VP8Context::@151 prob[2]
These are all of the updatable probabilities for binary decisions.
main external API structure.
struct VP8Context::@146 filter
uint8_t enabled
whether each mb can have a different strength based on mode/ref
int header_partition_size
uint8_t update_feature_data
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
void * hwaccel_picture_private
int8_t mode[VP8_MVMODE_SPLIT+1]
filter strength adjustment for the following macroblock modes: [0-3] - i16x16 (always zero) [4] - i4x...
struct VP8Context::@145 segmentation
Base parameters for segmentation, i.e.
struct VP8Context::@148 quant
#define HWACCEL_CAP_ASYNC_SAFE
static int vaapi_vp8_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int8_t filter_level[4]
base loop filter level
int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, const void *params_data, size_t params_size, const void *slice_data, size_t slice_size)