2 * Video Acceleration API (video decoding)
3 * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
5 * Copyright (C) 2008-2009 Splitted-Desktop Systems
7 * This file is part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef AVCODEC_VAAPI_INTERNAL_H
25 #define AVCODEC_VAAPI_INTERNAL_H
30 #include "mpegvideo.h"
33 * @addtogroup VAAPI_Decoding
38 /** Extract VASurfaceID from an AVFrame */
39 static inline VASurfaceID
ff_vaapi_get_surface_id(AVFrame
*pic
)
41 return (uintptr_t)pic
->data
[3];
44 /** Common AVHWAccel.end_frame() implementation */
45 void ff_vaapi_common_end_frame(AVCodecContext
*avctx
);
47 /** Allocate a new picture parameter buffer */
48 void *ff_vaapi_alloc_pic_param(struct vaapi_context
*vactx
, unsigned int size
);
50 /** Allocate a new IQ matrix buffer */
51 void *ff_vaapi_alloc_iq_matrix(struct vaapi_context
*vactx
, unsigned int size
);
53 /** Allocate a new bit-plane buffer */
54 uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context
*vactx
, uint32_t size
);
57 * Allocate a new slice descriptor for the input slice.
59 * @param vactx the VA API context
60 * @param buffer the slice data buffer base
61 * @param size the size of the slice in bytes
62 * @return the newly allocated slice parameter
64 VASliceParameterBufferBase
*ff_vaapi_alloc_slice(struct vaapi_context
*vactx
, const uint8_t *buffer
, uint32_t size
);
66 int ff_vaapi_mpeg_end_frame(AVCodecContext
*avctx
);
67 int ff_vaapi_commit_slices(struct vaapi_context
*vactx
);
68 int ff_vaapi_render_picture(struct vaapi_context
*vactx
, VASurfaceID surface
);
72 #endif /* AVCODEC_VAAPI_INTERNAL_H */