libavcodec/vaapi_h264.c File Reference

This file implements the glue code between FFmpeg's and VA API's structures for H.264 decoding. More...

#include "vaapi_internal.h"
#include "h264.h"

Go to the source code of this file.

Data Structures

struct  DPB
 Decoded Picture Buffer (DPB). More...

Functions

static void init_vaapi_pic (VAPictureH264 *va_pic)
 Initializes an empty VA API picture.
static void fill_vaapi_pic (VAPictureH264 *va_pic, Picture *pic, int pic_structure)
 Translates an FFmpeg Picture into its VA API form.
static int dpb_add (DPB *dpb, Picture *pic)
 Appends picture to the decoded picture buffer, in a VA API form that merges the second field picture attributes with the first, if available.
static int fill_vaapi_ReferenceFrames (VAPictureParameterBufferH264 *pic_param, H264Context *h)
 Fills in VA API reference frames array.
static void fill_vaapi_RefPicList (VAPictureH264 RefPicList[32], Picture *ref_list, unsigned int ref_count)
 Fills in VA API reference picture lists from the FFmpeg reference picture list.
static void fill_vaapi_plain_pred_weight_table (H264Context *h, int list, unsigned char *luma_weight_flag, short luma_weight[32], short luma_offset[32], unsigned char *chroma_weight_flag, short chroma_weight[32][2], short chroma_offset[32][2])
 Fills in prediction weight table.
static int start_frame (AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
 Initializes and starts decoding a frame with VA API.
static int end_frame (AVCodecContext *avctx)
 Ends a hardware decoding based frame.
static int decode_slice (AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
 Decodes the given H.264 slice with VA API.

Variables

AVHWAccel h264_vaapi_hwaccel


Detailed Description

This file implements the glue code between FFmpeg's and VA API's structures for H.264 decoding.

Definition in file vaapi_h264.c.


Function Documentation

static int decode_slice ( AVCodecContext avctx,
const uint8_t *  buffer,
uint32_t  size 
) [static]

Decodes the given H.264 slice with VA API.

Definition at line 297 of file vaapi_h264.c.

static int dpb_add ( DPB dpb,
Picture pic 
) [static]

Appends picture to the decoded picture buffer, in a VA API form that merges the second field picture attributes with the first, if available.

The decoded picture buffer's size must be large enough to receive the new VA API picture object.

Definition at line 90 of file vaapi_h264.c.

Referenced by fill_vaapi_ReferenceFrames().

static int end_frame ( AVCodecContext avctx  )  [static]

Ends a hardware decoding based frame.

Definition at line 288 of file vaapi_h264.c.

static void fill_vaapi_pic ( VAPictureH264 *  va_pic,
Picture pic,
int  pic_structure 
) [static]

Translates an FFmpeg Picture into its VA API form.

Parameters:
[out] va_pic A pointer to VA API's own picture struct
[in] pic A pointer to the FFmpeg picture struct to convert
[in] pic_structure The picture field type (as defined in mpegvideo.h), supersedes pic's field type if nonzero.

Definition at line 52 of file vaapi_h264.c.

Referenced by dpb_add(), fill_vaapi_RefPicList(), and start_frame().

static void fill_vaapi_plain_pred_weight_table ( H264Context h,
int  list,
unsigned char *  luma_weight_flag,
short  luma_weight[32],
short  luma_offset[32],
unsigned char *  chroma_weight_flag,
short  chroma_weight[32][2],
short  chroma_offset[32][2] 
) [static]

Fills in prediction weight table.

VA API requires a plain prediction weight table as it does not infer any value.

Parameters:
[in] h A pointer to the current H.264 context
[in] list The reference frame list index to use
[out] luma_weight_flag VA API plain luma weight flag
[out] luma_weight VA API plain luma weight table
[out] luma_offset VA API plain luma offset table
[out] chroma_weight_flag VA API plain chroma weight flag
[out] chroma_weight VA API plain chroma weight table
[out] chroma_offset VA API plain chroma offset table

Definition at line 183 of file vaapi_h264.c.

Referenced by decode_slice().

static int fill_vaapi_ReferenceFrames ( VAPictureParameterBufferH264 *  pic_param,
H264Context h 
) [static]

Fills in VA API reference frames array.

Definition at line 121 of file vaapi_h264.c.

Referenced by start_frame().

static void fill_vaapi_RefPicList ( VAPictureH264  RefPicList[32],
Picture ref_list,
unsigned int  ref_count 
) [static]

Fills in VA API reference picture lists from the FFmpeg reference picture list.

Parameters:
[out] RefPicList VA API internal reference picture list
[in] ref_list A pointer to the FFmpeg reference list
[in] ref_count The number of reference pictures in ref_list

Definition at line 155 of file vaapi_h264.c.

Referenced by decode_slice().

static void init_vaapi_pic ( VAPictureH264 *  va_pic  )  [static]

Initializes an empty VA API picture.

VA API requires a fixed-size reference picture array.

Definition at line 36 of file vaapi_h264.c.

Referenced by fill_vaapi_ReferenceFrames(), and fill_vaapi_RefPicList().

static int start_frame ( AVCodecContext avctx,
av_unused const uint8_t *  buffer,
av_unused uint32_t  size 
) [static]

Initializes and starts decoding a frame with VA API.

Definition at line 220 of file vaapi_h264.c.


Variable Documentation

Initial value:

 {
    .name           = "h264_vaapi",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_H264,
    .pix_fmt        = PIX_FMT_VAAPI_VLD,
    .capabilities   = 0,
    .start_frame    = start_frame,
    .end_frame      = end_frame,
    .decode_slice   = decode_slice,
    .priv_data_size = 0,
}

Definition at line 337 of file vaapi_h264.c.


Generated on Fri Oct 26 02:36:53 2012 for FFmpeg by  doxygen 1.5.8