[FFmpeg-devel] [PATCH][VAAPI][6/6] Add H.264 bitstream decoding (take 20)

Michael Niedermayer michaelni
Sun Dec 27 22:46:47 CET 2009


On Sun, Dec 20, 2009 at 05:21:06PM +0100, Gwenole Beauchesne wrote:
> Hi,
>
> On Wed, 10 Jun 2009, Cyril Russo wrote:
>
>> I've corrected all you've asked previously in the attached patch.
>
> Here is a new patch that makes the VAAPI DPB match FFmpeg short_ref[] U 
> long_ref[]. This will currently fail for some clips on GMA500 because the 
> driver requires some frames that are not strictly marked as "used for 
> reference" in the DPB, which FFmpeg doesn't provide. However, since my 
> limited testing on Windows 7 + DXVA2 shows this can work with a similar 
> approach (the one implemented in MPC-HC), Intel might be looking for a fix 
> in the Linux driver.
>
> In the mean time, this is the correct way for AMD and NVIDIA drivers.
>
> Regards,
> Gwenole.

[...]
> +/**
> + * Translate an FFmpeg Picture into its VA API form.
> + *
> + * @param[out] va_pic          A pointer to VA API's own picture struct
> + * @param[in]  pic             A pointer to the FFmpeg picture struct to convert
> + * @param[in]  pic_structure   The picture field type (as defined in mpegvideo.h),
> + *                             supersedes pic's field type if nonzero.
> + */
> +static void fill_vaapi_pic(VAPictureH264 *va_pic,
> +                           Picture       *pic,
> +                           int            pic_structure)
> +{
> +    if (pic_structure == 0)
> +        pic_structure = pic->reference;
> +

> +    va_pic->picture_id = ff_vaapi_get_surface(pic);

i think it should be called ff_vaapi_get_surface_id()


[...]
> +/** Decoded Picture Buffer (DPB). */
> +typedef struct DPB {

> +    int            size;
> +    int            max_size;

these 2 need some doxy


> +    VAPictureH264 *pics;

va_pics


[...]
> +                if (temp_va_pic.flags & VA_PICTURE_H264_TOP_FIELD)
> +                    va_pic->TopFieldOrderCnt    = temp_va_pic.TopFieldOrderCnt;
> +                else

if(){
}else


[...]
> +/** Initialize and start decoding a frame with VA API. */
> +static int start_frame(AVCodecContext          *avctx,
> +                       av_unused const uint8_t *buffer,
> +                       av_unused uint32_t       size)
> +{
> +    H264Context * const h = avctx->priv_data;
> +    MpegEncContext * const s = &h->s;
> +    struct vaapi_context * const vactx = avctx->hwaccel_context;
> +    VAPictureParameterBufferH264 *pic_param;
> +    VAIQMatrixBufferH264 *iq_matrix;
> +
> +    dprintf(avctx, "start_frame()\n");
> +
> +    vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
> +

> +    /* Fill in VAPictureParameterBufferH264. */
> +    pic_param = ff_vaapi_alloc_picture(vactx, sizeof(VAPictureParameterBufferH264));

we have a VAPictureH264 and a VAPictureParameterBufferH264
a function called ff_vaapi_alloc_picture() is not named appropriately to
allocate a Parameter Buffer


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091227/53e74b18/attachment.pgp>



More information about the ffmpeg-devel mailing list